{
OSSL_METHOD_STORE *store = get_decoder_store(methdata->libctx);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
+ const char *const propq = properties != NULL ? properties : "";
void *method = NULL;
int unsupported = 0;
unsupported = 1;
if (id == 0
- || !ossl_method_store_cache_get(store, NULL, id, properties, &method)) {
+ || !ossl_method_store_cache_get(store, NULL, id, propq, &method)) {
OSSL_METHOD_CONSTRUCT_METHOD mcm = {
get_tmp_decoder_store,
get_decoder_from_store,
methdata->id = id;
methdata->names = name;
- methdata->propquery = properties;
+ methdata->propquery = propq;
methdata->flag_construct_error_occurred = 0;
if ((method = ossl_method_construct(methdata->libctx, OSSL_OP_DECODER,
&prov, 0 /* !force_cache */,
if (id == 0 && name != NULL)
id = ossl_namemap_name2num(namemap, name);
if (id != 0)
- ossl_method_store_cache_set(store, prov, id, properties, method,
+ ossl_method_store_cache_set(store, prov, id, propq, method,
up_ref_decoder, free_decoder);
}
{
OSSL_METHOD_STORE *store = get_encoder_store(methdata->libctx);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
+ const char *const propq = properties != NULL ? properties : "";
void *method = NULL;
int unsupported = 0;
unsupported = 1;
if (id == 0
- || !ossl_method_store_cache_get(store, NULL, id, properties, &method)) {
+ || !ossl_method_store_cache_get(store, NULL, id, propq, &method)) {
OSSL_METHOD_CONSTRUCT_METHOD mcm = {
get_tmp_encoder_store,
get_encoder_from_store,
methdata->id = id;
methdata->names = name;
- methdata->propquery = properties;
+ methdata->propquery = propq;
methdata->flag_construct_error_occurred = 0;
if ((method = ossl_method_construct(methdata->libctx, OSSL_OP_ENCODER,
&prov, 0 /* !force_cache */,
*/
if (id == 0)
id = ossl_namemap_name2num(namemap, name);
- ossl_method_store_cache_set(store, prov, id, properties, method,
+ ossl_method_store_cache_set(store, prov, id, propq, method,
up_ref_encoder, free_encoder);
}
{
OSSL_METHOD_STORE *store = get_evp_method_store(methdata->libctx);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
+ const char *const propq = properties != NULL ? properties : "";
uint32_t meth_id = 0;
void *method = NULL;
int unsupported = 0;
unsupported = 1;
if (meth_id == 0
- || !ossl_method_store_cache_get(store, prov, meth_id, properties,
- &method)) {
+ || !ossl_method_store_cache_get(store, prov, meth_id, propq, &method)) {
OSSL_METHOD_CONSTRUCT_METHOD mcm = {
get_tmp_evp_method_store,
get_evp_method_from_store,
methdata->operation_id = operation_id;
methdata->name_id = name_id;
methdata->names = name;
- methdata->propquery = properties;
+ methdata->propquery = propq;
methdata->method_from_algorithm = new_method;
methdata->refcnt_up_method = up_ref_method;
methdata->destruct_method = free_method;
name_id = ossl_namemap_name2num(namemap, name);
meth_id = evp_method_id(name_id, operation_id);
if (name_id != 0)
- ossl_method_store_cache_set(store, prov, meth_id, properties,
+ ossl_method_store_cache_set(store, prov, meth_id, propq,
method, up_ref_method, free_method);
}
QUERY elem, *r;
int res = 0;
- if (nid <= 0 || store == NULL)
+ if (nid <= 0 || store == NULL || prop_query == NULL)
return 0;
if (!ossl_property_read_lock(store))
if (alg == NULL)
goto err;
- elem.query = prop_query != NULL ? prop_query : "";
+ elem.query = prop_query;
elem.provider = prov;
r = lh_QUERY_retrieve(alg->cache, &elem);
if (r == NULL)
size_t len;
int res = 1;
- if (nid <= 0 || store == NULL)
+ if (nid <= 0 || store == NULL || prop_query == NULL)
return 0;
- if (prop_query == NULL)
- return 1;
if (!ossl_assert(prov != NULL))
return 0;
{
OSSL_METHOD_STORE *store = get_loader_store(methdata->libctx);
OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
+ const char *const propq = properties != NULL ? properties : "";
void *method = NULL;
int unsupported = 0;
unsupported = 1;
if (id == 0
- || !ossl_method_store_cache_get(store, NULL, id, properties, &method)) {
+ || !ossl_method_store_cache_get(store, NULL, id, propq, &method)) {
OSSL_METHOD_CONSTRUCT_METHOD mcm = {
get_tmp_loader_store,
get_loader_from_store,
methdata->scheme_id = id;
methdata->scheme = scheme;
- methdata->propquery = properties;
+ methdata->propquery = propq;
methdata->flag_construct_error_occurred = 0;
if ((method = ossl_method_construct(methdata->libctx, OSSL_OP_STORE,
&prov, 0 /* !force_cache */,
*/
if (id == 0)
id = ossl_namemap_name2num(namemap, scheme);
- ossl_method_store_cache_set(store, prov, id, properties, method,
+ ossl_method_store_cache_set(store, prov, id, propq, method,
up_ref_loader, free_loader);
}
reference count of the method and the I<method_destruct> function is called
to decrement it.
+=head1 NOTES
+
+The I<prop_query> argument to ossl_method_store_cache_get() and
+ossl_method_store_cache_set() is not allowed to be NULL. Use "" for an
+empty property definition or query.
+
=head1 RETURN VALUES
ossl_method_store_new() returns a new method store object or NULL on failure.