return NULL;
if ((namemap = ossl_namemap_stored(libctx)) == NULL
- || (nameid = ossl_namemap_add(namemap, name)) == 0
+ || (nameid = ossl_namemap_name2num(namemap, name)) == 0
|| (methid = method_id(operation_id, nameid)) == 0)
return NULL;
uint32_t methid;
if ((namemap = ossl_namemap_stored(methdata->libctx)) == NULL
- || (nameid = ossl_namemap_add(namemap, name)) == 0
+ || (nameid = ossl_namemap_add(namemap, 0, name)) == 0
|| (methid = method_id(operation_id, nameid)) == 0)
return 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 *))
{
OSSL_METHOD_STORE *store = get_default_method_store(libctx);
* about 2^8) or too many names (more than about 2^24). In that
* case, we can't create any new method.
*/
- if ((nameid = ossl_namemap_number(namemap, name)) != 0
+ if ((nameid = ossl_namemap_name2num(namemap, name)) != 0
&& (methid = method_id(operation_id, nameid)) == 0)
return NULL;
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 */,
- &mcm, &mcmdata)) == NULL) {
+ &mcm, &mcmdata)) != NULL) {
/*
* If construction did create a method for us, we know that
* there is a correct nameid and methodid, since those have
* already been calculated in get_method_from_store() and
* put_method_in_store() above.
*/
- nameid = ossl_namemap_number(namemap, name);
+ nameid = ossl_namemap_name2num(namemap, name);
methid = method_id(operation_id, nameid);
ossl_method_store_cache_set(store, methid, properties, method);
}
} else {
- upref_method(method);
+ up_ref_method(method);
}
return method;