Skip to content

Replace CKR_ARGUMENTS_BAD by a better error code when appropriate#632

Draft
selvanair wants to merge 1 commit intosofthsm:mainfrom
selvanair:return-value
Draft

Replace CKR_ARGUMENTS_BAD by a better error code when appropriate#632
selvanair wants to merge 1 commit intosofthsm:mainfrom
selvanair:return-value

Conversation

@selvanair
Copy link

Cases where the error is due to a limitation in the
implementation (e.g., digest type in OAEP), return
CKM_MECHANISM_PARAMETER_INVALID instead of CKR_ARGUMENTS_BAD

Where the parameter is evidently wrong (like NULL for a
required parameter), CKR_ARGUMENTS_BAD is retained.

Signed-off-by: Selva Nair selva.nair@gmail.com

Cases where the error is due to a limitation in the
implementation (e.g., digest type in OAEP), return
CKM_MECHANISM_PARAMETER_INVALID instead of CKR_ARGUMENTS_BAD

Where the parameter is evidently wrong (like NULL for a
required parameter), CKR_ARGUMENTS_BAD is retained.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
@selvanair
Copy link
Author

PS: I'm not sure of how to treat the source == CKZ_DATA_SPECIFIED
requirement imposed for OAEP in some code paths. Is this required
to be set even when pSourceData is unused (NULL)?
Also, for some reason its not checked during Decrypt() -- only
Encrypt/Wrap/UnWrap checks it.

@jschlyter jschlyter marked this pull request as draft November 29, 2024 16:24
@jschlyter
Copy link
Contributor

Please rebase on develop and mark as ready when ready.

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