This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 6e6fd0a30a GH-38378: [C++][Parquet] Don't initialize OpenSSL 
explicitly with OpenSSL 1.1 (#38379)
6e6fd0a30a is described below

commit 6e6fd0a30aebee6738bb4bb703344f0c866debea
Author: Sutou Kouhei <[email protected]>
AuthorDate: Fri Oct 27 09:52:07 2023 +0900

    GH-38378: [C++][Parquet] Don't initialize OpenSSL explicitly with OpenSSL 
1.1 (#38379)
    
    ### Rationale for this change
    
    This explicit initialization is for Valgrind and OpenSSL 1.1 will be 
unsupported eventually. So we can disable this explicit initialization for 
OpenSSL 1.1.
    
    ### What changes are included in this PR?
    
    Disable the explicit initialization with OpenSSL 1.1.
    
    ### Are these changes tested?
    
    Yes.
    
    ### Are there any user-facing changes?
    
    No.
    * Closes: #38378
    
    Authored-by: Sutou Kouhei <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 cpp/src/parquet/encryption/openssl_internal.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/cpp/src/parquet/encryption/openssl_internal.cc 
b/cpp/src/parquet/encryption/openssl_internal.cc
index 05f2773532..61ec81b490 100644
--- a/cpp/src/parquet/encryption/openssl_internal.cc
+++ b/cpp/src/parquet/encryption/openssl_internal.cc
@@ -24,11 +24,14 @@
 namespace parquet::encryption::openssl {
 
 void EnsureInitialized() {
+// OpenSSL 1.1 doesn't provide OPENSSL_INIT_ENGINE_ALL_BUILTIN.
+#ifdef OPENSSL_INIT_ENGINE_ALL_BUILTIN
   // Initialize ciphers and random engines
   if (!OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_ALL_BUILTIN | 
OPENSSL_INIT_ADD_ALL_CIPHERS,
                            NULL)) {
     throw ParquetException("OpenSSL initialization failed");
   }
+#endif
 }
 
 }  // namespace parquet::encryption::openssl

Reply via email to