Add a key length indication to each SSH2 cipher structure, in
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 1 Mar 2001 17:45:31 +0000 (17:45 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 1 Mar 2001 17:45:31 +0000 (17:45 +0000)
preparation for needing to know how much key material each cipher
needs in order to select a suitable Diffie-Hellman group.

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

ssh.h
sshblowf.c
sshdes.c

diff --git a/ssh.h b/ssh.h
index 320c84e..6584029 100644 (file)
--- a/ssh.h
+++ b/ssh.h
@@ -103,6 +103,7 @@ struct ssh_cipher {
     void (*decrypt)(unsigned char *blk, int len);
     char *name;
     int blksize;
+    int keylen;
 };
 
 struct ssh_mac {
index dc507ca..1d92d30 100644 (file)
@@ -514,7 +514,7 @@ struct ssh_cipher ssh_blowfish_ssh1 = {
     blowfish_ssh1_encrypt_blk,
     blowfish_ssh1_decrypt_blk,
     "blowfish-cbc",
-    8
+    8, 256
 };
 
 struct ssh_cipher ssh_blowfish_ssh2 = {
@@ -524,5 +524,5 @@ struct ssh_cipher ssh_blowfish_ssh2 = {
     blowfish_ssh2_encrypt_blk,
     blowfish_ssh2_decrypt_blk,
     "blowfish-cbc",
-    8
+    8, 128
 };
index 1be340c..0b47aab 100644 (file)
--- a/sshdes.c
+++ b/sshdes.c
@@ -797,7 +797,7 @@ struct ssh_cipher ssh_3des_ssh2 = {
     des3_ssh2_encrypt_blk,
     des3_ssh2_decrypt_blk,
     "3des-cbc",
-    8
+    8, 168
 };
 
 struct ssh_cipher ssh_3des = {
@@ -806,7 +806,7 @@ struct ssh_cipher ssh_3des = {
     des3_encrypt_blk,
     des3_decrypt_blk,
     "3des-cbc",
-    8
+    8, 168
 };
 
 static void des_sesskey(unsigned char *key) {
@@ -829,5 +829,5 @@ struct ssh_cipher ssh_des = {
     des_encrypt_blk,
     des_decrypt_blk,
     "des-cbc", /* should never be used - not a valid cipher in ssh2 */
-    8
+    8, 56
 };