[Cryptech-Commits] [sw/libhal] 01/02: Debug most recent changes to C client RPC API.

git at cryptech.is git at cryptech.is
Sun Nov 6 06:16:14 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 0bd1d5a0f3115c950bcb342788760081f8b8cf98
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Sat Nov 5 21:49:16 2016 -0400

    Debug most recent changes to C client RPC API.
---
 rpc_client.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/rpc_client.c b/rpc_client.c
index 2df30b1..0bd3ed5 100644
--- a/rpc_client.c
+++ b/rpc_client.c
@@ -635,7 +635,7 @@ static hal_error_t pkey_remote_get_key_curve(const hal_pkey_handle_t pkey,
 
   check(hal_xdr_decode_int(&iptr, ilimit, &rpc_ret));
   if (rpc_ret == HAL_OK) {
-    check(hal_xdr_decode_int(&iptr, ilimit, &type32));
+    check(hal_xdr_decode_int(&iptr, ilimit, &curve32));
     *curve = (hal_curve_name_t)curve32;
   }
   return rpc_ret;
@@ -840,9 +840,9 @@ static hal_error_t pkey_remote_match(const hal_client_handle_t client,
   size_t attributes_buffer_len = 0;
   if (attributes != NULL)
     for (int i = 0; i < attributes_len; i++)
-      attributes_buffer_len += attributes[i].length;
+      attributes_buffer_len += pad(attributes[i].length);
 
-  uint8_t outbuf[nargs(9 + attributes_len * 2) + pad(attributes_buffer_len) + pad(sizeof(hal_uuid_t))];
+  uint8_t outbuf[nargs(9 + attributes_len * 2) + attributes_buffer_len + pad(sizeof(hal_uuid_t))];
   uint8_t *optr = outbuf, *olimit = outbuf + sizeof(outbuf);
   uint8_t inbuf[nargs(4) + pad(result_max * sizeof(hal_uuid_t))];
   const uint8_t *iptr = inbuf, *ilimit = inbuf + sizeof(inbuf);



More information about the Commits mailing list