diff options
author | Ingela Anderton Andin <[email protected]> | 2014-09-22 10:12:39 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2014-09-24 16:58:11 +0200 |
commit | 0fba2ec56dd3557a6ef74a211581dce9827be1a6 (patch) | |
tree | 55ac800434e0b1df99fc6cd70d4e4814fc6281ba /lib/ssh/src/ssh_connection_handler.erl | |
parent | b98334b677be774d746037ab81e7e724bfeca5eb (diff) | |
download | otp-0fba2ec56dd3557a6ef74a211581dce9827be1a6.tar.gz otp-0fba2ec56dd3557a6ef74a211581dce9827be1a6.tar.bz2 otp-0fba2ec56dd3557a6ef74a211581dce9827be1a6.zip |
ssh: Add format_status/2 so sensitive data will not be present in logs
Diffstat (limited to 'lib/ssh/src/ssh_connection_handler.erl')
-rw-r--r-- | lib/ssh/src/ssh_connection_handler.erl | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl index 68736c3365..fba278aba7 100644 --- a/lib/ssh/src/ssh_connection_handler.erl +++ b/lib/ssh/src/ssh_connection_handler.erl @@ -48,7 +48,7 @@ userauth/2, connected/2]). -export([init/1, handle_event/3, - handle_sync_event/4, handle_info/3, terminate/3, code_change/4]). + handle_sync_event/4, handle_info/3, terminate/3, format_status/2, code_change/4]). -record(state, { role, @@ -963,6 +963,36 @@ terminate_subsytem(#connection{system_supervisor = SysSup, terminate_subsytem(_) -> ok. +format_status(normal, [_, State]) -> + [{data, [{"StateData", State}]}]; +format_status(terminate, [_, State]) -> + SshParams0 = (State#state.ssh_params), + SshParams = SshParams0#ssh{c_keyinit = "***", + s_keyinit = "***", + send_mac_key = "***", + send_mac_size = "***", + recv_mac_key = "***", + recv_mac_size = "***", + encrypt_keys = "***", + encrypt_ctx = "***", + decrypt_keys = "***", + decrypt_ctx = "***", + compress_ctx = "***", + decompress_ctx = "***", + shared_secret = "***", + exchanged_hash = "***", + session_id = "***", + keyex_key = "***", + keyex_info = "***", + available_host_keys = "***"}, + [{data, [{"StateData", State#state{decoded_data_buffer = "***", + encoded_data_buffer = "***", + key_exchange_init_msg = "***", + opts = "***", + recbuf = "***", + ssh_params = SshParams + }}]}]. + %%-------------------------------------------------------------------- -spec code_change(OldVsn::term(), state_name(), Oldstate::term(), Extra::term()) -> {ok, state_name(), #state{}}. |