[Cryptech-Commits] [sw/libhal] 03/12: Missed a few instances of type-based key naming in keystore drivers.

git at cryptech.is git at cryptech.is
Fri Sep 16 19:53:11 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 13718c804fd2b20a50cd0fe318390c3b2d24de32
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Fri Sep 9 15:34:32 2016 -0400

    Missed a few instances of type-based key naming in keystore drivers.
---
 ks_flash.c    | 4 ++--
 ks_volatile.c | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/ks_flash.c b/ks_flash.c
index 9393100..a53edcf 100644
--- a/ks_flash.c
+++ b/ks_flash.c
@@ -306,7 +306,7 @@ static hal_error_t ks_fetch(hal_ks_t *ks,
                             hal_pkey_slot_t *slot,
                             uint8_t *der, size_t *der_len, const size_t der_max)
 {
-  if (ks != &db.ks || slot == NULL || !acceptable_key_type(slot->type))
+  if (ks != &db.ks || slot == NULL)
     return HAL_ERROR_BAD_ARGUMENTS;
 
   const hal_ks_key_t * const k = find(&slot->name);
@@ -479,7 +479,7 @@ static hal_error_t ks_store(hal_ks_t *ks,
 static hal_error_t ks_delete(hal_ks_t *ks,
                              const hal_pkey_slot_t * const slot)
 {
-  if (ks != &db.ks || slot == NULL || !acceptable_key_type(slot->type))
+  if (ks != &db.ks || slot == NULL)
     return HAL_ERROR_BAD_ARGUMENTS;
 
   hal_ks_key_t *k = find(&slot->name);
diff --git a/ks_volatile.c b/ks_volatile.c
index d4f8ebd..4ff23fb 100644
--- a/ks_volatile.c
+++ b/ks_volatile.c
@@ -142,7 +142,6 @@ static hal_error_t ks_store(hal_ks_t *ks,
     if (!ksv->db->keys[i].in_use && loc < 0)
       loc = i;
     if (ksv->db->keys[i].in_use &&
-        ksv->db->keys[i].type == slot->type &&
         hal_uuid_cmp(&ksv->db->keys[i].name, &slot->name) == 0)
       return HAL_ERROR_KEY_NAME_IN_USE;
   }



More information about the Commits mailing list