diff options
| author | Luke Bakken <lbakken@pivotal.io> | 2020-05-20 19:02:04 -0700 |
|---|---|---|
| committer | Luke Bakken <lbakken@pivotal.io> | 2020-05-20 19:03:03 -0700 |
| commit | 03c4a59d568c34e376e21762fdec21e17e82cd94 (patch) | |
| tree | c29d79ec53463008faf4f7bba021416441ccf002 /src | |
| parent | 52853f604864646b1d4d25ba192b52ff74f8bc2f (diff) | |
| download | rabbitmq-server-git-03c4a59d568c34e376e21762fdec21e17e82cd94.tar.gz | |
Fix rabbit_pbe and rabbit_control_pbe to take credentials-obfuscation 2.0 into account
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_control_pbe.erl | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/rabbit_control_pbe.erl b/src/rabbit_control_pbe.erl index 9c3de53c91..8e39ef351e 100644 --- a/src/rabbit_control_pbe.erl +++ b/src/rabbit_control_pbe.erl @@ -52,10 +52,9 @@ encode(Cipher, Hash, Iterations, Args) -> [Value, PassPhrase] = Args, try begin TermValue = evaluate_input_as_term(Value), - Result = rabbit_pbe:encrypt_term(Cipher, Hash, Iterations, - list_to_binary(PassPhrase), - TermValue), - {ok, io_lib:format("~p", [{encrypted, Result}])} + Result = {encrypted, _} = rabbit_pbe:encrypt_term(Cipher, Hash, Iterations, + list_to_binary(PassPhrase), TermValue), + {ok, io_lib:format("~p", [Result])} end catch _:Msg -> {error, io_lib:format("Error during cipher operation: ~p", [Msg])} @@ -70,10 +69,10 @@ decode(Cipher, Hash, Iterations, Args) -> try begin TermValue = evaluate_input_as_term(Value), TermToDecrypt = case TermValue of - {encrypted, EncryptedTerm} -> + {encrypted, _}=EncryptedTerm -> EncryptedTerm; _ -> - TermValue + {encrypted, TermValue} end, Result = rabbit_pbe:decrypt_term(Cipher, Hash, Iterations, list_to_binary(PassPhrase), |
