File otp_src_19.0.4-lib-stdlib-beam_lib-crypto.patch of Package erlang
diff -Ndurp otp_src_19.0.4/lib/stdlib/src/beam_lib.erl otp_src_19.0.4-lib-stdlib-beam_lib-crypto/lib/stdlib/src/beam_lib.erl
--- otp_src_19.0.4/lib/stdlib/src/beam_lib.erl 2016-08-11 17:23:53.000000000 +0300
+++ otp_src_19.0.4-lib-stdlib-beam_lib-crypto/lib/stdlib/src/beam_lib.erl 2016-08-16 02:28:13.994235524 +0300
@@ -888,10 +888,10 @@ decrypt_abst(Type, Module, File, Id, Ato
end.
decrypt_abst_1({Type,Key,IVec,_BlockSize}, Bin) ->
- ok = start_crypto(),
- NewBin = crypto:block_decrypt(Type, Key, IVec, Bin),
- Term = binary_to_term(NewBin),
- anno_from_term(Term).
+ case start_crypto() of
+ ok -> anno_from_term(binary_to_term(crypto:block_decrypt(Type, Key, IVec, Bin)));
+ {error, _} = E -> E
+ end.
anno_from_term({raw_abstract_v1, Forms}) ->
{raw_abstract_v1, anno_from_forms(Forms)};
@@ -912,11 +912,11 @@ anno_from_forms(Forms0) ->
[erl_parse:anno_from_term(Form) || Form <- Forms].
start_crypto() ->
- case crypto:start() of
- {error, {already_started, _}} ->
- ok;
- ok ->
- ok
+ try crypto:start() of
+ {error, {already_started, _}} -> ok;
+ ok -> ok
+ catch
+ error:_ -> {error, [{none, ?MODULE, no_crypto}]}
end.
get_crypto_key(What) ->