diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2007-12-16 18:55:02 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:53:51 -0500 |
commit | 668dc8af3150f837f7f0461001bbbc0ce25d7bdf (patch) | |
tree | 9ba3534a190bb69b3aebf24aaa4340685fe16539 /net/ipv4/ah4.c | |
parent | b2aa5e9d43a38dcdfa0878ed750cf32f98460278 (diff) |
[IPSEC]: Move integrity stat collection into xfrm_input
Similar to the moving out of the replay processing on the output, this
patch moves the integrity stat collectin from x->type->input into
xfrm_input.
This would eventually allow transforms such as AH/ESP to be lockless.
The error value EBADMSG (currently unused in the crypto layer) is used
to indicate a failed integrity check. In future this error can be
directly returned by the crypto layer once we switch to aead
algorithms.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ah4.c')
-rw-r--r-- | net/ipv4/ah4.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c index 5fc346d8b566..a989d29b44ea 100644 --- a/net/ipv4/ah4.c +++ b/net/ipv4/ah4.c | |||
@@ -177,9 +177,8 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb) | |||
177 | err = ah_mac_digest(ahp, skb, ah->auth_data); | 177 | err = ah_mac_digest(ahp, skb, ah->auth_data); |
178 | if (err) | 178 | if (err) |
179 | goto out; | 179 | goto out; |
180 | err = -EINVAL; | ||
181 | if (memcmp(ahp->work_icv, auth_data, ahp->icv_trunc_len)) { | 180 | if (memcmp(ahp->work_icv, auth_data, ahp->icv_trunc_len)) { |
182 | x->stats.integrity_failed++; | 181 | err = -EBADMSG; |
183 | goto out; | 182 | goto out; |
184 | } | 183 | } |
185 | } | 184 | } |