diff options
author | Rob Austein <sra@hactrn.net> | 2016-09-11 16:39:20 -0400 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2016-09-11 16:39:20 -0400 |
commit | 421626cdc49cab03f9b4071ee9e836f8d095aa20 (patch) | |
tree | 8cf7ebc4c706f009bfcde3b21ee8a64061cce007 /rpc_server.c | |
parent | 52bafc94397795e196aa516df044994692f4705f (diff) |
Explicit initialization of keystore drivers instead of guessing.
Diffstat (limited to 'rpc_server.c')
-rw-r--r-- | rpc_server.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/rpc_server.c b/rpc_server.c index 9397d3e..22e354a 100644 --- a/rpc_server.c +++ b/rpc_server.c @@ -807,12 +807,26 @@ const hal_rpc_pkey_dispatch_t *hal_rpc_pkey_dispatch = &hal_rpc_local_pkey_dispa hal_error_t hal_rpc_server_init(void) { - return hal_rpc_server_transport_init(); + hal_error_t err; + + if ((err = hal_ks_init(hal_ks_volatile_driver)) != HAL_OK || + (err = hal_ks_init(hal_ks_token_driver)) != HAL_OK || + (err = hal_rpc_server_transport_init()) != HAL_OK) + return err; + + return HAL_OK; } hal_error_t hal_rpc_server_close(void) { - return hal_rpc_server_transport_close(); + hal_error_t err; + + if ((err = hal_rpc_server_transport_close()) != HAL_OK || + (err = hal_ks_shutdown(hal_ks_token_driver)) != HAL_OK || + (err = hal_ks_shutdown(hal_ks_volatile_driver)) != HAL_OK) + return err; + + return HAL_OK; } |