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.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) { |
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; |
57 |
58 debug("SSH2_MSG_KEX_DH_GEX_REQUEST_OLD(%u) sent", nbits); 59 } else { |
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); |
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 --- |