diff options
Diffstat (limited to 'sshconnect1.c')
-rw-r--r-- | sshconnect1.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/sshconnect1.c b/sshconnect1.c index 90fcb344f..fd07bbf74 100644 --- a/sshconnect1.c +++ b/sshconnect1.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshconnect1.c,v 1.69 2006/08/03 03:34:42 deraadt Exp $ */ | 1 | /* $OpenBSD: sshconnect1.c,v 1.70 2006/11/06 21:25:28 markus Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -563,14 +563,20 @@ ssh_kex(char *host, struct sockaddr *hostaddr) | |||
563 | * the first 16 bytes of the session id. | 563 | * the first 16 bytes of the session id. |
564 | */ | 564 | */ |
565 | if ((key = BN_new()) == NULL) | 565 | if ((key = BN_new()) == NULL) |
566 | fatal("respond_to_rsa_challenge: BN_new failed"); | 566 | fatal("ssh_kex: BN_new failed"); |
567 | BN_set_word(key, 0); | 567 | if (BN_set_word(key, 0) == 0) |
568 | fatal("ssh_kex: BN_set_word failed"); | ||
568 | for (i = 0; i < SSH_SESSION_KEY_LENGTH; i++) { | 569 | for (i = 0; i < SSH_SESSION_KEY_LENGTH; i++) { |
569 | BN_lshift(key, key, 8); | 570 | if (BN_lshift(key, key, 8) == 0) |
570 | if (i < 16) | 571 | fatal("ssh_kex: BN_lshift failed"); |
571 | BN_add_word(key, session_key[i] ^ session_id[i]); | 572 | if (i < 16) { |
572 | else | 573 | if (BN_add_word(key, session_key[i] ^ session_id[i]) |
573 | BN_add_word(key, session_key[i]); | 574 | == 0) |
575 | fatal("ssh_kex: BN_add_word failed"); | ||
576 | } else { | ||
577 | if (BN_add_word(key, session_key[i]) == 0) | ||
578 | fatal("ssh_kex: BN_add_word failed"); | ||
579 | } | ||
574 | } | 580 | } |
575 | 581 | ||
576 | /* | 582 | /* |