}
md->prov = prov;
if (prov != NULL)
- ossl_provider_upref(prov);
+ ossl_provider_up_ref(prov);
return md;
}
}
cipher->prov = prov;
if (prov != NULL)
- ossl_provider_upref(prov);
+ ossl_provider_up_ref(prov);
return cipher;
}
const char *name, const char *properties,
void *(*new_method)(const OSSL_DISPATCH *fns,
OSSL_PROVIDER *prov),
- int (*upref_method)(void *),
+ int (*up_ref_method)(void *),
void (*free_method)(void *))
{
OSSL_METHOD_STORE *store = get_default_method_store(libctx);
mcmdata.name = name;
mcmdata.method_from_dispatch = new_method;
mcmdata.destruct_method = free_method;
- mcmdata.refcnt_up_method = upref_method;
+ mcmdata.refcnt_up_method = up_ref_method;
mcmdata.destruct_method = free_method;
if ((method = ossl_method_construct(libctx, operation_id, name,
properties, 0 /* !force_cache */,
ossl_method_store_cache_set(store, methid, properties, method);
}
} else {
- upref_method(method);
+ up_ref_method(method);
}
return method;
const char *algorithm, const char *properties,
void *(*new_method)(const OSSL_DISPATCH *fns,
OSSL_PROVIDER *prov),
- int (*upref_method)(void *),
+ int (*up_ref_method)(void *),
void (*free_method)(void *));
CRYPTO_THREAD_write_lock(store->lock);
if ((i = sk_OSSL_PROVIDER_find(store->providers, &tmpl)) == -1
|| (prov = sk_OSSL_PROVIDER_value(store->providers, i)) == NULL
- || !ossl_provider_upref(prov))
+ || !ossl_provider_up_ref(prov))
prov = NULL;
CRYPTO_THREAD_unlock(store->lock);
}
#ifndef HAVE_ATOMICS
|| (prov->refcnt_lock = CRYPTO_THREAD_lock_new()) == NULL
#endif
- || !ossl_provider_upref(prov) /* +1 One reference to be returned */
+ || !ossl_provider_up_ref(prov) /* +1 One reference to be returned */
|| (prov->name = OPENSSL_strdup(name)) == NULL) {
ossl_provider_free(prov);
CRYPTOerr(CRYPTO_F_PROVIDER_NEW, ERR_R_MALLOC_FAILURE);
return prov;
}
-int ossl_provider_upref(OSSL_PROVIDER *prov)
+int ossl_provider_up_ref(OSSL_PROVIDER *prov)
{
int ref = 0;
return NULL;
CRYPTO_THREAD_write_lock(store->lock);
- if (!ossl_provider_upref(prov)) { /* +1 One reference for the store */
+ if (!ossl_provider_up_ref(prov)) { /* +1 One reference for the store */
ossl_provider_free(prov); /* -1 Reference that was to be returned */
prov = NULL;
} else if (sk_OSSL_PROVIDER_push(store->providers, prov) == 0) {
const char *name, const char *properties,
void *(*new_method)(const OSSL_DISPATCH *fns,
OSSL_PROVIDER *prov),
- int (*upref_method)(void *),
+ int (*up_ref_method)(void *),
void (*free_method)(void *));
=head1 DESCRIPTION
evp_generic_fetch() calls ossl_method_construct() with the given
C<libctx>, C<operation_id>, C<name>, and C<properties> and uses
it to create an EVP method with the help of the functions
-C<new_method>, C<upref_method>, and C<free_method>.
+C<new_method>, C<up_ref_method>, and C<free_method>.
The three functions are supposed to:
creates an internal method from function pointers found in the
dispatch table C<fns>.
-=item upref_method()
+=item up_ref_method()
increments the reference counter for the given method, if there is
one.
}
foo->prov = prov;
if (prov)
- ossl_provider_upref(prov);
+ ossl_provider_up_ref(prov);
return foo;
}
return EVP_FOO_meth_from_dispatch(fns, prov);
}
- static int foo_upref(void *vfoo)
+ static int foo_up_ref(void *vfoo)
{
EVP_FOO *foo = vfoo;
int ref = 0;
{
EVP_FOO *foo =
evp_generic_fetch(ctx, OSSL_OP_FOO, name, properties,
- foo_from_dispatch, foo_upref, foo_free);
+ foo_from_dispatch, foo_up_ref, foo_free);
/*
* If this method exists in legacy form, with a constant NID for the
it possible for the sub-system constructor to keep a reference, which
is recommended.
If such a reference is kept, the I<provider object> reference counter
-must be incremented, using ossl_provider_upref().
+must be incremented, using ossl_provider_up_ref().
This function is expected to set the method's reference count to 1.
=head1 NAME
-ossl_provider_find, ossl_provider_new, ossl_provider_upref,
+ossl_provider_find, ossl_provider_new, ossl_provider_up_ref,
ossl_provider_free,
ossl_provider_set_fallback, ossl_provider_set_module_path,
ossl_provider_add_parameter,
OSSL_PROVIDER *ossl_provider_find(OPENSSL_CTX *libctx, const char *name);
OSSL_PROVIDER *ossl_provider_new(OPENSSL_CTX *libctx, const char *name,
ossl_provider_init_fn *init_function);
- int ossl_provider_upref(OSSL_PROVIDER *prov);
+ int ossl_provider_up_ref(OSSL_PROVIDER *prov);
void ossl_provider_free(OSSL_PROVIDER *prov);
/* Setters */
For further description of the initialisation function, see the
description of ossl_provider_activate() below.
-ossl_provider_upref() increments the provider object I<prov>'s
+ossl_provider_up_ref() increments the provider object I<prov>'s
reference count.
ossl_provider_free() decrements the provider object I<prov>'s
ossl_provider_find() and ossl_provider_new() return a pointer to a
provider object (I<OSSL_PROVIDER>) on success, or NULL on error.
-ossl_provider_upref() returns the value of the reference count after
+ossl_provider_up_ref() returns the value of the reference count after
it has been incremented.
ossl_provider_free() doesn't return any value.
OSSL_PROVIDER *ossl_provider_find(OPENSSL_CTX *libctx, const char *name);
OSSL_PROVIDER *ossl_provider_new(OPENSSL_CTX *libctx, const char *name,
OSSL_provider_init_fn *init_function);
-int ossl_provider_upref(OSSL_PROVIDER *prov);
+int ossl_provider_up_ref(OSSL_PROVIDER *prov);
void ossl_provider_free(OSSL_PROVIDER *prov);
/* Setters */