forked from wolfSSL/wolfssl
PKCS#11 fix: Generate ECC key for decrypt/sign or derive
Add debugging information to PKCS#11.
This commit is contained in:
@ -4401,9 +4401,10 @@ int wc_ecc_make_pub_ex(ecc_key* key, ecc_point* pubOut, WC_RNG* rng)
|
||||
}
|
||||
|
||||
|
||||
WOLFSSL_ABI
|
||||
int wc_ecc_make_key_ex(WC_RNG* rng, int keysize, ecc_key* key, int curve_id)
|
||||
int wc_ecc_make_key_ex2(WC_RNG* rng, int keysize, ecc_key* key, int curve_id,
|
||||
int flags)
|
||||
{
|
||||
|
||||
int err;
|
||||
#if !defined(WOLFSSL_ATECC508A) && !defined(WOLFSSL_ATECC608A) && \
|
||||
!defined(WOLFSSL_CRYPTOCELL)
|
||||
@ -4431,6 +4432,8 @@ int wc_ecc_make_key_ex(WC_RNG* rng, int keysize, ecc_key* key, int curve_id)
|
||||
return err;
|
||||
}
|
||||
|
||||
key->flags = flags;
|
||||
|
||||
#ifdef WOLF_CRYPTO_CB
|
||||
if (key->devId != INVALID_DEVID) {
|
||||
err = wc_CryptoCb_MakeEccKey(rng, keysize, key, curve_id);
|
||||
@ -4607,6 +4610,12 @@ int wc_ecc_make_key_ex(WC_RNG* rng, int keysize, ecc_key* key, int curve_id)
|
||||
return err;
|
||||
}
|
||||
|
||||
WOLFSSL_ABI
|
||||
int wc_ecc_make_key_ex(WC_RNG* rng, int keysize, ecc_key* key, int curve_id)
|
||||
{
|
||||
return wc_ecc_make_key_ex2(rng, keysize, key, curve_id, WC_ECC_FLAG_NONE);
|
||||
}
|
||||
|
||||
#ifdef ECC_DUMP_OID
|
||||
/* Optional dump of encoded OID for adding new curves */
|
||||
static int mOidDumpDone;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -352,10 +352,11 @@ typedef struct {
|
||||
|
||||
/* ECC Flags */
|
||||
enum {
|
||||
WC_ECC_FLAG_NONE = 0x00,
|
||||
WC_ECC_FLAG_NONE = 0x00,
|
||||
#ifdef HAVE_ECC_CDH
|
||||
WC_ECC_FLAG_COFACTOR = 0x01,
|
||||
#endif
|
||||
WC_ECC_FLAG_DEC_SIGN = 0x02,
|
||||
};
|
||||
|
||||
/* ECC non-blocking */
|
||||
@ -477,6 +478,9 @@ int wc_ecc_make_key(WC_RNG* rng, int keysize, ecc_key* key);
|
||||
WOLFSSL_ABI WOLFSSL_API
|
||||
int wc_ecc_make_key_ex(WC_RNG* rng, int keysize, ecc_key* key, int curve_id);
|
||||
WOLFSSL_API
|
||||
int wc_ecc_make_key_ex2(WC_RNG* rng, int keysize, ecc_key* key, int curve_id,
|
||||
int flags);
|
||||
WOLFSSL_API
|
||||
int wc_ecc_make_pub(ecc_key* key, ecc_point* pubOut);
|
||||
WOLFSSL_API
|
||||
int wc_ecc_make_pub_ex(ecc_key* key, ecc_point* pubOut, WC_RNG* rng);
|
||||
|
Reference in New Issue
Block a user