mapleFU commented on code in PR #43222:
URL: https://github.com/apache/arrow/pull/43222#discussion_r1675034356
##########
cpp/src/parquet/metadata.cc:
##########
@@ -649,9 +649,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)) {
+ throw ParquetException("Could not create AES encryptor for signature
verification");
Review Comment:
> Maybe it would be better to change Make to return
Result<std::unique_ptr<AesEncryptor>> to enforce checking for failure, or
possibly it makes sense to just change the _nossl versions of Make to throw an
exception rather than return null, as I can't see anywhere that handles a null
value already?
Currently I'm not familiar with encryption enough, so I just put the
checking here🤔
> AesDecryptor::Make also seems to have the same problem.
Yeah I'll update it here
--
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]