summaryrefslogtreecommitdiff
path: root/sshconnect1.c
diff options
context:
space:
mode:
Diffstat (limited to 'sshconnect1.c')
-rw-r--r--sshconnect1.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/sshconnect1.c b/sshconnect1.c
index a5fef1036..e66f35040 100644
--- a/sshconnect1.c
+++ b/sshconnect1.c
@@ -13,7 +13,7 @@
13 */ 13 */
14 14
15#include "includes.h" 15#include "includes.h"
16RCSID("$OpenBSD: sshconnect1.c,v 1.45 2001/12/28 12:14:27 markus Exp $"); 16RCSID("$OpenBSD: sshconnect1.c,v 1.46 2001/12/28 13:57:33 markus Exp $");
17 17
18#include <openssl/bn.h> 18#include <openssl/bn.h>
19#include <openssl/evp.h> 19#include <openssl/evp.h>
@@ -67,7 +67,7 @@ try_agent_authentication(void)
67 AuthenticationConnection *auth; 67 AuthenticationConnection *auth;
68 u_char response[16]; 68 u_char response[16];
69 u_int i; 69 u_int i;
70 int plen, clen; 70 int plen;
71 Key *key; 71 Key *key;
72 BIGNUM *challenge; 72 BIGNUM *challenge;
73 73
@@ -108,7 +108,7 @@ try_agent_authentication(void)
108 packet_disconnect("Protocol error during RSA authentication: %d", 108 packet_disconnect("Protocol error during RSA authentication: %d",
109 type); 109 type);
110 110
111 packet_get_bignum(challenge, &clen); 111 packet_get_bignum(challenge);
112 packet_check_eom(); 112 packet_check_eom();
113 113
114 debug("Received RSA challenge from server."); 114 debug("Received RSA challenge from server.");
@@ -209,7 +209,7 @@ try_rsa_authentication(int idx)
209 BIGNUM *challenge; 209 BIGNUM *challenge;
210 Key *public, *private; 210 Key *public, *private;
211 char buf[300], *passphrase, *comment, *authfile; 211 char buf[300], *passphrase, *comment, *authfile;
212 int i, type, quit, plen, clen; 212 int i, type, quit, plen;
213 213
214 public = options.identity_keys[idx]; 214 public = options.identity_keys[idx];
215 authfile = options.identity_files[idx]; 215 authfile = options.identity_files[idx];
@@ -242,7 +242,7 @@ try_rsa_authentication(int idx)
242 /* Get the challenge from the packet. */ 242 /* Get the challenge from the packet. */
243 if ((challenge = BN_new()) == NULL) 243 if ((challenge = BN_new()) == NULL)
244 fatal("try_rsa_authentication: BN_new failed"); 244 fatal("try_rsa_authentication: BN_new failed");
245 packet_get_bignum(challenge, &clen); 245 packet_get_bignum(challenge);
246 packet_check_eom(); 246 packet_check_eom();
247 247
248 debug("Received RSA challenge from server."); 248 debug("Received RSA challenge from server.");
@@ -327,7 +327,7 @@ try_rhosts_rsa_authentication(const char *local_user, Key * host_key)
327{ 327{
328 int type; 328 int type;
329 BIGNUM *challenge; 329 BIGNUM *challenge;
330 int plen, clen; 330 int plen;
331 331
332 debug("Trying rhosts or /etc/hosts.equiv with RSA host authentication."); 332 debug("Trying rhosts or /etc/hosts.equiv with RSA host authentication.");
333 333
@@ -356,7 +356,7 @@ try_rhosts_rsa_authentication(const char *local_user, Key * host_key)
356 /* Get the challenge from the packet. */ 356 /* Get the challenge from the packet. */
357 if ((challenge = BN_new()) == NULL) 357 if ((challenge = BN_new()) == NULL)
358 fatal("try_rhosts_rsa_authentication: BN_new failed"); 358 fatal("try_rhosts_rsa_authentication: BN_new failed");
359 packet_get_bignum(challenge, &clen); 359 packet_get_bignum(challenge);
360 packet_check_eom(); 360 packet_check_eom();
361 361
362 debug("Received RSA challenge for host key from server."); 362 debug("Received RSA challenge for host key from server.");
@@ -917,7 +917,7 @@ ssh_kex(char *host, struct sockaddr *hostaddr)
917 u_char cookie[8]; 917 u_char cookie[8];
918 u_int supported_ciphers; 918 u_int supported_ciphers;
919 u_int server_flags, client_flags; 919 u_int server_flags, client_flags;
920 int payload_len, clen, sum_len = 0; 920 int payload_len;
921 u_int32_t rand = 0; 921 u_int32_t rand = 0;
922 922
923 debug("Waiting for server public key."); 923 debug("Waiting for server public key.");
@@ -932,10 +932,8 @@ ssh_kex(char *host, struct sockaddr *hostaddr)
932 /* Get the public key. */ 932 /* Get the public key. */
933 server_key = key_new(KEY_RSA1); 933 server_key = key_new(KEY_RSA1);
934 bits = packet_get_int(); 934 bits = packet_get_int();
935 packet_get_bignum(server_key->rsa->e, &clen); 935 packet_get_bignum(server_key->rsa->e);
936 sum_len += clen; 936 packet_get_bignum(server_key->rsa->n);
937 packet_get_bignum(server_key->rsa->n, &clen);
938 sum_len += clen;
939 937
940 rbits = BN_num_bits(server_key->rsa->n); 938 rbits = BN_num_bits(server_key->rsa->n);
941 if (bits != rbits) { 939 if (bits != rbits) {
@@ -946,10 +944,8 @@ ssh_kex(char *host, struct sockaddr *hostaddr)
946 /* Get the host key. */ 944 /* Get the host key. */
947 host_key = key_new(KEY_RSA1); 945 host_key = key_new(KEY_RSA1);
948 bits = packet_get_int(); 946 bits = packet_get_int();
949 packet_get_bignum(host_key->rsa->e, &clen); 947 packet_get_bignum(host_key->rsa->e);
950 sum_len += clen; 948 packet_get_bignum(host_key->rsa->n);
951 packet_get_bignum(host_key->rsa->n, &clen);
952 sum_len += clen;
953 949
954 rbits = BN_num_bits(host_key->rsa->n); 950 rbits = BN_num_bits(host_key->rsa->n);
955 if (bits != rbits) { 951 if (bits != rbits) {