diff options
author | John-Mark Gurney <jmg@FreeBSD.org> | 2015-07-31 00:31:52 +0000 |
---|---|---|
committer | John-Mark Gurney <jmg@FreeBSD.org> | 2015-07-31 00:31:52 +0000 |
commit | 42e5fcbf2befe204d7e64b7f93ae0bee86c6ec18 (patch) | |
tree | 5b92b5caef8ebe1760f81cf0f64125873fac9b1a /sys/netipsec/xform_ah.c | |
parent | 817c7ed900427f8ae3e152fd1ad770878465ff11 (diff) | |
download | src-42e5fcbf2befe204d7e64b7f93ae0bee86c6ec18.tar.gz src-42e5fcbf2befe204d7e64b7f93ae0bee86c6ec18.zip |
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
Notes
Notes:
svn path=/head/; revision=286101
Diffstat (limited to 'sys/netipsec/xform_ah.c')
-rw-r--r-- | sys/netipsec/xform_ah.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netipsec/xform_ah.c b/sys/netipsec/xform_ah.c index ae0feb9f627a..350a735a89b3 100644 --- a/sys/netipsec/xform_ah.c +++ b/sys/netipsec/xform_ah.c @@ -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)), |