[BACK]Return to kex.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/kex.c between version 1.98 and 1.99

version 1.98, 2014/02/02 03:44:31 version 1.99, 2014/04/29 18:01:49
Line 30 
Line 30 
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
   
   #ifdef WITH_OPENSSL
 #include <openssl/crypto.h>  #include <openssl/crypto.h>
   #endif
   
 #include "xmalloc.h"  #include "xmalloc.h"
 #include "ssh2.h"  #include "ssh2.h"
Line 59 
Line 61 
         int hash_alg;          int hash_alg;
 };  };
 static const struct kexalg kexalgs[] = {  static const struct kexalg kexalgs[] = {
   #ifdef WITH_OPENSSL
         { KEX_DH1, KEX_DH_GRP1_SHA1, 0, SSH_DIGEST_SHA1 },          { KEX_DH1, KEX_DH_GRP1_SHA1, 0, SSH_DIGEST_SHA1 },
         { KEX_DH14, KEX_DH_GRP14_SHA1, 0, SSH_DIGEST_SHA1 },          { KEX_DH14, KEX_DH_GRP14_SHA1, 0, SSH_DIGEST_SHA1 },
         { KEX_DHGEX_SHA1, KEX_DH_GEX_SHA1, 0, SSH_DIGEST_SHA1 },          { KEX_DHGEX_SHA1, KEX_DH_GEX_SHA1, 0, SSH_DIGEST_SHA1 },
Line 69 
Line 72 
             SSH_DIGEST_SHA384 },              SSH_DIGEST_SHA384 },
         { KEX_ECDH_SHA2_NISTP521, KEX_ECDH_SHA2, NID_secp521r1,          { KEX_ECDH_SHA2_NISTP521, KEX_ECDH_SHA2, NID_secp521r1,
             SSH_DIGEST_SHA512 },              SSH_DIGEST_SHA512 },
   #endif
         { KEX_CURVE25519_SHA256, KEX_C25519_SHA256, 0, SSH_DIGEST_SHA256 },          { KEX_CURVE25519_SHA256, KEX_C25519_SHA256, 0, SSH_DIGEST_SHA256 },
         { NULL, -1, -1, -1},          { NULL, -1, -1, -1},
 };  };
Line 595 
Line 599 
         }          }
 }  }
   
   #ifdef WITH_OPENSSL
 void  void
 kex_derive_keys_bn(Kex *kex, u_char *hash, u_int hashlen, const BIGNUM *secret)  kex_derive_keys_bn(Kex *kex, u_char *hash, u_int hashlen, const BIGNUM *secret)
 {  {
Line 606 
Line 611 
             buffer_ptr(&shared_secret), buffer_len(&shared_secret));              buffer_ptr(&shared_secret), buffer_len(&shared_secret));
         buffer_free(&shared_secret);          buffer_free(&shared_secret);
 }  }
   #endif
   
 Newkeys *  Newkeys *
 kex_get_newkeys(int mode)  kex_get_newkeys(int mode)
Line 617 
Line 623 
         return ret;          return ret;
 }  }
   
   #ifdef WITH_SSH1
 void  void
 derive_ssh1_session_id(BIGNUM *host_modulus, BIGNUM *server_modulus,  derive_ssh1_session_id(BIGNUM *host_modulus, BIGNUM *server_modulus,
     u_int8_t cookie[8], u_int8_t id[16])      u_int8_t cookie[8], u_int8_t id[16])
Line 649 
Line 656 
         explicit_bzero(nbuf, sizeof(nbuf));          explicit_bzero(nbuf, sizeof(nbuf));
         explicit_bzero(obuf, sizeof(obuf));          explicit_bzero(obuf, sizeof(obuf));
 }  }
   #endif
   
 #if defined(DEBUG_KEX) || defined(DEBUG_KEXDH) || defined(DEBUG_KEXECDH)  #if defined(DEBUG_KEX) || defined(DEBUG_KEXDH) || defined(DEBUG_KEXECDH)
 void  void

Legend:
Removed from v.1.98  
changed lines
  Added in v.1.99