/*
- * Copyright (c) 2001 Simon Wilkinson. All rights reserved.
+ * Copyright (c) 2001,2002 Simon Wilkinson. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
OM_uint32 ret_flags = 0;
gss_buffer_desc gssbuf,send_tok,recv_tok,msg_tok;
Gssctxt ctxt;
- int dlen=0;
unsigned int klen, kout;
unsigned char *kbuf;
unsigned char *hash;
DH *dh;
- BIGNUM *shared_secret = 0;
- BIGNUM *dh_client_pub = 0;
+ BIGNUM *shared_secret = NULL;
+ BIGNUM *dh_client_pub = NULL;
int type =0;
/* Initialise GSSAPI */
if (ssh_gssapi_acquire_cred(&ctxt))
fatal("Unable to acquire credentials for the server");
- /* Initialise some bignums */
- dh_client_pub = BN_new();
- if (dh_client_pub == NULL)
- fatal("dh_client_pub == NULL");
-
do {
debug("Wait SSH2_MSG_GSSAPI_INIT");
type = packet_read();
switch(type) {
case SSH2_MSG_KEXGSS_INIT:
- if (dlen!=0)
+ if (dh_client_pub!=NULL)
fatal("Received KEXGSS_INIT after initialising");
recv_tok.value=packet_get_string(&recv_tok.length);
+
+ dh_client_pub = BN_new();
+
+ if (dh_client_pub == NULL)
+ fatal("dh_client_pub == NULL");
packet_get_bignum2(dh_client_pub);
- dlen = BN_num_bits(dh_client_pub);
+
/* Send SSH_MSG_KEXGSS_HOSTKEY here, if we want */
break;
case SSH2_MSG_KEXGSS_CONTINUE:
- if (dlen==0)
+ if (dh_client_pub == NULL)
fatal("Received KEXGSS_CONTINUE without initialising");
recv_tok.value=packet_get_string(&recv_tok.length);
break;