return 1;
}
-const OSSL_ITEM *OSSL_PROVIDER_get_param_types(const OSSL_PROVIDER *prov)
+const OSSL_PARAM *OSSL_PROVIDER_get_param_types(const OSSL_PROVIDER *prov)
{
return ossl_provider_get_param_types(prov);
}
prov->teardown(prov->provctx);
}
-const OSSL_ITEM *ossl_provider_get_param_types(const OSSL_PROVIDER *prov)
+const OSSL_PARAM *ossl_provider_get_param_types(const OSSL_PROVIDER *prov)
{
return prov->get_param_types == NULL
? NULL : prov->get_param_types(prov->provctx);
* discovery. We do not expect that many providers will use this, but one
* never knows.
*/
-static const OSSL_ITEM param_types[] = {
- { OSSL_PARAM_UTF8_PTR, "openssl-version" },
- { OSSL_PARAM_UTF8_PTR, "provider-name" },
- { 0, NULL }
+static const OSSL_PARAM param_types[] = {
+ OSSL_PARAM_DEFN("openssl-verstion", OSSL_PARAM_UTF8_PTR, NULL, 0),
+ OSSL_PARAM_DEFN("provider-name", OSSL_PARAM_UTF8_PTR, NULL, 0),
+ OSSL_PARAM_END
};
-static const OSSL_ITEM *core_get_param_types(const OSSL_PROVIDER *prov)
+static const OSSL_PARAM *core_get_param_types(const OSSL_PROVIDER *prov)
{
return param_types;
}
/* Thin wrappers around calls to the provider */
void ossl_provider_teardown(const OSSL_PROVIDER *prov);
- const OSSL_ITEM *ossl_provider_get_param_types(const OSSL_PROVIDER *prov);
+ const OSSL_PARAM *ossl_provider_get_param_types(const OSSL_PROVIDER *prov);
int ossl_provider_get_params(const OSSL_PROVIDER *prov, OSSL_PARAM params[]);
const OSSL_ALGORITHM *ossl_provider_query_operation(const OSSL_PROVIDER *prov,
int operation_id,
ossl_provider_get_param_types() calls the provider's I<get_param_types>
function, if the provider has one.
-It should return an array of I<OSSL_ITEM> to describe all the
+It should return an array of I<OSSL_PARAM> to describe all the
parameters that the provider has for the provider object.
ossl_provider_get_params() calls the provider's parameter request
ossl_provider_teardown() doesnt't return any value.
-ossl_provider_get_param_types() returns a pointer to an I<OSSL_ITEM>
-array if this function is available in the provider, otherwise
-NULL.
+ossl_provider_get_param_types() returns a pointer to a constant
+I<OSSL_PARAM> array if this function is available in the provider,
+otherwise NULL.
ossl_provider_get_params() returns 1 on success, or 0 on error.
If this function isn't available in the provider, 0 is returned.
OSSL_PROVIDER *OSSL_PROVIDER_load(OPENSSL_CTX *, const char *name);
int OSSL_PROVIDER_unload(OSSL_PROVIDER *prov);
- const OSSL_ITEM *OSSL_PROVIDER_get_param_types(OSSL_PROVIDER *prov);
+ const OSSL_PARAM *OSSL_PROVIDER_get_param_types(OSSL_PROVIDER *prov);
int OSSL_PROVIDER_get_params(OSSL_PROVIDER *prov, OSSL_PARAM params[]);
int OSSL_PROVIDER_add_builtin(OPENSSL_CTX *, const char *name,
runs its teardown function.
OSSL_PROVIDER_get_param_types() is used to get a provider parameter
-descriptor set as an B<OSSL_ITEM> array.
-Each element is a tuple of an B<OSSL_PARAM> parameter type and a name
-in form of a C string.
-See L<openssl-core.h(7)> for more information on B<OSSL_ITEM> and
-parameter types.
+descriptor set as a constant B<OSSL_PARAM> array.
+See L<OSSL_PARAM(3)> for more information.
OSSL_PROVIDER_get_params() is used to get provider parameter values.
The caller must prepare the B<OSSL_PARAM> array before calling this
OSSL_PROVIDER_unload() returns 1 on success, or 0 on error.
-OSSL_PROVIDER_get_param_types() returns a pointer to a constant array
-of B<OSSL_ITEM>, or NULL if none is provided.
+OSSL_PROVIDER_get_param_types() returns a pointer to an array
+of constant B<OSSL_PARAM>, or NULL if none is provided.
OSSL_PROVIDER_get_params() returns 1 on success, or 0 on error.
/* Thin wrappers around calls to the provider */
void ossl_provider_teardown(const OSSL_PROVIDER *prov);
-const OSSL_ITEM *ossl_provider_get_param_types(const OSSL_PROVIDER *prov);
+const OSSL_PARAM *ossl_provider_get_param_types(const OSSL_PROVIDER *prov);
int ossl_provider_get_params(const OSSL_PROVIDER *prov, OSSL_PARAM params[]);
const OSSL_ALGORITHM *ossl_provider_query_operation(const OSSL_PROVIDER *prov,
int operation_id,
* tables remain tables with function pointers only.
*
* This is used whenever we need to pass things like a table of error reason
- * codes <-> reason string maps, parameter name <-> parameter type maps, ...
+ * codes <-> reason string maps, ...
*
* Usage determines which field works as key if any, rather than field order.
*
*/
/* Functions provided by the Core to the provider, reserved numbers 1-1023 */
# define OSSL_FUNC_CORE_GET_PARAM_TYPES 1
-OSSL_CORE_MAKE_FUNC(const OSSL_ITEM *,
+OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
core_get_param_types,(const OSSL_PROVIDER *prov))
# define OSSL_FUNC_CORE_GET_PARAMS 2
OSSL_CORE_MAKE_FUNC(int,core_get_params,(const OSSL_PROVIDER *prov,
# define OSSL_FUNC_PROVIDER_TEARDOWN 1024
OSSL_CORE_MAKE_FUNC(void,provider_teardown,(void *provctx))
# define OSSL_FUNC_PROVIDER_GET_PARAM_TYPES 1025
-OSSL_CORE_MAKE_FUNC(const OSSL_ITEM *,
+OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
provider_get_param_types,(void *provctx))
# define OSSL_FUNC_PROVIDER_GET_PARAMS 1026
OSSL_CORE_MAKE_FUNC(int,provider_get_params,(void *provctx,
OSSL_PROVIDER *OSSL_PROVIDER_load(OPENSSL_CTX *, const char *name);
int OSSL_PROVIDER_unload(OSSL_PROVIDER *prov);
-const OSSL_ITEM *OSSL_PROVIDER_get_param_types(const OSSL_PROVIDER *prov);
+const OSSL_PARAM *OSSL_PROVIDER_get_param_types(const OSSL_PROVIDER *prov);
int OSSL_PROVIDER_get_params(const OSSL_PROVIDER *prov, OSSL_PARAM params[]);
/* Add a built in providers */
static OSSL_core_get_params_fn *c_get_params = NULL;
/* Parameters we provide to the core */
-static const OSSL_ITEM deflt_param_types[] = {
- { OSSL_PARAM_UTF8_PTR, OSSL_PROV_PARAM_NAME },
- { OSSL_PARAM_UTF8_PTR, OSSL_PROV_PARAM_VERSION },
- { OSSL_PARAM_UTF8_PTR, OSSL_PROV_PARAM_BUILDINFO },
- { 0, NULL }
+static const OSSL_PARAM deflt_param_types[] = {
+ OSSL_PARAM_DEFN(OSSL_PROV_PARAM_NAME, OSSL_PARAM_UTF8_PTR, NULL, 0),
+ OSSL_PARAM_DEFN(OSSL_PROV_PARAM_VERSION, OSSL_PARAM_UTF8_PTR, NULL, 0),
+ OSSL_PARAM_DEFN(OSSL_PROV_PARAM_BUILDINFO, OSSL_PARAM_UTF8_PTR, NULL, 0),
+ OSSL_PARAM_END
};
-static const OSSL_ITEM *deflt_get_param_types(const OSSL_PROVIDER *prov)
+static const OSSL_PARAM *deflt_get_param_types(const OSSL_PROVIDER *prov)
{
return deflt_param_types;
}
/* Parameters we provide to the core */
-static const OSSL_ITEM fips_param_types[] = {
- { OSSL_PARAM_UTF8_PTR, OSSL_PROV_PARAM_NAME },
- { OSSL_PARAM_UTF8_PTR, OSSL_PROV_PARAM_VERSION },
- { OSSL_PARAM_UTF8_PTR, OSSL_PROV_PARAM_BUILDINFO },
- { 0, NULL }
+static const OSSL_PARAM fips_param_types[] = {
+ OSSL_PARAM_DEFN(OSSL_PROV_PARAM_NAME, OSSL_PARAM_UTF8_PTR, NULL, 0),
+ OSSL_PARAM_DEFN(OSSL_PROV_PARAM_VERSION, OSSL_PARAM_UTF8_PTR, NULL, 0),
+ OSSL_PARAM_DEFN(OSSL_PROV_PARAM_BUILDINFO, OSSL_PARAM_UTF8_PTR, NULL, 0),
+ OSSL_PARAM_END
};
/* TODO(3.0): To be removed */
return ret;
}
-static const OSSL_ITEM *fips_get_param_types(const OSSL_PROVIDER *prov)
+static const OSSL_PARAM *fips_get_param_types(const OSSL_PROVIDER *prov)
{
return fips_param_types;
}
static OSSL_core_get_params_fn *c_get_params = NULL;
/* Tell the core what params we provide and what type they are */
-static const OSSL_ITEM p_param_types[] = {
- { OSSL_PARAM_UTF8_STRING, "greeting" },
- { 0, NULL }
+static const OSSL_PARAM p_param_types[] = {
+ { "greeting", OSSL_PARAM_UTF8_STRING, NULL, 0, 0 },
+ { NULL, 0, NULL, 0, 0 }
};
/* This is a trick to ensure we define the provider functions correctly */
static OSSL_provider_get_param_types_fn p_get_param_types;
static OSSL_provider_get_params_fn p_get_params;
-static const OSSL_ITEM *p_get_param_types(void *_)
+static const OSSL_PARAM *p_get_param_types(void *_)
{
return p_param_types;
}