Disable TLS Session Ticket extension by default for EAP-TLS/PEAP/TTLS
Some deployed authentication servers seem to be unable to handle the TLS Session Ticket extension (they are supposed to ignore unrecognized TLS extensions, but end up rejecting the ClientHello instead). As a workaround, disable use of TLS Sesson Ticket extension for EAP-TLS, EAP-PEAP, and EAP-TTLS (EAP-FAST uses session ticket, so any server that supports EAP-FAST does not need this workaround). Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
f210493b6e
commit
c22075e144
6 changed files with 25 additions and 6 deletions
|
@ -169,7 +169,7 @@ static void * eap_fast_init(struct eap_sm *sm)
|
|||
data->phase2_type.vendor = EAP_VENDOR_IETF;
|
||||
data->phase2_type.method = EAP_TYPE_NONE;
|
||||
|
||||
if (eap_peer_tls_ssl_init(sm, &data->ssl, config)) {
|
||||
if (eap_peer_tls_ssl_init(sm, &data->ssl, config, EAP_TYPE_FAST)) {
|
||||
wpa_printf(MSG_INFO, "EAP-FAST: Failed to initialize SSL.");
|
||||
eap_fast_deinit(sm, data);
|
||||
return NULL;
|
||||
|
|
|
@ -159,7 +159,7 @@ static void * eap_peap_init(struct eap_sm *sm)
|
|||
data->phase2_type.vendor = EAP_VENDOR_IETF;
|
||||
data->phase2_type.method = EAP_TYPE_NONE;
|
||||
|
||||
if (eap_peer_tls_ssl_init(sm, &data->ssl, config)) {
|
||||
if (eap_peer_tls_ssl_init(sm, &data->ssl, config, EAP_TYPE_PEAP)) {
|
||||
wpa_printf(MSG_INFO, "EAP-PEAP: Failed to initialize SSL.");
|
||||
eap_peap_deinit(sm, data);
|
||||
return NULL;
|
||||
|
|
|
@ -44,7 +44,7 @@ static void * eap_tls_init(struct eap_sm *sm)
|
|||
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)) {
|
||||
if (eap_peer_tls_ssl_init(sm, &data->ssl, config, EAP_TYPE_TLS)) {
|
||||
wpa_printf(MSG_INFO, "EAP-TLS: Failed to initialize SSL.");
|
||||
eap_tls_deinit(sm, data);
|
||||
if (config->engine) {
|
||||
|
|
|
@ -103,6 +103,18 @@ static int eap_tls_params_from_conf(struct eap_sm *sm,
|
|||
struct eap_peer_config *config, int phase2)
|
||||
{
|
||||
os_memset(params, 0, sizeof(*params));
|
||||
if (sm->workaround && data->eap_type != EAP_TYPE_FAST) {
|
||||
/*
|
||||
* Some deployed authentication servers seem to be unable to
|
||||
* handle the TLS Session Ticket extension (they are supposed
|
||||
* to ignore unrecognized TLS extensions, but end up rejecting
|
||||
* the ClientHello instead). As a workaround, disable use of
|
||||
* TLS Sesson Ticket extension for EAP-TLS, EAP-PEAP, and
|
||||
* EAP-TTLS (EAP-FAST uses session ticket, so any server that
|
||||
* supports EAP-FAST does not need this workaround).
|
||||
*/
|
||||
params->flags |= TLS_CONN_DISABLE_SESSION_TICKET;
|
||||
}
|
||||
if (phase2) {
|
||||
wpa_printf(MSG_DEBUG, "TLS: using phase2 config options");
|
||||
eap_tls_params_from_conf2(params, config);
|
||||
|
@ -186,13 +198,14 @@ static int eap_tls_init_connection(struct eap_sm *sm,
|
|||
* @sm: Pointer to EAP state machine allocated with eap_peer_sm_init()
|
||||
* @data: Data for TLS processing
|
||||
* @config: Pointer to the network configuration
|
||||
* @eap_type: EAP method used in Phase 1 (EAP_TYPE_TLS/PEAP/TTLS/FAST)
|
||||
* Returns: 0 on success, -1 on failure
|
||||
*
|
||||
* This function is used to initialize shared TLS functionality for EAP-TLS,
|
||||
* EAP-PEAP, EAP-TTLS, and EAP-FAST.
|
||||
*/
|
||||
int eap_peer_tls_ssl_init(struct eap_sm *sm, struct eap_ssl_data *data,
|
||||
struct eap_peer_config *config)
|
||||
struct eap_peer_config *config, u8 eap_type)
|
||||
{
|
||||
struct tls_connection_params params;
|
||||
|
||||
|
@ -200,6 +213,7 @@ int eap_peer_tls_ssl_init(struct eap_sm *sm, struct eap_ssl_data *data,
|
|||
return -1;
|
||||
|
||||
data->eap = sm;
|
||||
data->eap_type = eap_type;
|
||||
data->phase2 = sm->init_phase2;
|
||||
data->ssl_ctx = sm->init_phase2 && sm->ssl_ctx2 ? sm->ssl_ctx2 :
|
||||
sm->ssl_ctx;
|
||||
|
|
|
@ -68,6 +68,11 @@ struct eap_ssl_data {
|
|||
* ssl_ctx - TLS library context to use for the connection
|
||||
*/
|
||||
void *ssl_ctx;
|
||||
|
||||
/**
|
||||
* eap_type - EAP method used in Phase 1 (EAP_TYPE_TLS/PEAP/TTLS/FAST)
|
||||
*/
|
||||
u8 eap_type;
|
||||
};
|
||||
|
||||
|
||||
|
@ -82,7 +87,7 @@ struct eap_ssl_data {
|
|||
|
||||
|
||||
int eap_peer_tls_ssl_init(struct eap_sm *sm, struct eap_ssl_data *data,
|
||||
struct eap_peer_config *config);
|
||||
struct eap_peer_config *config, u8 eap_type);
|
||||
void eap_peer_tls_ssl_deinit(struct eap_sm *sm, struct eap_ssl_data *data);
|
||||
u8 * eap_peer_tls_derive_key(struct eap_sm *sm, struct eap_ssl_data *data,
|
||||
const char *label, size_t len);
|
||||
|
|
|
@ -110,7 +110,7 @@ static void * eap_ttls_init(struct eap_sm *sm)
|
|||
data->phase2_eap_type.method = EAP_TYPE_NONE;
|
||||
}
|
||||
|
||||
if (eap_peer_tls_ssl_init(sm, &data->ssl, config)) {
|
||||
if (eap_peer_tls_ssl_init(sm, &data->ssl, config, EAP_TYPE_TTLS)) {
|
||||
wpa_printf(MSG_INFO, "EAP-TTLS: Failed to initialize SSL.");
|
||||
eap_ttls_deinit(sm, data);
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in a new issue