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

ERROR: EVP_CipherFinal_ex failed. OpenSSL error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt #70

Closed
cobolbaby opened this issue Nov 14, 2023 · 2 comments
Assignees
Labels
bug Something isn't working community

Comments

@cobolbaby
Copy link

cobolbaby commented Nov 14, 2023

If you're dealing with a TEXT field, encryption and decryption issues may pop up.

postgres=# create table t(id int primary key, col2 text);
CREATE TABLE
postgres=# create table t_tde(id int primary key, col2 text) using pg_tde;
CREATE TABLE
postgres=# \timing on
Timing is on.
postgres=# insert into t select n, md5(random()::varchar) || n from generate_series(1, 1000000) as n;
INSERT 0 1000000
Time: 3345.107 ms (00:03.345)

postgres=# insert into t_tde select n, md5(random()::varchar) || n from generate_series(1, 1000000) as n;
2023-11-11 06:53:56.092 CST [12609] ERROR:  EVP_CipherFinal_ex failed. OpenSSL error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
2023-11-11 06:53:56.092 CST [12609] STATEMENT:  insert into t_tde select n, md5(random()::varchar) || n from generate_series(1, 1000000) as n;
ERROR:  EVP_CipherFinal_ex failed. OpenSSL error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
Time: 80.529 ms
postgres=# insert into t_tde values(0, 'abcdefg');
ERROR:  EVP_CipherFinal_ex failed. OpenSSL error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
Time: 1.043 ms
@github-project-automation github-project-automation bot moved this to 📋 Backlog in PG-TDE Nov 14, 2023
@dutow
Copy link
Collaborator

dutow commented Nov 14, 2023

Thank you for the bug report @cobolbaby

Could you give us a more detailed description, do you have example SQL statements that cause this error?

@hqakhtar hqakhtar added the bug Something isn't working label Jan 30, 2024
@hqakhtar hqakhtar added this to the Tech Preview - 1.0 Release milestone Jan 30, 2024
@dutow dutow moved this from 📋 Backlog to 🏗 In progress in PG-TDE Jan 31, 2024
@dutow
Copy link
Collaborator

dutow commented Feb 6, 2024

Fixed by #105

@dutow dutow closed this as completed Feb 6, 2024
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in PG-TDE Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community
Projects
None yet
Development

No branches or pull requests

4 participants