forked from wolfSSL/wolfssl
add unique RNG missing error
This commit is contained in:
@ -386,6 +386,9 @@ const char* wc_GetErrorString(int error)
|
|||||||
case ASN_COUNTRY_SIZE_E:
|
case ASN_COUNTRY_SIZE_E:
|
||||||
return "Country code size error, either too small or large";
|
return "Country code size error, either too small or large";
|
||||||
|
|
||||||
|
case MISSING_RNG_E:
|
||||||
|
return "RNG required but not provided";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return "unknown error number";
|
return "unknown error number";
|
||||||
|
|
||||||
|
@ -812,7 +812,10 @@ static int mp_rand(mp_int* a, int digits, WC_RNG* rng)
|
|||||||
int ret;
|
int ret;
|
||||||
mp_digit d;
|
mp_digit d;
|
||||||
|
|
||||||
if (a == NULL || rng == NULL)
|
if (rng == NULL)
|
||||||
|
return MISSING_RNG_E;
|
||||||
|
|
||||||
|
if (a == NULL)
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
|
|
||||||
mp_zero(a);
|
mp_zero(a);
|
||||||
|
@ -173,6 +173,7 @@ enum {
|
|||||||
|
|
||||||
WC_KEY_SIZE_E = -234, /* Key size error, either too small or large */
|
WC_KEY_SIZE_E = -234, /* Key size error, either too small or large */
|
||||||
ASN_COUNTRY_SIZE_E = -235, /* ASN Cert Gen, invalid country code size */
|
ASN_COUNTRY_SIZE_E = -235, /* ASN Cert Gen, invalid country code size */
|
||||||
|
MISSING_RNG_E = -236, /* RNG required but not provided */
|
||||||
|
|
||||||
MIN_CODE_E = -300 /* errors -101 - -299 */
|
MIN_CODE_E = -300 /* errors -101 - -299 */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user