[Cryptech-Commits] [sw/libhal] 08/12: Doh, allow keystore reinitialization after unclean reboot.

git at cryptech.is git at cryptech.is
Fri Sep 16 19:53:16 UTC 2016


This is an automated email from the git hooks/post-receive script.

sra at hactrn.net pushed a commit to branch ksng
in repository sw/libhal.

commit 73d62a85a904b64e259d523dadb45ad4ee8e2c2f
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Mon Sep 12 02:06:18 2016 -0400

    Doh, allow keystore reinitialization after unclean reboot.
---
 ks_flash.c    | 3 ---
 ks_volatile.c | 2 --
 2 files changed, 5 deletions(-)

diff --git a/ks_flash.c b/ks_flash.c
index c9c37b8..fdc800f 100644
--- a/ks_flash.c
+++ b/ks_flash.c
@@ -102,9 +102,6 @@ static inline uint32_t _get_key_offset(uint32_t num)
 
 static hal_error_t ks_init(const hal_ks_driver_t * const driver)
 {
-  if (db.ks.driver != NULL)
-    return HAL_ERROR_KEYSTORE_ACCESS;
-
   uint8_t page_buf[KEYSTORE_PAGE_SIZE];
   uint32_t idx = 0;             /* Current index into db.keys[] */
 
diff --git a/ks_volatile.c b/ks_volatile.c
index 290c356..3c9cba5 100644
--- a/ks_volatile.c
+++ b/ks_volatile.c
@@ -126,8 +126,6 @@ static hal_error_t ks_init(db_t *db)
 
 static hal_error_t ks_volatile_init(const hal_ks_driver_t * const driver)
 {
-  if (volatile_ks.ks.driver != NULL)
-    return HAL_ERROR_KEYSTORE_ACCESS;
   volatile_ks.ks.driver = driver;
   volatile_ks.db = &volatile_db;
   return ks_init(volatile_ks.db);



More information about the Commits mailing list