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


##########
cpp/src/parquet/encryption/encryption.cc:
##########
@@ -130,11 +123,11 @@ FileDecryptionProperties::Builder* 
FileDecryptionProperties::Builder::aad_prefix
 }
 
 ColumnDecryptionProperties::Builder* ColumnDecryptionProperties::Builder::key(
-    const std::string& key) {
+    encryption::SecureString key) {
   if (key.empty()) return this;
 
-  DCHECK(!key.empty());
-  key_ = key;
+  DCHECK(key_.empty());

Review Comment:
   This looked suspicious, all other setter methods check if the member is 
unset. Here, the check is always true as it checks the input.
   
   This is a breaking change if user code calls this setter twice with 
non-empty keys.



##########
cpp/src/parquet/encryption/encryption.cc:
##########
@@ -130,11 +123,11 @@ FileDecryptionProperties::Builder* 
FileDecryptionProperties::Builder::aad_prefix
 }
 
 ColumnDecryptionProperties::Builder* ColumnDecryptionProperties::Builder::key(
-    const std::string& key) {
+    encryption::SecureString key) {
   if (key.empty()) return this;
 
-  DCHECK(!key.empty());
-  key_ = key;
+  DCHECK(key_.empty());

Review Comment:
   This looked suspicious, all other setter methods check if the member is 
unset.
   Here, the check is always true as it checks the input.
   
   This is a breaking change if user code calls this setter twice with 
non-empty keys.



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