Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1244914

Summary: scep ca helper does not parse command line options correctly
Product: Red Hat Enterprise Linux 7 Reporter: Kaleem <ksiddiqu>
Component: certmongerAssignee: Jan Cholasta <jcholast>
Status: CLOSED ERRATA QA Contact: Kaleem <ksiddiqu>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: dkupka, nalin, nsoman
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://git.fedorahosted.org/cgit/certmonger.git/commit/?id=365e2b388e1c44db22c5656f8cc283b5dabc8860
Whiteboard:
Fixed In Version: certmonger-0.78.3-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 11:59:11 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 Kaleem 2015-07-20 18:32:52 UTC
Description of problem:

While working on scep support in certmonger, i found that when i tried to add CA cert with -R option with adding scep server url with -u option, helper does not parses -R option correctly and causing failure.

Version-Release number of selected component (if applicable):
[root@tigger ~]# rpm -q certmonger
certmonger-0.78.1-1.el7.x86_64
[root@tigger ~]# 

How reproducible:
Always,

Steps to Reproduce:
1.Add a scep server with scep ca helper with https url and CA cert with -R option

[root@tigger ~]# /usr/libexec/certmonger/scep-submit -u https://sceptest/CertSrv/mscep/ -R /root/certnew.pem -c -vv
* About to connect() to sceptest port 443 (#0)
*   Trying 10.65.201.139...
* Connected to sceptest (10.65.201.139) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* Server certificate:
* 	subject: CN=sceptest,OU=idmqe,O=redhat,L=pnq,ST=mh,C=IN
* 	start date: Jul 20 23:05:31 2015 GMT
* 	expire date: Jul 20 23:15:31 2016 GMT
* 	common name: sceptest
* 	issuer: CN=qe-SCEPTEST-CA
* NSS error -8179 (SEC_ERROR_UNKNOWN_ISSUER)
* Peer's Certificate issuer is not recognized.
* Closing connection 0
GET "https://sceptest/CertSrv/mscep/?operation=GetCACaps&message=0"
response_code = 0
content-type = ""
code = 60
code_text = "Peer certificate cannot be authenticated with given CA certificates"
results = ""
Error 60 connecting to https://sceptest/CertSrv/mscep/: Peer certificate cannot be authenticated with given CA certificates.
[root@tigger ~]# 

Actual results:
It complains that Peer certificate not authenticate by CA certificate provided.

Expected results:
It should not complain about the Peer certificate and capabilites of scep server should be fetched.

Additional info:

Comment 1 Nalin Dahyabhai 2015-07-20 18:36:38 UTC
This breaks SCEP to servers over HTTPS, and the same bug likely breaks dogtag-submit's parsing of -o and -O command-line options, which is functionality that IPA needs.  Pulling the fixes for these in to the 0.78 branch and tagging an 0.78.3 release to fix it.

Comment 3 Kaleem 2015-09-03 18:00:28 UTC
Verified.

Certmonger version:
===================
[root@dhcp207-177 ~]# rpm -q certmonger
certmonger-0.78.4-1.el7.x86_64
[root@dhcp207-177 ~]#

Snip from console output:
=========================
[root@yttrium ~]# getcert add-scep-ca -c scepca -u https://sceptest/CertSrv/mscep/mscep.dll -R /root/sceptest/ca-bundle.pem 
New CA "scepca" added.
[root@yttrium ~]# getcert list-cas -c scepca
CA 'scepca':
	is-default: no
	ca-type: EXTERNAL
	helper-location: /usr/libexec/certmonger/scep-submit -u https://sceptest/CertSrv/mscep/mscep.dll -R /root/sceptest/ca-bundle.pem     
	SCEP CA certificate thumbprint (MD5): 15D13237 EA719245 DD02978F AB9EDB8C
	SCEP CA certificate thumbprint (SHA1): 890CB405 68D3EAB2 4A09CFAE BA49D623 A7BF7740
[root@yttrium ~]# getcert request -c scepca -k /root/sceptest/newkey.prv -f /root/sceptest/newcert.cer -I newtest -L EA90FEF73AD5DA5A203F590AC1428CCCNew signing request "newtest" added.
[root@yttrium ~]# getcert list -i newtest
Number of certificates and requests being tracked: 1.
Request ID 'newtest':
	status: MONITORING
	stuck: no
	key pair storage: type=FILE,location='/root/sceptest/newkey.prv'
	certificate: type=FILE,location='/root/sceptest/newcert.cer'
	signing request thumbprint (MD5): 68393421 536D0CAA CD9EBD03 F1C853BA
	signing request thumbprint (SHA1): 7E24A0F5 3CBD01E3 49524694 6247C3C5 6396A8A9
	CA: scepca
	issuer: CN=sceptest-SCEPTEST-CA,DC=sceptest,DC=qe
	subject: CN=yttrium.idmqe.lab.eng.bos.redhat.com
	expires: 2017-08-05 16:38:33 UTC
	dns: yttrium.idmqe.lab.eng.bos.redhat.com
	key usage: digitalSignature,keyEncipherment
	eku: iso.org.dod.internet.security.mechanisms.8.2.2
	certificate template/profile: IPSECIntermediateOffline
	pre-save command: 
	post-save command: 
	track: yes
	auto-renew: yes
[root@yttrium ~]#

Comment 4 errata-xmlrpc 2015-11-19 11:59:11 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2365.html