steveloughran commented on code in PR #5256:
URL: https://github.com/apache/hadoop/pull/5256#discussion_r1820642049


##########
hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/crypto/OpensslCipher.c:
##########
@@ -169,9 +169,19 @@ JNIEXPORT void JNICALL 
Java_org_apache_hadoop_crypto_OpensslCipher_initIDs
                       "EVP_CIPHER_CTX_set_padding");
   LOAD_DYNAMIC_SYMBOL(dlsym_EVP_CIPHER_CTX_test_flags, env, openssl,  \
                       "EVP_CIPHER_CTX_test_flags");
+// name changed in OpenSSL 3 ABI - see History section in EVP_EncryptInit(3)
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+  LOAD_DYNAMIC_SYMBOL(dlsym_EVP_CIPHER_CTX_block_size, env, openssl,  \

Review Comment:
   let's have a single block for defining the string and then use 
   ```
   #if  OPENSSL_VERSION_NUMBER >= 0x30000000L
   #define CTX_BLOCK_SIZE "EVP_CIPHER_CTX_get_block_size"
   #define CTX_ENCRYPTING "EVP_CIPHER_CTX_is_encrypting"
   ...
   #else
   #define CTX_BLOCK_SIZE "EVP_CIPHER_CTX_block_size"
   #define CTX_ENCRYPTING "EVP_CIPHER_CTX_encrypting"
   ...
   #endif
   
    LOAD_DYNAMIC_SYMBOL(dlsym_EVP_CIPHER_CTX_block_size, env, openssl,
                         CTX_BLOCK_SIZE);
   ```
   
   Then the actual uses just refer to the macro definition as needed
   
   1. makes things less complex
   2. lines up for openssl 4 and any more changes.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to