mirror of https://github.com/wolfSSL/wolfssl.git
prep for Async release
parent
8fabb9e9bb
commit
8d7c61cf10
|
@ -238,8 +238,10 @@ static int HKDF_Expand_Label(byte* okm, word32 okmLen,
|
||||||
/* Length of hash of messages */
|
/* Length of hash of messages */
|
||||||
data[idx++] = (byte)infoLen;
|
data[idx++] = (byte)infoLen;
|
||||||
/* Hash of messages */
|
/* Hash of messages */
|
||||||
XMEMCPY(&data[idx], info, infoLen);
|
if (info != NULL && infoLen > 0) {
|
||||||
idx += infoLen;
|
XMEMCPY(&data[idx], info, infoLen);
|
||||||
|
idx += infoLen;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef WOLFSSL_DEBUG_TLS
|
#ifdef WOLFSSL_DEBUG_TLS
|
||||||
WOLFSSL_MSG(" PRK");
|
WOLFSSL_MSG(" PRK");
|
||||||
|
|
|
@ -6496,8 +6496,18 @@ int wc_PKCS7_AddRecipient_KTRI(PKCS7* pkcs7, const byte* cert, word32 certSz,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ret = wc_RsaPublicEncrypt(pkcs7->cek, pkcs7->cekSz, encryptedKey,
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
|
do {
|
||||||
|
ret = wc_AsyncWait(ret, &pubKey->asyncDev, WC_ASYNC_FLAG_CALL_AGAIN);
|
||||||
|
if (ret >= 0)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
ret = wc_RsaPublicEncrypt(pkcs7->cek, pkcs7->cekSz, encryptedKey,
|
||||||
encryptedKeySz, pubKey, &rng);
|
encryptedKeySz, pubKey, &rng);
|
||||||
|
}
|
||||||
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
|
} while (ret == WC_PENDING_E);
|
||||||
|
#endif
|
||||||
wc_FreeRsaKey(pubKey);
|
wc_FreeRsaKey(pubKey);
|
||||||
wc_FreeRng(&rng);
|
wc_FreeRng(&rng);
|
||||||
|
|
||||||
|
@ -8498,8 +8508,21 @@ static int wc_PKCS7_DecryptKtri(PKCS7* pkcs7, byte* in, word32 inSz,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
keySz = wc_RsaPrivateDecryptInline(encryptedKey, encryptedKeySz,
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
&outKey, privKey);
|
keySz = 0; /* set initial "ret" value to 0 */
|
||||||
|
do {
|
||||||
|
keySz = wc_AsyncWait(keySz, &privKey->asyncDev,
|
||||||
|
WC_ASYNC_FLAG_CALL_AGAIN);
|
||||||
|
if (keySz >= 0)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
keySz = wc_RsaPrivateDecryptInline(encryptedKey,
|
||||||
|
encryptedKeySz, &outKey,
|
||||||
|
privKey);
|
||||||
|
}
|
||||||
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
|
} while (keySz == WC_PENDING_E);
|
||||||
|
#endif
|
||||||
#ifdef WC_RSA_BLINDING
|
#ifdef WC_RSA_BLINDING
|
||||||
wc_FreeRng(&rng);
|
wc_FreeRng(&rng);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -21166,8 +21166,6 @@ static int ecc_test_curve_size(WC_RNG* rng, int keySize, int testVerifyCount,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ret = wc_ecc_make_key_ex(rng, keySize, userA, curve_id);
|
ret = wc_ecc_make_key_ex(rng, keySize, userA, curve_id);
|
||||||
if (ret != 0)
|
|
||||||
ERROR_OUT(-9909, done);
|
|
||||||
#if defined(WOLFSSL_ASYNC_CRYPT)
|
#if defined(WOLFSSL_ASYNC_CRYPT)
|
||||||
ret = wc_AsyncWait(ret, &userA->asyncDev, WC_ASYNC_FLAG_NONE);
|
ret = wc_AsyncWait(ret, &userA->asyncDev, WC_ASYNC_FLAG_NONE);
|
||||||
#endif
|
#endif
|
||||||
|
@ -21190,8 +21188,6 @@ static int ecc_test_curve_size(WC_RNG* rng, int keySize, int testVerifyCount,
|
||||||
#if !defined(WOLFSSL_ATECC508A) && !defined(WOLFSSL_ATECC608A)
|
#if !defined(WOLFSSL_ATECC508A) && !defined(WOLFSSL_ATECC608A)
|
||||||
|
|
||||||
ret = wc_ecc_make_key_ex(rng, keySize, userB, curve_id);
|
ret = wc_ecc_make_key_ex(rng, keySize, userB, curve_id);
|
||||||
if (ret != 0)
|
|
||||||
ERROR_OUT(-9913, done);
|
|
||||||
#if defined(WOLFSSL_ASYNC_CRYPT)
|
#if defined(WOLFSSL_ASYNC_CRYPT)
|
||||||
ret = wc_AsyncWait(ret, &userB->asyncDev, WC_ASYNC_FLAG_NONE);
|
ret = wc_AsyncWait(ret, &userB->asyncDev, WC_ASYNC_FLAG_NONE);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue