[Cryptech-Commits] [user/sra/pkcs11] 05/05: Fix a few new warnings on the Novena.

git at cryptech.is git at cryptech.is
Sat Jun 27 03:26:58 UTC 2015


This is an automated email from the git hooks/post-receive script.

sra at hactrn.net pushed a commit to branch master
in repository user/sra/pkcs11.

commit af566e0a410b81832d9b107833d1c978e02ef48d
Author: Rob Austein <sra at hactrn.net>
Date:   Wed Jun 24 19:29:44 2015 -0400

    Fix a few new warnings on the Novena.
---
 pkcs11.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/pkcs11.c b/pkcs11.c
index 255069a..74886b8 100644
--- a/pkcs11.c
+++ b/pkcs11.c
@@ -1932,9 +1932,8 @@ static CK_RV generate_keypair_rsa_pkcs(p11_session_t *session,
     keybuf[hal_rsa_key_t_size],
     modulus[hal_rsa_key_t_size/8],
     public_exponent[hal_rsa_key_t_size/8];
-  size_t
-    modulus_len,
-    public_exponent_len;
+  size_t modulus_len;
+  CK_ULONG public_exponent_len;
   hal_rsa_key_t key = { NULL };
   CK_ULONG keysize = 0;
   CK_RV rv;
@@ -2019,7 +2018,7 @@ static CK_RV generate_keypair_rsa_pkcs(p11_session_t *session,
       !p11_attribute_get(public_handle, CKA_PUBLIC_EXPONENT,
                          public_exponent, &public_exponent_len, sizeof(public_exponent))	||
       !hal_check(hal_rsa_key_gen(&key, keybuf, sizeof(keybuf), keysize/8,
-                                 public_exponent, public_exponent_len))        			||
+                                 public_exponent, (size_t) public_exponent_len))                ||
       !p11_object_set_rsa_private_key(private_handle, key)                                      ||
       !hal_check(hal_rsa_key_get_modulus(key, modulus, &modulus_len, sizeof(modulus)))          ||
       !p11_attribute_set(public_handle,  CKA_MODULUS, modulus, modulus_len)                     ||
@@ -2134,7 +2133,8 @@ static int pkcs1_5_pad(const uint8_t * const data, const size_t data_len,
   memcpy(block + block_len - data_len, data, data_len);
 
 #if DEBUG_PKCS11 > 1
-  fprintf(stderr, "[PKCS #1.5 block_len %lu data_len %lu block ", block_len, data_len);
+  fprintf(stderr, "[PKCS #1.5 block_len %lu data_len %lu block ",
+          (unsigned long) block_len, (unsigned long) data_len);
   for (int i = 0; i < block_len; i++)
     fprintf(stderr, "%s%02x", i == 0 ? "" : ":", block[i]);
   fprintf(stderr, "]\n");



More information about the Commits mailing list