rcolebaugh / rpms / openssh

Forked from rpms/openssh 2 years ago
Clone

Blame SOURCES/openssh-7.4p1-rsa1-segfault.patch

b58e57
diff --git a/sshd.c b/sshd.c
b58e57
--- a/sshd.c
b58e57
+++ b/sshd.c
b58e57
@@ -1551,6 +1551,15 @@ main(int ac, char **av)
b58e57
 			continue;
b58e57
 		key = key_load_private(options.host_key_files[i], "", NULL);
b58e57
 		pubkey = key_load_public(options.host_key_files[i], NULL);
b58e57
+
b58e57
+		if ((pubkey != NULL && pubkey->type == KEY_RSA1) ||
b58e57
+		    (key != NULL && key->type == KEY_RSA1)) {
b58e57
+			verbose("Ignoring RSA1 key %s",
b58e57
+			    options.host_key_files[i]);
b58e57
+			key_free(key);
b58e57
+			key_free(pubkey);
b58e57
+			continue;
b58e57
+		}
b58e57
 		if (pubkey == NULL && key != NULL)
b58e57
 			pubkey = key_demote(key);
b58e57
 		sensitive_data.host_keys[i] = key;