@@ -51,9 +51,7 @@ static void *ah_alloc_tmp(struct crypto_ahash *ahash, int nfrags,
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
@@ -75,10 +73,9 @@ static inline u8 *ah_tmp_auth(u8 *tmp, unsigned int offset)
75
73
return tmp + offset ;
76
74
}
77
75
78
- static inline u8 * ah_tmp_icv (struct crypto_ahash * ahash , void * tmp ,
79
- unsigned int offset )
76
+ static inline u8 * ah_tmp_icv (void * tmp , unsigned int offset )
80
77
{
81
- return PTR_ALIGN (( u8 * ) tmp + offset , crypto_ahash_alignmask ( ahash ) + 1 ) ;
78
+ return tmp + offset ;
82
79
}
83
80
84
81
static inline struct ahash_request * ah_tmp_req (struct crypto_ahash * ahash ,
@@ -299,7 +296,7 @@ static void ah6_output_done(void *data, int err)
299
296
300
297
iph_base = AH_SKB_CB (skb )-> tmp ;
301
298
iph_ext = ah_tmp_ext (iph_base );
302
- icv = ah_tmp_icv (ahp -> ahash , iph_ext , extlen );
299
+ icv = ah_tmp_icv (iph_ext , extlen );
303
300
304
301
memcpy (ah -> auth_data , icv , ahp -> icv_trunc_len );
305
302
memcpy (top_iph , iph_base , IPV6HDR_BASELEN );
@@ -362,7 +359,7 @@ static int ah6_output(struct xfrm_state *x, struct sk_buff *skb)
362
359
363
360
iph_ext = ah_tmp_ext (iph_base );
364
361
seqhi = (__be32 * )((char * )iph_ext + extlen );
365
- icv = ah_tmp_icv (ahash , seqhi , seqhi_len );
362
+ icv = ah_tmp_icv (seqhi , seqhi_len );
366
363
req = ah_tmp_req (ahash , icv );
367
364
sg = ah_req_sg (ahash , req );
368
365
seqhisg = sg + nfrags ;
@@ -468,7 +465,7 @@ static void ah6_input_done(void *data, int err)
468
465
469
466
work_iph = AH_SKB_CB (skb )-> tmp ;
470
467
auth_data = ah_tmp_auth (work_iph , hdr_len );
471
- icv = ah_tmp_icv (ahp -> ahash , auth_data , ahp -> icv_trunc_len );
468
+ icv = ah_tmp_icv (auth_data , ahp -> icv_trunc_len );
472
469
473
470
err = crypto_memneq (icv , auth_data , ahp -> icv_trunc_len ) ? - EBADMSG : 0 ;
474
471
if (err )
@@ -576,7 +573,7 @@ static int ah6_input(struct xfrm_state *x, struct sk_buff *skb)
576
573
577
574
auth_data = ah_tmp_auth ((u8 * )work_iph , hdr_len );
578
575
seqhi = (__be32 * )(auth_data + ahp -> icv_trunc_len );
579
- icv = ah_tmp_icv (ahash , seqhi , seqhi_len );
576
+ icv = ah_tmp_icv (seqhi , seqhi_len );
580
577
req = ah_tmp_req (ahash , icv );
581
578
sg = ah_req_sg (ahash , req );
582
579
seqhisg = sg + nfrags ;
0 commit comments