Skip to content

Commit

Permalink
prov: remove unused field flag_fallback and function `ossl_provider…
Browse files Browse the repository at this point in the history
…_set_fallback`

These are legacy of older versions of the code and are currently not used
anywhere.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #16985)

(cherry picked from commit 90c3113)
Reviewed-by: Hugo Landau <hlandau@openssl.org>
  • Loading branch information
paulidale authored and t8m committed Nov 9, 2022
1 parent c3f76ee commit e7557d7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
13 changes: 1 addition & 12 deletions crypto/provider_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
* The locks available are:
*
* The provider flag_lock: Used to control updates to the various provider
* "flags" (flag_initialized, flag_activated, flag_fallback) and associated
* "flags" (flag_initialized and flag_activated) and associated
* "counts" (activatecnt).
*
* The provider refcnt_lock: Only ever used to control updates to the provider
Expand Down Expand Up @@ -142,7 +142,6 @@ struct ossl_provider_st {
/* Flag bits */
unsigned int flag_initialized:1;
unsigned int flag_activated:1;
unsigned int flag_fallback:1; /* Can be used as fallback */

/* Getting and setting the flags require synchronization */
CRYPTO_RWLOCK *flag_lock;
Expand Down Expand Up @@ -1486,16 +1485,6 @@ int OSSL_PROVIDER_available(OSSL_LIB_CTX *libctx, const char *name)
return available;
}

/* Setters of Provider Object data */
int ossl_provider_set_fallback(OSSL_PROVIDER *prov)
{
if (prov == NULL)
return 0;

prov->flag_fallback = 1;
return 1;
}

/* Getters of Provider Object data */
const char *ossl_provider_name(const OSSL_PROVIDER *prov)
{
Expand Down
10 changes: 2 additions & 8 deletions doc/internal/man3/ossl_provider_new.pod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

ossl_provider_find, ossl_provider_new, ossl_provider_up_ref,
ossl_provider_free,
ossl_provider_set_fallback, ossl_provider_set_module_path,
ossl_provider_set_module_path,
ossl_provider_add_parameter, ossl_provider_set_child, ossl_provider_get_parent,
ossl_provider_up_ref_parent, ossl_provider_free_parent,
ossl_provider_default_props_update, ossl_provider_get0_dispatch,
Expand Down Expand Up @@ -35,7 +35,6 @@ ossl_provider_get_capabilities
void ossl_provider_free(OSSL_PROVIDER *prov);

/* Setters */
int ossl_provider_set_fallback(OSSL_PROVIDER *prov);
int ossl_provider_set_module_path(OSSL_PROVIDER *prov, const char *path);
int ossl_provider_add_parameter(OSSL_PROVIDER *prov, const char *name,
const char *value);
Expand Down Expand Up @@ -159,11 +158,6 @@ to have fallen out of use and will be deinitialized (its I<teardown>
function is called), and the associated module will be unloaded if one
was loaded, and I<prov> itself will be freed.

ossl_provider_set_fallback() marks an available provider I<prov> as
fallback.
Note that after this call, the provider object pointer that was
used can simply be dropped, but not freed.

ossl_provider_set_module_path() sets the module path to load the
provider module given the provider object I<prov>.
This will be used in preference to automatically trying to figure out
Expand Down Expand Up @@ -350,7 +344,7 @@ ossl_provider_doall_activated() returns 1 if the callback was called for all
activated providers. A return value of 0 means that the callback was not
called for any activated providers.

ossl_provider_set_module_path(), ossl_provider_set_fallback(),
ossl_provider_set_module_path(),
ossl_provider_activate(), ossl_provider_activate_leave_fallbacks() and
ossl_provider_deactivate(), ossl_provider_add_to_store(),
ossl_provider_default_props_update() return 1 on success, or 0 on error.
Expand Down
1 change: 0 additions & 1 deletion include/internal/provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ int ossl_provider_up_ref(OSSL_PROVIDER *prov);
void ossl_provider_free(OSSL_PROVIDER *prov);

/* Setters */
int ossl_provider_set_fallback(OSSL_PROVIDER *prov);
int ossl_provider_set_module_path(OSSL_PROVIDER *prov, const char *module_path);
int ossl_provider_add_parameter(OSSL_PROVIDER *prov, const char *name,
const char *value);
Expand Down

0 comments on commit e7557d7

Please sign in to comment.