Skip to content

Commit

Permalink
Spell none cipher with lowercase
Browse files Browse the repository at this point in the history
OpenVPN uses a idiosyncrasy that all ciphers are uppercase but none is
spelt lowercase and excepts this idiosyncrasy also in IV_CIPHERS

Signed-off-by: Arne Schwabe <arne@openvpn.net>
  • Loading branch information
schwabe authored and Jenkins-dev committed May 8, 2024
1 parent e34094e commit 2780eb9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion openvpn/crypto/cryptoalgs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class Alg

inline std::array<Alg, Type::SIZE> algs = {
// clang-format off
Alg{"NONE", F_CIPHER|F_DIGEST|CBC_HMAC, 0, 0, 0 },
Alg{"none", F_CIPHER|F_DIGEST|CBC_HMAC, 0, 0, 0 },
Alg{"AES-128-CBC", F_CIPHER|CBC_HMAC, 16, 16, 16 },
Alg{"AES-192-CBC", F_CIPHER|CBC_HMAC, 24, 16, 16 },
Alg{"AES-256-CBC", F_CIPHER|CBC_HMAC, 32, 16, 16 },
Expand Down
2 changes: 1 addition & 1 deletion test/unittests/test_proto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,7 @@ TEST(proto, iv_ciphers_legacy)
auto ivciphers = infostring.substr(infostring.find("IV_CIPHERS="));
ivciphers = ivciphers.substr(0, ivciphers.find("\n"));

std::string expectedstr{"IV_CIPHERS=NONE:AES-128-CBC:AES-192-CBC:AES-256-CBC:DES-CBC:DES-EDE3-CBC:BF-CBC:AES-128-GCM:AES-192-GCM:AES-256-GCM"};
std::string expectedstr{"IV_CIPHERS=none:AES-128-CBC:AES-192-CBC:AES-256-CBC:DES-CBC:DES-EDE3-CBC:BF-CBC:AES-128-GCM:AES-192-GCM:AES-256-GCM"};
if (SSLLib::CryptoAPI::CipherContextAEAD::is_supported(nullptr, openvpn::CryptoAlgs::CHACHA20_POLY1305))
expectedstr += ":CHACHA20-POLY1305";

Expand Down

0 comments on commit 2780eb9

Please sign in to comment.