From 8b74065b8018e1676d65f623f9a84351d4d3c884 Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Wed, 25 Nov 2020 12:45:59 +0100 Subject: [PATCH] Censor user password when logging Authenticate message --- src/connection.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/connection.rs b/src/connection.rs index 1a25c49..e2acb13 100644 --- a/src/connection.rs +++ b/src/connection.rs @@ -471,7 +471,13 @@ impl Connection { ) -> Result<(), Error> { match packet { ControlPacket::Authenticate(mut message) => { - println!("MSG Authenticate: {:?}", message); + println!("MSG Authenticate: {:?}", { + let mut message = message.clone(); + if message.get_password() != "" { + message.set_password("{{snip}}".to_string()); + } + message + }); if message.get_webrtc() { // strip webrtc support from the connection (we will be providing it) message.clear_webrtc();