Lines Matching refs:cb

618 	struct teap_tlv_crypto_binding *cb;  in eap_teap_build_crypto_binding()  local
621 buf = wpabuf_alloc(2 * sizeof(*result) + sizeof(*cb)); in eap_teap_build_crypto_binding()
656 cb = wpabuf_put(buf, sizeof(*cb)); in eap_teap_build_crypto_binding()
657 cb->tlv_type = host_to_be16(TEAP_TLV_MANDATORY | in eap_teap_build_crypto_binding()
659 cb->length = host_to_be16(sizeof(*cb) - sizeof(struct teap_tlv_hdr)); in eap_teap_build_crypto_binding()
660 cb->version = EAP_TEAP_VERSION; in eap_teap_build_crypto_binding()
661 cb->received_version = data->peer_version; in eap_teap_build_crypto_binding()
668 cb->subtype = (flags << 4) | subtype; in eap_teap_build_crypto_binding()
669 if (random_get_bytes(cb->nonce, sizeof(cb->nonce)) < 0) { in eap_teap_build_crypto_binding()
678 cb->nonce[sizeof(cb->nonce) - 1] &= ~0x01; in eap_teap_build_crypto_binding()
680 os_memcpy(data->crypto_binding_nonce, cb->nonce, sizeof(cb->nonce)); in eap_teap_build_crypto_binding()
682 if (eap_teap_compound_mac(data->tls_cs, cb, data->server_outer_tlvs, in eap_teap_build_crypto_binding()
684 cb->msk_compound_mac) < 0) { in eap_teap_build_crypto_binding()
690 eap_teap_compound_mac(data->tls_cs, cb, data->server_outer_tlvs, in eap_teap_build_crypto_binding()
692 cb->emsk_compound_mac) < 0) { in eap_teap_build_crypto_binding()
699 cb->version, cb->received_version, flags, subtype); in eap_teap_build_crypto_binding()
701 cb->nonce, sizeof(cb->nonce)); in eap_teap_build_crypto_binding()
703 cb->emsk_compound_mac, sizeof(cb->emsk_compound_mac)); in eap_teap_build_crypto_binding()
705 cb->msk_compound_mac, sizeof(cb->msk_compound_mac)); in eap_teap_build_crypto_binding()
1383 struct eap_teap_data *data, const struct teap_tlv_crypto_binding *cb, in eap_teap_validate_crypto_binding() argument
1388 subtype = cb->subtype & 0x0f; in eap_teap_validate_crypto_binding()
1389 flags = cb->subtype >> 4; in eap_teap_validate_crypto_binding()
1393 cb->version, cb->received_version, flags, subtype); in eap_teap_validate_crypto_binding()
1395 cb->nonce, sizeof(cb->nonce)); in eap_teap_validate_crypto_binding()
1397 cb->emsk_compound_mac, sizeof(cb->emsk_compound_mac)); in eap_teap_validate_crypto_binding()
1399 cb->msk_compound_mac, sizeof(cb->msk_compound_mac)); in eap_teap_validate_crypto_binding()
1401 if (cb->version != EAP_TEAP_VERSION || in eap_teap_validate_crypto_binding()
1402 cb->received_version != data->peer_version) { in eap_teap_validate_crypto_binding()
1405 cb->version, cb->received_version); in eap_teap_validate_crypto_binding()
1423 if (os_memcmp_const(data->crypto_binding_nonce, cb->nonce, in eap_teap_validate_crypto_binding()
1426 cb->nonce[EAP_TEAP_NONCE_LEN - 1]) { in eap_teap_validate_crypto_binding()
1436 if (eap_teap_compound_mac(data->tls_cs, cb, in eap_teap_validate_crypto_binding()
1441 if (os_memcmp_const(msk_compound_mac, cb->msk_compound_mac, in eap_teap_validate_crypto_binding()
1458 if (eap_teap_compound_mac(data->tls_cs, cb, in eap_teap_validate_crypto_binding()
1463 if (os_memcmp_const(emsk_compound_mac, cb->emsk_compound_mac, in eap_teap_validate_crypto_binding()