aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ah4.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/ah4.c')
-rw-r--r--net/ipv4/ah4.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c
index e8f862358518..37db44f60718 100644
--- a/net/ipv4/ah4.c
+++ b/net/ipv4/ah4.c
@@ -1,5 +1,6 @@
1#define pr_fmt(fmt) "IPsec: " fmt 1#define pr_fmt(fmt) "IPsec: " fmt
2 2
3#include <crypto/algapi.h>
3#include <crypto/hash.h> 4#include <crypto/hash.h>
4#include <linux/err.h> 5#include <linux/err.h>
5#include <linux/module.h> 6#include <linux/module.h>
@@ -279,7 +280,7 @@ static void ah_input_done(struct crypto_async_request *base, int err)
279 auth_data = ah_tmp_auth(work_iph, ihl); 280 auth_data = ah_tmp_auth(work_iph, ihl);
280 icv = ah_tmp_icv(ahp->ahash, auth_data, ahp->icv_trunc_len); 281 icv = ah_tmp_icv(ahp->ahash, auth_data, ahp->icv_trunc_len);
281 282
282 err = memcmp(icv, auth_data, ahp->icv_trunc_len) ? -EBADMSG: 0; 283 err = crypto_memneq(icv, auth_data, ahp->icv_trunc_len) ? -EBADMSG : 0;
283 if (err) 284 if (err)
284 goto out; 285 goto out;
285 286
@@ -417,7 +418,7 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb)
417 goto out_free; 418 goto out_free;
418 } 419 }
419 420
420 err = memcmp(icv, auth_data, ahp->icv_trunc_len) ? -EBADMSG: 0; 421 err = crypto_memneq(icv, auth_data, ahp->icv_trunc_len) ? -EBADMSG : 0;
421 if (err) 422 if (err)
422 goto out_free; 423 goto out_free;
423 424