mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-05 12:00:51 +02:00
Avoid unneeded temporary stack buffer; remove redundant check
This commit is contained in:
+1
-1
@@ -759,7 +759,7 @@ int wolfSSL_OCSP_resp_find_status(WOLFSSL_OCSP_BASICRESP *bs,
|
||||
single = single->next;
|
||||
}
|
||||
|
||||
if (single == NULL || single->status == NULL)
|
||||
if (single == NULL)
|
||||
return WOLFSSL_FAILURE;
|
||||
|
||||
if (status != NULL)
|
||||
|
||||
+4
-6
@@ -4317,11 +4317,6 @@ int wolfSSL_EVP_SignFinal(WOLFSSL_EVP_MD_CTX *ctx, unsigned char *sigret,
|
||||
#ifndef NO_DSA
|
||||
case WC_EVP_PKEY_DSA: {
|
||||
int bytes;
|
||||
unsigned char tmpSig[DSA_MAX_SIG_SIZE];
|
||||
ret = wolfSSL_DSA_do_sign(md, tmpSig, pkey->dsa);
|
||||
/* wolfSSL_DSA_do_sign() can return WOLFSSL_FATAL_ERROR */
|
||||
if (ret != WOLFSSL_SUCCESS)
|
||||
return ret;
|
||||
bytes = wolfSSL_BN_num_bytes(pkey->dsa->q);
|
||||
if (bytes == WC_NO_ERR_TRACE(WOLFSSL_FAILURE) ||
|
||||
bytes > DSA_MAX_HALF_SIZE ||
|
||||
@@ -4329,7 +4324,10 @@ int wolfSSL_EVP_SignFinal(WOLFSSL_EVP_MD_CTX *ctx, unsigned char *sigret,
|
||||
{
|
||||
return WOLFSSL_FAILURE;
|
||||
}
|
||||
XMEMCPY(sigret, tmpSig, bytes * 2);
|
||||
ret = wolfSSL_DSA_do_sign(md, sigret, pkey->dsa);
|
||||
/* wolfSSL_DSA_do_sign() can return WOLFSSL_FATAL_ERROR */
|
||||
if (ret != WOLFSSL_SUCCESS)
|
||||
return ret;
|
||||
*siglen = (unsigned int)(bytes * 2);
|
||||
return WOLFSSL_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user