mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
crypto: talitos - Fix timing leak in ESP ICV verification
Using non-constant time memcmp() makes the verification of the authentication tag in the decrypt path vulnerable to timing attacks. Fix this by using crypto_memneq() instead. Cc: [email protected] Signed-off-by: David Gstir <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
This commit is contained in:
parent
cb8affb55c
commit
79960943fd
1 changed files with 1 additions and 1 deletions
|
|
@ -977,7 +977,7 @@ static void ipsec_esp_decrypt_swauth_done(struct device *dev,
|
|||
} else
|
||||
oicv = (char *)&edesc->link_tbl[0];
|
||||
|
||||
err = memcmp(oicv, icv, authsize) ? -EBADMSG : 0;
|
||||
err = crypto_memneq(oicv, icv, authsize) ? -EBADMSG : 0;
|
||||
}
|
||||
|
||||
kfree(edesc);
|
||||
|
|
|
|||
Loading…
Reference in a new issue