Instead maintaining two different representation of the data channel
options in struct options and struct tls_options, use the same
flags variable that tls_options uses.
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Antonio Quartulli <antonio@openvpn.net>
Message-Id: <
20210408140229.31824-2-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22084.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
}
#ifdef HAVE_EXPORT_KEYING_MATERIAL
- o->data_channel_use_ekm = (proto & IV_PROTO_TLS_KEY_EXPORT);
+ if (proto & IV_PROTO_TLS_KEY_EXPORT)
+ {
+ o->data_channel_crypto_flags |= CO_USE_TLS_KEY_MATERIAL_EXPORT;
+ }
#endif
/* Select cipher if client supports Negotiable Crypto Parameters */
o->push_continuation = 0;
o->push_option_types_found = 0;
- o->data_channel_use_ekm = false;
+ o->data_channel_crypto_flags = 0;
}
/**
#ifdef HAVE_EXPORT_KEYING_MATERIAL
if (streq(p[1], "tls-ekm"))
{
- options->data_channel_use_ekm = true;
+ options->data_channel_crypto_flags |= CO_USE_TLS_KEY_MATERIAL_EXPORT;
}
else
#endif
* to the routing tables that would move packets into the tunnel. */
bool allow_recursive_routing;
- /* Use RFC5705 key export to generate data channel keys */
- bool data_channel_use_ekm;
+ /* data channel crypto flags set by push/pull. Reuses the CO_* crypto_flags */
+ unsigned int data_channel_crypto_flags;
};
#define streq(x, y) (!strcmp((x), (y)))
{
push_option_fmt(gc, push_list, M_USAGE, "cipher %s", o->ciphername);
}
- if (o->data_channel_use_ekm)
+ if (o->data_channel_crypto_flags & CO_USE_TLS_KEY_MATERIAL_EXPORT)
{
push_option_fmt(gc, push_list, M_USAGE, "key-derivation tls-ekm");
}
return false;
}
- if (options->data_channel_use_ekm)
- {
- session->opt->crypto_flags |= CO_USE_TLS_KEY_MATERIAL_EXPORT;
- }
+ /* Import crypto settings that might be set by pull/push */
+ session->opt->crypto_flags |= options->data_channel_crypto_flags;
if (strcmp(options->ciphername, session->opt->config_ciphername))
{