-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Description
Importing this key from some older OpenSSL tests results in an internal error:
https://github.com/openssl/openssl/blob/8efc4a9c656b8b3eabeac64c54efdeb07dd42f8e/test/recipes/30-test_evp_pkey_provided/DH.priv.pem
Example code:
#!/usr/bin/python3
from cryptography.hazmat.primitives.serialization import load_pem_private_key
x=b"""-----BEGIN PRIVATE KEY-----
MCQCAQAwFwYJKoZIhvcNAQMBMAoCBQCLtF9TAgECBAYCBGZsKwY=
-----END PRIVATE KEY-----
"""
load_pem_private_key(x, password=None)
Error message:
Traceback (most recent call last):
File "/tmp/foo.py", line 10, in <module>
load_pem_private_key(x, password=None)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
cryptography.exceptions.InternalError: Unknown OpenSSL error. This error is commonly encountered
when another library is not cleaning up the OpenSSL error
stack. If you are using cryptography with another library
that uses OpenSSL try disabling it before reporting a bug.
Otherwise please file an issue at
https://github.com/pyca/cryptography/issues with
information on how to reproduce this. (error:0280007E:Diffie-Hellman routines:generate_key:modulus too small:../openssl-3.5.0/crypto/dh/dh_key.c:287:)
Metadata
Metadata
Assignees
Labels
No labels