forked from espressif/esp-idf
EAP-TTLS: Key derivation per draft-ietf-emu-tls-eap-types-00
Use the TLS-Exporter with the label and context as defined in draft-ietf-emu-tls-eap-types-00 when deriving keys for EAP-TTLS with TLS 1.3. Signed-off-by: Alexander Clouter <alex@digriz.org.uk>
This commit is contained in:
committed by
Sarvesh Bodakhe
parent
0d90484018
commit
42e37285e5
@@ -217,11 +217,24 @@ static int eap_ttls_avp_encapsulate(struct wpabuf **resp, u32 avp_code,
|
||||
static int eap_ttls_v0_derive_key(struct eap_sm *sm,
|
||||
struct eap_ttls_data *data)
|
||||
{
|
||||
const char *label;
|
||||
const u8 eap_tls13_context[1] = { EAP_TYPE_TTLS };
|
||||
const u8 *context = NULL;
|
||||
size_t context_len = 0;
|
||||
|
||||
if (data->ssl.tls_v13) {
|
||||
label = "EXPORTER_EAP_TLS_Key_Material";
|
||||
context = eap_tls13_context;
|
||||
context_len = sizeof(eap_tls13_context);
|
||||
} else {
|
||||
label = "ttls keying material";
|
||||
}
|
||||
|
||||
eap_ttls_free_key(data);
|
||||
data->key_data = eap_peer_tls_derive_key(sm, &data->ssl,
|
||||
"ttls keying material",
|
||||
NULL, 0,
|
||||
EAP_TLS_KEY_LEN);
|
||||
data->key_data = eap_peer_tls_derive_key(sm, &data->ssl, label,
|
||||
context, context_len,
|
||||
EAP_TLS_KEY_LEN +
|
||||
EAP_EMSK_LEN);
|
||||
if (!data->key_data) {
|
||||
wpa_printf(MSG_ERROR, "EAP-TTLS: Failed to derive key");
|
||||
return -1;
|
||||
|
Reference in New Issue
Block a user