Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions examples/eckeygen.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@ static int parse_hex_key_id(const char *input, unsigned char **output, size_t *s
return -1;
}
*size = len / 2;
*output = OPENSSL_zalloc(*size);
*output = OPENSSL_malloc(*size);
if (!*output) {
return -1;
}
memset(*output, 0, *size);
for (i = 0; i < *size; i++) {
sscanf(input + (i * 2), "%2hhx", &(*output)[i]);
sscanf(input + (i * 2), "%2hhx", *output + i);
}
return 0;
}
Expand Down
5 changes: 3 additions & 2 deletions examples/rsakeygen.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@ static int parse_hex_key_id(const char *input, unsigned char **output, size_t *s
return -1;
}
*size = len / 2;
*output = OPENSSL_zalloc(*size);
*output = OPENSSL_malloc(*size);
if (!*output) {
return -1;
}
memset(*output, 0, *size);
for (i = 0; i < *size; i++) {
sscanf(input + (i * 2), "%2hhx", &(*output)[i]);
sscanf(input + (i * 2), "%2hhx", *output + i);
}
return 0;
}
Expand Down
7 changes: 7 additions & 0 deletions src/p11_ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ typedef int (*compute_key_fn)(void *, size_t,
void *(*)(const void *, size_t, void *, size_t *));
#endif
static compute_key_fn ossl_ecdh_compute_key;

#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
static void (*ossl_ec_finish)(EC_KEY *);
static int (*ossl_ec_copy)(EC_KEY *, const EC_KEY *);
#endif /* OPENSSL_VERSION_NUMBER */

static int ec_ex_index = 0;

Expand Down Expand Up @@ -445,6 +448,8 @@ static int pkcs11_ecdsa_sign(const unsigned char *msg, unsigned int msg_len,
return ck_sigsize;
}

#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)

static void pkcs11_ec_finish(EC_KEY *ec)
{
PKCS11_OBJECT_private *key;
Expand All @@ -458,6 +463,8 @@ static void pkcs11_ec_finish(EC_KEY *ec)
ossl_ec_finish(ec);
}

#endif /* OPENSSL_VERSION_NUMBER */

/**
* ECDSA signing method (replaces ossl_ecdsa_sign_sig)
*
Expand Down
Loading