aboutsummaryrefslogtreecommitdiff
path: root/hal.h
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2016-05-15 20:49:18 -0400
committerRob Austein <sra@hactrn.net>2016-05-15 20:49:18 -0400
commit0690aa3d48966a4b151a468fd3a0a65bb99de439 (patch)
treee88db7d7d677ea48d9bb3dbd57acc514785a44f7 /hal.h
parent53b0dd22287e07ca32184c27b7ec0d75d358bde4 (diff)
Add hal_rpc_pkey_rename(); allow null string as (temporary) key name.
Temporary nature of null string as key name is not enforced by the keystore code, it's just a convention to allow callers to generate a keypair, obtain the public key, hash that to a Subject Key Identifier (SKI), and rename the key using the SKI as the new name. This is a compromise to let us use SKI-based key names in PKCS #11 while keeping the keystore code simple.
Diffstat (limited to 'hal.h')
-rw-r--r--hal.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/hal.h b/hal.h
index 6fbfb9f..ee97e8a 100644
--- a/hal.h
+++ b/hal.h
@@ -129,6 +129,7 @@
DEFINE_HAL_ERROR(HAL_ERROR_RPC_TRANSPORT, "RPC transport error") \
DEFINE_HAL_ERROR(HAL_ERROR_RPC_PACKET_OVERFLOW, "RPC packet overflow") \
DEFINE_HAL_ERROR(HAL_ERROR_RPC_BAD_FUNCTION, "Bad RPC function number") \
+ DEFINE_HAL_ERROR(HAL_ERROR_KEY_NAME_TOO_LONG, "Key name too long") \
END_OF_HAL_ERROR_LIST
/* Marker to forestall silly line continuation errors */
@@ -350,7 +351,7 @@ extern hal_error_t hal_modexp(const hal_core_t *core,
*/
typedef enum {
- HAL_KEY_TYPE_NONE,
+ HAL_KEY_TYPE_NONE = 0,
HAL_KEY_TYPE_RSA_PRIVATE,
HAL_KEY_TYPE_RSA_PUBLIC,
HAL_KEY_TYPE_EC_PRIVATE,
@@ -685,6 +686,9 @@ extern hal_error_t hal_rpc_pkey_close(const hal_pkey_handle_t pkey);
extern hal_error_t hal_rpc_pkey_delete(const hal_pkey_handle_t pkey);
+extern hal_error_t hal_rpc_pkey_rename(const hal_pkey_handle_t pkey,
+ const uint8_t * const name, const size_t name_len);
+
extern hal_error_t hal_rpc_pkey_get_key_type(const hal_pkey_handle_t pkey,
hal_key_type_t *type);