Open
Description
Hi,
Thank you for cryptography.
I'm using cryptography with paramiko with python 3.10.
I have an RSA private key encrypted with a passphrase using DES-EDE3-CBC,0FC613071E6D505D encryption.
It loads correctly with cryptography 44.0.3 but with the 45.x.x releases I get a ValueError:
paramiko.ssh_exception.SSHException: Could not deserialize key data. The data may be in an incorrect format, it may be encrypted with an unsupported algorithm, or it may be an unsupported key type (e.g. EC curves with explicit parameters). Details: ASN.1 parsing error: unexpected tag (got Tag { value: 2, constructed: false, class: Universal })
I noticed the openssl default_backend version changed between these versions so that might be the reason:
# with cryptography 44.0.3
<OpenSSLBackend(version: OpenSSL 3.4.1 11 Feb 2025, FIPS: False, Legacy: True)>
# with cryptography 45.0.3
<OpenSSLBackend(version: OpenSSL 3.5.0 8 Apr 2025, FIPS: False, Legacy: True)>