From b1214089088d0321142f64abf2c820da9561bba9 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Fri, 9 Sep 2016 00:33:52 -0400 Subject: 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. --- rpc_pkey.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'rpc_pkey.c') 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; -- cgit v1.2.3