aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2019-01-21 12:15:27 +0100
committerGitHub <[email protected]>2019-01-21 12:15:27 +0100
commit702855e0af76dd5ac284397969c6527dded32b08 (patch)
tree44bc11827167f35381e63ba021fc91dc7db01a8b /lib
parentd4e1ffe0d687737445e54dd99f4e2d42a1ef7cdf (diff)
parentdf051081c6cb1fb8f2e40d53ea9b25e4a14eb5e2 (diff)
downloadotp-702855e0af76dd5ac284397969c6527dded32b08.tar.gz
otp-702855e0af76dd5ac284397969c6527dded32b08.tar.bz2
otp-702855e0af76dd5ac284397969c6527dded32b08.zip
Merge pull request #2030 from yakubovsky/patch-1
Fix encrypt_config_file and decrypt_config_file OTP-15540
Diffstat (limited to 'lib')
-rw-r--r--lib/common_test/src/ct_config.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/common_test/src/ct_config.erl b/lib/common_test/src/ct_config.erl
index a10d939919..a07e61199b 100644
--- a/lib/common_test/src/ct_config.erl
+++ b/lib/common_test/src/ct_config.erl
@@ -592,7 +592,7 @@ encrypt_config_file(SrcFileName, EncryptFileName, {file,KeyFile}) ->
encrypt_config_file(SrcFileName, EncryptFileName, {key,Key}) ->
_ = crypto:start(),
- {Key,IVec} = make_crypto_key(Key),
+ {CryptoKey,IVec} = make_crypto_key(Key),
case file:read_file(SrcFileName) of
{ok,Bin0} ->
Bin1 = term_to_binary({SrcFileName,Bin0}),
@@ -600,7 +600,7 @@ encrypt_config_file(SrcFileName, EncryptFileName, {key,Key}) ->
0 -> Bin1;
N -> list_to_binary([Bin1,random_bytes(8-N)])
end,
- EncBin = crypto:block_encrypt(des3_cbc, Key, IVec, Bin2),
+ EncBin = crypto:block_encrypt(des3_cbc, CryptoKey, IVec, Bin2),
case file:write_file(EncryptFileName, EncBin) of
ok ->
io:format("~ts --(encrypt)--> ~ts~n",
@@ -631,10 +631,10 @@ decrypt_config_file(EncryptFileName, TargetFileName, {file,KeyFile}) ->
decrypt_config_file(EncryptFileName, TargetFileName, {key,Key}) ->
_ = crypto:start(),
- {Key,IVec} = make_crypto_key(Key),
+ {CryptoKey,IVec} = make_crypto_key(Key),
case file:read_file(EncryptFileName) of
{ok,Bin} ->
- DecBin = crypto:block_decrypt(des3_cbc, Key, IVec, Bin),
+ DecBin = crypto:block_decrypt(des3_cbc, CryptoKey, IVec, Bin),
case catch binary_to_term(DecBin) of
{'EXIT',_} ->
{error,bad_file};