Searched hist:"4 eb886511f3ac0a9ebf53369992d102b75f58966" (Results 1 – 1 of 1) sorted by relevance
| /optee_os/ta/pkcs11/src/ |
| H A D | pkcs11_attributes.c | 4eb886511f3ac0a9ebf53369992d102b75f58966 Thu Oct 29 09:51:15 UTC 2020 Ruchika Gupta <ruchika.gupta@linaro.org> ta: pkcs11: Handle optional attributes without default values
In the current implementation all optional attributes of an object if not specified in the template while creating object, are assigned empty value by default. This works fine for the attributes where specification mentions that default value is empty or the attribute is modifiable later.
However for attributes like CKA_ALLOWED_MECHANISM, adding an empty default value results in a failure later in crypto operations when attribute of the object are checked against the mechanism.
To avoid such errors, the optional attributes array are split in 2 parts, one with the default empty value and ones which don't require a default value. All attributes in the specification which either should have default empty value or are allowed to be modified later by call to C_SetAttributes() or C_CopyObjects() would fall in the former category and be initialized with empty/NULL value.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org>
|