Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ci/docker/ubuntu-22.04-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ RUN apt-get update -y -q && \
gdb \
git \
libbenchmark-dev \
libboost-date-time-dev \
libboost-filesystem-dev \
libboost-system-dev \
libbrotli-dev \
Expand Down
1 change: 1 addition & 0 deletions ci/docker/ubuntu-24.04-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ RUN apt-get update -y -q && \
gdb \
git \
libbenchmark-dev \
libboost-date-time-dev \
libboost-filesystem-dev \
libboost-system-dev \
libbrotli-dev \
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/parquet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ if(PARQUET_REQUIRE_ENCRYPTION)

#TODO: Change to a specific tag/commit when we have one.
#https://github.com/protegrity/arrow/issues/179
GIT_TAG be87857e4d8c40977c3143c57805c7cc1c8394a8
GIT_TAG 4c808b2233ed0bc04529c3b0dbf7c214c4901043
GIT_SHALLOW FALSE
)

Expand Down
6 changes: 0 additions & 6 deletions cpp/src/parquet/encryption/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,4 @@ if(ARROW_TESTING)
add_parquet_test(dbpa-executor-test
SOURCES external/dbpa_executor_test.cc
LABELS "parquet-tests" "encryption-tests")

# Integration-like tests for External DBPA with various parquet settings
add_parquet_test(external-dbpa-encryption-integ_test
SOURCES external_dbpa_encryption_integ_test.cc
external/test_utils.cc
LABELS "parquet-tests" "encryption-tests")
endif()
11 changes: 9 additions & 2 deletions cpp/src/parquet/encryption/aes_encryption.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <algorithm>
#include <array>
#include <iostream>
#include <limits>
#include <memory>
#include <sstream>

Expand Down Expand Up @@ -334,7 +335,10 @@ uint64_t AesEncryptorFactory::MakeCacheKey(
}

AesEncryptor* AesEncryptorFactory::GetMetaAesEncryptor(
ParquetCipher::type alg_id, int32_t key_size) {
ParquetCipher::type alg_id, size_t key_size) {
if (key_size > static_cast<size_t>(std::numeric_limits<int32_t>::max())) {
throw ParquetException("Invalid key length: exceeds int32_t max");
}
auto key_len = static_cast<int32_t>(key_size);
// Create the cache key using the algorithm id, key length, and metadata flag
// to avoid collisions for encryptors with the same key length.
Expand All @@ -350,7 +354,10 @@ AesEncryptor* AesEncryptorFactory::GetMetaAesEncryptor(
}

AesEncryptor* AesEncryptorFactory::GetDataAesEncryptor(
ParquetCipher::type alg_id, int32_t key_size) {
ParquetCipher::type alg_id, size_t key_size) {
if (key_size > static_cast<size_t>(std::numeric_limits<int32_t>::max())) {
throw ParquetException("Invalid key length: exceeds int32_t max");
}
auto key_len = static_cast<int32_t>(key_size);
// Create the cache key using the algorithm id, key length, and metadata flag
// to avoid collisions for encryptors with the same key length.
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/parquet/encryption/aes_encryption.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ class PARQUET_EXPORT AesEncryptor : public AesCryptoContext, public EncryptorInt
// store the encryptors for the different key lengths.
class AesEncryptorFactory {
public:
AesEncryptor* GetMetaAesEncryptor(ParquetCipher::type alg_id, int32_t key_size);
AesEncryptor* GetDataAesEncryptor(ParquetCipher::type alg_id, int32_t key_size);
AesEncryptor* GetMetaAesEncryptor(ParquetCipher::type alg_id, size_t key_size);
AesEncryptor* GetDataAesEncryptor(ParquetCipher::type alg_id, size_t key_size);

private:
/// Build a cache key including algorithm id, key length, and metadata flag.
Expand Down
Loading
Loading