]> andersk Git - gssapi-openssh.git/blobdiff - openssh/kexgss.c
merging in Simon Wilkinson's latest patch (openssh-3.1p1-gssapi-20020323.diff)
[gssapi-openssh.git] / openssh / kexgss.c
index 861de8719467fd535b9a08f6e1460bb0f1e64859..c967b9b584af1998de37bca279f038c49e438b9d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -293,13 +293,12 @@ kexgss_server(Kex *kex)
        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 */
@@ -310,25 +309,25 @@ kexgss_server(Kex *kex)
         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;
This page took 0.04115 seconds and 4 git commands to generate.