forked from wolfSSL/wolfssl
static analysis report fixes
This commit is contained in:
@@ -15613,8 +15613,8 @@ WOLFSSL_EVP_PKEY* wolfSSL_X509_get_pubkey(WOLFSSL_X509* x509)
|
|||||||
if (wolfSSL_RSA_LoadDer_ex(key->rsa,
|
if (wolfSSL_RSA_LoadDer_ex(key->rsa,
|
||||||
(const unsigned char*)key->pkey.ptr, key->pkey_sz,
|
(const unsigned char*)key->pkey.ptr, key->pkey_sz,
|
||||||
WOLFSSL_RSA_LOAD_PUBLIC) != SSL_SUCCESS) {
|
WOLFSSL_RSA_LOAD_PUBLIC) != SSL_SUCCESS) {
|
||||||
XFREE(key, x509->heap, DYNAMIC_TYPE_PUBLIC_KEY);
|
|
||||||
wolfSSL_RSA_free(key->rsa);
|
wolfSSL_RSA_free(key->rsa);
|
||||||
|
XFREE(key, x509->heap, DYNAMIC_TYPE_PUBLIC_KEY);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -10885,8 +10885,10 @@ static int SignCert(int requestSz, int sType, byte* buffer, word32 buffSz,
|
|||||||
|
|
||||||
sigSz = MakeSignature(certSignCtx, buffer, requestSz, certSignCtx->sig,
|
sigSz = MakeSignature(certSignCtx, buffer, requestSz, certSignCtx->sig,
|
||||||
MAX_ENCODED_SIG_SZ, rsaKey, eccKey, ed25519Key, rng, sType, heap);
|
MAX_ENCODED_SIG_SZ, rsaKey, eccKey, ed25519Key, rng, sType, heap);
|
||||||
if (sigSz == WC_PENDING_E)
|
if (sigSz == WC_PENDING_E) {
|
||||||
|
XFREE(certSignCtx->sig, heap, DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
return sigSz;
|
return sigSz;
|
||||||
|
}
|
||||||
|
|
||||||
if (sigSz >= 0) {
|
if (sigSz >= 0) {
|
||||||
if (requestSz + MAX_SEQ_SZ * 2 + sigSz > (int)buffSz)
|
if (requestSz + MAX_SEQ_SZ * 2 + sigSz > (int)buffSz)
|
||||||
|
@@ -5048,6 +5048,7 @@ int wc_PKCS7_DecodeEncryptedData(PKCS7* pkcs7, byte* pkiMsg, word32 pkiMsgSz,
|
|||||||
/* go back and check the version now that attribs have been processed */
|
/* go back and check the version now that attribs have been processed */
|
||||||
if ((haveAttribs == 0 && version != 0) ||
|
if ((haveAttribs == 0 && version != 0) ||
|
||||||
(haveAttribs == 1 && version != 2) ) {
|
(haveAttribs == 1 && version != 2) ) {
|
||||||
|
XFREE(encryptedContent, pkcs7->heap, DYNAMIC_TYPE_PKCS7);
|
||||||
WOLFSSL_MSG("Wrong PKCS#7 EncryptedData version");
|
WOLFSSL_MSG("Wrong PKCS#7 EncryptedData version");
|
||||||
return ASN_VERSION_E;
|
return ASN_VERSION_E;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user