mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 03:22:48 -05:00
Rename the AES vtables.
The old names like ssh_aes128 and ssh_aes128_ctr reflect the SSH protocol IDs, which is all very well, but I think a more important principle is that it should be easy for me to remember which cipher mode each one refers to. So I've renamed them so that they all end in _cbc and _sdctr. (I've left alone the string identifiers used by testcrypt, for the moment. Perhaps I'll go back and change those later.)
This commit is contained in:
6
import.c
6
import.c
@ -547,7 +547,7 @@ static ssh2_userkey *openssh_pem_read(
|
||||
des3_decrypt_pubkey_ossh(keybuf, key->iv,
|
||||
key->keyblob->u, key->keyblob->len);
|
||||
else {
|
||||
ssh2_cipher *cipher = ssh2_cipher_new(&ssh_aes128);
|
||||
ssh2_cipher *cipher = ssh2_cipher_new(&ssh_aes128_cbc);
|
||||
ssh2_cipher_setkey(cipher, keybuf);
|
||||
ssh2_cipher_setiv(cipher, key->iv);
|
||||
ssh2_cipher_decrypt(cipher, key->keyblob->u, key->keyblob->len);
|
||||
@ -1390,7 +1390,7 @@ static ssh2_userkey *openssh_new_read(
|
||||
{
|
||||
ssh2_cipher *cipher = ssh2_cipher_new(
|
||||
key->cipher == ON_E_AES256CBC ?
|
||||
&ssh_aes256 : &ssh_aes256_ctr);
|
||||
&ssh_aes256_cbc : &ssh_aes256_sdctr);
|
||||
ssh2_cipher_setkey(cipher, keybuf);
|
||||
ssh2_cipher_setiv(cipher, keybuf + 32);
|
||||
/* Decrypt the private section in place, casting away
|
||||
@ -1594,7 +1594,7 @@ static bool openssh_new_write(
|
||||
bcrypt_salt, sizeof(bcrypt_salt), bcrypt_rounds,
|
||||
keybuf, sizeof(keybuf));
|
||||
|
||||
cipher = ssh2_cipher_new(&ssh_aes256_ctr);
|
||||
cipher = ssh2_cipher_new(&ssh_aes256_sdctr);
|
||||
ssh2_cipher_setkey(cipher, keybuf);
|
||||
ssh2_cipher_setiv(cipher, keybuf + 32);
|
||||
ssh2_cipher_encrypt(cipher, cpblob->u, cpblob->len);
|
||||
|
Reference in New Issue
Block a user