mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-01-29 21:02:12 +01:00
Dtls13GetRnMask: Correctly get chacha counter on BE systems
The issue was that BIG_ENDIAN is defined in endian.h (on linux). Our define is BIG_ENDIAN_ORDER.
This commit is contained in:
@@ -274,13 +274,7 @@ static int Dtls13GetRnMask(WOLFSSL* ssl, const byte* ciphertext, byte* mask,
|
||||
if (c->chacha == NULL)
|
||||
return BAD_STATE_E;
|
||||
|
||||
/* assuming CIPHER[0..3] should be interpreted as little endian 32-bits
|
||||
integer. The draft rfc isn't really clear on that. See sec 4.2.3 of
|
||||
the draft. See also Section 2.3 of the Chacha RFC. */
|
||||
XMEMCPY(&counter, ciphertext, sizeof(counter));
|
||||
#ifdef BIG_ENDIAN
|
||||
counter = ByteReverseWord32(counter);
|
||||
#endif /* BIG_ENDIAN */
|
||||
ato32le(ciphertext, &counter);
|
||||
|
||||
ret = wc_Chacha_SetIV(c->chacha, &ciphertext[4], counter);
|
||||
if (ret != 0)
|
||||
|
||||
Reference in New Issue
Block a user