diff options
Diffstat (limited to 'sshconnect2.c')
-rw-r--r-- | sshconnect2.c | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/sshconnect2.c b/sshconnect2.c index 0b13530ce..21a269d3c 100644 --- a/sshconnect2.c +++ b/sshconnect2.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshconnect2.c,v 1.198 2013/06/05 12:52:38 dtucker Exp $ */ | 1 | /* $OpenBSD: sshconnect2.c,v 1.201 2014/01/09 23:20:00 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. |
@@ -213,11 +213,12 @@ ssh_kex2(char *host, struct sockaddr *hostaddr, u_short port) | |||
213 | } | 213 | } |
214 | if (options.hostkeyalgorithms != NULL) | 214 | if (options.hostkeyalgorithms != NULL) |
215 | myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = | 215 | myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = |
216 | options.hostkeyalgorithms; | 216 | compat_pkalg_proposal(options.hostkeyalgorithms); |
217 | else { | 217 | else { |
218 | /* Prefer algorithms that we already have keys for */ | 218 | /* Prefer algorithms that we already have keys for */ |
219 | myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = | 219 | myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = |
220 | order_hostkeyalgs(host, hostaddr, port); | 220 | compat_pkalg_proposal( |
221 | order_hostkeyalgs(host, hostaddr, port)); | ||
221 | } | 222 | } |
222 | if (options.kex_algorithms != NULL) | 223 | if (options.kex_algorithms != NULL) |
223 | myproposal[PROPOSAL_KEX_ALGS] = options.kex_algorithms; | 224 | myproposal[PROPOSAL_KEX_ALGS] = options.kex_algorithms; |
@@ -244,6 +245,7 @@ ssh_kex2(char *host, struct sockaddr *hostaddr, u_short port) | |||
244 | kex->kex[KEX_DH_GEX_SHA1] = kexgex_client; | 245 | kex->kex[KEX_DH_GEX_SHA1] = kexgex_client; |
245 | kex->kex[KEX_DH_GEX_SHA256] = kexgex_client; | 246 | kex->kex[KEX_DH_GEX_SHA256] = kexgex_client; |
246 | kex->kex[KEX_ECDH_SHA2] = kexecdh_client; | 247 | kex->kex[KEX_ECDH_SHA2] = kexecdh_client; |
248 | kex->kex[KEX_C25519_SHA256] = kexc25519_client; | ||
247 | #ifdef GSSAPI | 249 | #ifdef GSSAPI |
248 | if (options.gss_keyex) { | 250 | if (options.gss_keyex) { |
249 | kex->kex[KEX_GSS_GRP1_SHA1] = kexgss_client; | 251 | kex->kex[KEX_GSS_GRP1_SHA1] = kexgss_client; |
@@ -1120,7 +1122,7 @@ jpake_password_to_secret(Authctxt *authctxt, const char *crypt_scheme, | |||
1120 | debug3("%s: crypted = %s", __func__, crypted); | 1122 | debug3("%s: crypted = %s", __func__, crypted); |
1121 | #endif | 1123 | #endif |
1122 | 1124 | ||
1123 | if (hash_buffer(crypted, strlen(crypted), EVP_sha256(), | 1125 | if (hash_buffer(crypted, strlen(crypted), SSH_DIGEST_SHA1, |
1124 | &secret, &secret_len) != 0) | 1126 | &secret, &secret_len) != 0) |
1125 | fatal("%s: hash_buffer", __func__); | 1127 | fatal("%s: hash_buffer", __func__); |
1126 | 1128 | ||
@@ -1604,17 +1606,31 @@ userauth_pubkey(Authctxt *authctxt) | |||
1604 | * encrypted keys we cannot do this and have to load the | 1606 | * encrypted keys we cannot do this and have to load the |
1605 | * private key instead | 1607 | * private key instead |
1606 | */ | 1608 | */ |
1607 | if (id->key && id->key->type != KEY_RSA1) { | 1609 | if (id->key != NULL) { |
1608 | debug("Offering %s public key: %s", key_type(id->key), | 1610 | if (key_type_plain(id->key->type) == KEY_RSA && |
1609 | id->filename); | 1611 | (datafellows & SSH_BUG_RSASIGMD5) != 0) { |
1610 | sent = send_pubkey_test(authctxt, id); | 1612 | debug("Skipped %s key %s for RSA/MD5 server", |
1611 | } else if (id->key == NULL) { | 1613 | key_type(id->key), id->filename); |
1614 | } else if (id->key->type != KEY_RSA1) { | ||
1615 | debug("Offering %s public key: %s", | ||
1616 | key_type(id->key), id->filename); | ||
1617 | sent = send_pubkey_test(authctxt, id); | ||
1618 | } | ||
1619 | } else { | ||
1612 | debug("Trying private key: %s", id->filename); | 1620 | debug("Trying private key: %s", id->filename); |
1613 | id->key = load_identity_file(id->filename, | 1621 | id->key = load_identity_file(id->filename, |
1614 | id->userprovided); | 1622 | id->userprovided); |
1615 | if (id->key != NULL) { | 1623 | if (id->key != NULL) { |
1616 | id->isprivate = 1; | 1624 | id->isprivate = 1; |
1617 | sent = sign_and_send_pubkey(authctxt, id); | 1625 | if (key_type_plain(id->key->type) == KEY_RSA && |
1626 | (datafellows & SSH_BUG_RSASIGMD5) != 0) { | ||
1627 | debug("Skipped %s key %s for RSA/MD5 " | ||
1628 | "server", key_type(id->key), | ||
1629 | id->filename); | ||
1630 | } else { | ||
1631 | sent = sign_and_send_pubkey( | ||
1632 | authctxt, id); | ||
1633 | } | ||
1618 | key_free(id->key); | 1634 | key_free(id->key); |
1619 | id->key = NULL; | 1635 | id->key = NULL; |
1620 | } | 1636 | } |