From d2a0e0be6953a1ae78e400669090dc2bde01c58e Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 1 Mar 2001 17:45:31 +0000 Subject: [PATCH] Add a key length indication to each SSH2 cipher structure, in 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 | 1 + sshblowf.c | 4 ++-- sshdes.c | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ssh.h b/ssh.h index 320c84e9..65840293 100644 --- 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 { diff --git a/sshblowf.c b/sshblowf.c index dc507ca5..1d92d30c 100644 --- a/sshblowf.c +++ b/sshblowf.c @@ -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 }; diff --git a/sshdes.c b/sshdes.c index 1be340c4..0b47aab6 100644 --- 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 }; -- 2.11.0