[Cryptech-Commits] [sw/libhal] 03/04: pkey_match() should just skip keys it lacks permission to read.

git at cryptech.is git at cryptech.is
Tue Nov 22 05:27:04 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 834924b3e4d827f6db03d307a88e23bf95dc4624
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Mon Nov 21 09:25:16 2016 -0500

    pkey_match() should just skip keys it lacks permission to read.
---
 rpc_pkey.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/rpc_pkey.c b/rpc_pkey.c
index 3788f5e..98b0ba1 100644
--- a/rpc_pkey.c
+++ b/rpc_pkey.c
@@ -945,7 +945,15 @@ static hal_error_t pkey_local_match(const hal_client_handle_t client,
   hal_ks_t *ks = NULL;
   hal_error_t err;
 
-  if ((err = check_readable(client, flags)) != HAL_OK)
+  err = check_readable(client, flags);
+
+  if (err == HAL_ERROR_FORBIDDEN) {
+    assert(result_len != NULL);
+    *result_len = 0;
+    return HAL_OK;
+  }
+
+  if (err != HAL_OK)
     return err;
 
   if ((err = ks_open_from_flags(&ks, flags)) == HAL_OK &&



More information about the Commits mailing list