aboutsummaryrefslogtreecommitdiff
path: root/rpc_pkey.c
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2016-09-09 00:33:52 -0400
committerRob Austein <sra@hactrn.net>2016-09-09 00:33:52 -0400
commitb1214089088d0321142f64abf2c820da9561bba9 (patch)
tree05a86d0c7ab9339a2102e8328f13fadd9a31330a /rpc_pkey.c
parent97ee7df6092551774b4c112a0349a25e76a684f3 (diff)
Simplify hal_rpc_pkey_find() by removing `type` argument.
Now that key names are UUIDs generated by the HSM, there's no real need to specify type key type when looking up a key, and removing the `type` argument allows a few simplifications of both the internal keystore API and of client code calling the public RPC API.
Diffstat (limited to 'rpc_pkey.c')
-rw-r--r--rpc_pkey.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/rpc_pkey.c b/rpc_pkey.c
index 069a73b..cf0975b 100644
--- a/rpc_pkey.c
+++ b/rpc_pkey.c
@@ -191,9 +191,9 @@ static hal_error_t pkey_local_load(const hal_client_handle_t client,
if ((err = hal_uuid_gen(&slot->name)) != HAL_OK)
return err;
- slot->client_handle = client;
+ slot->client_handle = client;
slot->session_handle = session;
- slot->type = type;
+ slot->type = type;
slot->curve = curve;
slot->flags = flags;
@@ -220,7 +220,6 @@ static hal_error_t pkey_local_load(const hal_client_handle_t client,
static hal_error_t pkey_local_find(const hal_client_handle_t client,
const hal_session_handle_t session,
hal_pkey_handle_t *pkey,
- const hal_key_type_t type,
const hal_uuid_t * const name,
const hal_key_flags_t flags)
{
@@ -236,7 +235,6 @@ static hal_error_t pkey_local_find(const hal_client_handle_t client,
slot->name = *name;
slot->client_handle = client;
slot->session_handle = session;
- slot->type = type;
if ((err = ks_open_from_flags(&ks, flags)) == HAL_OK &&
(err = hal_ks_fetch(ks, slot, NULL, NULL, 0)) == HAL_OK)
@@ -279,9 +277,9 @@ static hal_error_t pkey_local_generate_rsa(const hal_client_handle_t client,
if ((err = hal_uuid_gen(&slot->name)) != HAL_OK)
return err;
- slot->client_handle = client;
+ slot->client_handle = client;
slot->session_handle = session;
- slot->type = HAL_KEY_TYPE_RSA_PRIVATE;
+ slot->type = HAL_KEY_TYPE_RSA_PRIVATE;
slot->curve = HAL_CURVE_NONE;
slot->flags = flags;
@@ -340,9 +338,9 @@ static hal_error_t pkey_local_generate_ec(const hal_client_handle_t client,
if ((err = hal_uuid_gen(&slot->name)) != HAL_OK)
return err;
- slot->client_handle = client;
+ slot->client_handle = client;
slot->session_handle = session;
- slot->type = HAL_KEY_TYPE_EC_PRIVATE;
+ slot->type = HAL_KEY_TYPE_EC_PRIVATE;
slot->curve = curve;
slot->flags = flags;