summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2023-10-24 13:09:54 +0000
committertb <>2023-10-24 13:09:54 +0000
commite2af774f020a953e997ffcd0fe7386ca873b0035 (patch)
tree1c7f70a7a70d7c502c61a08c15821c129d4eaea0 /src
parentdac6e2f568f45af4bd8051bfafbd95b5ec65c73e (diff)
downloadopenbsd-e2af774f020a953e997ffcd0fe7386ca873b0035.tar.gz
openbsd-e2af774f020a953e997ffcd0fe7386ca873b0035.tar.bz2
openbsd-e2af774f020a953e997ffcd0fe7386ca873b0035.zip
Add chacha aliases for OpenSSL compatibility
OpenSSL has the 20 in the long and short names, so add aliases to the existing names to make things work. In particular, EVP_get_cipherbyname() will now return EVP_chacha20() for both 'ChaCha20' and 'chacha20'. Found by Facundo Tuesca when trying to add LibreSSL support for ChaCha20 in https://github.com/pyca/cryptography/pull/9209 ok jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/evp/c_all.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libcrypto/evp/c_all.c b/src/lib/libcrypto/evp/c_all.c
index 871abe6e9a..ec38b108c5 100644
--- a/src/lib/libcrypto/evp/c_all.c
+++ b/src/lib/libcrypto/evp/c_all.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: c_all.c,v 1.32 2023/07/24 10:24:58 jsing Exp $ */ 1/* $OpenBSD: c_all.c,v 1.33 2023/10/24 13:09:54 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -223,6 +223,8 @@ OpenSSL_add_all_ciphers_internal(void)
223 223
224#ifndef OPENSSL_NO_CHACHA 224#ifndef OPENSSL_NO_CHACHA
225 EVP_add_cipher(EVP_chacha20()); 225 EVP_add_cipher(EVP_chacha20());
226 EVP_add_cipher_alias(SN_chacha20, "ChaCha20");
227 EVP_add_cipher_alias(LN_chacha20, "chacha20");
226#endif 228#endif
227#if !defined(OPENSSL_NO_CHACHA) && !defined(OPENSSL_NO_POLY1305) 229#if !defined(OPENSSL_NO_CHACHA) && !defined(OPENSSL_NO_POLY1305)
228 EVP_add_cipher(EVP_chacha20_poly1305()); 230 EVP_add_cipher(EVP_chacha20_poly1305());