Skip to content

Commit

Permalink
apacheGH-38378: [C++][Parquet] Don't initialize OpenSSL explicitly wi…
Browse files Browse the repository at this point in the history
…th OpenSSL 1.1 (apache#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: apache#38378

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
kou authored and loicalleyne committed Nov 13, 2023
1 parent cb3355c commit d5bb3dd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cpp/src/parquet/encryption/openssl_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d5bb3dd

Please sign in to comment.