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

Diff for /src/usr.bin/ssh/Attic/kexdhs.c between version 1.2.6.3 and 1.3

version 1.2.6.3, 2006/11/08 00:44:05 version 1.3, 2005/11/04 05:15:59
Line 1 
Line 1 
 /* $OpenBSD$ */  
 /*  /*
  * Copyright (c) 2001 Markus Friedl.  All rights reserved.   * Copyright (c) 2001 Markus Friedl.  All rights reserved.
  *   *
Line 23 
Line 22 
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */   */
   
   #include "includes.h"
   RCSID("$OpenBSD$");
   
 #include <sys/types.h>  
 #include <string.h>  
 #include <signal.h>  
   
 #include "xmalloc.h"  #include "xmalloc.h"
 #include "buffer.h"  
 #include "key.h"  #include "key.h"
 #include "cipher.h"  
 #include "kex.h"  #include "kex.h"
 #include "log.h"  #include "log.h"
 #include "packet.h"  #include "packet.h"
 #include "dh.h"  #include "dh.h"
 #include "ssh2.h"  #include "ssh2.h"
 #ifdef GSSAPI  
 #include "ssh-gss.h"  
 #endif  
 #include "monitor_wrap.h"  #include "monitor_wrap.h"
   
 void  void
Line 49 
Line 41 
         DH *dh;          DH *dh;
         Key *server_host_key;          Key *server_host_key;
         u_char *kbuf, *hash, *signature = NULL, *server_host_key_blob = NULL;          u_char *kbuf, *hash, *signature = NULL, *server_host_key_blob = NULL;
         u_int sbloblen, klen, hashlen, slen;          u_int sbloblen, klen, kout, hashlen;
         int kout;          u_int slen;
   
         /* generate server DH public key */          /* generate server DH public key */
         switch (kex->kex_type) {          switch (kex->kex_type) {
Line 98 
Line 90 
   
         klen = DH_size(dh);          klen = DH_size(dh);
         kbuf = xmalloc(klen);          kbuf = xmalloc(klen);
         if ((kout = DH_compute_key(kbuf, dh_client_pub, dh)) < 0)          kout = DH_compute_key(kbuf, dh_client_pub, dh);
                 fatal("DH_compute_key: failed");  
 #ifdef DEBUG_KEXDH  #ifdef DEBUG_KEXDH
         dump_digest("shared secret", kbuf, kout);          dump_digest("shared secret", kbuf, kout);
 #endif  #endif
         if ((shared_secret = BN_new()) == NULL)          if ((shared_secret = BN_new()) == NULL)
                 fatal("kexdh_server: BN_new failed");                  fatal("kexdh_server: BN_new failed");
         if (BN_bin2bn(kbuf, kout, shared_secret) == NULL)          BN_bin2bn(kbuf, kout, shared_secret);
                 fatal("kexdh_server: BN_bin2bn failed");  
         memset(kbuf, 0, klen);          memset(kbuf, 0, klen);
         xfree(kbuf);          xfree(kbuf);
   

Legend:
Removed from v.1.2.6.3  
changed lines
  Added in v.1.3