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

Original content of column which is involved into ENCRYPT() is displayed as distorted view after this call [CORE6186] #6431

Closed
firebird-automations opened this issue Nov 11, 2019 · 5 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Query-1:

Trivial:

with
a as (
select s_origin
from (
select 'Encrypts/decrypts data using symmetric cipher' as s_origin
from rdb$database
)
)
select
a.s_origin
from a
;

It issues obvious result:
S_ORIGIN Encrypts/decrypts data using symmetric cipher

Query-2:

The same as Query-1, but we add call to ENCRYPT() function, see line marked as "[ 1 ]" below:

with
a as (
select s_origin
from (
select 'Encrypts/decrypts data using symmetric cipher' as s_origin
from rdb$database
)
)
select
a.s_origin
,encrypt( a.s_origin using aes mode ofb key '0123456789012345' iv 'abcdefghhgfedcba') as s_encrypted ------------- [ 1 ]
from a
;

Result will be:
S_ORIGIN
456E6372797074732F64656372797074732064617461207573696E672073796D6D657472696320636970686572
S_ENCRYPTED
910805BDA8B05C475E8B5D3D0971D58649EA0D549FEA1633A8811429183E925E1C2C77CE4E3B9DCDFA0C75997E

So, content of the column 'S_ORIGIN' has been changed (and I could not find any way to 'materialize' CTE 'a' in such manner that content of S_ORIGIN will be preserved from changing).

Commits: d501922

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Avoid too active conversion of encrypt() parameters to varbinary.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0 Beta 2 [ 10888 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants