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: Fix X.509 certificate attribute handlings #287

Merged
merged 3 commits into from
Oct 4, 2021

Conversation

vesajaaskelainen
Copy link
Contributor

@vesajaaskelainen vesajaaskelainen commented Oct 1, 2021

CK_ULONG conversion was forgotten on first batch so this adds them.

Also fixes error value returned when provided CK_ULONG value is too small.

Relates to:

Related PRs:

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.

Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>

CKA_NAME_HASH_ALGORITHM is CK_ULONG and needs to be translated to 32bits.

Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
CKA_CERTIFICATE_CATEGORY is CK_ULONG and needs to be translated to 32bits.

Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
We should return CKR_ATTRIBUTE_VALUE_INVALID to indicate that value is
incorrect.

CKR_ATTRIBUTE_TYPE_INVALID is used to indicate that unknown attribute was
provided.

Specified in:
PKCS OP-TEE#11 Cryptographic Token Interface Base Specification
Version 2.40 Plus Errata 01
4.1.1 Creating objects

"2. If the supplied template specifies an invalid value for a valid
attribute, then the attempt should fail with the error code
CKR_ATTRIBUTE_VALUE_INVALID."

Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
@vesajaaskelainen
Copy link
Contributor Author

Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>

Thanks for the review. Tags applied.

@jforissier jforissier merged commit 1828743 into OP-TEE:master Oct 4, 2021
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