mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-04 00:00:14 -04:00
aesni: Fix out-of-bound read when loading 192-bit AES keys
This commit is contained in:
parent
f2456376ae
commit
7217ff5fc5
@ -142,9 +142,11 @@ static __m128i _mm_shuffle_i01(__m128i a, __m128i b)
|
||||
static void expand192(__m128i *key, __m128i *schedule)
|
||||
{
|
||||
__m128i t1, t2, t3;
|
||||
u_char buf[16] = {};
|
||||
|
||||
schedule[0] = t1 = _mm_loadu_si128(key);
|
||||
t2 = t3 = _mm_loadu_si128(key + 1);
|
||||
memcpy(buf, key + 1, 8);
|
||||
t2 = t3 = _mm_loadu_si128((__m128i*)buf);
|
||||
|
||||
t2 = assist192(_mm_aeskeygenassist_si128(t2, 0x1), t2, &t1);
|
||||
schedule[1] = _mm_shuffle_i00(t3, t1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user