Files
wolfssl/wolfcrypt
Tobias Frauenschläger fe3801b942 Wait for async completion in the cryptocb make-pub test
cryptocb_test() generates a key with wc_ecc_make_key() and assigns the
result straight to ret. In an async build that call returns WC_PENDING_E,
which is not an encoded test result, so the raw -108 propagated out of
the test and printed as "error L=108" with no error code at all.

The key is reached through myCryptoDevCb, which services EC key
generation by calling wc_ecc_make_key_ex() on the same key after setting
key->devId = INVALID_DEVID. That comment says the intent is to force
software, and it does stop the crypto callback from dispatching again,
but the pending path in _ecc_make_key_ex() is gated on asyncDev.marker
rather than devId. The marker is untouched, so the inner call still goes
pending and the callback hands WC_PENDING_E back to its caller.

Wait at the call site rather than in the callback. Every other key
generation in this file already does exactly that, a callback returning
WC_PENDING_E is legitimate for a real asynchronous device, and the same
devId idiom appears 48 times in myCryptoDevCb against 48 different keys,
so there is no single place in the callback to fix.

With this, testwolfcrypt passes in full under --enable-all with
--enable-asynccrypt-sw, where it previously stopped here. Verified
against plain --enable-all as well, which is unaffected: the addition
compiles out entirely without WOLFSSL_ASYNC_CRYPT.

That configuration still cannot complete make check. unit.test fails in
the cipher suite runner on TLS 1.3 post-handshake authentication, which
is a record layer problem in the library rather than a test defect and
is not addressed here. All 2111 API tests pass.
2026-08-05 08:34:08 +02:00
..