]> andersk Git - openssh.git/blobdiff - mpaux.c
- Merged OpenBSD CVS changes:
[openssh.git] / mpaux.c
diff --git a/mpaux.c b/mpaux.c
index c17df9e7d26a2f17a65226528ab5abd580623bb6..fbc986cfed47d2be1d26b3eed5169b81647f312c 100644 (file)
--- a/mpaux.c
+++ b/mpaux.c
@@ -14,7 +14,6 @@ precision integers.
 
 */
 
-#include "config.h"
 #include "includes.h"
 RCSID("$Id$");
 
@@ -34,15 +33,15 @@ RCSID("$Id$");
 void
 compute_session_id(unsigned char session_id[16],
                   unsigned char cookie[8],
-                  unsigned int host_key_bits,
                   BIGNUM *host_key_n,
-                  unsigned int session_key_bits,
                   BIGNUM *session_key_n)
 {
+  unsigned int host_key_bits = BN_num_bits(host_key_n);
+  unsigned int session_key_bits = BN_num_bits(session_key_n);
   unsigned int bytes = (host_key_bits + 7) / 8 + (session_key_bits + 7) / 8 + 8;
   unsigned char *buf = xmalloc(bytes);
   MD5_CTX md;
-  
+
   BN_bn2bin(host_key_n, buf);
   BN_bn2bin(session_key_n, buf + (host_key_bits + 7 ) / 8);
   memcpy(buf + (host_key_bits + 7) / 8 + (session_key_bits + 7) / 8,
@@ -50,5 +49,6 @@ compute_session_id(unsigned char session_id[16],
   MD5_Init(&md);
   MD5_Update(&md, buf, bytes);
   MD5_Final(session_id, &md);
+  memset(buf, 0, bytes);
   xfree(buf);
 }
This page took 0.245576 seconds and 4 git commands to generate.