Bug 1485833
| Summary: | Missing CN in user signing cert would cause error in cmc user-signed [rhel-7.4.z] | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Oneata Mircea Teodor <toneata> |
| Component: | pki-core | Assignee: | Christina Fu <cfu> |
| Status: | CLOSED ERRATA | QA Contact: | Asha Akkiangady <aakkiang> |
| Severity: | urgent | Docs Contact: | Petr Bokoc <pbokoc> |
| Priority: | urgent | ||
| Version: | 7.4 | CC: | cfu, gkapoor, mharmsen, msauton, pbokoc |
| Target Milestone: | rc | Keywords: | ZStream |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| 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.
|
Story Points: | --- |
| Clone Of: | 1474658 | Environment: | |
| Last Closed: | 2017-11-30 15:32:00 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | 1474658 | ||
| Bug Blocks: | |||
|
Description
Oneata Mircea Teodor
2017-08-28 08:15:02 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
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"
I think that should do, Geetika. thanks. Thanks Christina.Marking this bug verified. 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 |