ossl_provider_free(cprov);
/*
- * The provider already exists. It could be an unused built-in, or a
- * previously created child, or it could have been explicitly loaded. If
- * explicitly loaded it cannot be converted to a child and we ignore it
- * - i.e. we don't start treating it like a child.
+ * The provider already exists. It could be a previously created child,
+ * or it could have been explicitly loaded. If explicitly loaded we
+ * ignore it - i.e. we don't start treating it like a child.
*/
- if (!ossl_provider_convert_to_child(cprov, prov,
- ossl_child_provider_init))
+ if (!ossl_provider_activate_child(cprov, prov, ossl_child_provider_init))
goto err;
} else {
/*
unsigned int flag_initialized:1;
unsigned int flag_activated:1;
unsigned int flag_fallback:1; /* Can be used as fallback */
-#ifndef FIPS_MODULE
- unsigned int flag_couldbechild:1;
-#endif
/* Getting and setting the flags require synchronization */
CRYPTO_RWLOCK *flag_lock;
prov->refcnt = 1; /* 1 One reference to be returned */
prov->init_function = init_function;
-#ifndef FIPS_MODULE
- prov->flag_couldbechild = 1;
-#endif
return prov;
}
}
prov->provctx = tmp_provctx;
prov->dispatch = provider_dispatch;
-#ifndef FIPS_MODULE
- prov->flag_couldbechild = 0;
-#endif
for (; provider_dispatch->function_id != 0; provider_dispatch++) {
switch (provider_dispatch->function_id) {
return 1;
}
-int ossl_provider_convert_to_child(OSSL_PROVIDER *prov,
- const OSSL_CORE_HANDLE *handle,
- OSSL_provider_init_fn *init_function)
+int ossl_provider_activate_child(OSSL_PROVIDER *prov,
+ const OSSL_CORE_HANDLE *handle,
+ OSSL_provider_init_fn *init_function)
{
int flush = 0;
return 0;
}
/*
- * The provider could be in one of three states: (1) Already a child,
- * (2) Not a child (but eligible to be one), or (3) Not a child (not
- * eligible to be one).
+ * The provider could be in one of two states: (1) Already a child,
+ * (2) Not a child (not eligible to be one).
*/
- if (prov->flag_couldbechild) {
- ossl_provider_set_child(prov, handle);
- prov->init_function = init_function;
- }
if (prov->ischild && provider_activate(prov, 0, 0)) {
flush = 1;
prov->store->use_fallbacks = 0;
provider_flush_store_cache(prov);
/*
- * We report success whether or not the provider was eligible for conversion
- * to a child. If its not elgibile then it has already been loaded as a non
- * child provider and we should keep it like that.
+ * We report success whether or not the provider was a child. If its not
+ * a child then it has been explicitly loaded as a non child provider and
+ * we should keep it like that.
*/
return 1;
}
int ossl_provider_is_child(const OSSL_PROVIDER *prov);
int ossl_provider_set_child(OSSL_PROVIDER *prov, const OSSL_CORE_HANDLE *handle);
-int ossl_provider_convert_to_child(OSSL_PROVIDER *prov,
- const OSSL_CORE_HANDLE *handle,
- OSSL_provider_init_fn *init_function);
+int ossl_provider_activate_child(OSSL_PROVIDER *prov,
+ const OSSL_CORE_HANDLE *handle,
+ OSSL_provider_init_fn *init_function);
const OSSL_CORE_HANDLE *ossl_provider_get_parent(OSSL_PROVIDER *prov);
int ossl_provider_up_ref_parent(OSSL_PROVIDER *prov, int activate);
int ossl_provider_free_parent(OSSL_PROVIDER *prov, int deactivate);