2019-01-20 20:23:30 +08:00
|
|
|
=pod
|
|
|
|
|
|
|
|
=head1 NAME
|
|
|
|
|
|
|
|
OSSL_PARAM - a structure to pass or request object parameters
|
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
|
|
|
|
#include <openssl/core.h>
|
|
|
|
|
|
|
|
typedef struct ossl_param_st OSSL_PARAM;
|
|
|
|
struct ossl_param_st {
|
|
|
|
const char *key; /* the name of the parameter */
|
2019-03-12 04:51:01 +08:00
|
|
|
unsigned char data_type; /* declare what kind of content is in data */
|
|
|
|
void *data; /* value being passed in or out */
|
|
|
|
size_t data_size; /* data size */
|
2019-06-24 12:43:55 +08:00
|
|
|
size_t return_size; /* returned size */
|
2019-01-20 20:23:30 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
B<OSSL_PARAM> is a type that allows passing arbitrary data for some
|
2019-01-20 20:23:30 +08:00
|
|
|
object between two parties that have no or very little shared
|
|
|
|
knowledge about their respective internal structures for that object.
|
|
|
|
|
|
|
|
A typical usage example could be an application that wants to set some
|
|
|
|
parameters for an object, or wants to find out some parameters of an
|
|
|
|
object.
|
|
|
|
|
2019-07-11 18:18:42 +08:00
|
|
|
Arrays of this type can be used for the following purposes:
|
2019-01-20 20:23:30 +08:00
|
|
|
|
|
|
|
=over 4
|
|
|
|
|
2019-07-11 18:18:42 +08:00
|
|
|
=item * Setting parameters for some object
|
2019-01-20 20:23:30 +08:00
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
The caller sets up the B<OSSL_PARAM> array and calls some function
|
2019-01-20 20:23:30 +08:00
|
|
|
(the I<setter>) that has intimate knowledge about the object that can
|
2019-08-31 15:29:33 +08:00
|
|
|
take the data from the B<OSSL_PARAM> array and assign them in a
|
2019-01-20 20:23:30 +08:00
|
|
|
suitable form for the internal structure of the object.
|
|
|
|
|
2019-07-11 18:18:42 +08:00
|
|
|
=item * Request parameters of some object
|
2019-01-20 20:23:30 +08:00
|
|
|
|
2023-05-10 18:10:57 +08:00
|
|
|
The caller (the I<requester>) sets up the B<OSSL_PARAM> array and
|
2019-01-20 20:23:30 +08:00
|
|
|
calls some function (the I<responder>) that has intimate knowledge
|
|
|
|
about the object, which can take the internal data of the object and
|
2019-03-12 04:51:01 +08:00
|
|
|
copy (possibly convert) that to the memory prepared by the
|
2023-05-10 18:10:57 +08:00
|
|
|
I<requester> and pointed at with the B<OSSL_PARAM> I<data>.
|
2019-01-20 20:23:30 +08:00
|
|
|
|
2019-07-11 18:18:42 +08:00
|
|
|
=item * Request parameter descriptors
|
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
The caller gets an array of constant B<OSSL_PARAM>, which describe
|
2019-07-11 18:18:42 +08:00
|
|
|
available parameters and some of their properties; name, data type and
|
|
|
|
expected data size.
|
|
|
|
For a detailed description of each field for this use, see the field
|
|
|
|
descriptions below.
|
|
|
|
|
|
|
|
The caller may then use the information from this descriptor array to
|
2019-08-31 15:29:33 +08:00
|
|
|
build up its own B<OSSL_PARAM> array to pass down to a I<setter> or
|
2019-07-11 18:18:42 +08:00
|
|
|
I<responder>.
|
|
|
|
|
2019-01-20 20:23:30 +08:00
|
|
|
=back
|
|
|
|
|
2019-08-31 15:30:43 +08:00
|
|
|
Normally, the order of the an B<OSSL_PARAM> array is not relevant.
|
|
|
|
However, if the I<responder> can handle multiple elements with the
|
|
|
|
same key, those elements must be handled in the order they are in.
|
|
|
|
|
2020-11-23 10:03:28 +08:00
|
|
|
An B<OSSL_PARAM> array must have a terminating element, where I<key>
|
|
|
|
is NULL. The usual full terminating template is:
|
|
|
|
|
|
|
|
{ NULL, 0, NULL, 0, 0 }
|
|
|
|
|
|
|
|
This can also be specified using L<OSSL_PARAM_END(3)>.
|
|
|
|
|
2021-04-29 00:08:00 +08:00
|
|
|
=head2 Functional support
|
|
|
|
|
|
|
|
Libcrypto offers a limited set of helper functions to handle
|
|
|
|
B<OSSL_PARAM> items and arrays, please see L<OSSL_PARAM_get_int(3)>.
|
|
|
|
Developers are free to extend or replace those as they see fit.
|
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
=head2 B<OSSL_PARAM> fields
|
2019-01-20 20:23:30 +08:00
|
|
|
|
|
|
|
=over 4
|
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
=item I<key>
|
2019-01-20 20:23:30 +08:00
|
|
|
|
|
|
|
The identity of the parameter in the form of a string.
|
|
|
|
|
2020-11-23 10:03:28 +08:00
|
|
|
In an B<OSSL_PARAM> array, an item with this field set to NULL is
|
|
|
|
considered a terminating item.
|
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
=item I<data_type>
|
2019-01-20 20:23:30 +08:00
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
The I<data_type> is a value that describes the type and organization of
|
2019-01-20 20:23:30 +08:00
|
|
|
the data.
|
|
|
|
See L</Supported types> below for a description of the types.
|
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
=item I<data>
|
2019-01-20 20:23:30 +08:00
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
=item I<data_size>
|
2019-01-20 20:23:30 +08:00
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
I<data> is a pointer to the memory where the parameter data is (when
|
2019-01-20 20:23:30 +08:00
|
|
|
setting parameters) or shall (when requesting parameters) be stored,
|
2019-08-31 15:29:33 +08:00
|
|
|
and I<data_size> is its size in bytes.
|
2019-01-20 20:23:30 +08:00
|
|
|
The organization of the data depends on the parameter type and flag.
|
|
|
|
|
OSSL_PARAM: Correct the assumptions on the UTF8 string length
When the string "ABCDEFGH" is passed, what's considered its data, this?
{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' }
or this?
{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', '\0' }
If it's passed as a pass phrase, should the terminating NUL byte be
considered part of the pass phrase, or not?
Our treatment of OSSL_PARAMs with the data type OSSL_PARAM_UTF8_STRING
set the length of the string to include the terminating NUL byte,
which is quite confusing. What should the recipient of such a string
believe?
Instead of perpetuating this confusion, we change the assumption to
set the OSSL_PARAM to the length of the string, not including the
terminating NUL byte, thereby giving it the same value as a strlen()
call would give.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14168)
2021-02-13 03:30:40 +08:00
|
|
|
The I<data_size> needs special attention with the parameter type
|
|
|
|
B<OSSL_PARAM_UTF8_STRING> in relation to C strings. When setting
|
|
|
|
parameters, the size should be set to the length of the string, not
|
|
|
|
counting the terminating NUL byte. When requesting parameters, the
|
|
|
|
size should be set to the size of the buffer to be populated, which
|
2022-01-03 07:00:27 +08:00
|
|
|
should accommodate enough space for a terminating NUL byte.
|
OSSL_PARAM: Correct the assumptions on the UTF8 string length
When the string "ABCDEFGH" is passed, what's considered its data, this?
{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' }
or this?
{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', '\0' }
If it's passed as a pass phrase, should the terminating NUL byte be
considered part of the pass phrase, or not?
Our treatment of OSSL_PARAMs with the data type OSSL_PARAM_UTF8_STRING
set the length of the string to include the terminating NUL byte,
which is quite confusing. What should the recipient of such a string
believe?
Instead of perpetuating this confusion, we change the assumption to
set the OSSL_PARAM to the length of the string, not including the
terminating NUL byte, thereby giving it the same value as a strlen()
call would give.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14168)
2021-02-13 03:30:40 +08:00
|
|
|
|
2019-09-26 13:42:06 +08:00
|
|
|
When I<requesting parameters>, it's acceptable for I<data> to be NULL.
|
2023-05-10 18:10:57 +08:00
|
|
|
This can be used by the I<requester> to figure out dynamically exactly
|
2019-09-26 13:42:06 +08:00
|
|
|
how much buffer space is needed to store the parameter data.
|
|
|
|
In this case, I<data_size> is ignored.
|
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
When the B<OSSL_PARAM> is used as a parameter descriptor, I<data>
|
2019-07-11 18:18:42 +08:00
|
|
|
should be ignored.
|
2019-08-31 15:29:33 +08:00
|
|
|
If I<data_size> is zero, it means that an arbitrary data size is
|
2019-07-11 18:18:42 +08:00
|
|
|
accepted, otherwise it specifies the maximum size allowed.
|
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
=item I<return_size>
|
2019-01-20 20:23:30 +08:00
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
When an array of B<OSSL_PARAM> is used to request data, the
|
2019-11-02 05:58:27 +08:00
|
|
|
I<responder> must set this field to indicate size of the parameter
|
|
|
|
data, including padding as the case may be.
|
|
|
|
In case the I<data_size> is an unsuitable size for the data, the
|
|
|
|
I<responder> must still set this field to indicate the minimum data
|
|
|
|
size required.
|
|
|
|
(further notes on this in L</NOTES> below).
|
2019-01-20 20:23:30 +08:00
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
When the B<OSSL_PARAM> is used as a parameter descriptor,
|
|
|
|
I<return_size> should be ignored.
|
2019-07-11 18:18:42 +08:00
|
|
|
|
2019-01-20 20:23:30 +08:00
|
|
|
=back
|
|
|
|
|
|
|
|
B<NOTE:>
|
|
|
|
|
|
|
|
The key names and associated types are defined by the entity that
|
|
|
|
offers these parameters, i.e. names for parameters provided by the
|
|
|
|
OpenSSL libraries are defined by the libraries, and names for
|
|
|
|
parameters provided by providers are defined by those providers,
|
|
|
|
except for the pointer form of strings (see data type descriptions
|
|
|
|
below).
|
|
|
|
Entities that want to set or request parameters need to know what
|
|
|
|
those keys are and of what type, any functionality between those two
|
2019-08-31 15:29:33 +08:00
|
|
|
entities should remain oblivious and just pass the B<OSSL_PARAM> array
|
2019-01-20 20:23:30 +08:00
|
|
|
along.
|
|
|
|
|
|
|
|
=head2 Supported types
|
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
The I<data_type> field can be one of the following types:
|
2019-01-20 20:23:30 +08:00
|
|
|
|
|
|
|
=over 4
|
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
=item B<OSSL_PARAM_INTEGER>
|
2019-01-20 20:23:30 +08:00
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
=item B<OSSL_PARAM_UNSIGNED_INTEGER>
|
2019-01-20 20:23:30 +08:00
|
|
|
|
|
|
|
The parameter data is an integer (signed or unsigned) of arbitrary
|
|
|
|
length, organized in native form, i.e. most significant byte first on
|
|
|
|
Big-Endian systems, and least significant byte first on Little-Endian
|
|
|
|
systems.
|
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
=item B<OSSL_PARAM_REAL>
|
2019-01-20 20:23:30 +08:00
|
|
|
|
|
|
|
The parameter data is a floating point value in native form.
|
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
=item B<OSSL_PARAM_UTF8_STRING>
|
2019-01-20 20:23:30 +08:00
|
|
|
|
|
|
|
The parameter data is a printable string.
|
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
=item B<OSSL_PARAM_OCTET_STRING>
|
2019-01-20 20:23:30 +08:00
|
|
|
|
|
|
|
The parameter data is an arbitrary string of bytes.
|
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
=item B<OSSL_PARAM_UTF8_PTR>
|
2019-01-20 20:23:30 +08:00
|
|
|
|
2019-02-22 10:21:33 +08:00
|
|
|
The parameter data is a pointer to a printable string.
|
2019-01-20 20:23:30 +08:00
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
The difference between this and B<OSSL_PARAM_UTF8_STRING> is that I<data>
|
2019-02-22 10:21:33 +08:00
|
|
|
doesn't point directly at the data, but to a pointer that points to the data.
|
2019-01-20 20:23:30 +08:00
|
|
|
|
2020-04-07 13:50:02 +08:00
|
|
|
If there is any uncertainty about which to use, B<OSSL_PARAM_UTF8_STRING> is
|
|
|
|
almost certainly the correct choice.
|
|
|
|
|
2019-02-22 10:21:33 +08:00
|
|
|
This is used to indicate that constant data is or will be passed,
|
2019-01-20 20:23:30 +08:00
|
|
|
and there is therefore no need to copy the data that is passed, just
|
|
|
|
the pointer to it.
|
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
I<data_size> must be set to the size of the data, not the size of the
|
2019-02-22 10:21:33 +08:00
|
|
|
pointer to the data.
|
|
|
|
If this is used in a parameter request,
|
2019-08-31 15:29:33 +08:00
|
|
|
I<data_size> is not relevant. However, the I<responder> will set
|
|
|
|
I<return_size> to the size of the data.
|
2019-01-20 20:23:30 +08:00
|
|
|
|
2019-02-22 10:21:33 +08:00
|
|
|
Note that the use of this type is B<fragile> and can only be safely
|
2019-01-20 20:23:30 +08:00
|
|
|
used for data that remains constant and in a constant location for a
|
|
|
|
long enough duration (such as the life-time of the entity that
|
|
|
|
offers these parameters).
|
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
=item B<OSSL_PARAM_OCTET_PTR>
|
2019-01-20 20:23:30 +08:00
|
|
|
|
2019-02-22 10:21:33 +08:00
|
|
|
The parameter data is a pointer to an arbitrary string of bytes.
|
2019-01-20 20:23:30 +08:00
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
The difference between this and B<OSSL_PARAM_OCTET_STRING> is that
|
|
|
|
I<data> doesn't point directly at the data, but to a pointer that
|
2019-02-22 10:21:33 +08:00
|
|
|
points to the data.
|
2019-01-20 20:23:30 +08:00
|
|
|
|
2020-04-07 13:50:02 +08:00
|
|
|
If there is any uncertainty about which to use, B<OSSL_PARAM_OCTET_STRING> is
|
|
|
|
almost certainly the correct choice.
|
|
|
|
|
2019-02-22 10:21:33 +08:00
|
|
|
This is used to indicate that constant data is or will be passed, and
|
|
|
|
there is therefore no need to copy the data that is passed, just the
|
|
|
|
pointer to it.
|
2019-01-20 20:23:30 +08:00
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
I<data_size> must be set to the size of the data, not the size of the
|
2019-02-22 10:21:33 +08:00
|
|
|
pointer to the data.
|
|
|
|
If this is used in a parameter request,
|
2019-08-31 15:29:33 +08:00
|
|
|
I<data_size> is not relevant. However, the I<responder> will set
|
|
|
|
I<return_size> to the size of the data.
|
2019-01-20 20:23:30 +08:00
|
|
|
|
2019-02-22 10:21:33 +08:00
|
|
|
Note that the use of this type is B<fragile> and can only be safely
|
|
|
|
used for data that remains constant and in a constant location for a
|
|
|
|
long enough duration (such as the life-time of the entity that
|
|
|
|
offers these parameters).
|
2019-01-20 20:23:30 +08:00
|
|
|
|
|
|
|
=back
|
|
|
|
|
|
|
|
=head1 NOTES
|
|
|
|
|
|
|
|
Both when setting and requesting parameters, the functions that are
|
|
|
|
called will have to decide what is and what is not an error.
|
|
|
|
The recommended behaviour is:
|
|
|
|
|
|
|
|
=over 4
|
|
|
|
|
|
|
|
=item *
|
|
|
|
|
|
|
|
Keys that a I<setter> or I<responder> doesn't recognise should simply
|
|
|
|
be ignored.
|
|
|
|
That in itself isn't an error.
|
|
|
|
|
|
|
|
=item *
|
|
|
|
|
|
|
|
If the keys that a called I<setter> recognises form a consistent
|
|
|
|
enough set of data, that call should succeed.
|
|
|
|
|
|
|
|
=item *
|
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
Apart from the I<return_size>, a I<responder> must never change the fields
|
|
|
|
of an B<OSSL_PARAM>.
|
2019-06-24 12:43:55 +08:00
|
|
|
To return a value, it should change the contents of the memory that
|
2019-08-31 15:29:33 +08:00
|
|
|
I<data> points at.
|
2019-01-20 20:23:30 +08:00
|
|
|
|
|
|
|
=item *
|
|
|
|
|
|
|
|
If the data type for a key that it's associated with is incorrect,
|
|
|
|
the called function may return an error.
|
|
|
|
|
|
|
|
The called function may also try to convert the data to a suitable
|
|
|
|
form (for example, it's plausible to pass a large number as an octet
|
|
|
|
string, so even though a given key is defined as an
|
2019-08-31 15:29:33 +08:00
|
|
|
B<OSSL_PARAM_UNSIGNED_INTEGER>, is plausible to pass the value as an
|
|
|
|
B<OSSL_PARAM_OCTET_STRING>), but this is in no way mandatory.
|
2019-01-20 20:23:30 +08:00
|
|
|
|
|
|
|
=item *
|
|
|
|
|
2023-05-20 04:55:08 +08:00
|
|
|
If I<data> for a B<OSSL_PARAM_OCTET_STRING> or a
|
|
|
|
B<OSSL_PARAM_UTF8_STRING> is NULL, the I<responder> should
|
|
|
|
set I<return_size> to the size of the item to be returned
|
|
|
|
and return success. Later the responder will be called again
|
|
|
|
with I<data> pointing at the place for the value to be put.
|
|
|
|
|
|
|
|
=item *
|
|
|
|
|
2019-03-12 04:51:01 +08:00
|
|
|
If a I<responder> finds that some data sizes are too small for the
|
2019-08-31 15:29:33 +08:00
|
|
|
requested data, it must set I<return_size> for each such
|
2019-11-02 05:58:27 +08:00
|
|
|
B<OSSL_PARAM> item to the minimum required size, and eventually return
|
|
|
|
an error.
|
|
|
|
|
|
|
|
=item *
|
|
|
|
|
|
|
|
For the integer type parameters (B<OSSL_PARAM_UNSIGNED_INTEGER> and
|
|
|
|
B<OSSL_PARAM_INTEGER>), a I<responder> may choose to return an error
|
|
|
|
if the I<data_size> isn't a suitable size (even if I<data_size> is
|
|
|
|
bigger than needed). If the I<responder> finds the size suitable, it
|
|
|
|
must fill all I<data_size> bytes and ensure correct padding for the
|
|
|
|
native endianness, and set I<return_size> to the same value as
|
|
|
|
I<data_size>.
|
2019-01-20 20:23:30 +08:00
|
|
|
|
|
|
|
=back
|
|
|
|
|
|
|
|
=begin comment RETURN VALUES doesn't make sense for a manual that only
|
|
|
|
describes a type, but document checkers still want that section, and
|
|
|
|
to have more than just the section title.
|
|
|
|
|
|
|
|
=head1 RETURN VALUES
|
|
|
|
|
|
|
|
txt
|
|
|
|
|
|
|
|
=end comment
|
|
|
|
|
|
|
|
=head1 EXAMPLES
|
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
A couple of examples to just show how B<OSSL_PARAM> arrays could be
|
2019-01-20 20:23:30 +08:00
|
|
|
set up.
|
|
|
|
|
|
|
|
=head3 Example 1
|
|
|
|
|
|
|
|
This example is for setting parameters on some object:
|
|
|
|
|
|
|
|
#include <openssl/core.h>
|
|
|
|
|
|
|
|
const char *foo = "some string";
|
2021-08-12 00:46:07 +08:00
|
|
|
size_t foo_l = strlen(foo);
|
2019-01-20 20:23:30 +08:00
|
|
|
const char bar[] = "some other string";
|
2019-06-24 12:43:55 +08:00
|
|
|
OSSL_PARAM set[] = {
|
2022-06-07 14:28:26 +08:00
|
|
|
{ "foo", OSSL_PARAM_UTF8_PTR, &foo, foo_l, 0 },
|
|
|
|
{ "bar", OSSL_PARAM_UTF8_STRING, (void *)&bar, sizeof(bar) - 1, 0 },
|
2020-11-23 10:03:28 +08:00
|
|
|
{ NULL, 0, NULL, 0, 0 }
|
2019-01-20 20:23:30 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
=head3 Example 2
|
|
|
|
|
|
|
|
This example is for requesting parameters on some object:
|
|
|
|
|
|
|
|
const char *foo = NULL;
|
|
|
|
size_t foo_l;
|
|
|
|
char bar[1024];
|
|
|
|
size_t bar_l;
|
2019-06-24 12:43:55 +08:00
|
|
|
OSSL_PARAM request[] = {
|
2022-06-07 14:28:26 +08:00
|
|
|
{ "foo", OSSL_PARAM_UTF8_PTR, &foo, 0 /*irrelevant*/, 0 },
|
2019-06-24 12:43:55 +08:00
|
|
|
{ "bar", OSSL_PARAM_UTF8_STRING, &bar, sizeof(bar), 0 },
|
2020-11-23 10:03:28 +08:00
|
|
|
{ NULL, 0, NULL, 0, 0 }
|
2019-01-20 20:23:30 +08:00
|
|
|
};
|
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
A I<responder> that receives this array (as I<params> in this example)
|
2019-01-20 20:23:30 +08:00
|
|
|
could fill in the parameters like this:
|
|
|
|
|
2019-06-24 12:43:55 +08:00
|
|
|
/* OSSL_PARAM *params */
|
2019-01-20 20:23:30 +08:00
|
|
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; params[i].key != NULL; i++) {
|
|
|
|
if (strcmp(params[i].key, "foo") == 0) {
|
2019-03-12 04:51:01 +08:00
|
|
|
*(char **)params[i].data = "foo value";
|
2021-08-12 00:46:07 +08:00
|
|
|
params[i].return_size = 9; /* length of "foo value" string */
|
2019-01-20 20:23:30 +08:00
|
|
|
} else if (strcmp(params[i].key, "bar") == 0) {
|
2019-06-12 07:48:13 +08:00
|
|
|
memcpy(params[i].data, "bar value", 10);
|
2021-08-12 00:46:07 +08:00
|
|
|
params[i].return_size = 9; /* length of "bar value" string */
|
2019-01-20 20:23:30 +08:00
|
|
|
}
|
|
|
|
/* Ignore stuff we don't know */
|
|
|
|
}
|
|
|
|
|
|
|
|
=head1 SEE ALSO
|
|
|
|
|
2021-04-07 09:27:18 +08:00
|
|
|
L<openssl-core.h(7)>, L<OSSL_PARAM_get_int(3)>, L<OSSL_PARAM_dup(3)>
|
2019-01-20 20:23:30 +08:00
|
|
|
|
|
|
|
=head1 HISTORY
|
|
|
|
|
2019-08-31 15:29:33 +08:00
|
|
|
B<OSSL_PARAM> was added in OpenSSL 3.0.
|
2019-01-20 20:23:30 +08:00
|
|
|
|
|
|
|
=head1 COPYRIGHT
|
|
|
|
|
2022-05-03 18:52:38 +08:00
|
|
|
Copyright 2019-2022 The OpenSSL Project Authors. All Rights Reserved.
|
2019-01-20 20:23:30 +08:00
|
|
|
|
|
|
|
Licensed under the Apache License 2.0 (the "License"). You may not use
|
|
|
|
this file except in compliance with the License. You can obtain a copy
|
|
|
|
in the file LICENSE in the source distribution or at
|
|
|
|
L<https://www.openssl.org/source/license.html>.
|
|
|
|
|
|
|
|
=cut
|