1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Fix mishandling of IV in AES-NI CBC decryption.

A user reported that the new hardware AES implementation wasn't
working, and sent an event log suggesting that it was being run in CBC
mode - which is unusual enough these days that that may well have been
its first test.

I wasn't looking forward to debugging the actual AES intrinsics code,
but fortunately, I didn't have to, because an eyeball review spotted a
nice simple error in the CBC decrypt function in which the wrong local
variable was being stored into the IV variable on exit from the
function. Testing against a local CBC-only server reproduced the
reported failure and suggested that this fixed it.
This commit is contained in:
Simon Tatham 2018-03-27 23:05:07 +01:00
parent c67389e1fb
commit d6338c22c3

View File

@ -1524,7 +1524,7 @@ static void aes_decrypt_cbc_ni(unsigned char *blk, int len, AESContext * ctx)
}
/* Update IV */
_mm_storeu_si128((__m128i*)(ctx->iv), dec);
_mm_storeu_si128((__m128i*)(ctx->iv), iv);
}
FUNC_ISA