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: ipv4: 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 ah4.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
e77f5dd7 93f367a9

+7 -10
+7 -10
net/ipv4/ah4.c
··· 27 27 { 28 28 unsigned int len; 29 29 30 - len = size + crypto_ahash_digestsize(ahash) + 31 - (crypto_ahash_alignmask(ahash) & 32 - ~(crypto_tfm_ctx_alignment() - 1)); 30 + len = size + crypto_ahash_digestsize(ahash); 33 31 34 32 len = ALIGN(len, crypto_tfm_ctx_alignment()); 35 33 ··· 44 46 return tmp + offset; 45 47 } 46 48 47 - static inline u8 *ah_tmp_icv(struct crypto_ahash *ahash, void *tmp, 48 - unsigned int offset) 49 + static inline u8 *ah_tmp_icv(void *tmp, unsigned int offset) 49 50 { 50 - return PTR_ALIGN((u8 *)tmp + offset, crypto_ahash_alignmask(ahash) + 1); 51 + return tmp + offset; 51 52 } 52 53 53 54 static inline struct ahash_request *ah_tmp_req(struct crypto_ahash *ahash, ··· 126 129 int ihl = ip_hdrlen(skb); 127 130 128 131 iph = AH_SKB_CB(skb)->tmp; 129 - icv = ah_tmp_icv(ahp->ahash, iph, ihl); 132 + icv = ah_tmp_icv(iph, ihl); 130 133 memcpy(ah->auth_data, icv, ahp->icv_trunc_len); 131 134 132 135 top_iph->tos = iph->tos; ··· 179 182 if (!iph) 180 183 goto out; 181 184 seqhi = (__be32 *)((char *)iph + ihl); 182 - icv = ah_tmp_icv(ahash, seqhi, seqhi_len); 185 + icv = ah_tmp_icv(seqhi, seqhi_len); 183 186 req = ah_tmp_req(ahash, icv); 184 187 sg = ah_req_sg(ahash, req); 185 188 seqhisg = sg + nfrags; ··· 276 279 277 280 work_iph = AH_SKB_CB(skb)->tmp; 278 281 auth_data = ah_tmp_auth(work_iph, ihl); 279 - icv = ah_tmp_icv(ahp->ahash, auth_data, ahp->icv_trunc_len); 282 + icv = ah_tmp_icv(auth_data, ahp->icv_trunc_len); 280 283 281 284 err = crypto_memneq(icv, auth_data, ahp->icv_trunc_len) ? -EBADMSG : 0; 282 285 if (err) ··· 371 374 372 375 seqhi = (__be32 *)((char *)work_iph + ihl); 373 376 auth_data = ah_tmp_auth(seqhi, seqhi_len); 374 - icv = ah_tmp_icv(ahash, auth_data, ahp->icv_trunc_len); 377 + icv = ah_tmp_icv(auth_data, ahp->icv_trunc_len); 375 378 req = ah_tmp_req(ahash, icv); 376 379 sg = ah_req_sg(ahash, req); 377 380 seqhisg = sg + nfrags;