X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=sshdes.c;h=9cb9cfa6c2c6afa9b2be57c14c2f377b3d83f8bd;hb=286f1f5b1fea191caf5b00704b50b4685996b67b;hp=265dc7679d0fcab09e6c847c97a922b0c3cddc98;hpb=3b20d71a7ee9b8efa00bba86ea16dc52be4dd3ff;p=PuTTY.git diff --git a/sshdes.c b/sshdes.c index 265dc767..9cb9cfa6 100644 --- a/sshdes.c +++ b/sshdes.c @@ -840,6 +840,7 @@ void des3_decrypt_pubkey(unsigned char *key, unsigned char *blk, int len) des_key_setup(GET_32BIT_MSB_FIRST(key), GET_32BIT_MSB_FIRST(key + 4), &ourkeys[2]); des_3cbc_decrypt(blk, blk, len, ourkeys); + memset(ourkeys, 0, sizeof(ourkeys)); } void des3_encrypt_pubkey(unsigned char *key, unsigned char *blk, int len) @@ -852,6 +853,7 @@ void des3_encrypt_pubkey(unsigned char *key, unsigned char *blk, int len) des_key_setup(GET_32BIT_MSB_FIRST(key), GET_32BIT_MSB_FIRST(key + 4), &ourkeys[2]); des_3cbc_encrypt(blk, blk, len, ourkeys); + memset(ourkeys, 0, sizeof(ourkeys)); } void des3_decrypt_pubkey_ossh(unsigned char *key, unsigned char *iv, @@ -867,6 +869,7 @@ void des3_decrypt_pubkey_ossh(unsigned char *key, unsigned char *iv, ourkeys[0].div0 = GET_32BIT_MSB_FIRST(iv); ourkeys[0].div1 = GET_32BIT_MSB_FIRST(iv+4); des_cbc3_decrypt(blk, blk, len, ourkeys); + memset(ourkeys, 0, sizeof(ourkeys)); } void des3_encrypt_pubkey_ossh(unsigned char *key, unsigned char *iv, @@ -882,6 +885,7 @@ void des3_encrypt_pubkey_ossh(unsigned char *key, unsigned char *iv, ourkeys[0].eiv0 = GET_32BIT_MSB_FIRST(iv); ourkeys[0].eiv1 = GET_32BIT_MSB_FIRST(iv+4); des_cbc3_encrypt(blk, blk, len, ourkeys); + memset(ourkeys, 0, sizeof(ourkeys)); } static const struct ssh2_cipher ssh_3des_ssh2 = {