*/
tls_named_group_t requested_curve;
+ /**
+ * Original cipher suite in HelloRetryRequest
+ */
+ tls_cipher_suite_t original_suite;
+
/**
* Cookie extension received in HelloRetryRequest
*/
this->alert->add(this->alert, TLS_FATAL, TLS_HANDSHAKE_FAILURE);
return NEED_MORE;
}
+ if (this->original_suite && this->original_suite != suite)
+ {
+ DBG1(DBG_TLS, "server selected %N instead of %N after retry",
+ tls_cipher_suite_names, suite, tls_cipher_suite_names,
+ this->original_suite);
+ this->alert->add(this->alert, TLS_FATAL, TLS_ILLEGAL_PARAMETER);
+ return NEED_MORE;
+ }
DBG1(DBG_TLS, "negotiated %N using suite %N",
tls_version_names, version, tls_cipher_suite_names, suite);
free(this->session.ptr);
DESTROY_IF(this->dh);
this->dh = NULL;
+ this->original_suite = suite;
this->requested_curve = key_type;
this->cookie = chunk_clone(cookie);
this->state = STATE_INIT;