From 6490ecd61521890e8660f014886197c9a185cdf8 Mon Sep 17 00:00:00 2001 From: Tim Kourt Date: Thu, 29 Nov 2018 14:41:44 -0800 Subject: [PATCH] eap-tls-common: Add accessors for variant data and ver --- src/eap-tls-common.c | 19 +++++++++++++++++-- src/eap-tls-common.h | 7 +++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/eap-tls-common.c b/src/eap-tls-common.c index 64993863..2663da96 100644 --- a/src/eap-tls-common.c +++ b/src/eap-tls-common.c @@ -831,6 +831,21 @@ void eap_tls_common_set_phase2_faild(struct eap_state *eap) eap_tls->phase2_failed = true; } +enum eap_tls_version eap_tls_common_get_negotiated_version( + struct eap_state *eap) +{ + struct eap_tls_state *eap_tls = eap_get_data(eap); + + return eap_tls->version_negotiated; +} + +void *eap_tls_common_get_variant_data(struct eap_state *eap) +{ + struct eap_tls_state *eap_tls = eap_get_data(eap); + + return eap_tls->variant_data; +} + bool eap_tls_common_tunnel_prf_get_bytes(struct eap_state *eap, bool use_master_secret, const char *label, uint8_t *buf, @@ -838,6 +853,6 @@ bool eap_tls_common_tunnel_prf_get_bytes(struct eap_state *eap, { struct eap_tls_state *eap_tls = eap_get_data(eap); - return l_tls_prf_get_bytes(eap_tls->tunnel, use_master_secret, label, - buf, buf_len); + return l_tls_prf_get_bytes(eap_tls->tunnel, use_master_secret, + label, buf, buf_len); } diff --git a/src/eap-tls-common.h b/src/eap-tls-common.h index 5eff6013..e192d57c 100644 --- a/src/eap-tls-common.h +++ b/src/eap-tls-common.h @@ -70,8 +70,11 @@ bool eap_tls_common_settings_load(struct eap_state *eap, void *variant_data); void eap_tls_common_send_empty_response(struct eap_state *eap); +enum eap_tls_version eap_tls_common_get_negotiated_version( + struct eap_state *eap); +void *eap_tls_common_get_variant_data(struct eap_state *eap); bool eap_tls_common_tunnel_prf_get_bytes(struct eap_state *eap, bool use_master_secret, - const char *label, uint8_t *buf, - size_t len); + const char *label, + uint8_t *buf, size_t len);