-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to validate PKCS #12 files generated by pk12util #796
Comments
Here's a sample PKCS12 generated by NSS 3.67 on Fedora 33 (please unpack with |
On 8/20/21 10:57 AM, Endi S. Dewata wrote:
Here's a sample PKCS12 generated by NSS 3.67 on Fedora 33 (please
unpack with |gunzip|):
test.p12.gz <https://github.com/dogtagpki/jss/files/7023321/test.p12.gz>
FYI NSS 3.66/3.67 on RHEL7 and RHEL8 retain the old defaults for PKCS
#12, but their pkutil can generate PKCS #12 with different hashes using
the -M option.
If you are curious, the original NSS patch to change the defaults is here:
https://hg.mozilla.org/projects/nss/rev/0a1687e1b39eaf066ff01ecc9b2b1d4db65c6eb4
Decrypting with other than SHA1 hashes were already in the NSS code, but
the changes to support encrypting with other than SHA1 hashes may hint
at what changes you may need to make to JSS.
bob
… —
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#796 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEXMMSO57TTLBX22OAXTUG3T52JSJANCNFSM5BRTWQQA>.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>.
|
Looking at
I have tried to replace the algorithm in For the hash it is not a problem but I cannot modify the cipher. I have tried modifying the Additionally, in JSS we have the hash, the digest and the key algorithm, is correct to map KeyGen to the nss cipher and the digest to the certCipher? I have done many tests and start to get confused. Finally, I have generated a pk12 with OpenSSL and it has different algorithm as default (certCicpher is AES_256_CBC). Is there a method tin JSS to get this information to choose the in reading right one? If not, is it possible to implement using nss api? |
@fmarco76 I don't have an answer for that. I'd defer to the others. |
#889 Fix this issue |
JSS can no longer validate PKCS #12 files generated by
pk12util
since recentlypk12util
was changed to use SHA-256 hash algorithm by default whereas JSS is still hard-coded to use SHA-1.Steps to reproduce:
Apparently the
pk12util
hash algorithm was changed in NSS 3.65 but the JSS hash algorithm is hard-coded in MacData class.Ideally JSS should obtain the hash algorithm from the PKCS #12 file itself for better compatibility with other tools.
IIUC the hash algorithm can be obtained from
DigestInfo.digestAlgorithm
from thePFX
object, but theMacData
code above requires three different algorithm IDs:KeyGenAlgorithm.PBA_SHA1_HMAC
HMACAlgorithm.SHA1
DigestAlgorithm.SHA1
so there needs to be a mechanism to translate the
DigestInfo.digestAlgorithm
into the three algorithm IDs needed byMacData
.The text was updated successfully, but these errors were encountered: