aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ah6.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/ah6.c')
-rw-r--r--net/ipv6/ah6.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index 755f38271dd5..7802b72196f3 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -25,6 +25,7 @@
25 25
26#define pr_fmt(fmt) "IPv6: " fmt 26#define pr_fmt(fmt) "IPv6: " fmt
27 27
28#include <crypto/algapi.h>
28#include <crypto/hash.h> 29#include <crypto/hash.h>
29#include <linux/module.h> 30#include <linux/module.h>
30#include <linux/slab.h> 31#include <linux/slab.h>
@@ -483,7 +484,7 @@ static void ah6_input_done(struct crypto_async_request *base, int err)
483 auth_data = ah_tmp_auth(work_iph, hdr_len); 484 auth_data = ah_tmp_auth(work_iph, hdr_len);
484 icv = ah_tmp_icv(ahp->ahash, auth_data, ahp->icv_trunc_len); 485 icv = ah_tmp_icv(ahp->ahash, auth_data, ahp->icv_trunc_len);
485 486
486 err = memcmp(icv, auth_data, ahp->icv_trunc_len) ? -EBADMSG : 0; 487 err = crypto_memneq(icv, auth_data, ahp->icv_trunc_len) ? -EBADMSG : 0;
487 if (err) 488 if (err)
488 goto out; 489 goto out;
489 490
@@ -631,7 +632,7 @@ static int ah6_input(struct xfrm_state *x, struct sk_buff *skb)
631 goto out_free; 632 goto out_free;
632 } 633 }
633 634
634 err = memcmp(icv, auth_data, ahp->icv_trunc_len) ? -EBADMSG : 0; 635 err = crypto_memneq(icv, auth_data, ahp->icv_trunc_len) ? -EBADMSG : 0;
635 if (err) 636 if (err)
636 goto out_free; 637 goto out_free;
637 638