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

UTF-8 chars in password break PKCS #12 #404

Open
pboguslawski opened this issue Apr 19, 2024 · 0 comments
Open

UTF-8 chars in password break PKCS #12 #404

pboguslawski opened this issue Apr 19, 2024 · 0 comments

Comments

@pboguslawski
Copy link

PKCS #12 file generated with code from #403 and password with UTF-8 chars i.e. żółw cannot be opened in openssl...

$ openssl version
OpenSSL 3.0.11 19 Sep 2023 (Library: OpenSSL 3.0.11 19 Sep 2023)

$ openssl pkcs12 -info -in test.p12 
Enter Import Password:  // correct password "źółw" is typed
MAC: sha256, Iteration 600000
MAC length: 32, salt length: 64
Warning: using broken algorithm
PKCS7 Encrypted data: PBES2, PBKDF2, AES-256-CBC, Iteration 600000, PRF hmacWithSHA256
Error outputting keys and certificates
40E7243F357F0000:error:1C800064:Provider routines:ossl_cipher_unpadblock:bad decrypt:../providers/implementations/ciphers/ciphercommon_block.c:124:
40E7243F357F0000:error:11800074:PKCS12 routines:PKCS12_pbe_crypt_ex:pkcs12 cipherfinal error:../crypto/pkcs12/p12_decr.c:86:maybe wrong password

$ openssl pkcs12 -info -in test.p12 
Enter Import Password: // incorrect password "bad" is typed
MAC: sha256, Iteration 600000
MAC length: 32, salt length: 64
Mac verify error: invalid password?

...nor imported to Firefox:

Failed to decode the file. Either it is not in PKCS #12 format, has been corrupted, or the password you entered was incorrect.

No such problem when password contains ASCII chars only i.e. zolw123!@#.

@pboguslawski pboguslawski changed the title UTF-8 chars in password breaks PKCS #12 UTF-8 chars in password break PKCS #12 Apr 19, 2024
pboguslawski added a commit to ibpl/web-certificate-tool that referenced this issue Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant