Lines Matching refs:hash
146 * HDR*, HASH(1), SA, Ni [, KE ] [, IDi2, IDr2 ]
154 vchar_t *hash = NULL;
277 /* generate HASH(1) */
278 hash = oakley_compute_hash1(iph2->ph1, iph2->msgid, body);
279 if (hash == NULL)
283 iph2->sendbuf = quick_ir1mx(iph2, body, hash);
300 if (hash != NULL)
301 vfree(hash);
308 * HDR*, HASH(2), SA, Nr [, KE ] [, IDi2, IDr2 ]
316 vchar_t *hbuf = NULL; /* for hash computing. */
320 struct isakmp_pl_hash *hash = NULL;
343 /* create buffer for validating HASH(2) */
346 * 1. the first one must be HASH
355 /* HASH payload is fixed postion */
363 hash = (struct isakmp_pl_hash *)pa->ptr;
371 /* HASH payload is fixed postion */
379 /* allocate buffer for computing HASH(2) */
385 "failed to get hash buffer.\n");
392 * copy non-HASH payloads into hbuf, so that we can validate HASH.
396 tlen = 0; /* count payload length except of HASH payload. */
399 /* copy to buffer for HASH */
478 if (hash == NULL || iph2->sa_ret == NULL || iph2->nonce_p == NULL) {
484 /* Fixed buffer for calculating HASH */
487 "HASH allocated:hbuf->l=%zu actual:tlen=%zu\n",
489 /* adjust buffer length for HASH */
492 /* validate HASH(2) */
498 r_hash = (char *)hash + sizeof(*hash);
500 plog(LLV_DEBUG, LOCATION, NULL, "HASH(2) received:");
501 plogdump(LLV_DEBUG, r_hash, ntohs(hash->h.len) - sizeof(*hash));
512 "HASH(2) mismatch.\n");
550 * HDR*, HASH(3)
559 vchar_t *hash = NULL;
571 /* generate HASH(3) */
575 plog(LLV_DEBUG, LOCATION, NULL, "HASH(3) generate\n");
580 "failed to get hash buffer.\n");
586 hash = oakley_compute_hash3(iph2->ph1, iph2->msgid, tmp);
589 if (hash == NULL)
595 + sizeof(struct isakmp_gen) + hash->l;
608 /* add HASH(3) payload */
609 p = set_isakmp_payload(p, hash, ISAKMP_NPTYPE_NONE);
681 if (hash != NULL)
682 hash);
689 * HDR#*, HASH(4), notify
699 struct isakmp_pl_hash *hash = NULL;
731 hash = (struct isakmp_pl_hash *)pa->ptr;
759 if (hash == NULL) {
765 /* validate HASH(4) */
772 r_hash = (char *)hash + sizeof(*hash);
774 plog(LLV_DEBUG, LOCATION, NULL, "HASH(4) validate:");
775 plogdump(LLV_DEBUG, r_hash, ntohs(hash->h.len) - sizeof(*hash));
787 "HASH(4) mismatch.\n");
832 * HDR*, HASH(1), SA, Ni [, KE ] [, IDi2, IDr2 ]
840 vchar_t *hbuf = NULL; /* for hash computing. */
844 struct isakmp_pl_hash *hash = NULL;
869 /* create buffer for using to validate HASH(1) */
872 * 1. the first one must be HASH
881 /* HASH payload is fixed postion */
890 hash = (struct isakmp_pl_hash *)pa->ptr;
898 /* HASH payload is fixed postion */
907 /* allocate buffer for computing HASH(1) */
912 "failed to get hash buffer.\n");
919 * copy non-HASH payloads into hbuf, so that we can validate HASH.
926 tlen = 0; /* count payload length except of HASH payload. */
937 /* copy to buffer for HASH */
1021 if (hash == NULL || iph2->sa == NULL || iph2->nonce_p == NULL) {
1037 /* adjust buffer length for HASH */
1040 /* validate HASH(1) */
1046 r_hash = (caddr_t)hash + sizeof(*hash);
1048 plog(LLV_DEBUG, LOCATION, NULL, "HASH(1) validate:");
1049 plogdump(LLV_DEBUG, r_hash, ntohs(hash->h.len) - sizeof(*hash));
1060 "HASH(1) mismatch.\n");
1180 * HDR*, HASH(2), SA, Nr [, KE ] [, IDi2, IDr2 ]
1188 vchar_t *hash = NULL;
1328 /* generate HASH(2) */
1335 "failed to get hash buffer.\n");
1341 hash = oakley_compute_hash1(iph2->ph1, iph2->msgid, tmp);
1344 if (hash == NULL)
1349 iph2->sendbuf = quick_ir1mx(iph2, body, hash);
1373 if (hash != NULL)
1374 vfree(hash);
1381 * HDR*, HASH(3)
1391 struct isakmp_pl_hash *hash = NULL;
1422 hash = (struct isakmp_pl_hash *)pa->ptr;
1438 if (hash == NULL) {
1444 /* validate HASH(3) */
1445 /* HASH(3) = prf(SKEYID_a, 0 | M-ID | Ni_b | Nr_b) */
1452 r_hash = (char *)hash + sizeof(*hash);
1454 plog(LLV_DEBUG, LOCATION, NULL, "HASH(3) validate:");
1455 plogdump(LLV_DEBUG, r_hash, ntohs(hash->h.len) - sizeof(*hash));
1460 "failed to get hash buffer.\n");
1476 "HASH(3) mismatch.\n");
1501 * HDR#*, HASH(4), notify
1523 /* generate HASH(4) */
1525 plog(LLV_DEBUG, LOCATION, NULL, "HASH(4) generate\n");
1564 /* add HASH(4) payload */
1733 * create HASH, body (SA, NONCE) payload with isakmp header.
1736 quick_ir1mx(iph2, body, hash)
1738 vchar_t *body, *hash;
1749 + sizeof(*gen) + hash->l
1766 /* add HASH payload */
1768 p = set_isakmp_payload(p, hash, ISAKMP_NPTYPE_SA);