diff options
author | Siri Hansen <[email protected]> | 2019-01-21 12:15:27 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-01-21 12:15:27 +0100 |
commit | 702855e0af76dd5ac284397969c6527dded32b08 (patch) | |
tree | 44bc11827167f35381e63ba021fc91dc7db01a8b /lib | |
parent | d4e1ffe0d687737445e54dd99f4e2d42a1ef7cdf (diff) | |
parent | df051081c6cb1fb8f2e40d53ea9b25e4a14eb5e2 (diff) | |
download | otp-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.erl | 8 |
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}; |