@@ -57,7 +57,6 @@ mod session;
5757pub use self :: session:: * ;
5858mod encrypted;
5959
60- #[ derive( Debug ) ]
6160/// Configuration of a server.
6261pub struct Config {
6362 /// The server ID string sent at the beginning of the protocol.
@@ -120,6 +119,32 @@ impl Default for Config {
120119 }
121120}
122121
122+ impl Debug for Config {
123+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
124+ // display everything except the private keys
125+ f. debug_struct ( "Config" )
126+ . field ( "server_id" , & self . server_id )
127+ . field ( "methods" , & self . methods )
128+ . field ( "auth_banner" , & self . auth_banner )
129+ . field ( "auth_rejection_time" , & self . auth_rejection_time )
130+ . field (
131+ "auth_rejection_time_initial" ,
132+ & self . auth_rejection_time_initial ,
133+ )
134+ . field ( "keys" , & "***" )
135+ . field ( "window_size" , & self . window_size )
136+ . field ( "maximum_packet_size" , & self . maximum_packet_size )
137+ . field ( "event_buffer_size" , & self . event_buffer_size )
138+ . field ( "limits" , & self . limits )
139+ . field ( "preferred" , & self . preferred )
140+ . field ( "max_auth_attempts" , & self . max_auth_attempts )
141+ . field ( "inactivity_timeout" , & self . inactivity_timeout )
142+ . field ( "keepalive_interval" , & self . keepalive_interval )
143+ . field ( "keepalive_max" , & self . keepalive_max )
144+ . finish ( )
145+ }
146+ }
147+
123148/// A client's response in a challenge-response authentication.
124149///
125150/// You should iterate it to get `&[u8]` response slices.
0 commit comments