From 19de5cd21bde4dcee12c40cd53d5592cbd91bc7b Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sun, 15 May 2016 23:49:03 -0400 Subject: Tweak keystore API to allow update-in-place, so hal_ks_rename() will work. --- ks_volatile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ks_volatile.c') diff --git a/ks_volatile.c b/ks_volatile.c index 9a47d52..00f656a 100644 --- a/ks_volatile.c +++ b/ks_volatile.c @@ -72,9 +72,10 @@ const hal_ks_keydb_t *hal_ks_get_keydb(void) } hal_error_t hal_ks_set_keydb(const hal_ks_key_t * const key, - const int loc) + const int loc, + const int updating) { - if (key == NULL || loc < 0 || loc >= sizeof(db->keys)/sizeof(*db->keys) || key->in_use) + if (key == NULL || loc < 0 || loc >= sizeof(db->keys)/sizeof(*db->keys) || (!key->in_use != !updating)) return HAL_ERROR_BAD_ARGUMENTS; db->keys[loc] = *key; -- cgit v1.2.3