Bug 1040640
| Summary: | Incorrect OIDs for SHA2 algorithms | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Nathan Kinder <nkinder> | ||||
| Component: | jss | Assignee: | Christina Fu <cfu> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Asha Akkiangady <aakkiang> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 7.0 | CC: | cfu, david.k.stutzman2.ctr, jmagne, jnimeh, mharmsen, nkinder, rpattath | ||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | other | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | jss-4.2.6-35.el7 | Doc Type: | Bug Fix | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | 1040638 | ||||||
| : | 1190302 (view as bug list) | Environment: | |||||
| Last Closed: | 2015-03-05 13:22:21 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: | |||||||
| Bug Depends On: | 1040638 | ||||||
| Bug Blocks: | 530474, 1061410, 1190302 | ||||||
| Attachments: |
|
||||||
|
Description
Nathan Kinder
2013-12-11 18:51:04 UTC
I've been able to rebuild JSS with the following fix in it and it has been working very well for me for the past few months. One file/one line fix:
diff -uN --recursive jss-4.2.6.orig/mozilla/security/jss/org/mozilla/jss/asn1/OBJECT_IDENTIFIER.java jss-4.2.6/mozilla/security/jss/org/mozilla/jss/asn1/OBJECT_IDENTIFIER.java
--- jss-4.2.6.orig/mozilla/security/jss/org/mozilla/jss/asn1/OBJECT_IDENTIFIER.java 2004-10-12 16:24:39.000000000 -0700
+++ jss-4.2.6/mozilla/security/jss/org/mozilla/jss/asn1/OBJECT_IDENTIFIER.java 2013-02-20 15:10:08.789342921 -0800
@@ -111,7 +111,7 @@
* The OID space for FIPS-180-2 SHA256/SHA384/SHA512 standardized algorithms.
*/
public static final OBJECT_IDENTIFIER HASH_ALGORITHM =
- new OBJECT_IDENTIFIER( new long[] {2, 16, 840, 1, 101, 3, 4 } );
+ new OBJECT_IDENTIFIER( new long[] {2, 16, 840, 1, 101, 3, 4, 2 } );
/**
(In reply to Jamil Nimeh from comment #1) Thank you Jamil for the contribution. I have taken a look of the fix and it looks good. I will put your email down as the contributor in the change log of the official build(s) when it happens. Best regards. *** Bug 1040638 has been marked as a duplicate of this bug. *** Created attachment 937135 [details] This is the same patch provided by jnimeh. This patch is now reviewed and tested by myself ready for next build. Test information for QE : Note1: There is a bug in CMCRequest: https://fedorahosted.org/pki/ticket/1158 CMCRequest does not support internal token Note2:This is how I did it; you are free to use other tools/methods): You might want to do the following exercise on a the CA running with previous JSS build (e.g. jss-4.2.6-33) * in CS.cfg: ca.signing.defaultSigningAlgorithm=SHA256withRSA * Generate a CMC request: - generate a pkcs10 request e.g. PKCS10Client -d . -p <passwd> -o certReq.p10 -n "CN=cfuTest" -a rsa -l 2048 - generate a CMC request using the resulting pkcs10 request from above: e.g. cat p10cmc.conf numRequests=1 #input: full path for the PKCS10 request or CRMF request, #the content must be in Base-64 encoded format #Multiple files are supported. They must be separated by space. input=certReq.p10 #output: full path for the CMC request in binary format output=certReq.p10.cmc #nickname: nickname for agent certificate which will be used #to sign the CMC full request. #tokenname=internal nickname=PKI Administrator for ca host #dbdir: directory for cert8.db, key3.db and secmod.db dbdir=./ #password: password for cert8.db which stores the agent #certificate password=<replace it with your password> #format: request format, either pkcs10 or crmf format=pkcs10 <snip> * use HttpClient to subnmit the CMC request to CA: e.g. cat HttpClientRSA.cfg #host: host name for the http server host=<your ca host> #port: port number port=8080 #secure: true for secure connection, false for nonsecure connection secure=false #input: full path for the enrollment request, the content must be in binary format input=/root/cfu/testCMC/certReq.p10.cmc #output: full path for the response in binary format output=/root/cfu/testCMC/certReq.p10.cmc.response #dbdir: directory for cert8.db, key3.db and secmod.db #This parameter will be ignored if secure=false dbdir=/root/cfu/testCMC #clientmode: true for client authentication, false for no client authentication #This parameter will be ignored if secure=false clientmode=false #password: password for cert8.db #This parameter will be ignored if secure=false and clientauth=false password=<replace it with your password> #tokenname= #nickname: nickname for client certificate #This parameter will be ignored if clientmode=false nickname=PKI Administrator for ca host #servlet: servlet name servlet=/ca/ee/ca/profileSubmitCMCFull * copy the Base64 CMC response result on the screen and pass it into an ASN.1 decoder: You will find the following (which is the "wrong" OID): 28 12: SEQUENCE { 30 8: OBJECT IDENTIFIER '2 16 840 1 101 3 4 1' 40 0: NULL : } : } ============ After reinstalling JSS with the revision with the fix (JSS version > jss-4.2.6-33), go through the above exercise again, and you shall see the following correct OID instead: 28 13: SEQUENCE { 30 9: OBJECT IDENTIFIER '2 16 840 1 101 3 4 2 1' 41 0: NULL : } : } The next JSS build containing this fix will be available when notified (currently waiting for one other bug to be addressed). I was able to verify the bug on RHEL 7.1 using jss-4.2.6-35.el7. I am not able to reproduce the bug by executing the steps explained in comment 5 on RHEL 7.0 using jss-4.2.6-33.el7. I was getting the following error when trying to run CMCRequest for the pkcs10 cert request [root@mgmt8 certs_db]# CMCRequest p10cmc.conf cert/key prefix = path = ./ CryptoManger initialized org.mozilla.jss.NoSuchTokenException at org.mozilla.jss.CryptoManager.getTokenByName(CryptoManager.java:622) at com.netscape.cmstools.CMCRequest.main(CMCRequest.java:1027) I just wanted to confirm if it is because of the following > Note1: There is a bug in CMCRequest: > https://fedorahosted.org/pki/ticket/1158 CMCRequest does not support > internal token Is there a different way to reproduce the bug? I tried to use jss-4.2.6-33.el7 on RHEL 7.1 but since tomcatjss has a dependency on jss, it did not go through. this is a reply to comment 7: most likely it is the result of https://fedorahosted.org/pki/ticket/1158. but you really don't need to do that step on rhel7 or rhel7.1. It is just the client (tool) side that hits the server to be tested. I think the fix was checked into the Dogtag so you can run the client there and point to the server if you want. Verified using jss-4.2.6-35.el7 by executing the steps explained in comment 5 and verifying the expected result. Reproduced the bug using jss-4.2.6-33.el7 and compared the differencr in OIDs. *** Bug 824624 has been marked as a duplicate of this bug. *** 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-0521.html |