Previous this function would return garbage during handshake, because
parameters were not considered established, however there are valid
uses of this function during it. For that reason this function is
modified to return a correct value even during handshake (after
a hello is being exchanged).
**/
gnutls_kx_algorithm_t gnutls_kx_get(gnutls_session_t session)
{
- return session->security_parameters.kx_algorithm;
+ if (session->internals.handshake_in_progress) {
+ /* This allows early call during handshake */
+ return _gnutls_cipher_suite_get_kx_algo(session->security_parameters.cipher_suite);
+ } else {
+ return session->security_parameters.kx_algorithm;
+ }
}
/**