From d4eb357b48244ee47ea2d75104372f4316a50ab6 Mon Sep 17 00:00:00 2001 From: Michael Nikitochkin Date: Fri, 31 Jan 2025 11:00:00 +0100 Subject: [PATCH] libcrypto: Correct EVP_CIPHER_get_flags argument type Per OpenSSL documentation [^1] and the usage of `LibCrypto#evp_cipher_flags`, `EVP_CIPHER_get_flags` should accept `EVP_CIPHER` rather than `EVP_CIPHER_CTX`. An example of this usage can be seen in `OpenSSL::Cipher#authenticated?`. This change does not introduce any functional impact but improves clarity by correctly reflecting the expected argument, reducing the need for developers to cross-check other sources. [^1]: https://docs.openssl.org/1.1.1/man3/EVP_EncryptInit/#synopsis --- src/openssl/lib_crypto.cr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openssl/lib_crypto.cr b/src/openssl/lib_crypto.cr index 8e24bbcbc78e..b75474951764 100644 --- a/src/openssl/lib_crypto.cr +++ b/src/openssl/lib_crypto.cr @@ -246,14 +246,14 @@ lib LibCrypto fun evp_cipher_block_size = EVP_CIPHER_get_block_size(cipher : EVP_CIPHER) : Int32 fun evp_cipher_key_length = EVP_CIPHER_get_key_length(cipher : EVP_CIPHER) : Int32 fun evp_cipher_iv_length = EVP_CIPHER_get_iv_length(cipher : EVP_CIPHER) : Int32 - fun evp_cipher_flags = EVP_CIPHER_get_flags(ctx : EVP_CIPHER_CTX) : CipherFlags + fun evp_cipher_flags = EVP_CIPHER_get_flags(cipher : EVP_CIPHER) : CipherFlags {% else %} fun evp_cipher_name = EVP_CIPHER_name(cipher : EVP_CIPHER) : UInt8* fun evp_cipher_nid = EVP_CIPHER_nid(cipher : EVP_CIPHER) : Int32 fun evp_cipher_block_size = EVP_CIPHER_block_size(cipher : EVP_CIPHER) : Int32 fun evp_cipher_key_length = EVP_CIPHER_key_length(cipher : EVP_CIPHER) : Int32 fun evp_cipher_iv_length = EVP_CIPHER_iv_length(cipher : EVP_CIPHER) : Int32 - fun evp_cipher_flags = EVP_CIPHER_flags(ctx : EVP_CIPHER_CTX) : CipherFlags + fun evp_cipher_flags = EVP_CIPHER_flags(cipher : EVP_CIPHER) : CipherFlags {% end %} fun evp_cipher_ctx_new = EVP_CIPHER_CTX_new : EVP_CIPHER_CTX