pitrou commented on code in PR #43222:
URL: https://github.com/apache/arrow/pull/43222#discussion_r1682844994


##########
cpp/src/parquet/encryption/encryption_internal_nossl.cc:
##########
@@ -72,14 +72,15 @@ void AesDecryptor::WipeOut() { 
ThrowOpenSSLRequiredException(); }
 
 AesDecryptor::~AesDecryptor() {}
 
-AesEncryptor* AesEncryptor::Make(ParquetCipher::type alg_id, int key_len, bool 
metadata,
-                                 std::vector<AesEncryptor*>* all_encryptors) {
+std::unique_ptr<AesEncryptor> AesEncryptor::Make(ParquetCipher::type alg_id, 
int key_len,
+                                                 bool metadata) {
+  ThrowOpenSSLRequiredException();

Review Comment:
   Can you also make the same change for `AesDecryptor::Make`?



##########
cpp/src/parquet/metadata.cc:
##########
@@ -651,9 +651,12 @@ class FileMetaData::FileMetaDataImpl {
     std::string key = file_decryptor_->GetFooterKey();
     std::string aad = encryption::CreateFooterAad(file_decryptor_->file_aad());
 
-    auto aes_encryptor = encryption::AesEncryptor::Make(
-        file_decryptor_->algorithm(), static_cast<int>(key.size()), true,
-        false /*write_length*/, nullptr);
+    auto aes_encryptor = 
encryption::AesEncryptor::Make(file_decryptor_->algorithm(),
+                                                        
static_cast<int>(key.size()),
+                                                        true, false 
/*write_length*/);
+    if (ARROW_PREDICT_FALSE(aes_encryptor == nullptr)) {

Review Comment:
   I think we can remove this check now that we know `AesEncryptor::Make` will 
never return a null pointer?



-- 
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]

Reply via email to