}
const bool nonecipher = (strcmp(token, "none") == 0);
+ const char *optstr = optional ? "optional " : "";
if (nonecipher)
{
}
if (!nonecipher && !cipher_valid(token))
{
- const char *optstr = optional ? "optional " : "";
msg(M_WARN, "Unsupported %scipher in --data-ciphers: %s", optstr, token);
error_found = error_found || !optional;
}
+ else if (!nonecipher && !cipher_kt_mode_aead(token)
+ && !cipher_kt_mode_cbc(token)
+ && !cipher_kt_mode_ofb_cfb(token))
+ {
+ msg(M_WARN, "Unsupported %scipher algorithm '%s'. It does not use "
+ "CFB, OFB, CBC, or a supported AEAD mode", optstr, token);
+ error_found = error_found || !optional;
+ }
else
{
const char *ovpn_cipher_name = cipher_kt_name(token);
/* If the last is optional, previous invalid ciphers should be ignored */
assert_ptr_equal(mutate_ncp_cipher_list("Vollbit:Littlebit:AES-256-CBC:BF-CBC:?nixbit", &gc), NULL);
+ /* We do not support CCM ciphers */
+ assert_ptr_equal(mutate_ncp_cipher_list("AES-256-GCM:AES-128-CCM", &gc), NULL);
+
+ assert_string_equal(mutate_ncp_cipher_list("AES-256-GCM:?AES-128-CCM:AES-128-GCM", &gc),
+ aes_ciphers);
+
/* For testing that with OpenSSL 1.1.0+ that also accepts ciphers in
* a different spelling the normalised cipher output is the same */
bool have_chacha_mixed_case = cipher_valid("ChaCha20-Poly1305");