Skip to content
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

Merged
merged 8 commits into from
Jul 13, 2023
Merged

DX-67209 updated aes_encrypt/decrypt #29

merged 8 commits into from
Jul 13, 2023

Conversation

xxlaykxx
Copy link

@xxlaykxx xxlaykxx commented Jun 30, 2023

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.

@github-actions
Copy link

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?

GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

or

MINOR: [${COMPONENT}] ${SUMMARY}

In the case of PARQUET issues on JIRA the title also supports:

PARQUET-${JIRA_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

See also:


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) {
Copy link

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.

Comment on lines +320 to +325
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;
Copy link

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.

@xxlaykxx xxlaykxx requested a review from lriggs July 10, 2023 16:33
@xxlaykxx xxlaykxx merged commit 03f3105 into dremio:dremio-12.0-main Jul 13, 2023
7 of 11 checks passed
lriggs pushed a commit that referenced this pull request Jul 13, 2023
* DX-67209 updated aes_encrypt/decrypt
lriggs pushed a commit that referenced this pull request Jul 21, 2023
* DX-67209 updated aes_encrypt/decrypt
lriggs pushed a commit that referenced this pull request Jul 28, 2023
* DX-67209 updated aes_encrypt/decrypt
xxlaykxx added a commit that referenced this pull request Oct 29, 2023
* DX-67209 updated aes_encrypt/decrypt
DenisTarasyuk pushed a commit that referenced this pull request Dec 19, 2023
* DX-67209 updated aes_encrypt/decrypt
DenisTarasyuk pushed a commit that referenced this pull request Jan 16, 2024
* DX-67209 updated aes_encrypt/decrypt
DenisTarasyuk pushed a commit that referenced this pull request Mar 6, 2024
* DX-67209 updated aes_encrypt/decrypt
lriggs pushed a commit to lriggs/arrow that referenced this pull request Mar 12, 2024
* DX-67209 updated aes_encrypt/decrypt
lriggs pushed a commit to lriggs/arrow that referenced this pull request Apr 25, 2024
* DX-67209 updated aes_encrypt/decrypt
stevelorddremio pushed a commit to stevelorddremio/arrow that referenced this pull request Jun 14, 2024
* DX-67209 updated aes_encrypt/decrypt
lriggs pushed a commit to lriggs/arrow that referenced this pull request Sep 3, 2024
* DX-67209 updated aes_encrypt/decrypt
lriggs pushed a commit to lriggs/arrow that referenced this pull request Sep 6, 2024
* DX-67209 updated aes_encrypt/decrypt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants