EnricoMi commented on code in PR #44990:
URL: https://github.com/apache/arrow/pull/44990#discussion_r2010048920


##########
cpp/src/parquet/encryption/internal_file_decryptor.cc:
##########
@@ -64,17 +66,20 @@ 
InternalFileDecryptor::InternalFileDecryptor(FileDecryptionProperties* propertie
   properties_->set_utilized();
 }
 
+InternalFileDecryptor::~InternalFileDecryptor() { WipeOutDecryptionKeys(); }
+
 void InternalFileDecryptor::WipeOutDecryptionKeys() {
-  std::lock_guard<std::mutex> lock(mutex_);
+  std::unique_lock lock(mutex_);
   properties_->WipeOutDecryptionKeys();
-  for (auto const& i : all_decryptors_) {
-    if (auto aes_decryptor = i.lock()) {
-      aes_decryptor->WipeOut();
-    }
-  }
+  footer_key_.clear();

Review Comment:
   It looks like `std::string::clear()` sets the length of the string to 0, so 
the string value becomes inaccessible, but the key is not erased in the memory. 
No need to call `footer_key.clear()` from destructor because the string will be 
deleted anyways.



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to