TLS: Use separate TLS library context for tunneled TLS
OpenSSL wrapper was using the same certificate store for both Phase 1 and Phase 2 TLS exchange in case of EAP-PEAP/TLS, EAP-TTLS/TLS, and EAP-FAST/TLS. This would be fine if the same CA certificates were used in both phases, but does not work properly if different CA certificates are used. Enforce full separation of TLS state between the phases by using a separate TLS library context in EAP peer implementation. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
d755e01b34
commit
9f98810c5d
5 changed files with 46 additions and 24 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* EAP peer method: EAP-TLS (RFC 2716)
|
||||
* Copyright (c) 2004-2008, Jouni Malinen <j@w1.fi>
|
||||
* Copyright (c) 2004-2008, 2012, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
|
@ -21,6 +21,7 @@ static void eap_tls_deinit(struct eap_sm *sm, void *priv);
|
|||
struct eap_tls_data {
|
||||
struct eap_ssl_data ssl;
|
||||
u8 *key_data;
|
||||
void *ssl_ctx;
|
||||
};
|
||||
|
||||
|
||||
|
@ -40,6 +41,9 @@ static void * eap_tls_init(struct eap_sm *sm)
|
|||
if (data == NULL)
|
||||
return NULL;
|
||||
|
||||
data->ssl_ctx = sm->init_phase2 && sm->ssl_ctx2 ? sm->ssl_ctx2 :
|
||||
sm->ssl_ctx;
|
||||
|
||||
if (eap_peer_tls_ssl_init(sm, &data->ssl, config)) {
|
||||
wpa_printf(MSG_INFO, "EAP-TLS: Failed to initialize SSL.");
|
||||
eap_tls_deinit(sm, data);
|
||||
|
@ -165,7 +169,7 @@ static struct wpabuf * eap_tls_process(struct eap_sm *sm, void *priv,
|
|||
return eap_tls_failure(sm, data, ret, res, resp, id);
|
||||
}
|
||||
|
||||
if (tls_connection_established(sm->ssl_ctx, data->ssl.conn))
|
||||
if (tls_connection_established(data->ssl_ctx, data->ssl.conn))
|
||||
eap_tls_success(sm, data, ret);
|
||||
|
||||
if (res == 1) {
|
||||
|
@ -180,7 +184,7 @@ static struct wpabuf * eap_tls_process(struct eap_sm *sm, void *priv,
|
|||
static Boolean eap_tls_has_reauth_data(struct eap_sm *sm, void *priv)
|
||||
{
|
||||
struct eap_tls_data *data = priv;
|
||||
return tls_connection_established(sm->ssl_ctx, data->ssl.conn);
|
||||
return tls_connection_established(data->ssl_ctx, data->ssl.conn);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue