SRTP KDF: Don't use i outside loop

When shifting index down, first XOR outside loop isn't meant to use i.
This commit is contained in:
Sean Parkinson 2023-11-08 09:57:58 +10:00
parent 1a3f3aa5f0
commit 716cb450aa

View File

@ -910,7 +910,7 @@ static void wc_srtp_kdf_first_block(const byte* salt, word32 saltSz, int kdrIdx,
}
else {
/* XOR in as bit shifted index. */
block[WC_SRTP_MAX_SALT - indexSz] ^= index[i+0] >> bits;
block[WC_SRTP_MAX_SALT - indexSz] ^= index[0] >> bits;
for (i = 1; i < indexSz; i++) {
block[i + WC_SRTP_MAX_SALT - indexSz] ^=
(index[i-1] << (8 - bits)) |