mirror of https://github.com/wolfSSL/wolfssl
Fixes for some async issues. Fixes an async issue with BuildMessage. Fixes for PKCS7 tests to not use async since it is not supported.
This commit is contained in:
parent
71606dde45
commit
1cb5bbf8ea
|
@ -13370,11 +13370,11 @@ int BuildMessage(WOLFSSL* ssl, byte* output, int outSz, const byte* input,
|
||||||
{
|
{
|
||||||
/* catch mistaken sizeOnly parameter */
|
/* catch mistaken sizeOnly parameter */
|
||||||
if (!sizeOnly && (output == NULL || input == NULL) ) {
|
if (!sizeOnly && (output == NULL || input == NULL) ) {
|
||||||
return BAD_FUNC_ARG;
|
ERROR_OUT(BAD_FUNC_ARG, exit_buildmsg);
|
||||||
}
|
}
|
||||||
if (sizeOnly && (output || input) ) {
|
if (sizeOnly && (output || input) ) {
|
||||||
WOLFSSL_MSG("BuildMessage w/sizeOnly doesn't need input/output");
|
WOLFSSL_MSG("BuildMessage w/sizeOnly doesn't need input/output");
|
||||||
return BAD_FUNC_ARG;
|
ERROR_OUT(BAD_FUNC_ARG, exit_buildmsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
ssl->options.buildMsgState = BUILD_MSG_SIZE;
|
ssl->options.buildMsgState = BUILD_MSG_SIZE;
|
||||||
|
@ -13564,6 +13564,9 @@ exit_buildmsg:
|
||||||
|
|
||||||
/* Final cleanup */
|
/* Final cleanup */
|
||||||
FreeBuildMsgArgs(ssl, args);
|
FreeBuildMsgArgs(ssl, args);
|
||||||
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
|
ssl->async.freeArgs = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
#endif /* !WOLFSSL_NO_TLS12 */
|
#endif /* !WOLFSSL_NO_TLS12 */
|
||||||
|
|
|
@ -9634,7 +9634,7 @@ static int rsa_certgen_test(RsaKey* key, RsaKey* keypub, WC_RNG* rng, byte* tmp)
|
||||||
ret = 0;
|
ret = 0;
|
||||||
do {
|
do {
|
||||||
#if defined(WOLFSSL_ASYNC_CRYPT)
|
#if defined(WOLFSSL_ASYNC_CRYPT)
|
||||||
ret = wc_AsyncWait(ret, &key.asyncDev, WC_ASYNC_FLAG_CALL_AGAIN);
|
ret = wc_AsyncWait(ret, &key->asyncDev, WC_ASYNC_FLAG_CALL_AGAIN);
|
||||||
#endif
|
#endif
|
||||||
if (ret >= 0) {
|
if (ret >= 0) {
|
||||||
ret = wc_MakeSelfCert(myCert, der, FOURK_BUF, key, rng);
|
ret = wc_MakeSelfCert(myCert, der, FOURK_BUF, key, rng);
|
||||||
|
@ -17946,8 +17946,13 @@ static int pkcs7enveloped_run_vectors(byte* rsaCert, word32 rsaCertSz,
|
||||||
testSz = sizeof(testVectors) / sizeof(pkcs7EnvelopedVector);
|
testSz = sizeof(testVectors) / sizeof(pkcs7EnvelopedVector);
|
||||||
|
|
||||||
for (i = 0; i < testSz; i++) {
|
for (i = 0; i < testSz; i++) {
|
||||||
|
ret = wc_PKCS7_Init(&pkcs7, HEAP_HINT,
|
||||||
ret = wc_PKCS7_Init(&pkcs7, HEAP_HINT, devId);
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
|
INVALID_DEVID /* async PKCS7 is not supported */
|
||||||
|
#else
|
||||||
|
devId
|
||||||
|
#endif
|
||||||
|
);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return -9214;
|
return -9214;
|
||||||
|
|
||||||
|
@ -18494,6 +18499,7 @@ static int pkcs7signed_run_vectors(byte* rsaCert, word32 rsaCertSz,
|
||||||
for (i = 0; i < testSz; i++) {
|
for (i = 0; i < testSz; i++) {
|
||||||
|
|
||||||
pkcs7.heap = HEAP_HINT;
|
pkcs7.heap = HEAP_HINT;
|
||||||
|
pkcs7.devId = INVALID_DEVID;
|
||||||
ret = wc_PKCS7_InitWithCert(&pkcs7, testVectors[i].cert,
|
ret = wc_PKCS7_InitWithCert(&pkcs7, testVectors[i].cert,
|
||||||
(word32)testVectors[i].certSz);
|
(word32)testVectors[i].certSz);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue