Log the hash used for DH kex (now there's a choice).
authorjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Sun, 12 Mar 2006 15:39:19 +0000 (15:39 +0000)
committerjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Sun, 12 Mar 2006 15:39:19 +0000 (15:39 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/putty@6605 cda61777-01e9-0310-a592-d414129be87e

ssh.c
ssh.h
sshsh256.c
sshsha.c

diff --git a/ssh.c b/ssh.c
index 60ddefc..ba3dfad 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -5519,7 +5519,8 @@ static int do_ssh2_transport(Ssh ssh, void *vin, int inlen,
                  ssh->kex->groupname);
     }
 
-    logevent("Doing Diffie-Hellman key exchange");
+    logeventf(ssh, "Doing Diffie-Hellman key exchange with hash %s",
+             ssh->kex->hash->text_name);
     /*
      * Now generate and send e for Diffie-Hellman.
      */
diff --git a/ssh.h b/ssh.h
index d0543cd..cca3ec0 100644 (file)
--- a/ssh.h
+++ b/ssh.h
@@ -190,6 +190,7 @@ struct ssh_hash {
     void (*bytes)(void *, void *, int);
     void (*final)(void *, unsigned char *); /* also frees context */
     int hlen; /* output length in bytes */
+    char *text_name;
 };   
 
 struct ssh_kex {
index 70c2d7d..ce6979e 100644 (file)
@@ -215,7 +215,7 @@ static void sha256_final(void *handle, unsigned char *output)
 }
 
 const struct ssh_hash ssh_sha256 = {
-    sha256_init, sha256_bytes, sha256_final, 32
+    sha256_init, sha256_bytes, sha256_final, 32, "SHA-256"
 };
 
 #ifdef TEST
index b3860b6..1db5c26 100644 (file)
--- a/sshsha.c
+++ b/sshsha.c
@@ -217,7 +217,7 @@ static void sha1_final(void *handle, unsigned char *output)
 }
 
 const struct ssh_hash ssh_sha1 = {
-    sha1_init, sha1_bytes, sha1_final, 20
+    sha1_init, sha1_bytes, sha1_final, 20, "SHA-1"
 };
 
 /* ----------------------------------------------------------------------