diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2001-12-28 13:57:34 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2001-12-28 13:57:34 +0000 |
commit | a0307edd5547caa983544cc1d600abe7046a8fba (patch) | |
tree | 794c4490db4e1cf02339f0d0dca062585e275c92 /usr.bin | |
parent | dbc31a4836c17141c13ad707affe4fdad2638811 (diff) |
packet_get_bignum* no longer returns a size
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ssh/auth1.c | 10 | ||||
-rw-r--r-- | usr.bin/ssh/kexdh.c | 10 | ||||
-rw-r--r-- | usr.bin/ssh/kexgex.c | 14 | ||||
-rw-r--r-- | usr.bin/ssh/packet.c | 10 | ||||
-rw-r--r-- | usr.bin/ssh/packet.h | 6 | ||||
-rw-r--r-- | usr.bin/ssh/sshconnect1.c | 28 | ||||
-rw-r--r-- | usr.bin/ssh/sshd.c | 6 |
7 files changed, 40 insertions, 44 deletions
diff --git a/usr.bin/ssh/auth1.c b/usr.bin/ssh/auth1.c index ffa67bc3d0e..784e8220cb9 100644 --- a/usr.bin/ssh/auth1.c +++ b/usr.bin/ssh/auth1.c @@ -10,7 +10,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth1.c,v 1.32 2001/12/28 12:14:27 markus Exp $"); +RCSID("$OpenBSD: auth1.c,v 1.33 2001/12/28 13:57:33 markus Exp $"); #include "xmalloc.h" #include "rsa.h" @@ -71,7 +71,7 @@ do_authloop(Authctxt *authctxt) char *client_user, *password; char info[1024]; u_int dlen; - int plen, nlen, elen; + int plen; u_int ulen; int type = 0; struct passwd *pw = authctxt->pw; @@ -198,8 +198,8 @@ do_authloop(Authctxt *authctxt) /* Get the client host key. */ client_host_key = key_new(KEY_RSA1); bits = packet_get_int(); - packet_get_bignum(client_host_key->rsa->e, &elen); - packet_get_bignum(client_host_key->rsa->n, &nlen); + packet_get_bignum(client_host_key->rsa->e); + packet_get_bignum(client_host_key->rsa->n); if (bits != BN_num_bits(client_host_key->rsa->n)) verbose("Warning: keysize mismatch for client_host_key: " @@ -223,7 +223,7 @@ do_authloop(Authctxt *authctxt) /* RSA authentication requested. */ if ((n = BN_new()) == NULL) fatal("do_authloop: BN_new failed"); - packet_get_bignum(n, &nlen); + packet_get_bignum(n); packet_check_eom(); authenticated = auth_rsa(pw, n); BN_clear_free(n); diff --git a/usr.bin/ssh/kexdh.c b/usr.bin/ssh/kexdh.c index 43a14f5584b..226b81bc94e 100644 --- a/usr.bin/ssh/kexdh.c +++ b/usr.bin/ssh/kexdh.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: kexdh.c,v 1.10 2001/12/28 12:14:27 markus Exp $"); +RCSID("$OpenBSD: kexdh.c,v 1.11 2001/12/28 13:57:33 markus Exp $"); #include <openssl/crypto.h> #include <openssl/bn.h> @@ -97,7 +97,7 @@ kexdh_client(Kex *kex) u_char *server_host_key_blob = NULL, *signature = NULL; u_char *kbuf, *hash; u_int klen, kout, slen, sbloblen; - int dlen, plen; + int plen; /* generate and send 'e', client DH public key */ dh = dh_new_group1(); @@ -131,7 +131,7 @@ kexdh_client(Kex *kex) /* DH paramter f, server public DH key */ if ((dh_server_pub = BN_new()) == NULL) fatal("dh_server_pub == NULL"); - packet_get_bignum2(dh_server_pub, &dlen); + packet_get_bignum2(dh_server_pub); #ifdef DEBUG_KEXDH fprintf(stderr, "dh_server_pub= "); @@ -201,7 +201,7 @@ kexdh_server(Kex *kex) Key *server_host_key; u_char *kbuf, *hash, *signature = NULL, *server_host_key_blob = NULL; u_int sbloblen, klen, kout; - int dlen, slen, plen; + int slen, plen; /* generate server DH public key */ dh = dh_new_group1(); @@ -219,7 +219,7 @@ kexdh_server(Kex *kex) /* key, cert */ if ((dh_client_pub = BN_new()) == NULL) fatal("dh_client_pub == NULL"); - packet_get_bignum2(dh_client_pub, &dlen); + packet_get_bignum2(dh_client_pub); #ifdef DEBUG_KEXDH fprintf(stderr, "dh_client_pub= "); diff --git a/usr.bin/ssh/kexgex.c b/usr.bin/ssh/kexgex.c index 49f639c61ca..99344bbbaba 100644 --- a/usr.bin/ssh/kexgex.c +++ b/usr.bin/ssh/kexgex.c @@ -24,7 +24,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: kexgex.c,v 1.13 2001/12/28 12:14:27 markus Exp $"); +RCSID("$OpenBSD: kexgex.c,v 1.14 2001/12/28 13:57:33 markus Exp $"); #include <openssl/bn.h> @@ -107,7 +107,7 @@ kexgex_client(Kex *kex) Key *server_host_key; u_char *kbuf, *hash, *signature = NULL, *server_host_key_blob = NULL; u_int klen, kout, slen, sbloblen; - int dlen, plen, min, max, nbits; + int plen, min, max, nbits; DH *dh; nbits = dh_estimate(kex->we_need * 8); @@ -142,10 +142,10 @@ kexgex_client(Kex *kex) if ((p = BN_new()) == NULL) fatal("BN_new"); - packet_get_bignum2(p, &dlen); + packet_get_bignum2(p); if ((g = BN_new()) == NULL) fatal("BN_new"); - packet_get_bignum2(g, &dlen); + packet_get_bignum2(g); packet_check_eom(); if (BN_num_bits(p) < min || BN_num_bits(p) > max) @@ -185,7 +185,7 @@ kexgex_client(Kex *kex) /* DH paramter f, server public DH key */ if ((dh_server_pub = BN_new()) == NULL) fatal("dh_server_pub == NULL"); - packet_get_bignum2(dh_server_pub, &dlen); + packet_get_bignum2(dh_server_pub); #ifdef DEBUG_KEXDH fprintf(stderr, "dh_server_pub= "); @@ -261,7 +261,7 @@ kexgex_server(Kex *kex) DH *dh = dh; u_char *kbuf, *hash, *signature = NULL, *server_host_key_blob = NULL; u_int sbloblen, klen, kout; - int min = -1, max = -1, nbits = -1, type, plen, dlen, slen; + int min = -1, max = -1, nbits = -1, type, plen, slen; if (kex->load_host_key == NULL) fatal("Cannot load hostkey"); @@ -317,7 +317,7 @@ kexgex_server(Kex *kex) /* key, cert */ if ((dh_client_pub = BN_new()) == NULL) fatal("dh_client_pub == NULL"); - packet_get_bignum2(dh_client_pub, &dlen); + packet_get_bignum2(dh_client_pub); #ifdef DEBUG_KEXDH fprintf(stderr, "dh_client_pub= "); diff --git a/usr.bin/ssh/packet.c b/usr.bin/ssh/packet.c index 367ffa8ae42..ab85a012b87 100644 --- a/usr.bin/ssh/packet.c +++ b/usr.bin/ssh/packet.c @@ -37,7 +37,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: packet.c,v 1.79 2001/12/28 12:14:27 markus Exp $"); +RCSID("$OpenBSD: packet.c,v 1.80 2001/12/28 13:57:33 markus Exp $"); #include "xmalloc.h" #include "buffer.h" @@ -1000,15 +1000,15 @@ packet_get_int(void) */ void -packet_get_bignum(BIGNUM * value, int *length_ptr) +packet_get_bignum(BIGNUM * value) { - *length_ptr = buffer_get_bignum(&incoming_packet, value); + (void)buffer_get_bignum(&incoming_packet, value); } void -packet_get_bignum2(BIGNUM * value, int *length_ptr) +packet_get_bignum2(BIGNUM * value) { - *length_ptr = buffer_get_bignum2(&incoming_packet, value); + (void)buffer_get_bignum2(&incoming_packet, value); } void * diff --git a/usr.bin/ssh/packet.h b/usr.bin/ssh/packet.h index 269b4c7f80d..dcf2a664f3a 100644 --- a/usr.bin/ssh/packet.h +++ b/usr.bin/ssh/packet.h @@ -11,7 +11,7 @@ * called by a name other than "ssh" or "Secure Shell". */ -/* RCSID("$OpenBSD: packet.h,v 1.30 2001/12/28 12:14:27 markus Exp $"); */ +/* RCSID("$OpenBSD: packet.h,v 1.31 2001/12/28 13:57:33 markus Exp $"); */ #ifndef PACKET_H #define PACKET_H @@ -49,8 +49,8 @@ int packet_read_poll_seqnr(int *packet_len_ptr, u_int32_t *seqnr_p); u_int packet_get_char(void); u_int packet_get_int(void); -void packet_get_bignum(BIGNUM * value, int *length_ptr); -void packet_get_bignum2(BIGNUM * value, int *length_ptr); +void packet_get_bignum(BIGNUM * value); +void packet_get_bignum2(BIGNUM * value); void *packet_get_raw(int *length_ptr); void *packet_get_string(u_int *length_ptr); void packet_disconnect(const char *fmt,...) __attribute__((format(printf, 1, 2))); diff --git a/usr.bin/ssh/sshconnect1.c b/usr.bin/ssh/sshconnect1.c index a5fef1036d4..e66f35040e8 100644 --- a/usr.bin/ssh/sshconnect1.c +++ b/usr.bin/ssh/sshconnect1.c @@ -13,7 +13,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshconnect1.c,v 1.45 2001/12/28 12:14:27 markus Exp $"); +RCSID("$OpenBSD: sshconnect1.c,v 1.46 2001/12/28 13:57:33 markus Exp $"); #include <openssl/bn.h> #include <openssl/evp.h> @@ -67,7 +67,7 @@ try_agent_authentication(void) AuthenticationConnection *auth; u_char response[16]; u_int i; - int plen, clen; + int plen; Key *key; BIGNUM *challenge; @@ -108,7 +108,7 @@ try_agent_authentication(void) packet_disconnect("Protocol error during RSA authentication: %d", type); - packet_get_bignum(challenge, &clen); + packet_get_bignum(challenge); packet_check_eom(); debug("Received RSA challenge from server."); @@ -209,7 +209,7 @@ try_rsa_authentication(int idx) BIGNUM *challenge; Key *public, *private; char buf[300], *passphrase, *comment, *authfile; - int i, type, quit, plen, clen; + int i, type, quit, plen; public = options.identity_keys[idx]; authfile = options.identity_files[idx]; @@ -242,7 +242,7 @@ try_rsa_authentication(int idx) /* Get the challenge from the packet. */ if ((challenge = BN_new()) == NULL) fatal("try_rsa_authentication: BN_new failed"); - packet_get_bignum(challenge, &clen); + packet_get_bignum(challenge); packet_check_eom(); debug("Received RSA challenge from server."); @@ -327,7 +327,7 @@ try_rhosts_rsa_authentication(const char *local_user, Key * host_key) { int type; BIGNUM *challenge; - int plen, clen; + int plen; debug("Trying rhosts or /etc/hosts.equiv with RSA host authentication."); @@ -356,7 +356,7 @@ try_rhosts_rsa_authentication(const char *local_user, Key * host_key) /* Get the challenge from the packet. */ if ((challenge = BN_new()) == NULL) fatal("try_rhosts_rsa_authentication: BN_new failed"); - packet_get_bignum(challenge, &clen); + packet_get_bignum(challenge); packet_check_eom(); debug("Received RSA challenge for host key from server."); @@ -917,7 +917,7 @@ ssh_kex(char *host, struct sockaddr *hostaddr) u_char cookie[8]; u_int supported_ciphers; u_int server_flags, client_flags; - int payload_len, clen, sum_len = 0; + int payload_len; u_int32_t rand = 0; debug("Waiting for server public key."); @@ -932,10 +932,8 @@ ssh_kex(char *host, struct sockaddr *hostaddr) /* Get the public key. */ server_key = key_new(KEY_RSA1); bits = packet_get_int(); - packet_get_bignum(server_key->rsa->e, &clen); - sum_len += clen; - packet_get_bignum(server_key->rsa->n, &clen); - sum_len += clen; + packet_get_bignum(server_key->rsa->e); + packet_get_bignum(server_key->rsa->n); rbits = BN_num_bits(server_key->rsa->n); if (bits != rbits) { @@ -946,10 +944,8 @@ ssh_kex(char *host, struct sockaddr *hostaddr) /* Get the host key. */ host_key = key_new(KEY_RSA1); bits = packet_get_int(); - packet_get_bignum(host_key->rsa->e, &clen); - sum_len += clen; - packet_get_bignum(host_key->rsa->n, &clen); - sum_len += clen; + packet_get_bignum(host_key->rsa->e); + packet_get_bignum(host_key->rsa->n); rbits = BN_num_bits(host_key->rsa->n); if (bits != rbits) { diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c index 87e608a5046..7059cdb472e 100644 --- a/usr.bin/ssh/sshd.c +++ b/usr.bin/ssh/sshd.c @@ -40,7 +40,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshd.c,v 1.220 2001/12/28 12:14:27 markus Exp $"); +RCSID("$OpenBSD: sshd.c,v 1.221 2001/12/28 13:57:33 markus Exp $"); #include <openssl/dh.h> #include <openssl/bn.h> @@ -1218,7 +1218,7 @@ static void do_ssh1_kex(void) { int i, len; - int plen, slen; + int plen; int rsafail = 0; BIGNUM *session_key_int; u_char session_key[SSH_SESSION_KEY_LENGTH]; @@ -1321,7 +1321,7 @@ do_ssh1_kex(void) /* Get the encrypted integer. */ if ((session_key_int = BN_new()) == NULL) fatal("do_ssh1_kex: BN_new failed"); - packet_get_bignum(session_key_int, &slen); + packet_get_bignum(session_key_int); protocol_flags = packet_get_int(); packet_set_protocol_flags(protocol_flags); |