aboutsummaryrefslogtreecommitdiff
path: root/ks.c
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2018-02-27 18:00:08 +0100
committerPaul Selkirk <paul@psgd.org>2018-04-19 18:57:32 -0400
commitefc47f47581bb164440b86e9e57382972a32dbe8 (patch)
tree26bd9adeccede30df05b4506a3829ae4d1f64af8 /ks.c
parent67d4de2fdb0cb473e53da52b8639a27ce0dfc2b7 (diff)
Add hal_ks_available
Diffstat (limited to 'ks.c')
-rw-r--r--ks.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ks.c b/ks.c
index 1598679..f145adc 100644
--- a/ks.c
+++ b/ks.c
@@ -1010,6 +1010,18 @@ hal_error_t hal_ks_rewrite_der(hal_ks_t *ks,
return err;
}
+hal_error_t hal_ks_available(hal_ks_t *ks, size_t *count)
+{
+ if (ks == NULL || count == NULL)
+ return HAL_ERROR_BAD_ARGUMENTS;
+
+ hal_ks_lock();
+ *count = ks->size - ks->used;
+ hal_ks_unlock();
+
+ return HAL_OK;
+}
+
/*
* Local variables:
* indent-tabs-mode: nil