aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkcs11.c10
1 files 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");