Deleted Added
full compact
kexgexc.c (113908) kexgexc.c (126274)
1/*
2 * Copyright (c) 2000 Niels Provos. All rights reserved.
3 * Copyright (c) 2001 Markus Friedl. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 10 unchanged lines hidden (view full) ---

19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include "includes.h"
1/*
2 * Copyright (c) 2000 Niels Provos. All rights reserved.
3 * Copyright (c) 2001 Markus Friedl. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 10 unchanged lines hidden (view full) ---

19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include "includes.h"
27RCSID("$OpenBSD: kexgexc.c,v 1.1 2003/02/16 17:09:57 markus Exp $");
27RCSID("$OpenBSD: kexgexc.c,v 1.2 2003/12/08 11:00:47 markus Exp $");
28
29#include "xmalloc.h"
30#include "key.h"
31#include "kex.h"
32#include "log.h"
33#include "packet.h"
34#include "dh.h"
35#include "ssh2.h"

--- 8 unchanged lines hidden (view full) ---

44 u_char *kbuf, *hash, *signature = NULL, *server_host_key_blob = NULL;
45 u_int klen, kout, slen, sbloblen;
46 int min, max, nbits;
47 DH *dh;
48
49 nbits = dh_estimate(kex->we_need * 8);
50
51 if (datafellows & SSH_OLD_DHGEX) {
28
29#include "xmalloc.h"
30#include "key.h"
31#include "kex.h"
32#include "log.h"
33#include "packet.h"
34#include "dh.h"
35#include "ssh2.h"

--- 8 unchanged lines hidden (view full) ---

44 u_char *kbuf, *hash, *signature = NULL, *server_host_key_blob = NULL;
45 u_int klen, kout, slen, sbloblen;
46 int min, max, nbits;
47 DH *dh;
48
49 nbits = dh_estimate(kex->we_need * 8);
50
51 if (datafellows & SSH_OLD_DHGEX) {
52 debug("SSH2_MSG_KEX_DH_GEX_REQUEST_OLD sent");
53
54 /* Old GEX request */
55 packet_start(SSH2_MSG_KEX_DH_GEX_REQUEST_OLD);
56 packet_put_int(nbits);
57 min = DH_GRP_MIN;
58 max = DH_GRP_MAX;
52 /* Old GEX request */
53 packet_start(SSH2_MSG_KEX_DH_GEX_REQUEST_OLD);
54 packet_put_int(nbits);
55 min = DH_GRP_MIN;
56 max = DH_GRP_MAX;
59 } else {
60 debug("SSH2_MSG_KEX_DH_GEX_REQUEST sent");
61
57
58 debug("SSH2_MSG_KEX_DH_GEX_REQUEST_OLD(%u) sent", nbits);
59 } else {
62 /* New GEX request */
63 min = DH_GRP_MIN;
64 max = DH_GRP_MAX;
65 packet_start(SSH2_MSG_KEX_DH_GEX_REQUEST);
66 packet_put_int(min);
67 packet_put_int(nbits);
68 packet_put_int(max);
60 /* New GEX request */
61 min = DH_GRP_MIN;
62 max = DH_GRP_MAX;
63 packet_start(SSH2_MSG_KEX_DH_GEX_REQUEST);
64 packet_put_int(min);
65 packet_put_int(nbits);
66 packet_put_int(max);
67
68 debug("SSH2_MSG_KEX_DH_GEX_REQUEST(%u<%u<%u) sent",
69 min, nbits, max);
69 }
70#ifdef DEBUG_KEXDH
71 fprintf(stderr, "\nmin = %d, nbits = %d, max = %d\n",
72 min, nbits, max);
73#endif
74 packet_send();
75
76 debug("expecting SSH2_MSG_KEX_DH_GEX_GROUP");

--- 113 unchanged lines hidden ---
70 }
71#ifdef DEBUG_KEXDH
72 fprintf(stderr, "\nmin = %d, nbits = %d, max = %d\n",
73 min, nbits, max);
74#endif
75 packet_send();
76
77 debug("expecting SSH2_MSG_KEX_DH_GEX_GROUP");

--- 113 unchanged lines hidden ---