summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuchika Gupta <ruchika.gupta@linaro.org>2020-12-11 17:25:54 +0530
committerJérôme Forissier <jerome@forissier.org>2020-12-17 09:45:03 +0100
commitd1d443727098d6af4a02e8e14ee48635055a7ec1 (patch)
treee182e90493b0e446e8ab74a4de8c5400c62b3467
parent5440719db58fae341de9079fc7ce556f7662de8b (diff)
ta: pkcs11: Fix the error code returned
While generating a key of type PKCS11_CKO_SECRET_KEY, if CKA_VALUE_LEN field is not specified in the attribute template, the error returned needs to be PKCS11_CKR_TEMPLATE_INCOMPLETE. Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org>
-rw-r--r--ta/pkcs11/src/pkcs11_attributes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ta/pkcs11/src/pkcs11_attributes.c b/ta/pkcs11/src/pkcs11_attributes.c
index a34bd3f5..c183f910 100644
--- a/ta/pkcs11/src/pkcs11_attributes.c
+++ b/ta/pkcs11/src/pkcs11_attributes.c
@@ -1022,7 +1022,7 @@ enum pkcs11_rc check_created_attrs(struct obj_attrs *key1,
rc = get_u32_attribute(secret, PKCS11_CKA_VALUE_LEN,
&key_length);
if (rc)
- return PKCS11_CKR_TEMPLATE_INCONSISTENT;
+ return PKCS11_CKR_TEMPLATE_INCOMPLETE;
}
get_key_min_max_sizes(get_key_type(key1), &min_key_size, &max_key_size);