diff options
author | Fredrik Gustafsson <[email protected]> | 2013-09-02 15:22:50 +0200 |
---|---|---|
committer | Fredrik Gustafsson <[email protected]> | 2013-09-02 15:22:50 +0200 |
commit | 1a57f9d04b0e846ba6dccdb99643c4f7ab17705f (patch) | |
tree | 2f4d0e0f306edf20b12060d65d6b3cf0096b051e /lib/public_key/src/public_key.erl | |
parent | b1b6087d7f52b4ac88c90b52be7b66f0e894e565 (diff) | |
parent | 909d2b4975f4e6b01c70e3577c8be510c7481ff6 (diff) | |
download | otp-1a57f9d04b0e846ba6dccdb99643c4f7ab17705f.tar.gz otp-1a57f9d04b0e846ba6dccdb99643c4f7ab17705f.tar.bz2 otp-1a57f9d04b0e846ba6dccdb99643c4f7ab17705f.zip |
Merge branch 'dotsimon/pubkey_aes_cbc/OTP-11281' into maint
* dotsimon/pubkey_aes_cbc/OTP-11281:
Allow public_key:pem_entry_decode/2) to handle AES-128-CBC ciphered keys
Diffstat (limited to 'lib/public_key/src/public_key.erl')
-rw-r--r-- | lib/public_key/src/public_key.erl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/public_key/src/public_key.erl b/lib/public_key/src/public_key.erl index cdbfe6e07c..a4b6b8ad15 100644 --- a/lib/public_key/src/public_key.erl +++ b/lib/public_key/src/public_key.erl @@ -118,6 +118,13 @@ pem_entry_decode({Asn1Type, CryptDer, {Cipher, Salt}} = PemEntry, is_list(Cipher) andalso is_binary(Salt) andalso erlang:byte_size(Salt) == 8 -> + do_pem_entry_decode(PemEntry, Password); +pem_entry_decode({Asn1Type, CryptDer, {"AES-128-CBC"=Cipher, IV}} = PemEntry, + Password) when is_atom(Asn1Type) andalso + is_binary(CryptDer) andalso + is_list(Cipher) andalso + is_binary(IV) andalso + erlang:byte_size(IV) == 16 -> do_pem_entry_decode(PemEntry, Password). %%-------------------------------------------------------------------- |