From 306c1dec5eb20da03bc9569aab83ae97a2ca9e7a Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sat, 19 Nov 2016 21:16:52 -0500 Subject: Support queries for attribute length and presence. Calling hal_rpc_pkey_get_attributes() with attribute_buffer_len = 0 now changes the return behavior so that it reports the lengths of attributes listed in the query, with a length of zero for attributes not present at all. This is mostly to support C_GetAttributeValue() in PKCS #11, but we also use it to make the Python interface a bit kinder to the user. --- hal_internal.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'hal_internal.h') diff --git a/hal_internal.h b/hal_internal.h index 9685b0c..0794d37 100644 --- a/hal_internal.h +++ b/hal_internal.h @@ -649,8 +649,7 @@ static inline hal_error_t hal_ks_get_attributes(hal_ks_t *ks, const size_t attributes_buffer_len) { if (ks == NULL || ks->driver == NULL || slot == NULL || - attributes == NULL || attributes_len == 0 || - attributes_buffer == NULL || attributes_buffer_len == 0) + attributes == NULL || attributes_len == 0) return HAL_ERROR_BAD_ARGUMENTS; if (ks->driver->get_attributes == NULL) -- cgit v1.2.3