summaryrefslogtreecommitdiff
path: root/ta/pkcs11
diff options
context:
space:
mode:
authorEtienne Carriere <etienne.carriere@linaro.org>2020-12-10 15:19:07 +0100
committerJérôme Forissier <jerome@forissier.org>2020-12-11 10:37:37 +0100
commit16df60c7f96bde77f26d8501933c0429c42c9f96 (patch)
treec1958f737c6d5f5726a52ba4e5d4ca0b7b875e3c /ta/pkcs11
parentfde67b24d9f008925aa1e509fc57d578e4bb2394 (diff)
ta: pkcs11: rename argument bp to attrs for generic attributes
Rename input argument bp/bp_count to attrs/attrs_count in several local functions in pkcs11_attributes.c since the reference cover any kind of attribute, not only boolean attributes (bp stood for boolean property). Reviewed-by: Ruchika Gupta <ruchika.gupta@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Diffstat (limited to 'ta/pkcs11')
-rw-r--r--ta/pkcs11/src/pkcs11_attributes.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/ta/pkcs11/src/pkcs11_attributes.c b/ta/pkcs11/src/pkcs11_attributes.c
index f44708c3..a34bd3f5 100644
--- a/ta/pkcs11/src/pkcs11_attributes.c
+++ b/ta/pkcs11/src/pkcs11_attributes.c
@@ -215,20 +215,20 @@ static enum pkcs11_rc set_mandatory_boolprops(struct obj_attrs **out,
static enum pkcs11_rc set_mandatory_attributes(struct obj_attrs **out,
struct obj_attrs *temp,
- uint32_t const *bp,
- size_t bp_count)
+ uint32_t const *attrs,
+ size_t attrs_count)
{
enum pkcs11_rc rc = PKCS11_CKR_OK;
size_t n = 0;
- for (n = 0; n < bp_count; n++) {
+ for (n = 0; n < attrs_count; n++) {
uint32_t size = 0;
void *value = NULL;
- if (get_attribute_ptr(temp, bp[n], &value, &size))
+ if (get_attribute_ptr(temp, attrs[n], &value, &size))
return PKCS11_CKR_TEMPLATE_INCOMPLETE;
- rc = add_attribute(out, bp[n], value, size);
+ rc = add_attribute(out, attrs[n], value, size);
if (rc)
return rc;
}
@@ -255,21 +255,21 @@ static enum pkcs11_rc get_default_value(enum pkcs11_attr_id id, void **value,
static enum pkcs11_rc set_optional_attributes_with_def(struct obj_attrs **out,
struct obj_attrs *temp,
- uint32_t const *bp,
- size_t bp_count,
+ uint32_t const *attrs,
+ size_t attrs_count,
bool default_to_null)
{
enum pkcs11_rc rc = PKCS11_CKR_OK;
size_t n = 0;
- for (n = 0; n < bp_count; n++) {
+ for (n = 0; n < attrs_count; n++) {
uint32_t size = 0;
void *value = NULL;
- rc = get_attribute_ptr(temp, bp[n], &value, &size);
+ rc = get_attribute_ptr(temp, attrs[n], &value, &size);
if (rc == PKCS11_RV_NOT_FOUND) {
if (default_to_null) {
- rc = get_default_value(bp[n], &value, &size);
+ rc = get_default_value(attrs[n], &value, &size);
} else {
rc = PKCS11_CKR_OK;
continue;
@@ -278,7 +278,7 @@ static enum pkcs11_rc set_optional_attributes_with_def(struct obj_attrs **out,
if (rc)
return rc;
- rc = add_attribute(out, bp[n], value, size);
+ rc = add_attribute(out, attrs[n], value, size);
if (rc)
return rc;
}
@@ -288,18 +288,20 @@ static enum pkcs11_rc set_optional_attributes_with_def(struct obj_attrs **out,
static enum pkcs11_rc set_attributes_opt_or_null(struct obj_attrs **out,
struct obj_attrs *temp,
- uint32_t const *bp,
- size_t bp_count)
+ uint32_t const *attrs,
+ size_t attrs_count)
{
- return set_optional_attributes_with_def(out, temp, bp, bp_count, true);
+ return set_optional_attributes_with_def(out, temp, attrs, attrs_count,
+ true /* defaults to empty */);
}
static enum pkcs11_rc set_optional_attributes(struct obj_attrs **out,
struct obj_attrs *temp,
- uint32_t const *bp,
- size_t bp_count)
+ uint32_t const *attrs,
+ size_t attrs_count)
{
- return set_optional_attributes_with_def(out, temp, bp, bp_count, false);
+ return set_optional_attributes_with_def(out, temp, attrs, attrs_count,
+ false /* no default value */);
}
/*