File 3841-compiler-beam_lib-Stop-using-deprecated-crypto-funct.patch of Package erlang
From b64cd0ba4a15650cdea2f32f9035efb4fcc66d36 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Wed, 18 Mar 2020 09:19:00 +0100
Subject: [PATCH] compiler, beam_lib: Stop using deprecated crypto functions
---
 lib/compiler/src/compile.erl | 3 +--
 lib/stdlib/src/beam_lib.erl  | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl
index 206cd78a4b..a84b60663a 100644
--- a/lib/compiler/src/compile.erl
+++ b/lib/compiler/src/compile.erl
@@ -1594,7 +1593,7 @@ encrypt({des3_cbc=Type,Key,IVec,BlockSize}, Bin0) ->
 	       0 -> Bin0;
 	       N -> list_to_binary([Bin0,crypto:strong_rand_bytes(BlockSize-N)])
 	   end,
-    Bin = crypto:block_encrypt(Type, Key, IVec, Bin1),
+    Bin = crypto:crypto_one_time(des_ede3_cbc, Key, IVec, Bin1, true),
     TypeString = atom_to_list(Type),
     list_to_binary([0,length(TypeString),TypeString,Bin]).
 
diff --git a/lib/stdlib/src/beam_lib.erl b/lib/stdlib/src/beam_lib.erl
index f908cf40dd..0a6dc74bd0 100644
--- a/lib/stdlib/src/beam_lib.erl
+++ b/lib/stdlib/src/beam_lib.erl
@@ -974,7 +973,7 @@ decrypt_chunk(Type, Module, File, Id, Bin) ->
 	KeyString = get_crypto_key({debug_info, Type, Module, File}),
 	{Type,Key,IVec,_BlockSize} = make_crypto_key(Type, KeyString),
 	ok = start_crypto(),
-	NewBin = crypto:block_decrypt(Type, Key, IVec, Bin),
+	NewBin = crypto:crypto_one_time(des_ede3_cbc, Key, IVec, Bin, false),
 	binary_to_term(NewBin)
     catch
 	_:_ ->
-- 
2.16.4