aboutsummaryrefslogtreecommitdiff
path: root/rpc_server.c
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2016-09-11 16:39:20 -0400
committerRob Austein <sra@hactrn.net>2016-09-11 16:39:20 -0400
commit421626cdc49cab03f9b4071ee9e836f8d095aa20 (patch)
tree8cf7ebc4c706f009bfcde3b21ee8a64061cce007 /rpc_server.c
parent52bafc94397795e196aa516df044994692f4705f (diff)
Explicit initialization of keystore drivers instead of guessing.
Diffstat (limited to 'rpc_server.c')
-rw-r--r--rpc_server.c18
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;
}