mirror of
git://anongit.mindrot.org/openssh.git
synced 2025-01-30 13:42:01 +00:00
- (djm) OpenBSD CVS Sync
- provos@cvs.openbsd.org 2001/03/28 21:59:41 [kex.c kex.h sshconnect2.c sshd.c] forgot to include min and max params in hash, okay markus@
This commit is contained in:
parent
d8f72ca6d5
commit
2557bfc5d7
@ -1,5 +1,9 @@
|
|||||||
20010330
|
20010330
|
||||||
- (djm) Another openbsd-compat/glob.c sync
|
- (djm) Another openbsd-compat/glob.c sync
|
||||||
|
- (djm) OpenBSD CVS Sync
|
||||||
|
- provos@cvs.openbsd.org 2001/03/28 21:59:41
|
||||||
|
[kex.c kex.h sshconnect2.c sshd.c]
|
||||||
|
forgot to include min and max params in hash, okay markus@
|
||||||
|
|
||||||
20010329
|
20010329
|
||||||
- OpenBSD CVS Sync
|
- OpenBSD CVS Sync
|
||||||
@ -4770,4 +4774,4 @@
|
|||||||
- Wrote replacements for strlcpy and mkdtemp
|
- Wrote replacements for strlcpy and mkdtemp
|
||||||
- Released 1.0pre1
|
- Released 1.0pre1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.1035 2001/03/30 00:23:17 djm Exp $
|
$Id: ChangeLog,v 1.1036 2001/03/30 00:47:14 djm Exp $
|
||||||
|
12
kex.c
12
kex.c
@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: kex.c,v 1.23 2001/03/10 17:51:04 markus Exp $");
|
RCSID("$OpenBSD: kex.c,v 1.24 2001/03/28 21:59:40 provos Exp $");
|
||||||
|
|
||||||
#include <openssl/crypto.h>
|
#include <openssl/crypto.h>
|
||||||
#include <openssl/bio.h>
|
#include <openssl/bio.h>
|
||||||
@ -290,7 +290,7 @@ kex_hash_gex(
|
|||||||
char *ckexinit, int ckexinitlen,
|
char *ckexinit, int ckexinitlen,
|
||||||
char *skexinit, int skexinitlen,
|
char *skexinit, int skexinitlen,
|
||||||
char *serverhostkeyblob, int sbloblen,
|
char *serverhostkeyblob, int sbloblen,
|
||||||
int minbits, BIGNUM *prime, BIGNUM *gen,
|
int min, int wantbits, int max, BIGNUM *prime, BIGNUM *gen,
|
||||||
BIGNUM *client_dh_pub,
|
BIGNUM *client_dh_pub,
|
||||||
BIGNUM *server_dh_pub,
|
BIGNUM *server_dh_pub,
|
||||||
BIGNUM *shared_secret)
|
BIGNUM *shared_secret)
|
||||||
@ -313,7 +313,13 @@ kex_hash_gex(
|
|||||||
buffer_append(&b, skexinit, skexinitlen);
|
buffer_append(&b, skexinit, skexinitlen);
|
||||||
|
|
||||||
buffer_put_string(&b, serverhostkeyblob, sbloblen);
|
buffer_put_string(&b, serverhostkeyblob, sbloblen);
|
||||||
buffer_put_int(&b, minbits);
|
if (min == -1 || max == -1)
|
||||||
|
buffer_put_int(&b, wantbits);
|
||||||
|
else {
|
||||||
|
buffer_put_int(&b, min);
|
||||||
|
buffer_put_int(&b, wantbits);
|
||||||
|
buffer_put_int(&b, max);
|
||||||
|
}
|
||||||
buffer_put_bignum2(&b, prime);
|
buffer_put_bignum2(&b, prime);
|
||||||
buffer_put_bignum2(&b, gen);
|
buffer_put_bignum2(&b, gen);
|
||||||
buffer_put_bignum2(&b, client_dh_pub);
|
buffer_put_bignum2(&b, client_dh_pub);
|
||||||
|
5
kex.h
5
kex.h
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: kex.h,v 1.15 2001/03/05 17:17:20 markus Exp $ */
|
/* $OpenBSD: kex.h,v 1.16 2001/03/28 21:59:40 provos Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000 Markus Friedl. All rights reserved.
|
* Copyright (c) 2000 Markus Friedl. All rights reserved.
|
||||||
@ -127,7 +127,8 @@ kex_hash_gex(
|
|||||||
char *ckexinit, int ckexinitlen,
|
char *ckexinit, int ckexinitlen,
|
||||||
char *skexinit, int skexinitlen,
|
char *skexinit, int skexinitlen,
|
||||||
char *serverhostkeyblob, int sbloblen,
|
char *serverhostkeyblob, int sbloblen,
|
||||||
int minbits, BIGNUM *prime, BIGNUM *gen,
|
int min, int wantbits, int max,
|
||||||
|
BIGNUM *prime, BIGNUM *gen,
|
||||||
BIGNUM *client_dh_pub,
|
BIGNUM *client_dh_pub,
|
||||||
BIGNUM *server_dh_pub,
|
BIGNUM *server_dh_pub,
|
||||||
BIGNUM *shared_secret);
|
BIGNUM *shared_secret);
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: sshconnect2.c,v 1.57 2001/03/27 17:46:49 provos Exp $");
|
RCSID("$OpenBSD: sshconnect2.c,v 1.58 2001/03/28 21:59:40 provos Exp $");
|
||||||
|
|
||||||
#include <openssl/bn.h>
|
#include <openssl/bn.h>
|
||||||
#include <openssl/md5.h>
|
#include <openssl/md5.h>
|
||||||
@ -440,6 +440,12 @@ ssh_dhgex_client(Kex *kex, char *host, struct sockaddr *hostaddr,
|
|||||||
memset(kbuf, 0, klen);
|
memset(kbuf, 0, klen);
|
||||||
xfree(kbuf);
|
xfree(kbuf);
|
||||||
|
|
||||||
|
if (datafellows & SSH_OLD_DHGEX) {
|
||||||
|
/* These values are not included in the hash */
|
||||||
|
min = -1;
|
||||||
|
max = -1;
|
||||||
|
}
|
||||||
|
|
||||||
/* calc and verify H */
|
/* calc and verify H */
|
||||||
hash = kex_hash_gex(
|
hash = kex_hash_gex(
|
||||||
client_version_string,
|
client_version_string,
|
||||||
@ -447,7 +453,8 @@ ssh_dhgex_client(Kex *kex, char *host, struct sockaddr *hostaddr,
|
|||||||
buffer_ptr(client_kexinit), buffer_len(client_kexinit),
|
buffer_ptr(client_kexinit), buffer_len(client_kexinit),
|
||||||
buffer_ptr(server_kexinit), buffer_len(server_kexinit),
|
buffer_ptr(server_kexinit), buffer_len(server_kexinit),
|
||||||
server_host_key_blob, sbloblen,
|
server_host_key_blob, sbloblen,
|
||||||
nbits, dh->p, dh->g,
|
min, nbits, max,
|
||||||
|
dh->p, dh->g,
|
||||||
dh->pub_key,
|
dh->pub_key,
|
||||||
dh_server_pub,
|
dh_server_pub,
|
||||||
shared_secret
|
shared_secret
|
||||||
|
11
sshd.c
11
sshd.c
@ -40,7 +40,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: sshd.c,v 1.182 2001/03/28 20:50:45 markus Exp $");
|
RCSID("$OpenBSD: sshd.c,v 1.183 2001/03/28 21:59:41 provos Exp $");
|
||||||
|
|
||||||
#include <openssl/dh.h>
|
#include <openssl/dh.h>
|
||||||
#include <openssl/bn.h>
|
#include <openssl/bn.h>
|
||||||
@ -1720,6 +1720,12 @@ ssh_dhgex_server(Kex *kex, Buffer *client_kexinit, Buffer *server_kexinit)
|
|||||||
/* XXX precompute? */
|
/* XXX precompute? */
|
||||||
key_to_blob(hostkey, &server_host_key_blob, &sbloblen);
|
key_to_blob(hostkey, &server_host_key_blob, &sbloblen);
|
||||||
|
|
||||||
|
if (type == SSH2_MSG_KEX_DH_GEX_REQUEST_OLD) {
|
||||||
|
/* These values are not included in the hash */
|
||||||
|
min = -1;
|
||||||
|
max = -1;
|
||||||
|
}
|
||||||
|
|
||||||
/* calc H */ /* XXX depends on 'kex' */
|
/* calc H */ /* XXX depends on 'kex' */
|
||||||
hash = kex_hash_gex(
|
hash = kex_hash_gex(
|
||||||
client_version_string,
|
client_version_string,
|
||||||
@ -1727,7 +1733,8 @@ ssh_dhgex_server(Kex *kex, Buffer *client_kexinit, Buffer *server_kexinit)
|
|||||||
buffer_ptr(client_kexinit), buffer_len(client_kexinit),
|
buffer_ptr(client_kexinit), buffer_len(client_kexinit),
|
||||||
buffer_ptr(server_kexinit), buffer_len(server_kexinit),
|
buffer_ptr(server_kexinit), buffer_len(server_kexinit),
|
||||||
(char *)server_host_key_blob, sbloblen,
|
(char *)server_host_key_blob, sbloblen,
|
||||||
nbits, dh->p, dh->g,
|
min, nbits, max,
|
||||||
|
dh->p, dh->g,
|
||||||
dh_client_pub,
|
dh_client_pub,
|
||||||
dh->pub_key,
|
dh->pub_key,
|
||||||
shared_secret
|
shared_secret
|
||||||
|
Loading…
Reference in New Issue
Block a user