X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/7b4ef1ae1f983601568125604c93a7727e7c6085..ee5c14220a9e2d3aeee34fa23db2e4ea1dcd32fb:/sshaes.c diff --git a/sshaes.c b/sshaes.c index f227c560..01dd04c2 100644 --- a/sshaes.c +++ b/sshaes.c @@ -1154,6 +1154,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)); } void aes256_decrypt_pubkey(unsigned char *key, unsigned char *blk, int len) @@ -1162,6 +1163,7 @@ 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)); } static const struct ssh2_cipher ssh_aes128 = {