summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArnaud Cogoluègnes <acogoluegnes@gmail.com>2016-10-14 14:46:02 +0200
committerArnaud Cogoluègnes <acogoluegnes@gmail.com>2016-10-14 14:46:02 +0200
commit44e7198298f984974e6c4e13e3d55d2aa685f455 (patch)
treee1450c3cd2f3f1fe6a83cd057bcf974e2b9861f8 /src
parentfc20fa9b03a232364bf4f7487d51f01e767d1ba3 (diff)
downloadrabbitmq-server-git-44e7198298f984974e6c4e13e3d55d2aa685f455.tar.gz
Use config_entry_decoder key for config encryption
Fixes #979
Diffstat (limited to 'src')
-rw-r--r--src/rabbit.app.src2
-rw-r--r--src/rabbit.erl16
2 files changed, 9 insertions, 9 deletions
diff --git a/src/rabbit.app.src b/src/rabbit.app.src
index 883b71cb77..dd38ad4072 100644
--- a/src/rabbit.app.src
+++ b/src/rabbit.app.src
@@ -100,7 +100,7 @@
%% see rabbitmq-server#248
%% and rabbitmq-server#667
{channel_operation_timeout, 15000},
- {decoder_config, [
+ {config_entry_decoder, [
{cipher, aes_cbc256},
{hash, sha512},
{iterations, 1000},
diff --git a/src/rabbit.erl b/src/rabbit.erl
index 9624aca184..1f0df1ad06 100644
--- a/src/rabbit.erl
+++ b/src/rabbit.erl
@@ -443,13 +443,13 @@ stop_and_halt() ->
start_apps(Apps) ->
app_utils:load_applications(Apps),
- DecoderConfig = case application:get_env(rabbit, decoder_config) of
+ ConfigEntryDecoder = case application:get_env(rabbit, config_entry_decoder) of
undefined ->
[];
{ok, Val} ->
Val
end,
- PassPhrase = case proplists:get_value(passphrase, DecoderConfig) of
+ PassPhrase = case proplists:get_value(passphrase, ConfigEntryDecoder) of
prompt ->
IoDevice = get_input_iodevice(),
io:setopts(IoDevice, [{echo, false}]),
@@ -467,9 +467,9 @@ start_apps(Apps) ->
PP
end,
Algo = {
- proplists:get_value(cipher, DecoderConfig, rabbit_pbe:default_cipher()),
- proplists:get_value(hash, DecoderConfig, rabbit_pbe:default_hash()),
- proplists:get_value(iterations, DecoderConfig, rabbit_pbe:default_iterations()),
+ proplists:get_value(cipher, ConfigEntryDecoder, rabbit_pbe:default_cipher()),
+ proplists:get_value(hash, ConfigEntryDecoder, rabbit_pbe:default_hash()),
+ proplists:get_value(iterations, ConfigEntryDecoder, rabbit_pbe:default_iterations()),
PassPhrase
},
decrypt_config(Apps, Algo),
@@ -527,8 +527,8 @@ decrypt_app(App, [{Key, Value}|Tail], Algo) ->
end
end
catch
- exit:{bad_configuration, decoder_config} ->
- exit({bad_configuration, decoder_config});
+ exit:{bad_configuration, config_entry_decoder} ->
+ exit({bad_configuration, config_entry_decoder});
_:Msg ->
rabbit_log:info("Error while decrypting key '~p'. Please check encrypted value, passphrase, and encryption configuration~n", [Key]),
exit({decryption_error, {key, Key}, Msg})
@@ -536,7 +536,7 @@ decrypt_app(App, [{Key, Value}|Tail], Algo) ->
decrypt_app(App, Tail, Algo).
decrypt({encrypted, _}, {_, _, _, undefined}) ->
- exit({bad_configuration, decoder_config});
+ exit({bad_configuration, config_entry_decoder});
decrypt({encrypted, EncValue}, {Cipher, Hash, Iterations, Password}) ->
rabbit_pbe:decrypt_term(Cipher, Hash, Iterations, Password, EncValue);
decrypt(List, Algo) when is_list(List) ->