mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
these are comparing authenticators and need to be constant time...
This could be a side channel attack... Now that we have a function for this, use it... jmgurney/ipsecgcm: 24d704cc and 7f37a14
This commit is contained in:
parent
817c7ed900
commit
42e5fcbf2b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=286101
|
@ -777,7 +777,7 @@ ah_input_cb(struct cryptop *crp)
|
|||
|
||||
/* Verify authenticator. */
|
||||
ptr = (caddr_t) (tc + 1);
|
||||
if (bcmp(ptr + skip + rplen, calc, authsize)) {
|
||||
if (timingsafe_bcmp(ptr + skip + rplen, calc, authsize)) {
|
||||
DPRINTF(("%s: authentication hash mismatch for packet "
|
||||
"in SA %s/%08lx\n", __func__,
|
||||
ipsec_address(&saidx->dst, buf, sizeof(buf)),
|
||||
|
|
|
@ -534,7 +534,7 @@ esp_input_cb(struct cryptop *crp)
|
|||
ptr = (caddr_t) (tc + 1);
|
||||
|
||||
/* Verify authenticator */
|
||||
if (bcmp(ptr, aalg, alen) != 0) {
|
||||
if (timingsafe_bcmp(ptr, aalg, alen) != 0) {
|
||||
DPRINTF(("%s: authentication hash mismatch for "
|
||||
"packet in SA %s/%08lx\n", __func__,
|
||||
ipsec_address(&saidx->dst, buf, sizeof(buf)),
|
||||
|
|
Loading…
Reference in a new issue