Commit dd7b2fc235 for openssl.org

commit dd7b2fc2358a8e54a7dd9325f62c1399182c1ed0
Author: Neil Horman <nhorman@openssl.org>
Date:   Wed Sep 23 12:50:28 2026 -0400

    flag us as having new providers every time we activate a provider

    Every time we load a new provider in a libctx set every element in its
    new_provider_loaded array to force ossl_method_construct to re-run
    construction for that operation type.

    Reviewed-by: Bob Beck <beck@openssl.org>
    Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
    Merge-date: Mon Oct 26 19:25:23 2026
    Merged-from: https://github.com/openssl/openssl/pull/32965

diff --git a/crypto/provider_core.c b/crypto/provider_core.c
index 127cb4a23c..c19f945ba2 100644
--- a/crypto/provider_core.c
+++ b/crypto/provider_core.c
@@ -1402,6 +1402,7 @@ static int provider_remove_store_methods(OSSL_PROVIDER *prov)
 int ossl_provider_activate(OSSL_PROVIDER *prov, int upcalls, int aschild)
 {
     int count;
+    int ret;

     if (prov == NULL)
         return 0;
@@ -1410,11 +1411,18 @@ int ossl_provider_activate(OSSL_PROVIDER *prov, int upcalls, int aschild)
      * If aschild is true, then we only actually do the activation if the
      * provider is a child. If its not, this is still success.
      */
-    if (aschild && !prov->ischild)
+    if (aschild && !prov->ischild) {
+        ossl_lib_ctx_set_new_providers_loaded(prov->libctx);
         return 1;
+    }
 #endif
-    if ((count = provider_activate(prov, 1, upcalls)) > 0)
-        return count == 1 ? provider_flush_store_cache(prov) : 1;
+    if ((count = provider_activate(prov, 1, upcalls)) > 0) {
+        ret = 1;
+        if (count == 1)
+            ret = provider_flush_store_cache(prov);
+        ossl_lib_ctx_set_new_providers_loaded(prov->libctx);
+        return ret;
+    }

     return 0;
 }