summaryrefslogtreecommitdiff
path: root/sshconnect2.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2013-12-31 12:25:40 +1100
committerDamien Miller <djm@mindrot.org>2013-12-31 12:25:40 +1100
commit324541e5264e1489ca0babfaf2b39612eb80dfb3 (patch)
tree3adbfd162c3704e6aeb36f30ca09e4c04fbd25e2 /sshconnect2.c
parent9f4c8e797ea002a883307ca906f1f1f815010e78 (diff)
- djm@cvs.openbsd.org 2013/12/30 23:52:28
[auth2-hostbased.c auth2-pubkey.c compat.c compat.h ssh-rsa.c] [sshconnect.c sshconnect2.c sshd.c] refuse RSA keys from old proprietary clients/servers that use the obsolete RSA+MD5 signature scheme. it will still be possible to connect with these clients/servers but only DSA keys will be accepted, and we'll deprecate them entirely in a future release. ok markus@
Diffstat (limited to 'sshconnect2.c')
-rw-r--r--sshconnect2.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/sshconnect2.c b/sshconnect2.c
index 1f6160e86..0d339b9c5 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshconnect2.c,v 1.199 2013/11/02 21:59:15 markus Exp $ */ 1/* $OpenBSD: sshconnect2.c,v 1.200 2013/12/30 23:52:28 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * Copyright (c) 2008 Damien Miller. All rights reserved. 4 * Copyright (c) 2008 Damien Miller. All rights reserved.
@@ -188,11 +188,12 @@ ssh_kex2(char *host, struct sockaddr *hostaddr, u_short port)
188 } 188 }
189 if (options.hostkeyalgorithms != NULL) 189 if (options.hostkeyalgorithms != NULL)
190 myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = 190 myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] =
191 options.hostkeyalgorithms; 191 compat_pkalg_proposal(options.hostkeyalgorithms);
192 else { 192 else {
193 /* Prefer algorithms that we already have keys for */ 193 /* Prefer algorithms that we already have keys for */
194 myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = 194 myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] =
195 order_hostkeyalgs(host, hostaddr, port); 195 compat_pkalg_proposal(
196 order_hostkeyalgs(host, hostaddr, port));
196 } 197 }
197 if (options.kex_algorithms != NULL) 198 if (options.kex_algorithms != NULL)
198 myproposal[PROPOSAL_KEX_ALGS] = options.kex_algorithms; 199 myproposal[PROPOSAL_KEX_ALGS] = options.kex_algorithms;
@@ -1489,17 +1490,31 @@ userauth_pubkey(Authctxt *authctxt)
1489 * encrypted keys we cannot do this and have to load the 1490 * encrypted keys we cannot do this and have to load the
1490 * private key instead 1491 * private key instead
1491 */ 1492 */
1492 if (id->key && id->key->type != KEY_RSA1) { 1493 if (id->key != NULL) {
1493 debug("Offering %s public key: %s", key_type(id->key), 1494 if (key_type_plain(id->key->type) == KEY_RSA &&
1494 id->filename); 1495 (datafellows & SSH_BUG_RSASIGMD5) != 0) {
1495 sent = send_pubkey_test(authctxt, id); 1496 debug("Skipped %s key %s for RSA/MD5 server",
1496 } else if (id->key == NULL) { 1497 key_type(id->key), id->filename);
1498 } else if (id->key->type != KEY_RSA1) {
1499 debug("Offering %s public key: %s",
1500 key_type(id->key), id->filename);
1501 sent = send_pubkey_test(authctxt, id);
1502 }
1503 } else {
1497 debug("Trying private key: %s", id->filename); 1504 debug("Trying private key: %s", id->filename);
1498 id->key = load_identity_file(id->filename, 1505 id->key = load_identity_file(id->filename,
1499 id->userprovided); 1506 id->userprovided);
1500 if (id->key != NULL) { 1507 if (id->key != NULL) {
1501 id->isprivate = 1; 1508 id->isprivate = 1;
1502 sent = sign_and_send_pubkey(authctxt, id); 1509 if (key_type_plain(id->key->type) == KEY_RSA &&
1510 (datafellows & SSH_BUG_RSASIGMD5) != 0) {
1511 debug("Skipped %s key %s for RSA/MD5 "
1512 "server", key_type(id->key),
1513 id->filename);
1514 } else {
1515 sent = sign_and_send_pubkey(
1516 authctxt, id);
1517 }
1503 key_free(id->key); 1518 key_free(id->key);
1504 id->key = NULL; 1519 id->key = NULL;
1505 } 1520 }