mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-02-03 23:25:05 +01:00
@@ -2143,7 +2143,6 @@ static int _DhSetKey(DhKey* key, const byte* p, word32 pSz, const byte* g,
|
||||
int ret = 0;
|
||||
mp_int* keyP = NULL;
|
||||
mp_int* keyG = NULL;
|
||||
mp_int* keyQ = NULL;
|
||||
|
||||
if (key == NULL || p == NULL || g == NULL || pSz == 0 || gSz == 0) {
|
||||
ret = BAD_FUNC_ARG;
|
||||
@@ -2203,13 +2202,9 @@ static int _DhSetKey(DhKey* key, const byte* p, word32 pSz, const byte* g,
|
||||
if (ret == 0 && q != NULL) {
|
||||
if (mp_read_unsigned_bin(&key->q, q, qSz) != MP_OKAY)
|
||||
ret = MP_INIT_E;
|
||||
else
|
||||
keyQ = &key->q;
|
||||
}
|
||||
|
||||
if (ret != 0 && key != NULL) {
|
||||
if (keyQ)
|
||||
mp_clear(keyQ);
|
||||
if (keyG)
|
||||
mp_clear(keyG);
|
||||
if (keyP)
|
||||
|
||||
@@ -1401,6 +1401,9 @@ int wolfSSL_EVP_PKEY_keygen(WOLFSSL_EVP_PKEY_CTX *ctx,
|
||||
if (pkey == NULL) {
|
||||
ownPkey = 1;
|
||||
pkey = wolfSSL_PKEY_new();
|
||||
|
||||
if (pkey == NULL)
|
||||
return ret;
|
||||
}
|
||||
|
||||
switch (pkey->type) {
|
||||
|
||||
@@ -2838,6 +2838,14 @@ int mp_set_bit (mp_int * a, int b)
|
||||
{
|
||||
int i = b / DIGIT_BIT, res;
|
||||
|
||||
/*
|
||||
* Require:
|
||||
* bit index b >= 0
|
||||
* a->alloc == a->used == 0 if a->dp == NULL
|
||||
*/
|
||||
if (b < 0 || (a->dp == NULL && (a->alloc != 0 || a->used != 0)))
|
||||
return MP_VAL;
|
||||
|
||||
if (a->dp == NULL || a->used < (int)(i + 1)) {
|
||||
/* grow a to accommodate the single bit */
|
||||
if ((res = mp_grow (a, i + 1)) != MP_OKAY) {
|
||||
|
||||
@@ -11419,7 +11419,9 @@ authenv_atrbend:
|
||||
XFREE(decryptedKey, pkcs7->heap, DYNAMIC_TYPE_PKCS7);
|
||||
decryptedKey = NULL;
|
||||
#ifdef WOLFSSL_SMALL_STACK
|
||||
#ifndef NO_PKCS7_STREAM
|
||||
pkcs7->stream->key = NULL;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
ret = encryptedContentSz;
|
||||
|
||||
@@ -1596,7 +1596,7 @@ static int RsaUnPad(const byte *pkcsBlock, unsigned int pkcsBlockLen,
|
||||
byte invalid = 0;
|
||||
#endif
|
||||
|
||||
if (output == NULL || pkcsBlockLen == 0) {
|
||||
if (output == NULL || pkcsBlockLen == 0 || pkcsBlockLen > 0xFFFF) {
|
||||
return BAD_FUNC_ARG;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user