Basically calls to cipher_kt_get were calling
translate_cipher_name_from_openvpn. The only two exception were the
(broken) unit test and tls-crypt that uses cipher_kt_get("AES-256-CTR")
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Steffan Karger <steffan@karger.me>
Message-Id: <
20200605112519.22714-2-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg19969.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
CLEAR(*kt);
if (strcmp(ciphername, "none") != 0)
{
- kt->cipher = cipher_kt_get(translate_cipher_name_from_openvpn(ciphername));
+ kt->cipher = cipher_kt_get(ciphername);
if (!kt->cipher)
{
msg(M_FATAL, "Cipher %s not supported", ciphername);
* initialise encryption/decryption.
*
* @param ciphername Name of the cipher to retrieve parameters for (e.g.
- * \c AES-128-CBC).
+ * \c AES-128-CBC). Will be translated to the library name
+ * from the openvpn config name if needed.
*
* @return A statically allocated structure containing parameters
* for the given cipher, or NULL if no matching parameters
ASSERT(ciphername);
+ ciphername = translate_cipher_name_from_openvpn(ciphername);
cipher = mbedtls_cipher_info_from_string(ciphername);
if (NULL == cipher)
ASSERT(ciphername);
+ ciphername = translate_cipher_name_from_openvpn(ciphername);
cipher = EVP_get_cipherbyname(ciphername);
if (NULL == cipher)
while (token)
{
/*
- * Going through a roundtrip by using translate_cipher_name_from_openvpn
- * and translate_cipher_name_to_openvpn also normalises the cipher name,
+ * Going through a roundtrip by using cipher_kt_get/cipher_kt_name
+ * (and translate_cipher_name_from_openvpn/
+ * translate_cipher_name_to_openvpn) also normalises the cipher name,
* e.g. replacing AeS-128-gCm with AES-128-GCM
*/
- const char *cipher_name = translate_cipher_name_from_openvpn(token);
- const cipher_kt_t *ktc = cipher_kt_get(cipher_name);
+ const cipher_kt_t *ktc = cipher_kt_get(token);
if (!ktc)
{
msg(M_WARN, "Unsupported cipher in --ncp-ciphers: %s", token);