From 5892e0f17a8473a472abbf5044b174c6c7d3a82b Mon Sep 17 00:00:00 2001 From: tb Date: Tue, 24 Oct 2023 13:09:54 +0000 Subject: [PATCH] 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 --- lib/libcrypto/evp/c_all.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/libcrypto/evp/c_all.c b/lib/libcrypto/evp/c_all.c index 871abe6e9a1..ec38b108c53 100644 --- a/lib/libcrypto/evp/c_all.c +++ b/lib/libcrypto/evp/c_all.c @@ -1,4 +1,4 @@ -/* $OpenBSD: c_all.c,v 1.32 2023/07/24 10:24:58 jsing Exp $ */ +/* $OpenBSD: c_all.c,v 1.33 2023/10/24 13:09:54 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -223,6 +223,8 @@ OpenSSL_add_all_ciphers_internal(void) #ifndef OPENSSL_NO_CHACHA EVP_add_cipher(EVP_chacha20()); + EVP_add_cipher_alias(SN_chacha20, "ChaCha20"); + EVP_add_cipher_alias(LN_chacha20, "chacha20"); #endif #if !defined(OPENSSL_NO_CHACHA) && !defined(OPENSSL_NO_POLY1305) EVP_add_cipher(EVP_chacha20_poly1305()); -- 2.20.1