Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: ipv6: stop checking crypto_ahash_alignmask

Now that the alignmask for ahash and shash algorithms is always 0,
crypto_ahash_alignmask() always returns 0 and will be removed. In
preparation for this, stop checking crypto_ahash_alignmask() in ah6.c.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Eric Biggers and committed by
Herbert Xu
0a6bfaa0 e77f5dd7

+7 -10
+7 -10
net/ipv6/ah6.c
··· 51 51 { 52 52 unsigned int len; 53 53 54 - len = size + crypto_ahash_digestsize(ahash) + 55 - (crypto_ahash_alignmask(ahash) & 56 - ~(crypto_tfm_ctx_alignment() - 1)); 54 + len = size + crypto_ahash_digestsize(ahash); 57 55 58 56 len = ALIGN(len, crypto_tfm_ctx_alignment()); 59 57 ··· 73 75 return tmp + offset; 74 76 } 75 77 76 - static inline u8 *ah_tmp_icv(struct crypto_ahash *ahash, void *tmp, 77 - unsigned int offset) 78 + static inline u8 *ah_tmp_icv(void *tmp, unsigned int offset) 78 79 { 79 - return PTR_ALIGN((u8 *)tmp + offset, crypto_ahash_alignmask(ahash) + 1); 80 + return tmp + offset; 80 81 } 81 82 82 83 static inline struct ahash_request *ah_tmp_req(struct crypto_ahash *ahash, ··· 296 299 297 300 iph_base = AH_SKB_CB(skb)->tmp; 298 301 iph_ext = ah_tmp_ext(iph_base); 299 - icv = ah_tmp_icv(ahp->ahash, iph_ext, extlen); 302 + icv = ah_tmp_icv(iph_ext, extlen); 300 303 301 304 memcpy(ah->auth_data, icv, ahp->icv_trunc_len); 302 305 memcpy(top_iph, iph_base, IPV6HDR_BASELEN); ··· 359 362 360 363 iph_ext = ah_tmp_ext(iph_base); 361 364 seqhi = (__be32 *)((char *)iph_ext + extlen); 362 - icv = ah_tmp_icv(ahash, seqhi, seqhi_len); 365 + icv = ah_tmp_icv(seqhi, seqhi_len); 363 366 req = ah_tmp_req(ahash, icv); 364 367 sg = ah_req_sg(ahash, req); 365 368 seqhisg = sg + nfrags; ··· 465 468 466 469 work_iph = AH_SKB_CB(skb)->tmp; 467 470 auth_data = ah_tmp_auth(work_iph, hdr_len); 468 - icv = ah_tmp_icv(ahp->ahash, auth_data, ahp->icv_trunc_len); 471 + icv = ah_tmp_icv(auth_data, ahp->icv_trunc_len); 469 472 470 473 err = crypto_memneq(icv, auth_data, ahp->icv_trunc_len) ? -EBADMSG : 0; 471 474 if (err) ··· 573 576 574 577 auth_data = ah_tmp_auth((u8 *)work_iph, hdr_len); 575 578 seqhi = (__be32 *)(auth_data + ahp->icv_trunc_len); 576 - icv = ah_tmp_icv(ahash, seqhi, seqhi_len); 579 + icv = ah_tmp_icv(seqhi, seqhi_len); 577 580 req = ah_tmp_req(ahash, icv); 578 581 sg = ah_req_sg(ahash, req); 579 582 seqhisg = sg + nfrags;