[serverloop.c session.c ssh.c sshconnect1.c sshd.c ttymodes.c]
get rid of packet_integrity_check, use packet_done() instead.
- markus@cvs.openbsd.org 2001/12/28 12:14:27
- [auth1.c auth2.c auth2-chall.c auth-rsa.c channels.c clientloop.c kex.c kexdh.c kexgex.c packet.c packet.h serverloop.c session.c ssh.c sshconnect1.c sshconnect2.c sshd.c]
+ [auth1.c auth2.c auth2-chall.c auth-rsa.c channels.c clientloop.c]
+ [kex.c kexdh.c kexgex.c packet.c packet.h serverloop.c session.c]
+ [ssh.c sshconnect1.c sshconnect2.c sshd.c]
s/packet_done/packet_check_eom/ (end-of-message); ok djm@
+ - markus@cvs.openbsd.org 2001/12/28 13:57:33
+ [auth1.c kexdh.c kexgex.c packet.c packet.h sshconnect1.c sshd.c]
+ packet_get_bignum* no longer returns a size
20020121
*/
#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"
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;
/* 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: "
/* 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);
*/
#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>
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();
/* 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= ");
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();
/* 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= ");
*/
#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>
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);
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)
/* 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= ");
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");
/* 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= ");
*/
#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"
*/
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 *
* 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
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)));
*/
#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>
AuthenticationConnection *auth;
u_char response[16];
u_int i;
- int plen, clen;
+ int plen;
Key *key;
BIGNUM *challenge;
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.");
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];
/* 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.");
{
int type;
BIGNUM *challenge;
- int plen, clen;
+ int plen;
debug("Trying rhosts or /etc/hosts.equiv with RSA host authentication.");
/* 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.");
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.");
/* 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) {
/* 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) {
*/
#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>
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];
/* 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);