From 77fea4fe841a14f39cae1a4df37bba241665aadf Mon Sep 17 00:00:00 2001 From: jordan Date: Mon, 15 Jun 2026 16:00:19 -0500 Subject: [PATCH] bsdkm driver: fix callback sync. --- bsdkm/wolfkmod_aes.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bsdkm/wolfkmod_aes.c b/bsdkm/wolfkmod_aes.c index fc356d6a86..28f3a149b6 100644 --- a/bsdkm/wolfkmod_aes.c +++ b/bsdkm/wolfkmod_aes.c @@ -83,9 +83,12 @@ static int wolfkdriv_test_aes_cbc_big(device_t dev, int crid) goto test_aes_cbc_big_out; } + /* configure it. + * note: CRYPTO_F_CBIFSYNC is required, or the callback may be deferred + * to later, even if the session was sync. */ crp->crp_callback = wolfkdriv_test_crp_callback; crp->crp_op = CRYPTO_OP_ENCRYPT; - crp->crp_flags = CRYPTO_F_IV_SEPARATE; + crp->crp_flags = CRYPTO_F_IV_SEPARATE | CRYPTO_F_CBIFSYNC; memcpy(crp->crp_iv, iv, WC_AES_BLOCK_SIZE); @@ -266,10 +269,12 @@ static int wolfkdriv_test_aes_gcm(device_t dev, int crid) goto test_aes_gcm_out; } - /* configure it */ + /* configure it. + * note: CRYPTO_F_CBIFSYNC is required, or the callback may be deferred + * to later, even if the session was sync. */ crp->crp_callback = wolfkdriv_test_crp_callback; crp->crp_op = (CRYPTO_OP_ENCRYPT | CRYPTO_OP_COMPUTE_DIGEST); - crp->crp_flags = CRYPTO_F_IV_SEPARATE; + crp->crp_flags = CRYPTO_F_IV_SEPARATE | CRYPTO_F_CBIFSYNC; memcpy(crp->crp_iv, iv1, sizeof(iv1));