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 1485833 - Missing CN in user signing cert would cause error in cmc user-signed [rhel-7.4.z]
Summary: Missing CN in user signing cert would cause error in cmc user-signed [rhel-7....
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pki-core
Version: 7.4
Hardware: All
OS: Linux
urgent
urgent
Target Milestone: rc
: ---
Assignee: Christina Fu
QA Contact: Asha Akkiangady
Petr Bokoc
URL:
Whiteboard:
Depends On: 1474658
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-28 08:15 UTC by Oneata Mircea Teodor
Modified: 2017-11-30 15:32 UTC (History)
5 users (show)

Fixed In Version: pki-core-10.4.1-14.el7_4
Doc Type: Bug Fix
Doc Text:
Previously, an incoming request missing the Common Name (CN) component caused a NullPointerException on the Certificate Authority (CA) because the implementation expected the CN to be present in the subject Distinguished Name (DN) of the CMC. This update allows the CA to handle subject DN without a CN component, preventing the exception from being thrown.
Clone Of: 1474658
Environment:
Last Closed: 2017-11-30 15:32:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:3301 0 normal SHIPPED_LIVE pki-core bug fix and enhancement update 2017-11-30 20:14:57 UTC

Description Oneata Mircea Teodor 2017-08-28 08:15:02 UTC
This bug has been copied from bug #1474658 and has been proposed to be backported to 7.4 z-stream (EUS).

Comment 3 Geetika Kapoor 2017-09-28 10:34:01 UTC
How to reproduce issue:

Environment:
rpm -qa pki-ca
pki-ca-10.4.1-13.el7_4.noarch


Certificate used for testing purpose:

<Certificate snip>
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number: 525797390 (0x1f57080e)
        Signature Algorithm: PKCS #1 SHA-512 With RSA Encryption
        Issuer: "CN=CA Signing Certificate,OU=rhcs-0day,O=Example-rhcs92-CA"
        Validity:
            Not Before: Wed Sep 27 05:56:15 2017
            Not After : Mon Mar 26 05:56:15 2018
        Subject: "UID=testing,E=Geetikakk"
        Subject Public Key Info:

</Certificate snip>

Testing Steps:

Import certificate in the nssdb with nickname=testing.
Both cmc file and Httpclient file should have:
user-signed/cmc.self.cfg:nickname=testing
user-signed/HttpClient-cmc-crmf.self.cfg:nickname=testing

1. PKCS10Client -d . -p SECret.123 -n "uid=update2"  -o user-signed/pkcs10.req
2. update privatekey value in user-signed/cmc.self.cfg
3. Run CMCRequest user-signed/cmc.self.cfg
4. Run HttpClient user-signed/HttpClient-cmc-crmf.self.cfg
5. CMCResponse -d . -i user-signed/cmc.self.Resp

Logs and files:

1. Debug logs:

[28/Sep/2017:05:15:17][http-bio-8443-exec-3]: SignedAuditEventFactory: create() message created for eventType=ACCESS_SESSION_ESTABLISH_SUCCESS

[28/Sep/2017:05:15:17][http-bio-8443-exec-3]: CMSServlet:service() uri = /ca/ee/ca/profileSubmitUserSignedCMCFull
[28/Sep/2017:05:15:17][http-bio-8443-exec-3]: CMSServlet: caProfileSubmitUserSignedCMCFull start to service.
[28/Sep/2017:05:15:17][http-bio-8443-exec-3]: Start of ProfileSubmitCMCServlet Input Parameters
[28/Sep/2017:05:15:17][http-bio-8443-exec-3]: End of ProfileSubmitCMCServlet Input Parameters
[28/Sep/2017:05:15:17][http-bio-8443-exec-3]: ProfileSubmitCMCServlet: start serving
[28/Sep/2017:05:15:17][http-bio-8443-exec-3]: ProfileSubmitCMCServlet: SubId=profile
[28/Sep/2017:05:15:17][http-bio-8443-exec-3]: ProfileSubmitCMCServlet: profileId caFullCMCUserSignedCert
[28/Sep/2017:05:15:17][http-bio-8443-exec-3]: ProfileSubmitCMCServlet: authenticator CMCUserSignedAuth found
[28/Sep/2017:05:15:17][http-bio-8443-exec-3]: ProfileSubmitCMCServlet: set Inputs into Context
[28/Sep/2017:05:15:17][http-bio-8443-exec-3]: ProfileSubmitCMCServlet: set sslClientCertProvider
[28/Sep/2017:05:15:17][http-bio-8443-exec-3]: CMCUserSignedAuth: authenticate: begins
[28/Sep/2017:05:15:17][http-bio-8443-exec-3]: SignedAuditEventFactory: create() message created for eventType=ACCESS_SESSION_TERMINATED

2.


HttpClient user-signed/HttpClient-cmc-crmf.self.cfg

Total number of bytes read = 2888
after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
client cert is not null
handshake happened
writing to socket
Total number of bytes read = 234
PEhUTUw+CjxCT0RZIEJHQ09MT1I9d2hpdGU+CjxQPgpUaGUgQ2VydGlmaWNhdGUg
U3lzdGVtIGhhcyBlbmNvdW50ZXJlZCBhbiB1bnJlY292ZXJhYmxlIGVycm9yLgo8
UD4KRXJyb3IgTWVzc2FnZTo8QlI+CjxJPmphdmEubGFuZy5OdWxsUG9pbnRlckV4
Y2VwdGlvbjwvST4KPFA+ClBsZWFzZSBjb250YWN0IHlvdXIgbG9jYWwgYWRtaW5p
c3RyYXRvciBmb3IgYXNzaXN0YW5jZS4KPC9CT0RZPgo8L0hUTUw+Cg0K


The response in binary format is stored in user-signed/cmc.self.Resp

[root@pki1 0day]# cat user-signed/cmc.self.Resp
<HTML>
<BODY BGCOLOR=white>
<P>
The Certificate System has encountered an unrecoverable error.
<P>
Error Message:<BR>
<I>java.lang.NullPointerException</I>
<P>
Please contact your local administrator for assistance.
</BODY>
</HTML>


CMCResponse -d . -i user-signed/cmc.self.Resp
Error found in the response. Exception: org.mozilla.jss.asn1.InvalidBERException: SEQUENCE(item #0) >> Incorrect tag: expected [UNIVERSAL 16], found [UNIVERSAL 28]


Testing with Fix:
================

Environment:

rpm -qa pki-ca
pki-ca-10.4.1-15.el7_4.noarch

1. Stop the CA and KRA instance.
2. Upgrade the pki packages
3. Start CA and KRA instance.Perform same test again


Test Case 1: Use the same certificate without CN and make sure certificate is issued.


Perform testing steps as mentioned above.

Result:

Audit logs:

0.http-bio-8443-exec-11 - [28/Sep/2017:05:40:42 EDT] [14] [6] [AuditEvent=PROOF_OF_POSSESSION][SubjectID=UID=testing,E=Geetikakk][Outcome=Success][Info=method=EnrollProfile: fillTaggedRequest: ] proof of possession
0.http-bio-8443-exec-11 - [28/Sep/2017:05:40:42 EDT] [14] [6] [AuditEvent=PROFILE_CERT_REQUEST][SubjectID=UID=testing,E=Geetikakk][Outcome=Success][ReqID=1800180018001826][ProfileID=caFullCMCUserSignedCert][CertSubject=UID=testing,E=Geetikakk] certificate request made with certificate profiles
0.http-bio-8443-exec-11 - [28/Sep/2017:05:40:42 EDT] [14] [6] [AuditEvent=CERT_REQUEST_PROCESSED][SubjectID=UID=testing,E=Geetikakk][Outcome=Success][ReqID=1800180018001826][CertSerialNum=486932078] certificate request processed
0.http-bio-8443-exec-11 - [28/Sep/2017:05:40:42 EDT] [14] [6] [AuditEvent=ACCESS_SESSION_TERMINATED][ClientIP=10.12.28.208][ServerIP=10.12.28.208][SubjectID=UID=testing,E=Geetikakk][Outcome=Success][Info=CLOSE_NOTIFY] access session terminated

2. Make sure Certificate exist in CA Agent page.

    Certificate: 
        Data: 
            Version:  v3
            Serial Number: 0x1D05FE6E
            Signature Algorithm: SHA512withRSA - 1.2.840.113549.1.1.13
            Issuer: CN=CA Signing Certificate,OU=rhcs-0day,O=Example-rhcs92-CA
            Validity: 
                Not Before: Thursday, September 28, 2017 5:40:42 AM EDT America/New_York
                Not  After: Tuesday, March 27, 2018 5:40:42 AM EDT America/New_York
            Subject: UID=testing,E=Geetikakk
            Subject Public Key Info: 
                Algorithm: RSA - 1.2.840.113549.1.1.1
                Public Key: 
                    Exponent: 65537

3. Verify the CMCResponse.

Number of controls is 1
Control #0: CMCStatusInfoV2
   OID: {1 3 6 1 5 5 7 7 25}
   BodyList: 1 
   Status: SUCCESS

Test Case 2: with muiltple fields in subject dn  
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number: 314909420 (0x12c522ec)
        Signature Algorithm: PKCS #1 SHA-512 With RSA Encryption
        Issuer: "CN=CA Signing Certificate,OU=rhcs-0day,O=Example-rhcs92-CA"
        Validity:
            Not Before: Thu Sep 28 10:13:18 2017
            Not After : Tue Mar 27 10:13:18 2018
        Subject: "UID=testing,E=dmail.smtp@redhat,CN=CHECK,OU=OU3,OU=OU2,OU=O
            U1,OU=OU,O=TEST,C=IN"


Audit logs

hat,CN=CHECK,OU=OU3,OU=OU2,OU=OU1,OU=OU,O=TEST,C=IN][Outcome=Success][AuthMgr=CMCUserSignedAuth] authentication success
0.http-bio-8443-exec-19 - [28/Sep/2017:06:27:47 EDT] [14] [6] [AuditEvent=AUTHZ_SUCCESS][SubjectID=UID=testing,E=dmail.smtp@redhat,CN=CHECK,OU=OU3,OU=OU2,OU=OU1,OU=OU,O=TEST,C=IN][Outcome=Success][aclResource=certServer.ee.profile][Op=submit] authorization success
0.http-bio-8443-exec-19 - [28/Sep/2017:06:27:47 EDT] [14] [6] [AuditEvent=ROLE_ASSUME][SubjectID=UID=testing,E=dmail.smtp@redhat,CN=CHECK,OU=OU3,OU=OU2,OU=OU1,OU=OU,O=TEST,C=IN][Outcome=Success][Role=<null>] assume privileged role
0.http-bio-8443-exec-19 - [28/Sep/2017:06:27:47 EDT] [14] [6] [AuditEvent=PROOF_OF_POSSESSION][SubjectID=UID=testing,E=dmail.smtp@redhat,CN=CHECK,OU=OU3,OU=OU2,OU=OU1,OU=OU,O=TEST,C=IN][Outcome=Success][Info=method=EnrollProfile: fillTaggedRequest: ] proof of possession
0.http-bio-8443-exec-19 - [28/Sep/2017:06:27:47 EDT] [14] [6] [AuditEvent=PROFILE_CERT_REQUEST][SubjectID=UID=testing,E=dmail.smtp@redhat,CN=CHECK,OU=OU3,OU=OU2,OU=OU1,OU=OU,O=TEST,C=IN][Outcome=Success][ReqID=1800180018001836][ProfileID=caFullCMCUserSignedCert][CertSubject=UID=testing,E=dmail.smtp@redhat,CN=CHECK,OU=OU3,OU=OU2,OU=OU1,OU=OU,O=TEST,C=IN] certificate request made with certificate profiles
0.http-bio-8443-exec-19 - [28/Sep/2017:06:27:47 EDT] [14] [6] [AuditEvent=CERT_REQUEST_PROCESSED][SubjectID=UID=testing,E=dmail.smtp@redhat,CN=CHECK,OU=OU3,OU=OU2,OU=OU1,OU=OU,O=TEST,C=IN][Outcome=Success][ReqID=1800180018001836][CertSerialNum=429885275] certificate request processed
0.http-bio-8443-exec-19 - [28/Sep/2017:06:27:47 EDT] [14] [6] [AuditEvent=ACCESS_SESSION_TERMINATED][ClientIP=10.12.28.208][ServerIP=10.12.28.208][SubjectID=UID=testing,E=dmail.smtp@redhat,CN=CHECK,OU=OU3,OU=OU2,OU=OU1,OU=OU,O=TEST,C=IN][Outcome=Success][Info=CLOSE_NOTIFY] access session terminated

2. Make sure certificate exist on CA Page.

Certificate Pretty Print 
    Certificate: 
        Data: 
            Version:  v3
            Serial Number: 0x199F875B
            Signature Algorithm: SHA512withRSA - 1.2.840.113549.1.1.13
            Issuer: CN=CA Signing Certificate,OU=rhcs-0day,O=Example-rhcs92-CA
            Validity: 
                Not Before: Thursday, September 28, 2017 6:27:47 AM EDT America/New_York
                Not  After: Tuesday, March 27, 2018 6:27:47 AM EDT America/New_York
            Subject: UID=testing,E=dmail.smtp@redhat,CN=CHECK,OU=OU3,OU=OU2,OU=OU1,OU=OU,O=TEST,C=IN
            Subject Public Key Info: 
                Algorithm: RSA - 1.2.840.113549.1.1.1
                Public Key: 
                    Exponent: 65537
3. CMCResponse:

Number of controls is 1
Control #0: CMCStatusInfoV2
   OID: {1 3 6 1 5 5 7 7 25}
   BodyList: 1 
   Status: SUCCESS

Comment 4 Geetika Kapoor 2017-09-28 10:42:52 UTC
I have added test cases mentioned below.Do you think I should be adding more test cases here?

Test Cases:
==========

Test Case 1: Use the same certificate without CN and make sure certificate is issued. 
example: 
Subject: UID=testing,E=Geetikakk

Test Case 2: with muiltple fields in subject dn .

Example : Subject: "UID=testing,E=dmail.smtp@redhat,CN=CHECK,OU=OU3,OU=OU2,OU=O
            U1,OU=OU,O=TEST,C=IN"

Comment 5 Christina Fu 2017-10-04 20:42:46 UTC
I think that should do, Geetika.  thanks.

Comment 6 Geetika Kapoor 2017-10-05 05:11:09 UTC
Thanks Christina.Marking this bug verified.

Comment 9 errata-xmlrpc 2017-11-30 15:32:00 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://access.redhat.com/errata/RHBA-2017:3301


Note You need to log in before you can comment on or make changes to this bug.