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

Padding bug mismatch #144

Merged
merged 2 commits into from
Jan 21, 2025
Merged

Padding bug mismatch #144

merged 2 commits into from
Jan 21, 2025

Conversation

simo5
Copy link
Member

@simo5 simo5 commented Jan 20, 2025

Found while messing with some openssl test code and pkcs11-provider

@simo5 simo5 requested a review from Jakuje January 20, 2025 23:01
CBC with no padding requires input that is an entire block in length.
If a different size is provided we should return an error on _final.

Signed-off-by: Simo Sorce <[email protected]>
Copy link
Contributor

@Jakuje Jakuje left a comment

Choose a reason for hiding this comment

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

lgtm.
The only though I had is that the decrypt_initialize() and encrypt_initialize() have almost all repeated code so I though if we should factor it out to some crypt_initialize() and use the EVP_CipherInit_ex() and similar functions in here. But I can do it in separate PR if you would find it useful.

@simo5
Copy link
Member Author

simo5 commented Jan 21, 2025

lgtm. The only though I had is that the decrypt_initialize() and encrypt_initialize() have almost all repeated code so I though if we should factor it out to some crypt_initialize() and use the EVP_CipherInit_ex() and similar functions in here. But I can do it in separate PR if you would find it useful.

I am not against, but it is also minor impact work, so can be done later as needed.

@simo5 simo5 merged commit ff6b251 into latchset:main Jan 21, 2025
20 checks passed
@Jakuje
Copy link
Contributor

Jakuje commented Jan 21, 2025

ok. Will make it into an issue so it wont be lost and do it once I will have some time.

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