@@ -27,9 +27,7 @@ static void *ah_alloc_tmp(struct crypto_ahash *ahash, int nfrags,
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
@@ -46,10 +44,9 @@ static inline u8 *ah_tmp_auth(void *tmp, unsigned int offset)
46
44
return tmp + offset ;
47
45
}
48
46
49
- static inline u8 * ah_tmp_icv (struct crypto_ahash * ahash , void * tmp ,
50
- unsigned int offset )
47
+ static inline u8 * ah_tmp_icv (void * tmp , unsigned int offset )
51
48
{
52
- return PTR_ALIGN (( u8 * ) tmp + offset , crypto_ahash_alignmask ( ahash ) + 1 ) ;
49
+ return tmp + offset ;
53
50
}
54
51
55
52
static inline struct ahash_request * ah_tmp_req (struct crypto_ahash * ahash ,
@@ -129,7 +126,7 @@ static void ah_output_done(void *data, int err)
129
126
int ihl = ip_hdrlen (skb );
130
127
131
128
iph = AH_SKB_CB (skb )-> tmp ;
132
- icv = ah_tmp_icv (ahp -> ahash , iph , ihl );
129
+ icv = ah_tmp_icv (iph , ihl );
133
130
memcpy (ah -> auth_data , icv , ahp -> icv_trunc_len );
134
131
135
132
top_iph -> tos = iph -> tos ;
@@ -182,7 +179,7 @@ static int ah_output(struct xfrm_state *x, struct sk_buff *skb)
182
179
if (!iph )
183
180
goto out ;
184
181
seqhi = (__be32 * )((char * )iph + ihl );
185
- icv = ah_tmp_icv (ahash , seqhi , seqhi_len );
182
+ icv = ah_tmp_icv (seqhi , seqhi_len );
186
183
req = ah_tmp_req (ahash , icv );
187
184
sg = ah_req_sg (ahash , req );
188
185
seqhisg = sg + nfrags ;
@@ -279,7 +276,7 @@ static void ah_input_done(void *data, int err)
279
276
280
277
work_iph = AH_SKB_CB (skb )-> tmp ;
281
278
auth_data = ah_tmp_auth (work_iph , ihl );
282
- icv = ah_tmp_icv (ahp -> ahash , auth_data , ahp -> icv_trunc_len );
279
+ icv = ah_tmp_icv (auth_data , ahp -> icv_trunc_len );
283
280
284
281
err = crypto_memneq (icv , auth_data , ahp -> icv_trunc_len ) ? - EBADMSG : 0 ;
285
282
if (err )
@@ -374,7 +371,7 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb)
374
371
375
372
seqhi = (__be32 * )((char * )work_iph + ihl );
376
373
auth_data = ah_tmp_auth (seqhi , seqhi_len );
377
- icv = ah_tmp_icv (ahash , auth_data , ahp -> icv_trunc_len );
374
+ icv = ah_tmp_icv (auth_data , ahp -> icv_trunc_len );
378
375
req = ah_tmp_req (ahash , icv );
379
376
sg = ah_req_sg (ahash , req );
380
377
seqhisg = sg + nfrags ;
0 commit comments