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

Validate EdDSA mechanism parameter length #394

Merged
merged 1 commit into from
Nov 29, 2024
Merged

Conversation

mzachar
Copy link
Contributor

@mzachar mzachar commented Nov 29, 2024

I run into an segmentation fault when using following command:

$ pkcs11-tool --module /usr/lib/libckteec.so.0 --login --sign -m EDDSA --slot 0 --id 01 --input-file /tmp/data --output-file /tmp/data.sig

After bit of digging I found out that there is no parameterLen validation in EdDSA mechanism branch which result in null pointer dereference.

This fixes Segmentation fault when no parameter is provided as specified in pkcs11 v3.0 spec for Ed25519 Signature Scheme

libckteec/src/serialize_ck.c Outdated Show resolved Hide resolved
libckteec/src/serialize_ck.c Outdated Show resolved Hide resolved
@mzachar
Copy link
Contributor Author

mzachar commented Nov 29, 2024

I updated the PR with suggested changes

Copy link
Contributor

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

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

Thanks a lot @mzachar for reporting and fixing this issue.

Could you add prefix libckteec: to the commit message header line? With that addressed,
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>.

@etienne-lms
Copy link
Contributor

@jforissier, could you launch CI tests for this P-R?

@etienne-lms
Copy link
Contributor

@mzachar, could you add the review tag i posted into you commit message so that @jforissier can merge your change?

This fixes Segmentation fault when no parameter is provided
as specified in pkcs11 v3.0 spec for Ed25519 Signature Scheme

Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
Signed-off-by: Matej Zachar <zachar.matej@gmail.com>
@jforissier jforissier merged commit 6486773 into OP-TEE:master Nov 29, 2024
2 checks passed
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.

3 participants