Skip to content
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

Add support for specifying PKCS#12 MAC parameters #772

Open
paihu opened this issue Jul 1, 2024 · 2 comments
Open

Add support for specifying PKCS#12 MAC parameters #772

paihu opened this issue Jul 1, 2024 · 2 comments

Comments

@paihu
Copy link

paihu commented Jul 1, 2024

Issue #654 closed but it doesn't seem to be resolved.

Here's what we created using the legacy provider:

openssl pkcs12 -in xx.p12 -info -noout -legacy
Enter Import Password:
MAC: sha256, Iteration 1
MAC length: 32, salt length: 8
PKCS7 Encrypted data: pbeWithSHA1And40BitRC2-CBC, Iteration 2048
Certificate bag
PKCS7 Data
Shrouded Keybag: pbeWithSHA1And3-KeyTripleDES-CBC, Iteration 2048

It uses sha256 instead of sha1.

current OpenSSL::PKCS12.create not support -macalg

pyca/cryptography#7293 (comment)

@rhenium
Copy link
Member

rhenium commented Jul 3, 2024

You are right, the example code provided in #654 had another error and I skipped the main question.

Should we add a binding for PKCS12_set_mac()?

@paihu
Copy link
Author

paihu commented Jul 3, 2024

I think adding the PKCS12_set_mac() binding would be beneficial to maintain backward compatibility with legacy OpenSSL.

@rhenium rhenium changed the title Issue imporitng certificates created using OpenSSL::PKCS12 on macOS devices Add support for specifying PKCS#12 MAC parameters Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants