X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=sshaes.c;h=904cbdb2b6f997a3e8dc2ca77c1dcf835d95f891;hb=e22120fea8d39e6a2ef6b2f4ab3ee5502f56169a;hp=2800e021f0d0d1ed66733c8cadbabadf2a0d0fde;hpb=108791e15c1df03c58cc4e98e1e5b2f20415d0d4;p=PuTTY.git diff --git a/sshaes.c b/sshaes.c index 2800e021..904cbdb2 100644 --- a/sshaes.c +++ b/sshaes.c @@ -1157,7 +1157,7 @@ void aes256_encrypt_pubkey(unsigned char *key, unsigned char *blk, int len) aes_setup(&ctx, 16, key, 32); memset(ctx.iv, 0, sizeof(ctx.iv)); aes_encrypt_cbc(blk, len, &ctx); - memset(&ctx, 0, sizeof(ctx)); + smemclr(&ctx, sizeof(ctx)); } void aes256_decrypt_pubkey(unsigned char *key, unsigned char *blk, int len) @@ -1166,56 +1166,63 @@ void aes256_decrypt_pubkey(unsigned char *key, unsigned char *blk, int len) aes_setup(&ctx, 16, key, 32); memset(ctx.iv, 0, sizeof(ctx.iv)); aes_decrypt_cbc(blk, len, &ctx); - memset(&ctx, 0, sizeof(ctx)); + smemclr(&ctx, sizeof(ctx)); } static const struct ssh2_cipher ssh_aes128_ctr = { aes_make_context, aes_free_context, aes_iv, aes128_key, - aes_ssh2_sdctr, aes_ssh2_sdctr, + aes_ssh2_sdctr, aes_ssh2_sdctr, NULL, NULL, "aes128-ctr", - 16, 128, 0, "AES-128 SDCTR" + 16, 128, 16, 0, "AES-128 SDCTR", + NULL }; static const struct ssh2_cipher ssh_aes192_ctr = { aes_make_context, aes_free_context, aes_iv, aes192_key, - aes_ssh2_sdctr, aes_ssh2_sdctr, + aes_ssh2_sdctr, aes_ssh2_sdctr, NULL, NULL, "aes192-ctr", - 16, 192, 0, "AES-192 SDCTR" + 16, 192, 24, 0, "AES-192 SDCTR", + NULL }; static const struct ssh2_cipher ssh_aes256_ctr = { aes_make_context, aes_free_context, aes_iv, aes256_key, - aes_ssh2_sdctr, aes_ssh2_sdctr, + aes_ssh2_sdctr, aes_ssh2_sdctr, NULL, NULL, "aes256-ctr", - 16, 256, 0, "AES-256 SDCTR" + 16, 256, 32, 0, "AES-256 SDCTR", + NULL }; static const struct ssh2_cipher ssh_aes128 = { aes_make_context, aes_free_context, aes_iv, aes128_key, - aes_ssh2_encrypt_blk, aes_ssh2_decrypt_blk, + aes_ssh2_encrypt_blk, aes_ssh2_decrypt_blk, NULL, NULL, "aes128-cbc", - 16, 128, SSH_CIPHER_IS_CBC, "AES-128 CBC" + 16, 128, 16, SSH_CIPHER_IS_CBC, "AES-128 CBC", + NULL }; static const struct ssh2_cipher ssh_aes192 = { aes_make_context, aes_free_context, aes_iv, aes192_key, - aes_ssh2_encrypt_blk, aes_ssh2_decrypt_blk, + aes_ssh2_encrypt_blk, aes_ssh2_decrypt_blk, NULL, NULL, "aes192-cbc", - 16, 192, SSH_CIPHER_IS_CBC, "AES-192 CBC" + 16, 192, 24, SSH_CIPHER_IS_CBC, "AES-192 CBC", + NULL }; static const struct ssh2_cipher ssh_aes256 = { aes_make_context, aes_free_context, aes_iv, aes256_key, - aes_ssh2_encrypt_blk, aes_ssh2_decrypt_blk, + aes_ssh2_encrypt_blk, aes_ssh2_decrypt_blk, NULL, NULL, "aes256-cbc", - 16, 256, SSH_CIPHER_IS_CBC, "AES-256 CBC" + 16, 256, 32, SSH_CIPHER_IS_CBC, "AES-256 CBC", + NULL }; static const struct ssh2_cipher ssh_rijndael_lysator = { aes_make_context, aes_free_context, aes_iv, aes256_key, - aes_ssh2_encrypt_blk, aes_ssh2_decrypt_blk, + aes_ssh2_encrypt_blk, aes_ssh2_decrypt_blk, NULL, NULL, "rijndael-cbc@lysator.liu.se", - 16, 256, SSH_CIPHER_IS_CBC, "AES-256 CBC" + 16, 256, 32, SSH_CIPHER_IS_CBC, "AES-256 CBC", + NULL }; static const struct ssh2_cipher *const aes_list[] = {