Lines Matching defs:ahp
227 struct ah_data *ahp;
280 ahp = x->data;
282 ahp->icv_trunc_len) >> 2) - 2;
288 err = ah_mac_digest(ahp, skb, ah->auth_data);
291 memcpy(ah->auth_data, ahp->work_icv, ahp->icv_trunc_len);
329 struct ah_data *ahp;
347 ahp = x->data;
351 if (ah_hlen != XFRM_ALIGN8(sizeof(struct ipv6_auth_hdr) + ahp->icv_full_len) &&
352 ah_hlen != XFRM_ALIGN8(sizeof(struct ipv6_auth_hdr) + ahp->icv_trunc_len))
373 memcpy(auth_data, ah->auth_data, ahp->icv_trunc_len);
374 memset(ah->auth_data, 0, ahp->icv_trunc_len);
376 err = ah_mac_digest(ahp, skb, ah->auth_data);
380 if (memcmp(ahp->work_icv, auth_data, ahp->icv_trunc_len)) {
425 struct ah_data *ahp = NULL;
439 ahp = kzalloc(sizeof(*ahp), GFP_KERNEL);
440 if (ahp == NULL)
443 ahp->key = x->aalg->alg_key;
444 ahp->key_len = (x->aalg->alg_key_len+7)/8;
449 ahp->tfm = tfm;
450 if (crypto_hash_setkey(tfm, ahp->key, ahp->key_len))
470 ahp->icv_full_len = aalg_desc->uinfo.auth.icv_fullbits/8;
471 ahp->icv_trunc_len = aalg_desc->uinfo.auth.icv_truncbits/8;
473 BUG_ON(ahp->icv_trunc_len > MAX_AH_AUTH_LEN);
475 ahp->work_icv = kmalloc(ahp->icv_full_len, GFP_KERNEL);
476 if (!ahp->work_icv)
479 x->props.header_len = XFRM_ALIGN8(sizeof(struct ipv6_auth_hdr) + ahp->icv_trunc_len);
482 x->data = ahp;
487 if (ahp) {
488 kfree(ahp->work_icv);
489 crypto_free_hash(ahp->tfm);
490 kfree(ahp);
497 struct ah_data *ahp = x->data;
499 if (!ahp)
502 kfree(ahp->work_icv);
503 ahp->work_icv = NULL;
504 crypto_free_hash(ahp->tfm);
505 ahp->tfm = NULL;
506 kfree(ahp);