diff options
author | Ingela Anderton Andin <[email protected]> | 2013-05-28 11:38:20 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2013-05-28 11:38:20 +0200 |
commit | e910933e572a84f145184000438097c4f2a531d7 (patch) | |
tree | 556607170e64156d193fc08a72c8a29a4ee1e75f /lib/stdlib/src/beam_lib.erl | |
parent | 1b5d887a79f31031caf3fc9f0b282b2d1ce71ce9 (diff) | |
parent | 7f5fa1b06671d31476e0fc0f28b878a6b5059b1b (diff) | |
download | otp-e910933e572a84f145184000438097c4f2a531d7.tar.gz otp-e910933e572a84f145184000438097c4f2a531d7.tar.bz2 otp-e910933e572a84f145184000438097c4f2a531d7.zip |
Merge remote-tracking branch 'upstream/maint'
Conflicts:
bootstrap/lib/stdlib/ebin/beam_lib.beam
lib/public_key/test/erl_make_certs.erl
Diffstat (limited to 'lib/stdlib/src/beam_lib.erl')
-rw-r--r-- | lib/stdlib/src/beam_lib.erl | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/stdlib/src/beam_lib.erl b/lib/stdlib/src/beam_lib.erl index 7a93fa0f45..90bc4be354 100644 --- a/lib/stdlib/src/beam_lib.erl +++ b/lib/stdlib/src/beam_lib.erl @@ -302,10 +302,10 @@ clear_crypto_key_fun() -> -spec make_crypto_key(mode(), string()) -> {binary(), binary(), binary(), binary()}. -make_crypto_key(des3_cbc, String) -> +make_crypto_key(des3_cbc=Type, String) -> <<K1:8/binary,K2:8/binary>> = First = erlang:md5(String), <<K3:8/binary,IVec:8/binary>> = erlang:md5([First|reverse(String)]), - {K1,K2,K3,IVec}. + {Type,[K1,K2,K3],IVec,8}. %% %% Local functions @@ -864,20 +864,20 @@ mandatory_chunks() -> -define(CRYPTO_KEY_SERVER, beam_lib__crypto_key_server). -decrypt_abst(Mode, Module, File, Id, AtomTable, Bin) -> +decrypt_abst(Type, Module, File, Id, AtomTable, Bin) -> try - KeyString = get_crypto_key({debug_info, Mode, Module, File}), - Key = make_crypto_key(des3_cbc, KeyString), - Term = decrypt_abst_1(Mode, Key, Bin), + KeyString = get_crypto_key({debug_info, Type, Module, File}), + Key = make_crypto_key(Type, KeyString), + Term = decrypt_abst_1(Key, Bin), {AtomTable, {Id, Term}} catch _:_ -> error({key_missing_or_invalid, File, Id}) end. -decrypt_abst_1(des3_cbc, {K1, K2, K3, IVec}, Bin) -> +decrypt_abst_1({Type,Key,IVec,_BlockSize}, Bin) -> ok = start_crypto(), - NewBin = crypto:des3_cbc_decrypt(K1, K2, K3, IVec, Bin), + NewBin = crypto:block_decrypt(Type, Key, IVec, Bin), binary_to_term(NewBin). start_crypto() -> |