forked from wolfSSL/wolfssl
For ED255219 and ED448 if importing private only and public key is already set then check it.
This commit is contained in:
@ -1054,6 +1054,11 @@ int wc_ed25519_import_private_only(const byte* priv, word32 privSz,
|
|||||||
XMEMCPY(key->k, priv, ED25519_KEY_SIZE);
|
XMEMCPY(key->k, priv, ED25519_KEY_SIZE);
|
||||||
key->privKeySet = 1;
|
key->privKeySet = 1;
|
||||||
|
|
||||||
|
if (key->pubKeySet) {
|
||||||
|
/* Validate loaded public key */
|
||||||
|
return wc_ed25519_check_key(key);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -997,6 +997,11 @@ int wc_ed448_import_private_only(const byte* priv, word32 privSz,
|
|||||||
key->privKeySet = 1;
|
key->privKeySet = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((ret == 0) && key->pubKeySet) {
|
||||||
|
/* Validate loaded public key */
|
||||||
|
ret = wc_ed448_check_key(key);
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,8 +44,8 @@ decouple library dependencies with standard string, memory and so on.
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* This struct is used multiple time by other structs and
|
* This struct is used multiple time by other structs and
|
||||||
* needs to be defined somwhere that all structs can import
|
* needs to be defined somewhere that all structs can import
|
||||||
* (with minimal depencencies).
|
* (with minimal dependencies).
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_EX_DATA
|
#ifdef HAVE_EX_DATA
|
||||||
#ifdef HAVE_EX_DATA_CLEANUP_HOOKS
|
#ifdef HAVE_EX_DATA_CLEANUP_HOOKS
|
||||||
@ -208,14 +208,14 @@ decouple library dependencies with standard string, memory and so on.
|
|||||||
#elif defined(WC_16BIT_CPU)
|
#elif defined(WC_16BIT_CPU)
|
||||||
#undef WORD64_AVAILABLE
|
#undef WORD64_AVAILABLE
|
||||||
typedef word16 wolfssl_word;
|
typedef word16 wolfssl_word;
|
||||||
#define MP_16BIT /* for mp_int, mp_word needs to be twice as big as
|
#define MP_16BIT /* for mp_int, mp_word needs to be twice as big as \
|
||||||
mp_digit, no 64 bit type so make mp_digit 16 bit */
|
* mp_digit, no 64 bit type so make mp_digit 16 bit */
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#undef WORD64_AVAILABLE
|
#undef WORD64_AVAILABLE
|
||||||
typedef word32 wolfssl_word;
|
typedef word32 wolfssl_word;
|
||||||
#define MP_16BIT /* for mp_int, mp_word needs to be twice as big as
|
#define MP_16BIT /* for mp_int, mp_word needs to be twice as big as \
|
||||||
mp_digit, no 64 bit type so make mp_digit 16 bit */
|
* mp_digit, no 64 bit type so make mp_digit 16 bit */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct w64wrapper {
|
typedef struct w64wrapper {
|
||||||
|
Reference in New Issue
Block a user