[PATCH] sshd drops connection if host key is not found.

Jan IVEN Jan.Iven at cern.ch
Thu Dec 21 03:35:11 EST 2000


Hello,

if one of the host keys from the config file cannot be found at
runtime, sshd may drop any connection after exchanging the session
key. This is due to the fact that uninitialized memory is passed to
key_free which either chokes with a fatal "key_free: bad key type" or
quietly commits SEGV.

A possible solution is appended below.

Best regards
Jan

--- openssh-SNAP-20001213.orig/sshd.c	Wed Dec  6 02:42:49 2000
+++ openssh/sshd.c	Wed Dec 20 17:26:05 2000
@@ -706,6 +708,7 @@
 
 	for(i = 0; i < options.num_host_key_files; i++) {
 		Key *key = load_private_key_autodetect(options.host_key_files[i]);
+		sensitive_data.host_keys[i] = NULL;
 		if (key == NULL) {
 			error("Could not load host key: %.200s: %.100s",
 			    options.host_key_files[i], strerror(errno));





More information about the openssh-unix-dev mailing list