aboutsummaryrefslogtreecommitdiff
path: root/rpc_pkey.c
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2016-11-10 21:44:22 -0500
committerRob Austein <sra@hactrn.net>2016-11-10 21:44:22 -0500
commit2ff032823f6acf0cc409c0e541041ebe1f0dbc75 (patch)
tree547c9c218a147f500c341e74afa8df2ba8642c1e /rpc_pkey.c
parent1f78f1bad3ab08706df3030936275b6114f31e24 (diff)
Clean out huge swacks of RPC API we don't need anymore.
pkey attribute API is now just set_attributes() and get_attributes().
Diffstat (limited to 'rpc_pkey.c')
-rw-r--r--rpc_pkey.c101
1 files changed, 1 insertions, 100 deletions
diff --git a/rpc_pkey.c b/rpc_pkey.c
index 50403d7..0310647 100644
--- a/rpc_pkey.c
+++ b/rpc_pkey.c
@@ -977,77 +977,6 @@ static hal_error_t pkey_local_match(const hal_client_handle_t client,
return err;
}
-static hal_error_t pkey_local_set_attribute(const hal_pkey_handle_t pkey,
- const uint32_t type,
- const uint8_t * const value,
- const size_t value_len)
-{
- hal_pkey_slot_t *slot = find_handle(pkey);
-
- if (slot == NULL)
- return HAL_ERROR_KEY_NOT_FOUND;
-
- hal_ks_t *ks = NULL;
- hal_error_t err;
-
- if ((err = check_writable(slot->client_handle, slot->flags)) != HAL_OK)
- return err;
-
- if ((err = ks_open_from_flags(&ks, slot->flags)) == HAL_OK &&
- (err = hal_ks_set_attribute(ks, slot, type, value, value_len)) == HAL_OK)
- err = hal_ks_close(ks);
- else if (ks != NULL)
- (void) hal_ks_close(ks);
-
- return err;
-}
-
-static hal_error_t pkey_local_get_attribute(const hal_pkey_handle_t pkey,
- const uint32_t type,
- uint8_t *value,
- size_t *value_len,
- const size_t value_max)
-{
- hal_pkey_slot_t *slot = find_handle(pkey);
-
- if (slot == NULL)
- return HAL_ERROR_KEY_NOT_FOUND;
-
- hal_ks_t *ks = NULL;
- hal_error_t err;
-
- if ((err = ks_open_from_flags(&ks, slot->flags)) == HAL_OK &&
- (err = hal_ks_get_attribute(ks, slot, type, value, value_len, value_max)) == HAL_OK)
- err = hal_ks_close(ks);
- else if (ks != NULL)
- (void) hal_ks_close(ks);
-
- return err;
-}
-
-static hal_error_t pkey_local_delete_attribute(const hal_pkey_handle_t pkey,
- const uint32_t type)
-{
- hal_pkey_slot_t *slot = find_handle(pkey);
-
- if (slot == NULL)
- return HAL_ERROR_KEY_NOT_FOUND;
-
- hal_ks_t *ks = NULL;
- hal_error_t err;
-
- if ((err = check_writable(slot->client_handle, slot->flags)) != HAL_OK)
- return err;
-
- if ((err = ks_open_from_flags(&ks, slot->flags)) == HAL_OK &&
- (err = hal_ks_delete_attribute(ks, slot, type)) == HAL_OK)
- err = hal_ks_close(ks);
- else if (ks != NULL)
- (void) hal_ks_close(ks);
-
- return err;
-}
-
static hal_error_t pkey_local_set_attributes(const hal_pkey_handle_t pkey,
const hal_rpc_pkey_attribute_t *attributes,
const unsigned attributes_len)
@@ -1096,30 +1025,6 @@ static hal_error_t pkey_local_get_attributes(const hal_pkey_handle_t pkey,
return err;
}
-static hal_error_t pkey_local_delete_attributes(const hal_pkey_handle_t pkey,
- const uint32_t * const types,
- const unsigned types_len)
-{
- hal_pkey_slot_t *slot = find_handle(pkey);
-
- if (slot == NULL)
- return HAL_ERROR_KEY_NOT_FOUND;
-
- hal_ks_t *ks = NULL;
- hal_error_t err;
-
- if ((err = check_writable(slot->client_handle, slot->flags)) != HAL_OK)
- return err;
-
- if ((err = ks_open_from_flags(&ks, slot->flags)) == HAL_OK &&
- (err = hal_ks_delete_attributes(ks, slot, types, types_len)) == HAL_OK)
- err = hal_ks_close(ks);
- else if (ks != NULL)
- (void) hal_ks_close(ks);
-
- return err;
-}
-
const hal_rpc_pkey_dispatch_t hal_rpc_local_pkey_dispatch = {
pkey_local_load,
pkey_local_find,
@@ -1136,12 +1041,8 @@ const hal_rpc_pkey_dispatch_t hal_rpc_local_pkey_dispatch = {
pkey_local_verify,
pkey_local_list,
pkey_local_match,
- pkey_local_set_attribute,
- pkey_local_get_attribute,
- pkey_local_delete_attribute,
pkey_local_set_attributes,
- pkey_local_get_attributes,
- pkey_local_delete_attributes
+ pkey_local_get_attributes
};
/*