Mention the negotiated SSH-2 MAC algorithm(s) in the Event Log.
authorjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Wed, 29 Sep 2004 23:57:03 +0000 (23:57 +0000)
committerjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Wed, 29 Sep 2004 23:57:03 +0000 (23:57 +0000)
(It should be possible to at least see what MAC is in use without going to a
SSH packet log.)

git-svn-id: svn://svn.tartarus.org/sgt/putty@4591 cda61777-01e9-0310-a592-d414129be87e

ssh.c
ssh.h
sshmd5.c
sshsha.c

diff --git a/ssh.c b/ssh.c
index d5a1a99..5b5a6be 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -4502,6 +4502,10 @@ static int do_ssh2_transport(Ssh ssh, unsigned char *in, int inlen, int ispkt)
              ssh->cscipher->text_name);
     logeventf(ssh, "Initialised %.200s server->client encryption",
              ssh->sccipher->text_name);
+    logeventf(ssh, "Initialised %.200s client->server MAC algorithm",
+             ssh->csmac->text_name);
+    logeventf(ssh, "Initialised %.200s server->client MAC algorithm",
+             ssh->scmac->text_name);
     if (ssh->cscomp->text_name)
        logeventf(ssh, "Initialised %s compression",
                  ssh->cscomp->text_name);
diff --git a/ssh.h b/ssh.h
index d7d17ff..5e41b7a 100644 (file)
--- a/ssh.h
+++ b/ssh.h
@@ -170,6 +170,7 @@ struct ssh_mac {
     int (*verify) (void *, unsigned char *blk, int len, unsigned long seq);
     char *name;
     int len;
+    char *text_name;
 };
 
 struct ssh_kex {
index 8913340..325a5ae 100644 (file)
--- a/sshmd5.c
+++ b/sshmd5.c
@@ -311,5 +311,6 @@ const struct ssh_mac ssh_md5 = {
     hmacmd5_make_context, hmacmd5_free_context, hmacmd5_key_16,
     hmacmd5_generate, hmacmd5_verify,
     "hmac-md5",
-    16
+    16,
+    "HMAC-MD5"
 };
index d7c1f43..d545cf0 100644 (file)
--- a/sshsha.c
+++ b/sshsha.c
@@ -286,12 +286,14 @@ const struct ssh_mac ssh_sha1 = {
     sha1_make_context, sha1_free_context, sha1_key,
     sha1_generate, sha1_verify,
     "hmac-sha1",
-    20
+    20,
+    "HMAC-SHA1"
 };
 
 const struct ssh_mac ssh_sha1_buggy = {
     sha1_make_context, sha1_free_context, sha1_key_buggy,
     sha1_generate, sha1_verify,
     "hmac-sha1",
-    20
+    20,
+    "bug-compatible HMAC-SHA1"
 };