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

libckteec: one shot encryption/decryption may have no input data #375

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

etienne-lms
Copy link
Contributor

Change the one shot encryption and decryption handler function to allow input buffer reference to be NULL. This may happen for example with AES GCM operation where encryption of a NULL buffer is expected to produce an AES GCM authentication tag. Before this change, providing a NULL buffer to C_Encrypt() made ckteec_register_shm() to fail and ckteec_register_shm() to return CKR_HOST_MEMORY error code.

Fixes: aa3dd58 ("libckteec: Allow 0 length input buffer for update operations;")

Copy link
Contributor

@jforissier jforissier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acked-by: Jerome Forissier <[email protected]>

@etienne-lms
Copy link
Contributor Author

Review tag applied. Thanks.

Change the one shot encryption and decryption handler function to
allow input buffer reference to be NULL. This may happen for example
with AES GCM operation where encryption of a NULL buffer is expected to
produce an AES GCM authentication tag. Before this change, providing a
NULL buffer to C_Encrypt() made ckteec_register_shm() to fail and
ckteec_register_shm() to return CKR_HOST_MEMORY error code.

Fixes: aa3dd58 ("libckteec: Allow 0 length input buffer  for update operations.")
Acked-by: Jerome Forissier <[email protected]>
Signed-off-by: Etienne Carriere <[email protected]>
@etienne-lms
Copy link
Contributor Author

I saw a minor issue in the commit message. Referred commit header line is wrong:

-Fixes: aa3dd58d605e ("libckteec: Allow 0 length input buffer  for update operations;")
+Fixes: aa3dd58d605e ("libckteec: Allow 0 length input buffer  for update operations.")

I'll force push an fixed commit.

@etienne-lms
Copy link
Contributor Author

Rebased

@jforissier jforissier merged commit c5b3920 into OP-TEE:master Feb 14, 2024
3 checks passed
@etienne-lms etienne-lms deleted the pkcs11-fix branch June 17, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants