From f48efe5bfcbb7e10310f0265420e2d5f9e359300 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Thu, 11 Jun 2026 16:48:19 -0500 Subject: [PATCH] fix F-705: Missing wc_RsaSetRNG in sig_alg km_pkcs1_set_pub After Key Re-Init --- linuxkm/lkcapi_rsa_glue.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/linuxkm/lkcapi_rsa_glue.c b/linuxkm/lkcapi_rsa_glue.c index 4fb126605d..785ea2e2bf 100644 --- a/linuxkm/lkcapi_rsa_glue.c +++ b/linuxkm/lkcapi_rsa_glue.c @@ -1621,6 +1621,12 @@ static int km_pkcs1_set_pub(struct crypto_sig *tfm, const void *key, if (unlikely(err)) { return -ENOMEM; } + + /* Note the initialization of ctx->rng is deferred unless/until needed. */ + err = wc_RsaSetRNG(ctx->key, &ctx->rng); + if (unlikely(err)) { + return -ENOMEM; + } } err = wc_RsaPublicKeyDecode(key, &idx, ctx->key, keylen);