diff options
author | Paul Selkirk <paul@psgd.org> | 2018-02-27 18:00:08 +0100 |
---|---|---|
committer | Paul Selkirk <paul@psgd.org> | 2018-02-27 18:00:08 +0100 |
commit | 3f374757fdfde32abceb88adca31d21f2b05cab1 (patch) | |
tree | f14ff60badf35807e08a34fd047e9d4be5b555e6 /ks.c | |
parent | b87e7392cdc71b3a69728d7fb40a6697eeeed09e (diff) |
Add hal_ks_available
Diffstat (limited to 'ks.c')
-rw-r--r-- | ks.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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 |