aboutsummaryrefslogtreecommitdiff
path: root/hal_internal.h
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2017-05-28 16:11:25 -0400
committerRob Austein <sra@hactrn.net>2017-05-28 16:11:25 -0400
commit2caa6c72640877abc5f3572c4d926a23ff672ab1 (patch)
tree91f74c4a1342e0d0d0add7d0564b26b1f744135c /hal_internal.h
parentf59533ee9807832ea5ca7dd5492592c8991a9f34 (diff)
Almost compiles.
Need to refactor init sequence slightly (again), this time to humor the bootloader, which has its own special read-only view of the PIN block in the token keystore.
Diffstat (limited to 'hal_internal.h')
-rw-r--r--hal_internal.h44
1 files changed, 42 insertions, 2 deletions
diff --git a/hal_internal.h b/hal_internal.h
index 667c5a4..e998ae3 100644
--- a/hal_internal.h
+++ b/hal_internal.h
@@ -397,8 +397,6 @@ extern hal_error_t hal_get_pin(const hal_user_t user,
extern hal_error_t hal_set_pin(const hal_user_t user,
const hal_ks_pin_t * const pin);
-extern void hal_ks_init_read_only_pins_only(void);
-
/*
* Master key memory (MKM) and key-encryption-key (KEK).
*
@@ -482,6 +480,48 @@ typedef struct hal_ks hal_ks_t;
extern hal_ks_t * const hal_ks_token;
extern hal_ks_t * const hal_ks_volatile;
+extern hal_error_t hal_ks_init(hal_ks_t *ks,
+ const int alloc);
+
+extern void hal_ks_init_read_only_pins_only(void);
+
+extern hal_error_t hal_ks_store(hal_ks_t *ks,
+ hal_pkey_slot_t *slot,
+ const uint8_t * const der, const size_t der_len);
+
+extern hal_error_t hal_ks_fetch(hal_ks_t *ks,
+ hal_pkey_slot_t *slot,
+ uint8_t *der, size_t *der_len, const size_t der_max);
+
+extern hal_error_t hal_ks_delete(hal_ks_t *ks,
+ hal_pkey_slot_t *slot);
+
+extern hal_error_t hal_ks_match(hal_ks_t *ks,
+ const hal_client_handle_t client,
+ const hal_session_handle_t session,
+ const hal_key_type_t type,
+ const hal_curve_name_t curve,
+ const hal_key_flags_t mask,
+ const hal_key_flags_t flags,
+ const hal_pkey_attribute_t *attributes,
+ const unsigned attributes_len,
+ hal_uuid_t *result,
+ unsigned *result_len,
+ const unsigned result_max,
+ const hal_uuid_t * const previous_uuid);
+
+extern hal_error_t hal_ks_set_attributes(hal_ks_t *ks,
+ hal_pkey_slot_t *slot,
+ const hal_pkey_attribute_t *attributes,
+ const unsigned attributes_len);
+
+extern hal_error_t hal_ks_get_attributes(hal_ks_t *ks,
+ hal_pkey_slot_t *slot,
+ hal_pkey_attribute_t *attributes,
+ const unsigned attributes_len,
+ uint8_t *attributes_buffer,
+ const size_t attributes_buffer_len);
+
/*
* RPC lowest-level send and receive routines. These are blocking, and
* transport-specific (sockets, USB).