Lines Matching refs:cb
622 struct teap_tlv_crypto_binding *cb; in eap_teap_build_crypto_binding() local
625 buf = wpabuf_alloc(2 * sizeof(*result) + sizeof(*cb)); in eap_teap_build_crypto_binding()
660 cb = wpabuf_put(buf, sizeof(*cb)); in eap_teap_build_crypto_binding()
661 cb->tlv_type = host_to_be16(TEAP_TLV_MANDATORY | in eap_teap_build_crypto_binding()
663 cb->length = host_to_be16(sizeof(*cb) - sizeof(struct teap_tlv_hdr)); in eap_teap_build_crypto_binding()
664 cb->version = EAP_TEAP_VERSION; in eap_teap_build_crypto_binding()
665 cb->received_version = data->peer_version; in eap_teap_build_crypto_binding()
672 cb->subtype = (flags << 4) | subtype; in eap_teap_build_crypto_binding()
673 if (random_get_bytes(cb->nonce, sizeof(cb->nonce)) < 0) { in eap_teap_build_crypto_binding()
682 cb->nonce[sizeof(cb->nonce) - 1] &= ~0x01; in eap_teap_build_crypto_binding()
684 os_memcpy(data->crypto_binding_nonce, cb->nonce, sizeof(cb->nonce)); in eap_teap_build_crypto_binding()
686 if (eap_teap_compound_mac(data->tls_cs, cb, data->server_outer_tlvs, in eap_teap_build_crypto_binding()
688 cb->msk_compound_mac) < 0) { in eap_teap_build_crypto_binding()
694 eap_teap_compound_mac(data->tls_cs, cb, data->server_outer_tlvs, in eap_teap_build_crypto_binding()
696 cb->emsk_compound_mac) < 0) { in eap_teap_build_crypto_binding()
703 cb->version, cb->received_version, flags, subtype); in eap_teap_build_crypto_binding()
705 cb->nonce, sizeof(cb->nonce)); in eap_teap_build_crypto_binding()
707 cb->emsk_compound_mac, sizeof(cb->emsk_compound_mac)); in eap_teap_build_crypto_binding()
709 cb->msk_compound_mac, sizeof(cb->msk_compound_mac)); in eap_teap_build_crypto_binding()
1413 struct eap_teap_data *data, const struct teap_tlv_crypto_binding *cb, in eap_teap_validate_crypto_binding() argument
1418 subtype = cb->subtype & 0x0f; in eap_teap_validate_crypto_binding()
1419 flags = cb->subtype >> 4; in eap_teap_validate_crypto_binding()
1423 cb->version, cb->received_version, flags, subtype); in eap_teap_validate_crypto_binding()
1425 cb->nonce, sizeof(cb->nonce)); in eap_teap_validate_crypto_binding()
1427 cb->emsk_compound_mac, sizeof(cb->emsk_compound_mac)); in eap_teap_validate_crypto_binding()
1429 cb->msk_compound_mac, sizeof(cb->msk_compound_mac)); in eap_teap_validate_crypto_binding()
1431 if (cb->version != EAP_TEAP_VERSION || in eap_teap_validate_crypto_binding()
1432 cb->received_version != data->peer_version) { in eap_teap_validate_crypto_binding()
1435 cb->version, cb->received_version); in eap_teap_validate_crypto_binding()
1453 if (os_memcmp_const(data->crypto_binding_nonce, cb->nonce, in eap_teap_validate_crypto_binding()
1456 cb->nonce[EAP_TEAP_NONCE_LEN - 1]) { in eap_teap_validate_crypto_binding()
1466 if (eap_teap_compound_mac(data->tls_cs, cb, in eap_teap_validate_crypto_binding()
1471 if (os_memcmp_const(msk_compound_mac, cb->msk_compound_mac, in eap_teap_validate_crypto_binding()
1488 if (eap_teap_compound_mac(data->tls_cs, cb, in eap_teap_validate_crypto_binding()
1493 if (os_memcmp_const(emsk_compound_mac, cb->emsk_compound_mac, in eap_teap_validate_crypto_binding()