Bug 1807680

Summary: Error while starting helper "/usr/libexec/certmonger/scep-submit [...]": Argument list too long
Product: Red Hat Enterprise Linux 8 Reporter: Graham Leggett <minfrin>
Component: certmongerAssignee: Rob Crittenden <rcritten>
Status: CLOSED WONTFIX QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 8.4CC: kenyon, nalin, pcech, tapazogl
Target Milestone: rcKeywords: Triaged
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-09-01 07:27:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Graham Leggett 2020-02-26 22:40:30 UTC
Description of problem:

When an attempt is made to have a certificate issued via scep from the Redwax Interop server, the following error is logged:

Feb 26 22:33:41 bob certmonger[3888]: 2020-02-26 22:33:41 [3888] Error while starting helper "/usr/libexec/certmonger/scep-submit -u https://interop.redwax.eu/test/simple/scep -R /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem     ": Argument list too long.

Version-Release number of selected component (if applicable):

certmonger 0.79.7-3.el8

How reproducible:

Always.

Steps to Reproduce:
1. Add the Redwax Interop CA as follows:

getcert add-scep-ca -c "Redwax Interop" -u https://interop.redwax.eu/test/simple/scep -R /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem

2. Request a certificate as follows:

getcert request -f /etc/pki/interop/test.example.com.cert -k /etc/pki/interop/test.example.com.key -c "Redwax Interop" -I test.example.com -D test.example.com -G rsa -g 4096 -u digitalSignature -u keyEncipherment -L challenge -v

Actual results:

Certificate is stuck in status NEED_TO_SUBMIT with no obvious clue as to why it is stuck:

[root@bob ~]# getcert list
Number of certificates and requests being tracked: 1.
Request ID 'test.example.com':
	status: NEED_TO_SUBMIT

The following error is logged periodically in /var/log/messages:

Feb 26 22:39:32 bob certmonger[3888]: 2020-02-26 22:39:32 [3888] Error while starting helper "/usr/libexec/certmonger/scep-submit -u https://interop.redwax.eu/test/simple/scep -R /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem     ": Argument list too long.

Expected results:

Certificate successfully issued.

Additional info:

Comment 1 Rob Crittenden 2020-02-26 23:02:33 UTC
It doesn't like something about /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem. It is intended to pass in just the certs required for validation and not an entire bundle of unrelated CAs.

Comment 2 Graham Leggett 2020-02-26 23:05:01 UTC
Not seeing how an incorrectly specified certificate could lead to "Argument list too long", especially when the argument consists of 140 characters?

Comment 3 Rob Crittenden 2020-02-27 00:15:04 UTC
certmonger passes the value of -R as an environment variable and 200k is too big.

Comment 4 Graham Leggett 2020-02-29 19:45:36 UTC
This problem is related to https://bugzilla.redhat.com/show_bug.cgi?id=1808613.

If an attempt is made to set the CA certificate bundle for the https connection using -R, this bundle overrides the CA certificate that is discovered through SCEP, and in turn breaks SCEP, unless by accident the two CA certs are the same.

To fix this, we need a separate command line option that is used for https CA certificates (as well as options for specifying a cert and key for https, because it's incomplete not to). The second command line option must be passed by filename, not through the raw certificate in an environment variable, so that we can support large CA lists as well as directory paths.

Comment 8 Rob Crittenden 2021-08-10 19:11:10 UTC
I'm not able to reproduce this on Fedora 34 with current certmonger, 0.79.14. I suppose its possible that some other SCEP-related change addressed this but I'm not sure. I used the reproducer steps, basically cut-n-paste, and was able to get a certificate.

Comment 9 RHEL Program Management 2021-09-01 07:27:02 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.