X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/88c152099b9012a92e6ff4d8157933b55401cdf3..708bbbbe30a499a0a51e0356e7056206b15989fd:/sshdes.c?ds=inline diff --git a/sshdes.c b/sshdes.c index 67d91c7f..1be340c4 100644 --- a/sshdes.c +++ b/sshdes.c @@ -778,6 +778,18 @@ void des3_decrypt_pubkey(unsigned char *key, des_3cbc_decrypt(blk, blk, len, ourkeys); } +void des3_encrypt_pubkey(unsigned char *key, + unsigned char *blk, int len) { + DESContext ourkeys[3]; + des_key_setup(GET_32BIT_MSB_FIRST(key), + GET_32BIT_MSB_FIRST(key+4), &ourkeys[0]); + des_key_setup(GET_32BIT_MSB_FIRST(key+8), + GET_32BIT_MSB_FIRST(key+12), &ourkeys[1]); + des_key_setup(GET_32BIT_MSB_FIRST(key), + GET_32BIT_MSB_FIRST(key+4), &ourkeys[2]); + des_3cbc_encrypt(blk, blk, len, ourkeys); +} + struct ssh_cipher ssh_3des_ssh2 = { NULL, des3_csiv, des3_cskey,