bmh10 / rpms / openssh

Forked from rpms/openssh 2 days ago
Clone

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

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