}
else if (c->options.ncp_enabled)
{
+ /* If the server did not push a --cipher, we will switch to the
+ * remote cipher if it is in our ncp-ciphers list */
tls_poor_mans_ncp(&c->options, c->c2.tls_multi->remote_ciphername);
}
struct frame *frame_fragment = NULL;
options->keysize = 0;
}
}
+ else
+ {
+ /* Very hacky workaround and quick fix for frame calculation
+ * different when adjusting frame size when the original and new cipher
+ * are identical to avoid a regression with client without NCP */
+ return tls_session_generate_data_channel_keys(session);
+ }
init_key_type(&session->opt->key_type, options->ciphername,
options->authname, options->keysize, true, true);
* generation is postponed until after the pull/push, so we can process pushed
* cipher directives.
*/
- if (session->opt->server && !(session->opt->ncp_enabled
- && session->opt->mode == MODE_SERVER && ks->key_id <= 0))
+ if (session->opt->server && !(session->opt->mode == MODE_SERVER && ks->key_id <= 0))
{
if (ks->authenticated > KS_AUTH_FALSE)
{
multi->remote_ciphername =
options_string_extract_option(options, "cipher", NULL);
- if (!tls_peer_supports_ncp(multi->peer_info))
- {
- /* Peer does not support NCP, but leave NCP enabled if the local and
- * remote cipher do not match to attempt 'poor-man's NCP'.
- */
- if (multi->remote_ciphername == NULL
- || 0 == strcmp(multi->remote_ciphername, multi->opt.config_ciphername))
- {
- session->opt->ncp_enabled = false;
- }
- }
-
if (tls_session_user_pass_enabled(session))
{
/* Perform username/password authentication */