diff options
author | Rob Austein <sra@hactrn.net> | 2015-12-23 21:35:28 -0500 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2015-12-23 21:35:28 -0500 |
commit | a1e4e4fe7331338ece1a6d3ba01862a35a22f4ae (patch) | |
tree | bfccf359539f1d98d314eea4e3043e9f379cc3c1 /ks_mmap.c | |
parent | 0fc5ab986329e48ac8de0fd8fa12455c1e6345af (diff) |
RPC interface to TRNG and (incomplete) PIN code.
Diffstat (limited to 'ks_mmap.c')
-rw-r--r-- | ks_mmap.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -116,6 +116,25 @@ hal_error_t hal_ks_del_keydb(const int loc) return HAL_OK; } +hal_error_t hal_ks_set_pin(const hal_user_t user, + const hal_ks_pin_t * const pin) +{ + if (pin == NULL) + return HAL_ERROR_BAD_ARGUMENTS; + + hal_ks_pin_t *p = NULL; + + switch (user) { + case HAL_USER_WHEEL: p = &db->wheel_pin; break; + case HAL_USER_SO: p = &db->so_pin; break; + case HAL_USER_NORMAL: p = &db->user_pin; break; + default: return HAL_ERROR_BAD_ARGUMENTS; + } + + *p = *pin; + return HAL_OK; +} + /* * Local variables: * indent-tabs-mode: nil |