Skip to content

Fix digest, sign and verify length handling - #241

Open
aidangarske wants to merge 160 commits into
wolfSSL:masterfrom
aidangarske:fenrir-fixes-2786-3639
Open

aidangarske wants to merge 160 commits into
wolfSSL:masterfrom
aidangarske:fenrir-fixes-2786-3639

Conversation

@aidangarske

@aidangarske aidangarske commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

F-2040 - 24c189a - C_Digest now checks for an active digest operation with WP11_INIT_DIGEST, like C_DigestUpdate and C_DigestFinal.

F-2786 - 201e498 - C_Digest, C_DigestUpdate, C_Sign, C_SignUpdate, C_Verify, C_VerifyUpdate and the RSA paths of C_Encrypt and C_Decrypt now reject lengths that do not fit in 32 bits and end the operation through WP11_Session_AbortOp.

F-2787 - 44603f1 - The HMAC and CMAC paths of C_VerifyFinal now return CKR_SIGNATURE_LEN_RANGE for a signature length of 2^32 or more and abort the operation.

F-5155 - 6cee715 - C_Sign and C_SignFinal now compare the output length as a CK_ULONG, and CMAC and TLS MAC capacities are capped with CK_ULONG_CAP_WORD32.

F-3639 - b228e70 - The CKR_BUFFER_TOO_SMALL paths in encrypt, decrypt and sign, and WP11_Aes_Cmac_Check_Len, now write the required output length first.

F-3836 - 1837d67 - WP11_Digest_Single now sets the output length on BUFFER_E and keeps the operation active so the call can be retried.

F-3837 - daf2709 - WP11_Digest_Final now sets the output length on BUFFER_E.

F-5154 - 4bf34a8 - C_Digest and C_DigestFinal now cap the output buffer length with CK_ULONG_CAP_WORD32.

F-2377 - 863ce5a - C_Digest and C_DigestUpdate now accept zero-length input and only validate pointers, with a NULL data pointer still returning CKR_ARGUMENTS_BAD.

F-2782 - 6250e3a - C_DigestKey now hashes the secret key's CKA_VALUE and returns CKR_KEY_INDIGESTIBLE for other object classes or unsupported key types, ending the operation on every error exit.

@aidangarske aidangarske self-assigned this Oct 8, 2026
Copilot AI balanced review requested due to automatic review settings October 8, 2026 22:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@aidangarske
aidangarske force-pushed the fenrir-fixes-2786-3639 branch 2 times, most recently from 6a7c941 to 6250e3a Compare October 9, 2026 02:00
@aidangarske aidangarske changed the title Fix digest, sign, and verify length handling Fix digest, sign and verify length handling Oct 9, 2026
@aidangarske
aidangarske force-pushed the fenrir-fixes-2786-3639 branch from 6250e3a to 7e96568 Compare October 10, 2026 03:20
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