-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DX-67209 updated aes_encrypt/decrypt #29
Conversation
Thanks for opening a pull request! If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project. Then could you also rename the pull request title in the following format?
or
In the case of PARQUET issues on JIRA the title also supports:
See also: |
cpp/src/gandiva/encrypt_utils.cc
Outdated
|
||
if (!en_ctx) { | ||
throw std::runtime_error("could not create a new evp cipher ctx for encryption"); | ||
} | ||
|
||
if (!EVP_EncryptInit_ex(en_ctx, EVP_aes_128_ecb(), nullptr, | ||
switch (key_len) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be combined with the other similar code below into a helper function.
if (key_data_len == 16 || key_data_len == 24 || key_data_len == 32) { | ||
kAesBlockSize = static_cast<int64_t>(key_data_len); | ||
} else { | ||
gdv_fn_context_set_error_msg(context, "invalid key length"); | ||
*out_len = 0; | ||
return nullptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't the helper functions already check the length? I think it would be better to just do the check in one place since the code would be easier to read and better tested. It doesn't look like this path is being tested since the unit tests call the helper functions.
* DX-67209 updated aes_encrypt/decrypt
* DX-67209 updated aes_encrypt/decrypt
* DX-67209 updated aes_encrypt/decrypt
* DX-67209 updated aes_encrypt/decrypt
* DX-67209 updated aes_encrypt/decrypt
* DX-67209 updated aes_encrypt/decrypt
* DX-67209 updated aes_encrypt/decrypt
* DX-67209 updated aes_encrypt/decrypt
* DX-67209 updated aes_encrypt/decrypt
* DX-67209 updated aes_encrypt/decrypt
* DX-67209 updated aes_encrypt/decrypt
* DX-67209 updated aes_encrypt/decrypt
* DX-67209 updated aes_encrypt/decrypt
aes_ecrypt/decrypt support 128, 192, 254 bit key and this strict requirement - key should be 16 or 24 or 32 chars.
If not - error will be returned.