summaryrefslogtreecommitdiff
path: root/ta/pkcs11
diff options
context:
space:
mode:
authorRuchika Gupta <ruchika.gupta@linaro.org>2020-12-22 14:54:02 +0530
committerJérôme Forissier <jerome@forissier.org>2020-12-23 09:51:29 +0100
commit90c47fe29e97003d7e9aebe063276155b5748ba4 (patch)
treee9672b65b0de475edd8b7b6bc36fa21370aabdf1 /ta/pkcs11
parent4cfce748748a47029b2c30f911b4b0232b23349f (diff)
ta: pkcs11: Use get_attribute_ptr() instead of get_attribute()
When just trying to determine if an attribute is present in the list or not withour requiring the actual value of the attribute, using get_attribute_ptr() is better to use as it is more light-weight than it's counterpart get_attribute(). Suggested-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
Diffstat (limited to 'ta/pkcs11')
-rw-r--r--ta/pkcs11/src/pkcs11_attributes.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ta/pkcs11/src/pkcs11_attributes.c b/ta/pkcs11/src/pkcs11_attributes.c
index eeb792f0..8bfd3520 100644
--- a/ta/pkcs11/src/pkcs11_attributes.c
+++ b/ta/pkcs11/src/pkcs11_attributes.c
@@ -785,13 +785,13 @@ create_attributes_from_template(struct obj_attrs **out, void *template,
if (rc)
goto out;
- if (get_attribute(temp, PKCS11_CKA_LOCAL, NULL, NULL) !=
+ if (get_attribute_ptr(temp, PKCS11_CKA_LOCAL, NULL, NULL) !=
PKCS11_RV_NOT_FOUND) {
rc = PKCS11_CKR_TEMPLATE_INCONSISTENT;
goto out;
}
- if (get_attribute(temp, PKCS11_CKA_KEY_GEN_MECHANISM, NULL, NULL) !=
+ if (get_attribute_ptr(temp, PKCS11_CKA_KEY_GEN_MECHANISM, NULL, NULL) !=
PKCS11_RV_NOT_FOUND) {
rc = PKCS11_CKR_TEMPLATE_INCONSISTENT;
goto out;