[Cryptech-Commits] [sw/libhal] 11/14: Fix a few dumb compile-time bugs.
git at cryptech.is
git at cryptech.is
Thu Apr 6 23:38:10 UTC 2017
This is an automated email from the git hooks/post-receive script.
sra at hactrn.net pushed a commit to branch pkcs8
in repository sw/libhal.
commit b1c86e4c256258d155eb9f57edd1f27d7f7de68f
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Thu Apr 6 01:11:33 2017 -0400
Fix a few dumb compile-time bugs.
---
rpc_pkey.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/rpc_pkey.c b/rpc_pkey.c
index aff833b..4867f97 100644
--- a/rpc_pkey.c
+++ b/rpc_pkey.c
@@ -38,6 +38,7 @@
#include "hal.h"
#include "hal_internal.h"
+#include "asn1_internal.h"
#ifndef HAL_STATIC_PKEY_STATE_BLOCKS
#define HAL_STATIC_PKEY_STATE_BLOCKS 0
@@ -1137,7 +1138,7 @@ static hal_error_t pkey_local_export(const hal_pkey_handle_t pkey_handle,
if (err != HAL_OK)
goto fail;
- if ((err = hal_rsa_get_modulus(rsa, NULL, kek_len, 0)) != HAL_OK)
+ if ((err = hal_rsa_key_get_modulus(rsa, NULL, kek_len, 0)) != HAL_OK)
goto fail;
if (*kek_len > kek_max) {
@@ -1171,7 +1172,7 @@ static hal_error_t pkey_local_export(const hal_pkey_handle_t pkey_handle,
goto fail;
if ((err = hal_asn1_encode_pkcs8_encryptedprivatekeyinfo(hal_asn1_oid_rsaEncryption, hal_asn1_oid_rsaEncryption_len,
- kek, *kek_len, kek, *kek_len, kek_max)) != HAL_OK)
+ kek, *kek_len, kek, kek_len, kek_max)) != HAL_OK)
goto fail;
memset(rsabuf, 0, sizeof(rsabuf));
@@ -1196,8 +1197,9 @@ static hal_error_t pkey_local_import(const hal_client_handle_t client,
{
assert(pkey != NULL && name != NULL && pkcs8 != NULL && kek_ != NULL && kek_len > 2);
- uint8_t kek[KEK_LENGTH], rsabuf[hal_rsa_key_t_size], der[HAL_KS_WRAPPED_KEYSIZE], *d, *oid, *data;
+ uint8_t kek[KEK_LENGTH], rsabuf[hal_rsa_key_t_size], der[HAL_KS_WRAPPED_KEYSIZE], *d;
size_t der_len, oid_len, data_len;
+ const uint8_t *oid, *data;
hal_rsa_key_t *rsa = NULL;
hal_curve_name_t curve;
hal_key_type_t type;
More information about the Commits
mailing list