Latest update.
This commit is contained in:
@@ -22,10 +22,10 @@ ASN1_INTEGER_get_int64, ASN1_INTEGER_get, ASN1_INTEGER_set_int64, ASN1_INTEGER_s
|
||||
ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai);
|
||||
BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn);
|
||||
|
||||
int ASN1_ENUMERATED_get_int64(int64_t *pr, const ASN1_INTEGER *a);
|
||||
int ASN1_ENUMERATED_get_int64(int64_t *pr, const ASN1_ENUMERATED *a);
|
||||
long ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a);
|
||||
|
||||
int ASN1_ENUMERATED_set_int64(ASN1_INTEGER *a, int64_t r);
|
||||
int ASN1_ENUMERATED_set_int64(ASN1_ENUMERATED *a, int64_t r);
|
||||
int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v);
|
||||
|
||||
ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai);
|
||||
|
||||
@@ -13,7 +13,8 @@ ASN1_TIME_print, ASN1_UTCTIME_print, ASN1_GENERALIZEDTIME_print,
|
||||
ASN1_TIME_diff,
|
||||
ASN1_TIME_cmp_time_t, ASN1_UTCTIME_cmp_time_t,
|
||||
ASN1_TIME_compare,
|
||||
ASN1_TIME_to_generalizedtime - ASN.1 Time functions
|
||||
ASN1_TIME_to_generalizedtime,
|
||||
ASN1_TIME_dup, ASN1_UTCTIME_dup, ASN1_GENERALIZEDTIME_dup - ASN.1 Time functions
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -58,6 +59,10 @@ ASN1_TIME_to_generalizedtime - ASN.1 Time functions
|
||||
ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t,
|
||||
ASN1_GENERALIZEDTIME **out);
|
||||
|
||||
ASN1_TIME *ASN1_TIME_dup(const ASN1_TIME *t);
|
||||
ASN1_UTCTIME *ASN1_UTCTIME_dup(const ASN1_UTCTIME *t);
|
||||
ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_dup(const ASN1_GENERALIZEDTIME *t);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The ASN1_TIME_set(), ASN1_UTCTIME_set() and ASN1_GENERALIZEDTIME_set()
|
||||
@@ -131,6 +136,10 @@ The ASN1_TIME_to_generalizedtime() function converts an B<ASN1_TIME> to an
|
||||
B<ASN1_GENERALIZEDTIME>, regardless of year. If either I<out> or
|
||||
I<*out> are NULL, then a new object is allocated and must be freed after use.
|
||||
|
||||
The ASN1_TIME_dup(), ASN1_UTCTIME_dup() and ASN1_GENERALIZEDTIME_dup() functions
|
||||
duplicate the time structure I<t> and return the duplicated result
|
||||
correspondingly.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
The B<ASN1_TIME> structure corresponds to the ASN.1 structure B<Time>
|
||||
@@ -210,6 +219,9 @@ or 1 if I<a> is after I<b>. -2 is returned on error.
|
||||
ASN1_TIME_to_generalizedtime() returns a pointer to the appropriate time
|
||||
structure on success or NULL if an error occurred.
|
||||
|
||||
ASN1_TIME_dup(), ASN1_UTCTIME_dup() and ASN1_GENERALIZEDTIME_dup() return a
|
||||
pointer to a time structure or NULL if an error occurred.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
Set a time structure to one hour after the current time and print it out:
|
||||
|
||||
@@ -187,7 +187,7 @@ ASYNC_WAIT_CTX_set_wait_fd, ASYNC_WAIT_CTX_get_fd, ASYNC_WAIT_CTX_get_all_fds,
|
||||
ASYNC_WAIT_CTX_get_changed_fds, ASYNC_WAIT_CTX_clear_fd,
|
||||
ASYNC_WAIT_CTX_set_callback, ASYNC_WAIT_CTX_get_callback and
|
||||
ASYNC_WAIT_CTX_set_status all return 1 on success or 0 on error.
|
||||
ASYNC_WAIT_CTX_get_status() returs the engine status.
|
||||
ASYNC_WAIT_CTX_get_status() returns the engine status.
|
||||
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
@@ -9,6 +9,10 @@ BF_cfb64_encrypt, BF_ofb64_encrypt, BF_options - Blowfish encryption
|
||||
|
||||
#include <openssl/blowfish.h>
|
||||
|
||||
Deprecated since OpenSSL 3.0, can be hidden entirely by defining
|
||||
B<OPENSSL_API_COMPAT> with a suitable version value, see
|
||||
L<openssl_user_macros(7)>:
|
||||
|
||||
void BF_set_key(BF_KEY *key, int len, const unsigned char *data);
|
||||
|
||||
void BF_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
||||
@@ -29,6 +33,10 @@ BF_cfb64_encrypt, BF_ofb64_encrypt, BF_options - Blowfish encryption
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
All of the functions described on this page are deprecated. Applications should
|
||||
instead use L<EVP_EncryptInit_ex(3)>, L<EVP_EncryptUpdate(3)> and
|
||||
L<EVP_EncryptFinal_ex(3)> or the equivalently named decrypt functions.
|
||||
|
||||
This library implements the Blowfish cipher, which was invented and described
|
||||
by Counterpane (see http://www.counterpane.com/blowfish.html ).
|
||||
|
||||
@@ -107,6 +115,10 @@ functions directly.
|
||||
L<EVP_EncryptInit(3)>,
|
||||
L<des_modes(7)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
All of these functions were deprecated in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
BIO_f_prefix, BIO_set_prefix, BIO_set_indent, BIO_get_indent
|
||||
- prefix BIO filter
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/bio.h>
|
||||
|
||||
const BIO_METHOD *BIO_f_prefix(void);
|
||||
long BIO_set_prefix(BIO *b, const char *prefix);
|
||||
long BIO_set_indent(BIO *b, long indent);
|
||||
long BIO_get_indent(BIO *b);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
BIO_f_cipher() returns the prefix BIO method. This is a filter for
|
||||
text output, where each line gets automatically prefixed and indented
|
||||
according to user input.
|
||||
|
||||
The prefix and the indentation are combined. For each line of output
|
||||
going through this filter, the prefix is output first, then the amount
|
||||
of additional spaces indicated by the indentation, and then the line
|
||||
itself.
|
||||
|
||||
By default, there is no prefix, and indentation is set to 0.
|
||||
|
||||
BIO_set_prefix() sets the prefix to be used for future lines of
|
||||
text, using I<prefix>. I<prefix> may be NULL, signifying that there
|
||||
should be no prefix. If I<prefix> isn't NULL, this function makes a
|
||||
copy of it.
|
||||
|
||||
BIO_set_indent() sets the indentation to be used for future lines of
|
||||
text, using I<indent>. Negative values are not allowed.
|
||||
|
||||
BIO_get_indent() gets the current indentation.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
BIO_set_prefix(), BIO_set_indent() and BIO_get_indent() are
|
||||
implemented as macros.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
BIO_f_prefix() returns the prefix BIO method.
|
||||
|
||||
BIO_set_prefix() returns 1 if the prefix was correctly set, or 0 on
|
||||
failure.
|
||||
|
||||
BIO_set_indent() returns 1 if the prefix was correctly set, or 0 on
|
||||
failure.
|
||||
|
||||
BIO_get_indent() returns the current indentation.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<bio(7)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
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
|
||||
@@ -47,7 +47,7 @@ BIO_get_shutdown() returns the stat of the BIO's shutdown (i.e. BIO_CLOSE) flag.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<bio>, L<BIO_meth_new>
|
||||
L<bio(7)>, L<BIO_meth_new(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
|
||||
@@ -3,16 +3,27 @@
|
||||
=head1 NAME
|
||||
|
||||
BIO_get_ex_new_index, BIO_set_ex_data, BIO_get_ex_data,
|
||||
ENGINE_get_ex_new_index, ENGINE_set_ex_data, ENGINE_get_ex_data,
|
||||
UI_get_ex_new_index, UI_set_ex_data, UI_get_ex_data,
|
||||
X509_get_ex_new_index, X509_set_ex_data, X509_get_ex_data,
|
||||
X509_STORE_get_ex_new_index, X509_STORE_set_ex_data, X509_STORE_get_ex_data,
|
||||
X509_STORE_CTX_get_ex_new_index, X509_STORE_CTX_set_ex_data, X509_STORE_CTX_get_ex_data,
|
||||
BIO_set_app_data, BIO_get_app_data,
|
||||
DH_get_ex_new_index, DH_set_ex_data, DH_get_ex_data,
|
||||
DSA_get_ex_new_index, DSA_set_ex_data, DSA_get_ex_data,
|
||||
ECDH_get_ex_new_index, ECDH_set_ex_data, ECDH_get_ex_data,
|
||||
EC_KEY_get_ex_new_index, EC_KEY_set_ex_data, EC_KEY_get_ex_data,
|
||||
RSA_get_ex_new_index, RSA_set_ex_data, RSA_get_ex_data
|
||||
ENGINE_get_ex_new_index, ENGINE_set_ex_data, ENGINE_get_ex_data,
|
||||
RAND_DRBG_set_ex_data, RAND_DRBG_get_ex_data, RAND_DRBG_get_ex_new_index,
|
||||
RSA_get_ex_new_index, RSA_set_ex_data, RSA_get_ex_data,
|
||||
RSA_set_app_data, RSA_get_app_data,
|
||||
SSL_get_ex_new_index, SSL_set_ex_data, SSL_get_ex_data,
|
||||
SSL_set_app_data, SSL_get_app_data,
|
||||
SSL_CTX_get_ex_new_index, SSL_CTX_set_ex_data, SSL_CTX_get_ex_data,
|
||||
SSL_CTX_set_app_data, SSL_CTX_get_app_data,
|
||||
SSL_SESSION_get_ex_new_index, SSL_SESSION_set_ex_data, SSL_SESSION_get_ex_data,
|
||||
SSL_SESSION_set_app_data, SSL_SESSION_get_app_data,
|
||||
UI_get_ex_new_index, UI_set_ex_data, UI_get_ex_data,
|
||||
UI_set_app_data, UI_get_app_data,
|
||||
X509_STORE_CTX_get_ex_new_index, X509_STORE_CTX_set_ex_data, X509_STORE_CTX_get_ex_data,
|
||||
X509_STORE_CTX_set_app_data, X509_STORE_CTX_get_app_data,
|
||||
X509_STORE_get_ex_new_index, X509_STORE_set_ex_data, X509_STORE_get_ex_data,
|
||||
X509_get_ex_new_index, X509_set_ex_data, X509_get_ex_data
|
||||
- application-specific data
|
||||
|
||||
=head1 SYNOPSIS
|
||||
@@ -30,6 +41,9 @@ RSA_get_ex_new_index, RSA_set_ex_data, RSA_get_ex_data
|
||||
|
||||
void *TYPE_get_ex_data(TYPE *d, int idx);
|
||||
|
||||
#define TYPE_set_app_data(TYPE *d, void *arg)
|
||||
#define TYPE_get_app_data(TYPE *d)
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
In the description here, I<TYPE> is used a placeholder
|
||||
@@ -48,6 +62,16 @@ an offset into the opaque exdata part of the TYPE object.
|
||||
TYPE_get_ex_data() is a function that calls CRYPTO_get_ex_data() with
|
||||
an offset into the opaque exdata part of the TYPE object.
|
||||
|
||||
For compatibility with previous releases, the exdata index of zero is
|
||||
reserved for "application data." There are two convenience functions for
|
||||
this.
|
||||
TYPE_set_app_data() is a macro that invokes TYPE_set_ex_data() with
|
||||
B<idx> set to zero.
|
||||
TYPE_get_app_data() is a macro that invokes TYPE_get_ex_data() with
|
||||
B<idx> set to zero.
|
||||
Note that these functions are not defined for the B<RAND_DRBG> type because
|
||||
there are no backward compatibility concerns.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
TYPE_get_new_ex_index() returns a new index on success or -1 on error.
|
||||
|
||||
@@ -60,7 +60,7 @@ BIO_meth_set_callback_ctrl - Routines to build up BIO methods
|
||||
|
||||
The B<BIO_METHOD> type is a structure used for the implementation of new BIO
|
||||
types. It provides a set of functions used by OpenSSL for the implementation
|
||||
of the various BIO capabilities. See the L<bio> page for more information.
|
||||
of the various BIO capabilities. See the L<bio(7)> page for more information.
|
||||
|
||||
BIO_meth_new() creates a new B<BIO_METHOD> structure. It should be given a
|
||||
unique integer B<type> and a string that represents its B<name>.
|
||||
@@ -72,7 +72,7 @@ include B<BIO_TYPE_BUFFER> and B<BIO_TYPE_CIPHER>. Filter BIOs should have a
|
||||
type which have the "filter" bit set (B<BIO_TYPE_FILTER>). Source/sink BIOs
|
||||
should have the "source/sink" bit set (B<BIO_TYPE_SOURCE_SINK>). File descriptor
|
||||
based BIOs (e.g. socket, fd, connect, accept etc) should additionally have the
|
||||
"descriptor" bit set (B<BIO_TYPE_DESCRIPTOR>). See the L<BIO_find_type> page for
|
||||
"descriptor" bit set (B<BIO_TYPE_DESCRIPTOR>). See the L<BIO_find_type(3)> page for
|
||||
more information.
|
||||
|
||||
BIO_meth_free() destroys a B<BIO_METHOD> structure and frees up any memory
|
||||
@@ -108,7 +108,7 @@ application calling BIO_gets(). The parameters for the function have the same
|
||||
meaning as for BIO_gets().
|
||||
|
||||
BIO_meth_get_ctrl() and BIO_meth_set_ctrl() get and set the function used for
|
||||
processing ctrl messages in the BIO respectively. See the L<BIO_ctrl> page for
|
||||
processing ctrl messages in the BIO respectively. See the L<BIO_ctrl(3)> page for
|
||||
more information. This function will be called in response to the application
|
||||
calling BIO_ctrl(). The parameters for the function have the same meaning as for
|
||||
BIO_ctrl().
|
||||
@@ -146,7 +146,7 @@ The B<BIO_meth_get> functions return the corresponding function pointers.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<bio>, L<BIO_find_type>, L<BIO_ctrl>, L<BIO_read_ex>, L<BIO_new>
|
||||
L<bio(7)>, L<BIO_find_type(3)>, L<BIO_ctrl(3)>, L<BIO_read_ex(3)>, L<BIO_new(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ be written to B<md1> as before.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<bio>
|
||||
L<bio(7)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ BIO_get_retry_reason() returns the reason for a special condition.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<bio>
|
||||
L<bio(7)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@ an ASN1_OBJECT pointer. An application can then decide how to process the
|
||||
CMS_ContentInfo structure based on this value.
|
||||
|
||||
CMS_set1_eContentType() sets the embedded content type of a CMS_ContentInfo
|
||||
structure. It should be called with CMS functions (such as L<CMS_sign>, L<CMS_encrypt>)
|
||||
structure. It should be called with CMS functions (such as L<CMS_sign(3)>,
|
||||
L<CMS_encrypt(3)>)
|
||||
with the B<CMS_PARTIAL>
|
||||
flag and B<before> the structure is finalised, otherwise the results are
|
||||
undefined.
|
||||
|
||||
@@ -44,13 +44,12 @@ Several OpenSSL structures can have application-specific data attached to them,
|
||||
known as "exdata."
|
||||
The specific structures are:
|
||||
|
||||
APP
|
||||
BIO
|
||||
DH
|
||||
DRBG
|
||||
DSA
|
||||
EC_KEY
|
||||
ENGINE
|
||||
RAND_DRBG
|
||||
RSA
|
||||
SSL
|
||||
SSL_CTX
|
||||
@@ -61,6 +60,8 @@ The specific structures are:
|
||||
X509_STORE
|
||||
X509_STORE_CTX
|
||||
|
||||
In addition, the B<APP> name is reserved for use by application code.
|
||||
|
||||
Each is identified by an B<CRYPTO_EX_INDEX_xxx> define in the B<crypto.h>
|
||||
header file. In addition, B<CRYPTO_EX_INDEX_APP> is reserved for
|
||||
applications to use this facility for their own structures.
|
||||
|
||||
@@ -25,8 +25,8 @@ logs). The list can be loaded from one or more files and then searched by LogID
|
||||
CTLOG_STORE_new() creates an empty list of CT logs. This is then populated
|
||||
by CTLOG_STORE_load_default_file() or CTLOG_STORE_load_file().
|
||||
CTLOG_STORE_load_default_file() loads from the default file, which is named
|
||||
"ct_log_list.cnf" in OPENSSLDIR (see the output of L<version>). This can be
|
||||
overridden using an environment variable named "CTLOG_FILE".
|
||||
F<ct_log_list.cnf> in OPENSSLDIR (see the output of L<openssl-version(1)>).
|
||||
This can be overridden using an environment variable named B<CTLOG_FILE>.
|
||||
CTLOG_STORE_load_file() loads from a caller-specified file path instead.
|
||||
Both of these functions append any loaded CT logs to the CTLOG_STORE.
|
||||
|
||||
|
||||
@@ -88,8 +88,7 @@ DSA_meth_set_keygen - Routines to build up DSA methods
|
||||
|
||||
The B<DSA_METHOD> type is a structure used for the provision of custom DSA
|
||||
implementations. It provides a set of functions used by OpenSSL for the
|
||||
implementation of the various DSA capabilities. See the L<dsa> page for more
|
||||
information.
|
||||
implementation of the various DSA capabilities.
|
||||
|
||||
DSA_meth_new() creates a new B<DSA_METHOD> structure. It should be given a
|
||||
unique B<name> and a set of B<flags>. The B<name> should be a NULL terminated
|
||||
|
||||
@@ -49,7 +49,7 @@ be released during the change. It is possible to have DSA keys that only
|
||||
work with certain DSA_METHOD implementations (eg. from an ENGINE module
|
||||
that supports embedded hardware-protected keys), and in such cases
|
||||
attempting to change the DSA_METHOD for the key can have unexpected
|
||||
results. See L<DSA_meth_new> for information on constructing custom DSA_METHOD
|
||||
results. See L<DSA_meth_new(3)> for information on constructing custom DSA_METHOD
|
||||
objects;
|
||||
|
||||
DSA_new_method() allocates and initializes a DSA structure so that B<engine>
|
||||
|
||||
+52
-38
@@ -42,7 +42,7 @@ EC_GROUP_get_pentanomial_basis, EC_GROUP_get0_field
|
||||
int EC_GROUP_get_asn1_flag(const EC_GROUP *group);
|
||||
|
||||
void EC_GROUP_set_point_conversion_form(EC_GROUP *group, point_conversion_form_t form);
|
||||
point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *);
|
||||
point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *group);
|
||||
|
||||
unsigned char *EC_GROUP_get0_seed(const EC_GROUP *x);
|
||||
size_t EC_GROUP_get_seed_len(const EC_GROUP *);
|
||||
@@ -65,34 +65,39 @@ EC_GROUP_get_pentanomial_basis, EC_GROUP_get0_field
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
EC_GROUP_copy copies the curve B<src> into B<dst>. Both B<src> and B<dst> must use the same EC_METHOD.
|
||||
EC_GROUP_copy() copies the curve B<src> into B<dst>. Both B<src> and B<dst> must use the same EC_METHOD.
|
||||
|
||||
EC_GROUP_dup creates a new EC_GROUP object and copies the content from B<src> to the newly created
|
||||
EC_GROUP_dup() creates a new EC_GROUP object and copies the content from B<src> to the newly created
|
||||
EC_GROUP object.
|
||||
|
||||
EC_GROUP_method_of obtains the EC_METHOD of B<group>.
|
||||
EC_GROUP_method_of() obtains the EC_METHOD of B<group>.
|
||||
|
||||
EC_GROUP_set_generator sets curve parameters that must be agreed by all participants using the curve. These
|
||||
EC_GROUP_set_generator() sets curve parameters that must be agreed by all participants using the curve. These
|
||||
parameters include the B<generator>, the B<order> and the B<cofactor>. The B<generator> is a well defined point on the
|
||||
curve chosen for cryptographic operations. Integers used for point multiplications will be between 0 and
|
||||
n-1 where n is the B<order>. The B<order> multiplied by the B<cofactor> gives the number of points on the curve.
|
||||
|
||||
EC_GROUP_get0_generator returns the generator for the identified B<group>.
|
||||
EC_GROUP_get0_generator() returns the generator for the identified B<group>.
|
||||
|
||||
The functions EC_GROUP_get_order and EC_GROUP_get_cofactor populate the provided B<order> and B<cofactor> parameters
|
||||
with the respective order and cofactors for the B<group>.
|
||||
EC_GROUP_get_order() retrieves the order of B<group> and copies its value into
|
||||
B<order>. It fails in case B<group> is not fully initialized (i.e., its order
|
||||
is not set or set to zero).
|
||||
|
||||
The functions EC_GROUP_set_curve_name and EC_GROUP_get_curve_name, set and get the NID for the curve respectively
|
||||
EC_GROUP_get_cofactor() retrieves the cofactor of B<group> and copies its value
|
||||
into B<cofactor>. It fails in case B<group> is not fully initialized or if the
|
||||
cofactor is not set (or set to zero).
|
||||
|
||||
The functions EC_GROUP_set_curve_name() and EC_GROUP_get_curve_name(), set and get the NID for the curve respectively
|
||||
(see L<EC_GROUP_new(3)>). If a curve does not have a NID associated with it, then EC_GROUP_get_curve_name
|
||||
will return 0.
|
||||
will return NID_undef.
|
||||
|
||||
The asn1_flag value is used to determine whether the curve encoding uses
|
||||
explicit parameters or a named curve using an ASN1 OID: many applications only
|
||||
support the latter form. If asn1_flag is B<OPENSSL_EC_NAMED_CURVE> then the
|
||||
named curve form is used and the parameters must have a corresponding
|
||||
named curve NID set. If asn1_flags is B<OPENSSL_EC_EXPLICIT_CURVE> the
|
||||
parameters are explicitly encoded. The functions EC_GROUP_get_asn1_flag and
|
||||
EC_GROUP_set_asn1_flag get and set the status of the asn1_flag for the curve.
|
||||
parameters are explicitly encoded. The functions EC_GROUP_get_asn1_flag() and
|
||||
EC_GROUP_set_asn1_flag() get and set the status of the asn1_flag for the curve.
|
||||
Note: B<OPENSSL_EC_EXPLICIT_CURVE> was added in OpenSSL 1.1.0, for
|
||||
previous versions of OpenSSL the value 0 must be used instead. Before OpenSSL
|
||||
1.1.0 the default form was to use explicit parameters (meaning that
|
||||
@@ -123,30 +128,30 @@ the two possible solutions for y has been used, followed by the octets for x.
|
||||
For POINT_CONVERSION_HYBRID the point is encoded as an octet signifying the HYBRID form has been used AND which of the two
|
||||
possible solutions for y has been used, followed by the octets for x, followed by the octets for y.
|
||||
|
||||
The functions EC_GROUP_set_point_conversion_form and EC_GROUP_get_point_conversion_form set and get the point_conversion_form
|
||||
The functions EC_GROUP_set_point_conversion_form() and EC_GROUP_get_point_conversion_form(), set and get the point_conversion_form
|
||||
for the curve respectively.
|
||||
|
||||
ANSI X9.62 (ECDSA standard) defines a method of generating the curve parameter b from a random number. This provides advantages
|
||||
in that a parameter obtained in this way is highly unlikely to be susceptible to special purpose attacks, or have any trapdoors in it.
|
||||
If the seed is present for a curve then the b parameter was generated in a verifiable fashion using that seed. The OpenSSL EC library
|
||||
does not use this seed value but does enable you to inspect it using EC_GROUP_get0_seed. This returns a pointer to a memory block
|
||||
containing the seed that was used. The length of the memory block can be obtained using EC_GROUP_get_seed_len. A number of the
|
||||
does not use this seed value but does enable you to inspect it using EC_GROUP_get0_seed(). This returns a pointer to a memory block
|
||||
containing the seed that was used. The length of the memory block can be obtained using EC_GROUP_get_seed_len(). A number of the
|
||||
built-in curves within the library provide seed values that can be obtained. It is also possible to set a custom seed using
|
||||
EC_GROUP_set_seed and passing a pointer to a memory block, along with the length of the seed. Again, the EC library will not use
|
||||
EC_GROUP_set_seed() and passing a pointer to a memory block, along with the length of the seed. Again, the EC library will not use
|
||||
this seed value, although it will be preserved in any ASN1 based communications.
|
||||
|
||||
EC_GROUP_get_degree gets the degree of the field. For Fp fields this will be the number of bits in p. For F2^m fields this will be
|
||||
EC_GROUP_get_degree() gets the degree of the field. For Fp fields this will be the number of bits in p. For F2^m fields this will be
|
||||
the value m.
|
||||
|
||||
The function EC_GROUP_check_discriminant calculates the discriminant for the curve and verifies that it is valid.
|
||||
The function EC_GROUP_check_discriminant() calculates the discriminant for the curve and verifies that it is valid.
|
||||
For a curve defined over Fp the discriminant is given by the formula 4*a^3 + 27*b^2 whilst for F2^m curves the discriminant is
|
||||
simply b. In either case for the curve to be valid the discriminant must be non zero.
|
||||
|
||||
The function EC_GROUP_check performs a number of checks on a curve to verify that it is valid. Checks performed include
|
||||
The function EC_GROUP_check() performs a number of checks on a curve to verify that it is valid. Checks performed include
|
||||
verifying that the discriminant is non zero; that a generator has been defined; that the generator is on the curve and has
|
||||
the correct order.
|
||||
|
||||
The function EC_GROUP_check_named_curve determines if the group's domain parameters match one of the built-in curves supported by the library.
|
||||
The function EC_GROUP_check_named_curve() determines if the group's domain parameters match one of the built-in curves supported by the library.
|
||||
The curve name is returned as a B<NID> if it matches. If the group's domain parameters have been modified then no match will be found.
|
||||
If the curve name of the given group is B<NID_undef> (e.g. it has been created by using explicit parameters with no curve name),
|
||||
then this method can be used to lookup the name of the curve that matches the group domain parameters. The built-in curves contain
|
||||
@@ -156,9 +161,9 @@ If B<nist_only> is 1 it will only look for NIST approved curves, otherwise it se
|
||||
This function may be passed a BN_CTX object in the B<ctx> parameter.
|
||||
The B<ctx> parameter may be NULL.
|
||||
|
||||
EC_GROUP_cmp compares B<a> and B<b> to determine whether they represent the same curve or not.
|
||||
EC_GROUP_cmp() compares B<a> and B<b> to determine whether they represent the same curve or not.
|
||||
|
||||
The functions EC_GROUP_get_basis_type, EC_GROUP_get_trinomial_basis and EC_GROUP_get_pentanomial_basis should only be called for curves
|
||||
The functions EC_GROUP_get_basis_type(), EC_GROUP_get_trinomial_basis() and EC_GROUP_get_pentanomial_basis() should only be called for curves
|
||||
defined over an F2^m field. Addition and multiplication operations within an F2^m field are performed using an irreducible polynomial
|
||||
function f(x). This function is either a trinomial of the form:
|
||||
|
||||
@@ -168,25 +173,34 @@ or a pentanomial of the form:
|
||||
|
||||
f(x) = x^m + x^k3 + x^k2 + x^k1 + 1 with m > k3 > k2 > k1 >= 1
|
||||
|
||||
The function EC_GROUP_get_basis_type returns a NID identifying whether a trinomial or pentanomial is in use for the field. The
|
||||
function EC_GROUP_get_trinomial_basis must only be called where f(x) is of the trinomial form, and returns the value of B<k>. Similarly
|
||||
the function EC_GROUP_get_pentanomial_basis must only be called where f(x) is of the pentanomial form, and returns the values of B<k1>,
|
||||
The function EC_GROUP_get_basis_type() returns a NID identifying whether a trinomial or pentanomial is in use for the field. The
|
||||
function EC_GROUP_get_trinomial_basis() must only be called where f(x) is of the trinomial form, and returns the value of B<k>. Similarly
|
||||
the function EC_GROUP_get_pentanomial_basis() must only be called where f(x) is of the pentanomial form, and returns the values of B<k1>,
|
||||
B<k2> and B<k3> respectively.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
The following functions return 1 on success or 0 on error: EC_GROUP_copy, EC_GROUP_set_generator, EC_GROUP_check,
|
||||
EC_GROUP_check_discriminant, EC_GROUP_get_trinomial_basis and EC_GROUP_get_pentanomial_basis.
|
||||
The following functions return 1 on success or 0 on error: EC_GROUP_copy(), EC_GROUP_set_generator(), EC_GROUP_check(),
|
||||
EC_GROUP_check_discriminant(), EC_GROUP_get_trinomial_basis() and EC_GROUP_get_pentanomial_basis().
|
||||
|
||||
EC_GROUP_dup returns a pointer to the duplicated curve, or NULL on error.
|
||||
EC_GROUP_dup() returns a pointer to the duplicated curve, or NULL on error.
|
||||
|
||||
EC_GROUP_method_of returns the EC_METHOD implementation in use for the given curve or NULL on error.
|
||||
EC_GROUP_method_of() returns the EC_METHOD implementation in use for the given curve or NULL on error.
|
||||
|
||||
EC_GROUP_get0_generator returns the generator for the given curve or NULL on error.
|
||||
EC_GROUP_get0_generator() returns the generator for the given curve or NULL on error.
|
||||
|
||||
EC_GROUP_get_order, EC_GROUP_get_cofactor, EC_GROUP_get_curve_name, EC_GROUP_get_asn1_flag, EC_GROUP_get_point_conversion_form
|
||||
and EC_GROUP_get_degree return the order, cofactor, curve name (NID), ASN1 flag, point_conversion_form and degree for the
|
||||
specified curve respectively. If there is no curve name associated with a curve then EC_GROUP_get_curve_name will return 0.
|
||||
EC_GROUP_get_order() returns 0 if the order is not set (or set to zero) for
|
||||
B<group> or if copying into B<order> fails, 1 otherwise.
|
||||
|
||||
EC_GROUP_get_cofactor() returns 0 if the cofactor is not set (or is set to zero) for B<group> or if copying into B<cofactor> fails, 1 otherwise.
|
||||
|
||||
EC_GROUP_get_curve_name() returns the curve name (NID) for B<group> or will return NID_undef if no curve name is associated.
|
||||
|
||||
EC_GROUP_get_asn1_flag() returns the ASN1 flag for the specified B<group> .
|
||||
|
||||
EC_GROUP_get_point_conversion_form() returns the point_conversion_form for B<group>.
|
||||
|
||||
EC_GROUP_get_degree() returns the degree for B<group> or 0 if the operation is not supported by the underlying group implementation.
|
||||
|
||||
EC_GROUP_check_named_curve() returns the nid of the matching named curve, otherwise it returns 0 for no match, or -1 on error.
|
||||
|
||||
@@ -196,15 +210,15 @@ EC_GROUP_get0_cofactor() returns an internal pointer to the group cofactor.
|
||||
EC_GROUP_get0_field() returns an internal pointer to the group field. For curves over GF(p), this is the modulus; for curves
|
||||
over GF(2^m), this is the irreducible polynomial defining the field.
|
||||
|
||||
EC_GROUP_get0_seed returns a pointer to the seed that was used to generate the parameter b, or NULL if the seed is not
|
||||
specified. EC_GROUP_get_seed_len returns the length of the seed or 0 if the seed is not specified.
|
||||
EC_GROUP_get0_seed() returns a pointer to the seed that was used to generate the parameter b, or NULL if the seed is not
|
||||
specified. EC_GROUP_get_seed_len() returns the length of the seed or 0 if the seed is not specified.
|
||||
|
||||
EC_GROUP_set_seed returns the length of the seed that has been set. If the supplied seed is NULL, or the supplied seed length is
|
||||
EC_GROUP_set_seed() returns the length of the seed that has been set. If the supplied seed is NULL, or the supplied seed length is
|
||||
0, the return value will be 1. On error 0 is returned.
|
||||
|
||||
EC_GROUP_cmp returns 0 if the curves are equal, 1 if they are not equal, or -1 on error.
|
||||
EC_GROUP_cmp() returns 0 if the curves are equal, 1 if they are not equal, or -1 on error.
|
||||
|
||||
EC_GROUP_get_basis_type returns the values NID_X9_62_tpBasis or NID_X9_62_ppBasis (as defined in <openssl/obj_mac.h>) for a
|
||||
EC_GROUP_get_basis_type() returns the values NID_X9_62_tpBasis or NID_X9_62_ppBasis (as defined in <openssl/obj_mac.h>) for a
|
||||
trinomial or pentanomial respectively. Alternatively in the event of an error a 0 is returned.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
+82
-42
@@ -32,7 +32,6 @@ objects
|
||||
EC_GROUP *EC_GROUP_new_from_ecparameters(const ECPARAMETERS *params)
|
||||
EC_GROUP *EC_GROUP_new_from_ecpkparameters(const ECPKPARAMETERS *params)
|
||||
void EC_GROUP_free(EC_GROUP *group);
|
||||
void EC_GROUP_clear_free(EC_GROUP *group);
|
||||
|
||||
EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a,
|
||||
const BIGNUM *b, BN_CTX *ctx);
|
||||
@@ -59,57 +58,78 @@ objects
|
||||
|
||||
size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems);
|
||||
|
||||
Deprecated since OpenSSL 3.0, can be hidden entirely by defining
|
||||
B<OPENSSL_API_COMPAT> with a suitable version value, see
|
||||
L<openssl_user_macros(7)>:
|
||||
|
||||
void EC_GROUP_clear_free(EC_GROUP *group);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Within the library there are two forms of elliptic curve that are of interest. The first form is those defined over the
|
||||
prime field Fp. The elements of Fp are the integers 0 to p-1, where p is a prime number. This gives us a revised
|
||||
Within the library there are two forms of elliptic curve that are of interest.
|
||||
The first form is those defined over the prime field Fp. The elements of Fp are
|
||||
the integers 0 to p-1, where p is a prime number. This gives us a revised
|
||||
elliptic curve equation as follows:
|
||||
|
||||
y^2 mod p = x^3 +ax + b mod p
|
||||
|
||||
The second form is those defined over a binary field F2^m where the elements of the field are integers of length at
|
||||
most m bits. For this form the elliptic curve equation is modified to:
|
||||
The second form is those defined over a binary field F2^m where the elements of
|
||||
the field are integers of length at most m bits. For this form the elliptic
|
||||
curve equation is modified to:
|
||||
|
||||
y^2 + xy = x^3 + ax^2 + b (where b != 0)
|
||||
|
||||
Operations in a binary field are performed relative to an B<irreducible polynomial>. All such curves with OpenSSL
|
||||
use a trinomial or a pentanomial for this parameter.
|
||||
Operations in a binary field are performed relative to an
|
||||
B<irreducible polynomial>. All such curves with OpenSSL use a trinomial or a
|
||||
pentanomial for this parameter.
|
||||
|
||||
A new curve can be constructed by calling EC_GROUP_new_ex, using the implementation provided by B<meth> (see
|
||||
L<EC_GFp_simple_method(3)>) and associated with the library context B<ctx>
|
||||
(see L<OPENSSL_CTX(3)>).
|
||||
The B<ctx> parameter may be NULL in which case the default library context is used.
|
||||
A new curve can be constructed by calling EC_GROUP_new_ex(), using the
|
||||
implementation provided by B<meth> (see L<EC_GFp_simple_method(3)>) and
|
||||
associated with the library context B<ctx> (see L<OPENSSL_CTX(3)>).
|
||||
The B<ctx> parameter may be NULL in which case the default library context is
|
||||
used.
|
||||
It is then necessary to call EC_GROUP_set_curve() to set the curve parameters.
|
||||
EC_GROUP_new_from_ecparameters() will create a group from the
|
||||
specified B<params> and
|
||||
EC_GROUP_new_from_ecpkparameters() will create a group from the specific PK B<params>.
|
||||
EC_GROUP_new_from_ecpkparameters() will create a group from the specific PK
|
||||
B<params>.
|
||||
|
||||
EC_GROUP_new is the same as EC_GROUP_new_ex() except that the library context
|
||||
EC_GROUP_new() is the same as EC_GROUP_new_ex() except that the library context
|
||||
used is always the default library context.
|
||||
|
||||
EC_GROUP_set_curve() sets the curve parameters B<p>, B<a> and B<b>. For a curve over Fp B<b>
|
||||
is the prime for the field. For a curve over F2^m B<p> represents the irreducible polynomial - each bit
|
||||
represents a term in the polynomial. Therefore there will either be three or five bits set dependent on whether
|
||||
the polynomial is a trinomial or a pentanomial.
|
||||
EC_GROUP_set_curve() sets the curve parameters B<p>, B<a> and B<b>. For a curve
|
||||
over Fp B<p> is the prime for the field. For a curve over F2^m B<p> represents
|
||||
the irreducible polynomial - each bit represents a term in the polynomial.
|
||||
Therefore there will either be three or five bits set dependent on whether the
|
||||
polynomial is a trinomial or a pentanomial.
|
||||
In either case, B<a> and B<b> represents the coefficients a and b from the
|
||||
relevant equation introduced above.
|
||||
|
||||
EC_group_get_curve() obtains the previously set curve parameters.
|
||||
|
||||
EC_GROUP_set_curve_GFp() and EC_GROUP_set_curve_GF2m() are synonyms for EC_GROUP_set_curve(). They are defined for
|
||||
backwards compatibility only and should not be used.
|
||||
EC_GROUP_set_curve_GFp() and EC_GROUP_set_curve_GF2m() are synonyms for
|
||||
EC_GROUP_set_curve(). They are defined for backwards compatibility only and
|
||||
should not be used.
|
||||
|
||||
EC_GROUP_get_curve_GFp() and EC_GROUP_get_curve_GF2m() are synonyms for EC_GROUP_get_curve(). They are defined for
|
||||
backwards compatibility only and should not be used.
|
||||
EC_GROUP_get_curve_GFp() and EC_GROUP_get_curve_GF2m() are synonyms for
|
||||
EC_GROUP_get_curve(). They are defined for backwards compatibility only and
|
||||
should not be used.
|
||||
|
||||
The functions EC_GROUP_new_curve_GFp and EC_GROUP_new_curve_GF2m are shortcuts for calling EC_GROUP_new and then the
|
||||
EC_GROUP_set_curve function. An appropriate default implementation method will be used.
|
||||
The functions EC_GROUP_new_curve_GFp() and EC_GROUP_new_curve_GF2m() are
|
||||
shortcuts for calling EC_GROUP_new() and then the EC_GROUP_set_curve() function.
|
||||
An appropriate default implementation method will be used.
|
||||
|
||||
Whilst the library can be used to create any curve using the functions described above, there are also a number of
|
||||
predefined curves that are available. In order to obtain a list of all of the predefined curves, call the function
|
||||
EC_get_builtin_curves(). The parameter B<r> should be an array of EC_builtin_curve structures of size B<nitems>. The function
|
||||
will populate the B<r> array with information about the built-in curves. If B<nitems> is less than the total number of
|
||||
curves available, then the first B<nitems> curves will be returned. Otherwise the total number of curves will be
|
||||
provided. The return value is the total number of curves available (whether that number has been populated in B<r> or
|
||||
not). Passing a NULL B<r>, or setting B<nitems> to 0 will do nothing other than return the total number of curves available.
|
||||
Whilst the library can be used to create any curve using the functions described
|
||||
above, there are also a number of predefined curves that are available. In order
|
||||
to obtain a list of all of the predefined curves, call the function
|
||||
EC_get_builtin_curves(). The parameter B<r> should be an array of
|
||||
EC_builtin_curve structures of size B<nitems>. The function will populate the
|
||||
B<r> array with information about the built-in curves. If B<nitems> is less than
|
||||
the total number of curves available, then the first B<nitems> curves will be
|
||||
returned. Otherwise the total number of curves will be provided. The return
|
||||
value is the total number of curves available (whether that number has been
|
||||
populated in B<r> or not). Passing a NULL B<r>, or setting B<nitems> to 0 will
|
||||
do nothing other than return the total number of curves available.
|
||||
The EC_builtin_curve structure is defined as follows:
|
||||
|
||||
typedef struct {
|
||||
@@ -117,28 +137,37 @@ The EC_builtin_curve structure is defined as follows:
|
||||
const char *comment;
|
||||
} EC_builtin_curve;
|
||||
|
||||
Each EC_builtin_curve item has a unique integer id (B<nid>), and a human readable comment string describing the curve.
|
||||
Each EC_builtin_curve item has a unique integer id (B<nid>), and a human
|
||||
readable comment string describing the curve.
|
||||
|
||||
In order to construct a built-in curve use the function EC_GROUP_new_by_curve_name_ex and provide the B<nid> of the curve to
|
||||
be constructed and the associated library context to be used in B<ctx> (see L<OPENSSL_CTX(3)>).
|
||||
The B<ctx> value may be NULL in which case the default library context is used.
|
||||
In order to construct a built-in curve use the function
|
||||
EC_GROUP_new_by_curve_name_ex() and provide the B<nid> of the curve to be
|
||||
constructed and the associated library context to be used in B<ctx> (see
|
||||
L<OPENSSL_CTX(3)>). The B<ctx> value may be NULL in which case the default
|
||||
library context is used.
|
||||
|
||||
EC_GROUP_new_by_curve_name is the same as EC_GROUP_new_by_curve_name_ex except
|
||||
that the default library context is always used.
|
||||
EC_GROUP_new_by_curve_name() is the same as EC_GROUP_new_by_curve_name_ex()
|
||||
except that the default library context is always used.
|
||||
|
||||
EC_GROUP_free frees the memory associated with the EC_GROUP.
|
||||
EC_GROUP_free() frees the memory associated with the EC_GROUP.
|
||||
If B<group> is NULL nothing is done.
|
||||
|
||||
EC_GROUP_clear_free destroys any sensitive data held within the EC_GROUP and then frees its memory.
|
||||
EC_GROUP_clear_free() is deprecated: it was meant to destroy any sensitive data
|
||||
held within the EC_GROUP and then free its memory, but since all the data stored
|
||||
in the EC_GROUP is public anyway, this function is unnecessary.
|
||||
Its use can be safely replaced with EC_GROUP_free().
|
||||
If B<group> is NULL nothing is done.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
All EC_GROUP_new* functions return a pointer to the newly constructed group, or NULL on error.
|
||||
All EC_GROUP_new* functions return a pointer to the newly constructed group, or
|
||||
NULL on error.
|
||||
|
||||
EC_get_builtin_curves returns the number of built-in curves that are available.
|
||||
EC_get_builtin_curves() returns the number of built-in curves that are
|
||||
available.
|
||||
|
||||
EC_GROUP_set_curve_GFp, EC_GROUP_get_curve_GFp, EC_GROUP_set_curve_GF2m, EC_GROUP_get_curve_GF2m return 1 on success or 0 on error.
|
||||
EC_GROUP_set_curve_GFp(), EC_GROUP_get_curve_GFp(), EC_GROUP_set_curve_GF2m(),
|
||||
EC_GROUP_get_curve_GF2m() return 1 on success or 0 on error.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
@@ -149,7 +178,18 @@ L<OPENSSL_CTX(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
EC_GROUP_new_ex and EC_GROUP_new_by_curve_name_ex were added in OpenSSL 3.0.
|
||||
=over 2
|
||||
|
||||
=item *
|
||||
|
||||
EC_GROUP_new_ex() and EC_GROUP_new_by_curve_name_ex() were added in OpenSSL 3.0.
|
||||
|
||||
=item *
|
||||
|
||||
EC_GROUP_clear_free() was deprecated in OpenSSL 3.0; use EC_GROUP_free()
|
||||
instead.
|
||||
|
||||
=back
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
|
||||
@@ -171,6 +171,26 @@ The functions EC_POINT_point2oct(), EC_POINT_oct2point(), EC_POINT_point2bn(),
|
||||
EC_POINT_bn2point(), EC_POINT_point2hex() and EC_POINT_hex2point() convert from
|
||||
and to EC_POINTs for the formats: octet, BIGNUM and hexadecimal respectively.
|
||||
|
||||
The function EC_POINT_point2oct() encodes the given curve point B<p> as an
|
||||
octet string into the buffer B<buf> of size B<len>, using the specified
|
||||
conversion form B<form>.
|
||||
The encoding conforms with Sec. 2.3.3 of the SECG SEC 1 ("Elliptic Curve
|
||||
Cryptography") standard.
|
||||
Similarly the function EC_POINT_oct2point() decodes a curve point into B<p> from
|
||||
the octet string contained in the given buffer B<buf> of size B<len>, conforming
|
||||
to Sec. 2.3.4 of the SECG SEC 1 ("Elliptic Curve Cryptography") standard.
|
||||
|
||||
The functions EC_POINT_point2hex() and EC_POINT_point2bn() convert a point B<p>,
|
||||
respectively, to the hexadecimal or BIGNUM representation of the same
|
||||
encoding of the function EC_POINT_point2oct().
|
||||
Vice versa, similarly to the function EC_POINT_oct2point(), the functions
|
||||
EC_POINT_hex2point() and EC_POINT_point2bn() decode the hexadecimal or
|
||||
BIGNUM representation into the EC_POINT B<p>.
|
||||
|
||||
Notice that, according to the standard, the octet string encoding of the point
|
||||
at infinity for a given curve is fixed to a single octet of value zero and that,
|
||||
vice versa, a single octet of size zero is decoded as the point at infinity.
|
||||
|
||||
The function EC_POINT_point2oct() must be supplied with a buffer long enough to
|
||||
store the octet form. The return value provides the number of octets stored.
|
||||
Calling the function with a NULL buffer will not perform the conversion but
|
||||
|
||||
@@ -27,7 +27,7 @@ ERR_set_debug() sets the debug information related to the current
|
||||
error in the thread's error queue.
|
||||
The values that can be given are the filename I<file>, line in the
|
||||
file I<line> and the name of the function I<func> where the error
|
||||
occured.
|
||||
occurred.
|
||||
The names must be constant, this function will only save away the
|
||||
pointers, not copy the strings.
|
||||
|
||||
|
||||
@@ -23,9 +23,9 @@ Deprecated since OpenSSL 3.0:
|
||||
=head1 DESCRIPTION
|
||||
|
||||
ERR_raise() adds a new error to the thread's error queue. The
|
||||
error occured in the library B<lib> for the reason given by the
|
||||
error occurred in the library B<lib> for the reason given by the
|
||||
B<reason> code. Furthermore, the name of the file, the line, and name
|
||||
of the function where the error occured is saved with the error
|
||||
of the function where the error occurred is saved with the error
|
||||
record.
|
||||
|
||||
ERR_raise_data() does the same thing as ERR_raise(), but also lets the
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
EVP_ASYM_CIPHER_fetch, EVP_ASYM_CIPHER_free, EVP_ASYM_CIPHER_up_ref,
|
||||
EVP_ASYM_CIPHER_number, EVP_ASYM_CIPHER_is_a, EVP_ASYM_CIPHER_provider,
|
||||
EVP_ASYM_CIPHER_do_all_provided, EVP_ASYM_CIPHER_names_do_all
|
||||
- Functions to manage EVP_ASYM_CIPHER algorithm objects
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/evp.h>
|
||||
|
||||
EVP_ASYM_CIPHER *EVP_ASYM_CIPHER_fetch(OPENSSL_CTX *ctx, const char *algorithm,
|
||||
const char *properties);
|
||||
void EVP_ASYM_CIPHER_free(EVP_ASYM_CIPHER *cipher);
|
||||
int EVP_ASYM_CIPHER_up_ref(EVP_ASYM_CIPHER *cipher);
|
||||
int EVP_ASYM_CIPHER_number(const EVP_ASYM_CIPHER *cipher);
|
||||
int EVP_ASYM_CIPHER_is_a(const EVP_ASYM_CIPHER *cipher, const char *name);
|
||||
OSSL_PROVIDER *EVP_ASYM_CIPHER_provider(const EVP_ASYM_CIPHER *cipher);
|
||||
void EVP_ASYM_CIPHER_do_all_provided(OPENSSL_CTX *libctx,
|
||||
void (*fn)(EVP_ASYM_CIPHER *cipher,
|
||||
void *arg),
|
||||
void *arg);
|
||||
void EVP_ASYM_CIPHER_names_do_all(const EVP_ASYM_CIPHER *cipher,
|
||||
void (*fn)(const char *name, void *data),
|
||||
void *data);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
EVP_ASYM_CIPHER_fetch() fetches the implementation for the given
|
||||
B<algorithm> from any provider offering it, within the criteria given
|
||||
by the B<properties> and in the scope of the given library context B<ctx> (see
|
||||
L<OPENSSL_CTX(3)>). The algorithm will be one offering functions for performing
|
||||
asymmetric cipher related tasks such as asymmetric encryption and decryption.
|
||||
See L<provider(7)/Fetching algorithms> for further information.
|
||||
|
||||
The returned value must eventually be freed with EVP_ASYM_CIPHER_free().
|
||||
|
||||
EVP_ASYM_CIPHER_free() decrements the reference count for the B<EVP_ASYM_CIPHER>
|
||||
structure. Typically this structure will have been obtained from an earlier call
|
||||
to EVP_ASYM_CIPHER_fetch(). If the reference count drops to 0 then the
|
||||
structure is freed.
|
||||
|
||||
EVP_ASYM_CIPHER_up_ref() increments the reference count for an
|
||||
B<EVP_ASYM_CIPHER> structure.
|
||||
|
||||
EVP_ASYM_CIPHER_is_a() returns 1 if I<cipher> is an implementation of an
|
||||
algorithm that's identifiable with I<name>, otherwise 0.
|
||||
|
||||
EVP_ASYM_CIPHER_provider() returns the provider that I<cipher> was fetched from.
|
||||
|
||||
EVP_ASYM_CIPHER_do_all_provided() traverses all EVP_ASYM_CIPHERs implemented by
|
||||
all activated providers in the given library context I<libctx>, and for each of
|
||||
the implementations, calls the given function I<fn> with the implementation
|
||||
method and the given I<arg> as argument.
|
||||
|
||||
EVP_ASYM_CIPHER_number() returns the internal dynamic number assigned to
|
||||
I<cipher>.
|
||||
|
||||
EVP_ASYM_CIPHER_names_do_all() traverses all names for I<cipher>, and calls
|
||||
I<fn> with each name and I<data>.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
EVP_ASYM_CIPHER_fetch() returns a pointer to an B<EVP_ASYM_CIPHER> for success
|
||||
or B<NULL> for failure.
|
||||
|
||||
EVP_ASYM_CIPHER_up_ref() returns 1 for success or 0 otherwise.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<provider(7)/Fetching algorithms>, L<OSSL_PROVIDER(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
The functions described here were added in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
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
|
||||
@@ -234,7 +234,7 @@ respective B<cipher> function.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<EVP_EncryptInit>
|
||||
L<EVP_EncryptInit(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
|
||||
@@ -248,6 +248,11 @@ be initialized.
|
||||
Returns 1 if I<md> is an implementation of an algorithm that's
|
||||
identifiable with I<name>, otherwise 0.
|
||||
|
||||
If I<md> is a legacy digest (it's the return value from the likes of
|
||||
EVP_sha256() rather than the result of an EVP_MD_fetch()), only cipher
|
||||
names registered with the default library context (see
|
||||
L<OPENSSL_CTX(3)>) will be considered.
|
||||
|
||||
=item EVP_MD_number()
|
||||
|
||||
Returns the internal dynamic number assigned to the I<md>. This is
|
||||
@@ -591,7 +596,7 @@ digest name passed on the command line.
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<EVP_MD_meth_new(3)>,
|
||||
L<dgst(1)>,
|
||||
L<openssl-dgst(1)>,
|
||||
L<evp(7)>,
|
||||
L<OSSL_PROVIDER(3)>,
|
||||
L<OSSL_PARAM(3)>
|
||||
|
||||
@@ -11,7 +11,7 @@ EVP_DigestSignFinal, EVP_DigestSign - EVP signing functions
|
||||
|
||||
int EVP_DigestSignInit_ex(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
|
||||
const char *mdname, const char *props,
|
||||
EVP_PKEY *pkey, EVP_SIGNATURE *signature);
|
||||
EVP_PKEY *pkey);
|
||||
int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
|
||||
const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey);
|
||||
int EVP_DigestSignUpdate(EVP_MD_CTX *ctx, const void *d, size_t cnt);
|
||||
@@ -26,41 +26,38 @@ EVP_DigestSignFinal, EVP_DigestSign - EVP signing functions
|
||||
The EVP signature routines are a high level interface to digital signatures.
|
||||
Input data is digested first before the signing takes place.
|
||||
|
||||
EVP_DigestSignInit_ex() sets up signing context B<ctx> to use a digest with the
|
||||
name B<mdname> and private key B<pkey>. The signature algorithm B<signature>
|
||||
will be used for the actual signing which must be compatible with the private
|
||||
key. The name of the digest to be used is passed to the provider of the
|
||||
signature algorithm in use. How that provider interprets the digest name is
|
||||
provider specific. The provider may implement that digest directly itself or it
|
||||
may (optionally) choose to fetch it (which could result in a digest from a
|
||||
different provider being selected). If the provider supports fetching the digest
|
||||
then it may use the B<props> argument for the properties to be used during the
|
||||
fetch.
|
||||
EVP_DigestSignInit_ex() sets up signing context I<ctx> to use a digest with the
|
||||
name I<mdname> and private key I<pkey>. The name of the digest to be used is
|
||||
passed to the provider of the signature algorithm in use. How that provider
|
||||
interprets the digest name is provider specific. The provider may implement
|
||||
that digest directly itself or it may (optionally) choose to fetch it (which
|
||||
could result in a digest from a different provider being selected). If the
|
||||
provider supports fetching the digest then it may use the I<props> argument for
|
||||
the properties to be used during the fetch.
|
||||
|
||||
The B<signature> parameter may be NULL in which case a suitable signature
|
||||
algorithm implementation will be implicitly fetched based on the type of key in
|
||||
use. See L<provider(7)> for further information about providers and fetching
|
||||
algorithms.
|
||||
The I<pkey> algorithm is used to fetch a B<EVP_SIGNATURE> method implicitly, to
|
||||
be used for the actual signing. See L<provider(7)/Implicit fetch> for
|
||||
more information about implict fetches.
|
||||
|
||||
The OpenSSL default and legacy providers support fetching digests and can fetch
|
||||
those digests from any available provider. The OpenSSL fips provider also
|
||||
supports fetching digests but will only fetch digests that are themselves
|
||||
implemented inside the fips provider.
|
||||
|
||||
B<ctx> must be created with EVP_MD_CTX_new() before calling this function. If
|
||||
B<pctx> is not NULL, the EVP_PKEY_CTX of the signing operation will be written
|
||||
to B<*pctx>: this can be used to set alternative signing options. Note that any
|
||||
existing value in B<*pctx> is overwritten. The EVP_PKEY_CTX value returned must
|
||||
not be freed directly by the application if B<ctx> is not assigned an
|
||||
I<ctx> must be created with EVP_MD_CTX_new() before calling this function. If
|
||||
I<pctx> is not NULL, the EVP_PKEY_CTX of the signing operation will be written
|
||||
to I<*pctx>: this can be used to set alternative signing options. Note that any
|
||||
existing value in I<*pctx> is overwritten. The EVP_PKEY_CTX value returned must
|
||||
not be freed directly by the application if I<ctx> is not assigned an
|
||||
EVP_PKEY_CTX value before being passed to EVP_DigestSignInit_ex() (which means
|
||||
the EVP_PKEY_CTX is created inside EVP_DigestSignInit_ex() and it will be freed
|
||||
automatically when the EVP_MD_CTX is freed).
|
||||
|
||||
The digest B<mdname> may be NULL if the signing algorithm supports it. The
|
||||
B<props> argument can always be NULL.
|
||||
The digest I<mdname> may be NULL if the signing algorithm supports it. The
|
||||
I<props> argument can always be NULL.
|
||||
|
||||
No B<EVP_PKEY_CTX> will be created by EVP_DigestSignInit_ex() if the passed
|
||||
B<ctx> has already been assigned one via L<EVP_MD_CTX_set_ctx(3)>. See also
|
||||
I<ctx> has already been assigned one via L<EVP_MD_CTX_set_pkey_ctx(3)>. See also
|
||||
L<SM2(7)>.
|
||||
|
||||
Only EVP_PKEY types that support signing can be used with these functions. This
|
||||
@@ -82,7 +79,7 @@ Supports SHA1, SHA224, SHA256, SHA384, SHA512 and SM3
|
||||
|
||||
=item RSA with no padding
|
||||
|
||||
Supports no digests (the digest B<type> must be NULL)
|
||||
Supports no digests (the digest I<type> must be NULL)
|
||||
|
||||
=item RSA with X931 padding
|
||||
|
||||
@@ -95,7 +92,7 @@ SHA3-224, SHA3-256, SHA3-384, SHA3-512
|
||||
|
||||
=item Ed25519 and Ed448
|
||||
|
||||
Support no digests (the digest B<type> must be NULL)
|
||||
Support no digests (the digest I<type> must be NULL)
|
||||
|
||||
=item HMAC
|
||||
|
||||
@@ -110,31 +107,29 @@ Will ignore any digest provided.
|
||||
If RSA-PSS is used and restrictions apply then the digest must match.
|
||||
|
||||
EVP_DigestSignInit() works in the same way as EVP_DigestSignInit_ex() except
|
||||
that the B<mdname> parameter will be inferred from the supplied digest B<type>,
|
||||
and B<props> will be NULL. Where supplied the ENGINE B<e> will be used for the
|
||||
signing and digest algorithm implementations. B<e> may be NULL.
|
||||
that the I<mdname> parameter will be inferred from the supplied digest I<type>,
|
||||
and I<props> will be NULL. Where supplied the ENGINE I<e> will be used for the
|
||||
signing and digest algorithm implementations. I<e> may be NULL.
|
||||
|
||||
EVP_DigestSignUpdate() hashes B<cnt> bytes of data at B<d> into the
|
||||
signature context B<ctx>. This function can be called several times on the
|
||||
same B<ctx> to include additional data.
|
||||
EVP_DigestSignUpdate() hashes I<cnt> bytes of data at I<d> into the
|
||||
signature context I<ctx>. This function can be called several times on the
|
||||
same I<ctx> to include additional data.
|
||||
|
||||
EVP_DigestSignFinal() signs the data in B<ctx> and places the signature in B<sig>.
|
||||
If B<sig> is B<NULL> then the maximum size of the output buffer is written to
|
||||
the B<siglen> parameter. If B<sig> is not B<NULL> then before the call the
|
||||
B<siglen> parameter should contain the length of the B<sig> buffer. If the
|
||||
call is successful the signature is written to B<sig> and the amount of data
|
||||
written to B<siglen>.
|
||||
EVP_DigestSignFinal() signs the data in I<ctx> and places the signature in I<sig>.
|
||||
If I<sig> is NULL then the maximum size of the output buffer is written to
|
||||
the I<siglen> parameter. If I<sig> is not NULL then before the call the
|
||||
I<siglen> parameter should contain the length of the I<sig> buffer. If the
|
||||
call is successful the signature is written to I<sig> and the amount of data
|
||||
written to I<siglen>.
|
||||
|
||||
EVP_DigestSign() signs B<tbslen> bytes of data at B<tbs> and places the
|
||||
signature in B<sig> and its length in B<siglen> in a similar way to
|
||||
EVP_DigestSign() signs I<tbslen> bytes of data at I<tbs> and places the
|
||||
signature in I<sig> and its length in I<siglen> in a similar way to
|
||||
EVP_DigestSignFinal().
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
EVP_DigestSignInit(), EVP_DigestSignUpdate(), EVP_DigestSignaFinal() and
|
||||
EVP_DigestSign() return 1 for success and 0 or a negative value for failure. In
|
||||
particular, a return value of -2 indicates the operation is not supported by the
|
||||
public key algorithm.
|
||||
EVP_DigestSign() return 1 for success and 0 for failure.
|
||||
|
||||
The error codes can be obtained from L<ERR_get_error(3)>.
|
||||
|
||||
@@ -177,7 +172,7 @@ L<EVP_DigestVerifyInit(3)>,
|
||||
L<EVP_DigestInit(3)>,
|
||||
L<evp(7)>, L<HMAC(3)>, L<MD2(3)>,
|
||||
L<MD5(3)>, L<MDC2(3)>, L<RIPEMD160(3)>,
|
||||
L<SHA1(3)>, L<dgst(1)>,
|
||||
L<SHA1(3)>, L<openssl-dgst(1)>,
|
||||
L<RAND(7)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
@@ -56,7 +56,7 @@ means the EVP_PKEY_CTX is created inside EVP_DigestVerifyInit_ex() and it will
|
||||
be freed automatically when the EVP_MD_CTX is freed).
|
||||
|
||||
No B<EVP_PKEY_CTX> will be created by EVP_DigestSignInit_ex() if the passed
|
||||
B<ctx> has already been assigned one via L<EVP_MD_CTX_set_ctx(3)>. See also
|
||||
B<ctx> has already been assigned one via L<EVP_MD_CTX_set_pkey_ctx(3)>. See also
|
||||
L<SM2(7)>.
|
||||
|
||||
Not all digests can be used for all key types. The following combinations apply.
|
||||
@@ -163,7 +163,7 @@ L<EVP_DigestSignInit(3)>,
|
||||
L<EVP_DigestInit(3)>,
|
||||
L<evp(7)>, L<HMAC(3)>, L<MD2(3)>,
|
||||
L<MD5(3)>, L<MDC2(3)>, L<RIPEMD160(3)>,
|
||||
L<SHA1(3)>, L<dgst(1)>,
|
||||
L<SHA1(3)>, L<openssl-dgst(1)>,
|
||||
L<RAND(7)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
@@ -299,7 +299,7 @@ B<params> from CIPHER context B<ctx>.
|
||||
|
||||
EVP_CIPHER_gettable_params(), EVP_CIPHER_gettable_ctx_params(), and
|
||||
EVP_CIPHER_settable_ctx_params() get a constant B<OSSL_PARAM> array
|
||||
that decribes the retrievable and settable parameters, i.e. parameters
|
||||
that describes the retrievable and settable parameters, i.e. parameters
|
||||
that can be used with EVP_CIPHER_get_params(), EVP_CIPHER_CTX_get_params()
|
||||
and EVP_CIPHER_CTX_set_params(), respectively.
|
||||
See L<OSSL_PARAM(3)> for the use of B<OSSL_PARAM> as parameter descriptor.
|
||||
@@ -338,6 +338,10 @@ B<NID_undef>.
|
||||
|
||||
EVP_CIPHER_is_a() returns 1 if I<cipher> is an implementation of an
|
||||
algorithm that's identifiable with I<name>, otherwise 0.
|
||||
If I<cipher> is a legacy cipher (it's the return value from the likes
|
||||
of EVP_aes128() rather than the result of an EVP_CIPHER_fetch()), only
|
||||
cipher names registered with the default library context (see
|
||||
L<OPENSSL_CTX(3)>) will be considered.
|
||||
|
||||
EVP_CIPHER_number() returns the internal dynamic number assigned to
|
||||
the I<cipher>. This is only useful with fetched B<EVP_CIPHER>s.
|
||||
@@ -456,7 +460,7 @@ EVP_CIPHER_CTX_rand_key() returns 1 for success.
|
||||
|
||||
All algorithms have a fixed key length unless otherwise stated.
|
||||
|
||||
Refer to L<SEE ALSO> for the full list of ciphers available through the EVP
|
||||
Refer to L</SEE ALSO> for the full list of ciphers available through the EVP
|
||||
interface.
|
||||
|
||||
=over 4
|
||||
@@ -667,6 +671,15 @@ EVP_EncryptFinal_ex(), EVP_DecryptInit_ex(), EVP_DecryptFinal_ex(),
|
||||
EVP_CipherInit_ex() and EVP_CipherFinal_ex() because they can reuse an
|
||||
existing context without allocating and freeing it up on each call.
|
||||
|
||||
There are some differences between functions EVP_CipherInit() and
|
||||
EVP_CipherInit_ex(), significant in some circumstances. EVP_CipherInit() fills
|
||||
the passed context object with zeros. As a consequence, EVP_CipherInit() does
|
||||
not allow step-by-step initialization of the ctx when the I<key> and I<iv> are
|
||||
passed in separate calls. It also means that the flags set for the CTX are
|
||||
removed, and it is especially important for the
|
||||
B<EVP_CIPHER_CTX_FLAG_WRAP_ALLOW> flag treated specially in
|
||||
EVP_CipherInit_ex().
|
||||
|
||||
EVP_get_cipherbynid(), and EVP_get_cipherbyobj() are implemented as macros.
|
||||
|
||||
=head1 BUGS
|
||||
@@ -794,20 +807,20 @@ L<evp(7)>
|
||||
|
||||
Supported ciphers are listed in:
|
||||
|
||||
L<EVP_aes(3)>,
|
||||
L<EVP_aria(3)>,
|
||||
L<EVP_bf(3)>,
|
||||
L<EVP_camellia(3)>,
|
||||
L<EVP_cast5(3)>,
|
||||
L<EVP_aes_128_gcm(3)>,
|
||||
L<EVP_aria_128_gcm(3)>,
|
||||
L<EVP_bf_cbc(3)>,
|
||||
L<EVP_camellia_128_ecb(3)>,
|
||||
L<EVP_cast5_cbc(3)>,
|
||||
L<EVP_chacha20(3)>,
|
||||
L<EVP_des(3)>,
|
||||
L<EVP_desx(3)>,
|
||||
L<EVP_idea(3)>,
|
||||
L<EVP_rc2(3)>,
|
||||
L<EVP_des_cbc(3)>,
|
||||
L<EVP_desx_cbc(3)>,
|
||||
L<EVP_idea_cbc(3)>,
|
||||
L<EVP_rc2_cbc(3)>,
|
||||
L<EVP_rc4(3)>,
|
||||
L<EVP_rc5(3)>,
|
||||
L<EVP_seed(3)>,
|
||||
L<EVP_sm4(3)>
|
||||
L<EVP_rc5_32_12_16_cbc(3)>,
|
||||
L<EVP_seed_cbc(3)>,
|
||||
L<EVP_sm4_cbc(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ defined by the implementation.
|
||||
|
||||
EVP_KDF_gettable_params(), EVP_KDF_gettable_ctx_params() and
|
||||
EVP_KDF_settable_ctx_params() get a constant B<OSSL_PARAM> array that
|
||||
decribes the retrievable and settable parameters, i.e. parameters that
|
||||
describes the retrievable and settable parameters, i.e. parameters that
|
||||
can be used with EVP_KDF_get_params(), EVP_KDF_CTX_get_params()
|
||||
and EVP_KDF_CTX_set_params(), respectively.
|
||||
See L<OSSL_PARAM(3)> for the use of B<OSSL_PARAM> as parameter descriptor.
|
||||
@@ -183,8 +183,10 @@ The default value, if any, is implementation dependent.
|
||||
|
||||
=item "digest" (B<OSSL_KDF_PARAM_DIGEST>) <UTF8 string>
|
||||
|
||||
For KDF implementations that use an underlying computation MAC or
|
||||
digest, these parameters set what the algorithm should be.
|
||||
=item "cipher" (B<OSSL_KDF_PARAM_CIPHER>) <UTF8 string>
|
||||
|
||||
For KDF implementations that use an underlying computation MAC, digest or
|
||||
cipher, these parameters set what the algorithm should be.
|
||||
|
||||
The value is always the name of the intended algorithm,
|
||||
or the properties.
|
||||
|
||||
@@ -151,7 +151,7 @@ defined by the implementation.
|
||||
|
||||
EVP_MAC_gettable_params(), EVP_MAC_gettable_ctx_params() and
|
||||
EVP_MAC_settable_ctx_params() get a constant B<OSSL_PARAM> array that
|
||||
decribes the retrievable and settable parameters, i.e. parameters that
|
||||
describes the retrievable and settable parameters, i.e. parameters that
|
||||
can be used with EVP_MAC_get_params(), EVP_MAC_CTX_get_params()
|
||||
and EVP_MAC_CTX_set_params(), respectively.
|
||||
See L<OSSL_PARAM(3)> for the use of B<OSSL_PARAM> as parameter descriptor.
|
||||
@@ -370,13 +370,13 @@ F<./foo>)
|
||||
|
||||
L<property(7)>
|
||||
L<OSSL_PARAM(3)>,
|
||||
L<EVP_MAC_BLAKE2(7)>,
|
||||
L<EVP_MAC_CMAC(7)>,
|
||||
L<EVP_MAC_GMAC(7)>,
|
||||
L<EVP_MAC_HMAC(7)>,
|
||||
L<EVP_MAC_KMAC(7)>,
|
||||
L<EVP_MAC_SIPHASH(7)>,
|
||||
L<EVP_MAC_POLY1305(7)>
|
||||
L<EVP_MAC-BLAKE2(7)>,
|
||||
L<EVP_MAC-CMAC(7)>,
|
||||
L<EVP_MAC-GMAC(7)>,
|
||||
L<EVP_MAC-HMAC(7)>,
|
||||
L<EVP_MAC-KMAC(7)>,
|
||||
L<EVP_MAC-Siphash(7)>,
|
||||
L<EVP_MAC-Poly1305(7)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
|
||||
@@ -20,10 +20,14 @@ EVP_PKEY_CTX_get_rsa_pss_saltlen,
|
||||
EVP_PKEY_CTX_set_rsa_keygen_bits,
|
||||
EVP_PKEY_CTX_set_rsa_keygen_pubexp,
|
||||
EVP_PKEY_CTX_set_rsa_keygen_primes,
|
||||
EVP_PKEY_CTX_set_rsa_mgf1_md_name,
|
||||
EVP_PKEY_CTX_set_rsa_mgf1_md,
|
||||
EVP_PKEY_CTX_get_rsa_mgf1_md,
|
||||
EVP_PKEY_CTX_get_rsa_mgf1_md_name,
|
||||
EVP_PKEY_CTX_set_rsa_oaep_md_name,
|
||||
EVP_PKEY_CTX_set_rsa_oaep_md,
|
||||
EVP_PKEY_CTX_get_rsa_oaep_md,
|
||||
EVP_PKEY_CTX_get_rsa_oaep_md_name,
|
||||
EVP_PKEY_CTX_set0_rsa_oaep_label,
|
||||
EVP_PKEY_CTX_get0_rsa_oaep_label,
|
||||
EVP_PKEY_CTX_set_dsa_paramgen_bits,
|
||||
@@ -95,10 +99,18 @@ EVP_PKEY_CTX_set1_id, EVP_PKEY_CTX_get1_id, EVP_PKEY_CTX_get1_id_len
|
||||
int EVP_PKEY_CTX_set_rsa_keygen_bits(EVP_PKEY_CTX *ctx, int mbits);
|
||||
int EVP_PKEY_CTX_set_rsa_keygen_pubexp(EVP_PKEY_CTX *ctx, BIGNUM *pubexp);
|
||||
int EVP_PKEY_CTX_set_rsa_keygen_primes(EVP_PKEY_CTX *ctx, int primes);
|
||||
int EVP_PKEY_CTX_set_rsa_mgf1_md_name(EVP_PKEY_CTX *ctx, const char *mdname,
|
||||
const char *mdprops);
|
||||
int EVP_PKEY_CTX_set_rsa_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
|
||||
int EVP_PKEY_CTX_get_rsa_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD **md);
|
||||
int EVP_PKEY_CTX_get_rsa_mgf1_md_name(EVP_PKEY_CTX *ctx, char *name,
|
||||
size_t namelen);
|
||||
int EVP_PKEY_CTX_set_rsa_oaep_md_name(EVP_PKEY_CTX *ctx, const char *mdname,
|
||||
const char *mdprops);
|
||||
int EVP_PKEY_CTX_set_rsa_oaep_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
|
||||
int EVP_PKEY_CTX_get_rsa_oaep_md(EVP_PKEY_CTX *ctx, const EVP_MD **md);
|
||||
int EVP_PKEY_CTX_get_rsa_oaep_md_name(EVP_PKEY_CTX *ctx, char *name,
|
||||
size_t namelen)
|
||||
int EVP_PKEY_CTX_set0_rsa_oaep_label(EVP_PKEY_CTX *ctx, unsigned char *label, int len);
|
||||
int EVP_PKEY_CTX_get0_rsa_oaep_label(EVP_PKEY_CTX *ctx, unsigned char **label);
|
||||
|
||||
@@ -186,7 +198,7 @@ The internal algorithm that supports this parameter is DSA.
|
||||
=back
|
||||
|
||||
EVP_PKEY_CTX_gettable_params() and EVP_PKEY_CTX_settable_params() gets a
|
||||
constant B<OSSL_PARAM> array that decribes the gettable and
|
||||
constant B<OSSL_PARAM> array that describes the gettable and
|
||||
settable parameters for the current algorithm implementation, i.e. parameters
|
||||
that can be used with EVP_PKEY_CTX_get_params() and EVP_PKEY_CTX_set_params()
|
||||
respectively.
|
||||
@@ -241,12 +253,14 @@ supported by the L<EVP_PKEY_new_raw_private_key(3)> function.
|
||||
|
||||
=head2 RSA parameters
|
||||
|
||||
The EVP_PKEY_CTX_set_rsa_padding() macro sets the RSA padding mode for B<ctx>.
|
||||
The EVP_PKEY_CTX_set_rsa_padding() function sets the RSA padding mode for B<ctx>.
|
||||
The B<pad> parameter can take the value B<RSA_PKCS1_PADDING> for PKCS#1
|
||||
padding, B<RSA_SSLV23_PADDING> for SSLv23 padding, B<RSA_NO_PADDING> for
|
||||
no padding, B<RSA_PKCS1_OAEP_PADDING> for OAEP padding (encrypt and
|
||||
decrypt only), B<RSA_X931_PADDING> for X9.31 padding (signature operations
|
||||
only) and B<RSA_PKCS1_PSS_PADDING> (sign and verify only).
|
||||
only), B<RSA_PKCS1_PSS_PADDING> (sign and verify only) and
|
||||
B<RSA_PKCS1_WITH_TLS_PADDING> for TLS RSA ClientKeyExchange message padding
|
||||
(decryption only).
|
||||
|
||||
Two RSA padding modes behave differently if EVP_PKEY_CTX_set_signature_md()
|
||||
is used. If this macro is called for PKCS#1 padding the plaintext buffer is
|
||||
@@ -258,7 +272,7 @@ padding for RSA the algorithm identifier byte is added or checked and removed
|
||||
if this control is called. If it is not called then the first byte of the plaintext
|
||||
buffer is expected to be the algorithm identifier byte.
|
||||
|
||||
The EVP_PKEY_CTX_get_rsa_padding() macro gets the RSA padding mode for B<ctx>.
|
||||
The EVP_PKEY_CTX_get_rsa_padding() function gets the RSA padding mode for B<ctx>.
|
||||
|
||||
The EVP_PKEY_CTX_set_rsa_pss_saltlen() macro sets the RSA PSS salt length to
|
||||
B<len>. As its name implies it is only supported for PSS padding. Three special
|
||||
@@ -283,34 +297,82 @@ modified or freed after the call. If not specified 65537 is used.
|
||||
The EVP_PKEY_CTX_set_rsa_keygen_primes() macro sets the number of primes for
|
||||
RSA key generation to B<primes>. If not specified 2 is used.
|
||||
|
||||
The EVP_PKEY_CTX_set_rsa_mgf1_md() macro sets the MGF1 digest for RSA padding
|
||||
schemes to B<md>. If not explicitly set the signing digest is used. The
|
||||
padding mode must have been set to B<RSA_PKCS1_OAEP_PADDING>
|
||||
The EVP_PKEY_CTX_set_rsa_mgf1_md_name() function sets the MGF1 digest for RSA
|
||||
padding schemes to the digest named B<mdname>. If the RSA algorithm
|
||||
implementation for the selected provider supports it then the digest will be
|
||||
fetched using the properties B<mdprops>. If not explicitly set the signing
|
||||
digest is used. The padding mode must have been set to B<RSA_PKCS1_OAEP_PADDING>
|
||||
or B<RSA_PKCS1_PSS_PADDING>.
|
||||
|
||||
The EVP_PKEY_CTX_get_rsa_mgf1_md() macro gets the MGF1 digest for B<ctx>.
|
||||
If not explicitly set the signing digest is used. The padding mode must have
|
||||
been set to B<RSA_PKCS1_OAEP_PADDING> or B<RSA_PKCS1_PSS_PADDING>.
|
||||
The EVP_PKEY_CTX_set_rsa_mgf1_md() function does the same as
|
||||
EVP_PKEY_CTX_set_rsa_mgf1_md_name() except that the name of the digest is
|
||||
inferred from the supplied B<md> and it is not possible to specify any
|
||||
properties.
|
||||
|
||||
The EVP_PKEY_CTX_set_rsa_oaep_md() macro sets the message digest type used
|
||||
in RSA OAEP to B<md>. The padding mode must have been set to
|
||||
The EVP_PKEY_CTX_get_rsa_mgf1_md_name() function gets the name of the MGF1
|
||||
digest algorithm for B<ctx>. If not explicitly set the signing digest is used.
|
||||
The padding mode must have been set to B<RSA_PKCS1_OAEP_PADDING> or
|
||||
B<RSA_PKCS1_PSS_PADDING>.
|
||||
|
||||
The EVP_PKEY_CTX_get_rsa_mgf1_md() function does the same as
|
||||
EVP_PKEY_CTX_get_rsa_mgf1_md_name() except that it returns a pointer to an
|
||||
EVP_MD object instead. Note that only known, built-in EVP_MD objects will be
|
||||
returned. The EVP_MD object may be NULL if the digest is not one of these (such
|
||||
as a digest only implemented in a third party provider).
|
||||
|
||||
The EVP_PKEY_CTX_set_rsa_oaep_md_name() function sets the message digest type
|
||||
used in RSA OAEP to the digest named B<mdname>. If the RSA algorithm
|
||||
implementation for the selected provider supports it then the digest will be
|
||||
fetched using the properties B<mdprops>. The padding mode must have been set to
|
||||
B<RSA_PKCS1_OAEP_PADDING>.
|
||||
|
||||
The EVP_PKEY_CTX_get_rsa_oaep_md() macro gets the message digest type used
|
||||
in RSA OAEP to B<md>. The padding mode must have been set to
|
||||
B<RSA_PKCS1_OAEP_PADDING>.
|
||||
The EVP_PKEY_CTX_set_rsa_oaep_md() function does the same as
|
||||
EVP_PKEY_CTX_set_rsa_oaep_md_name() except that the name of the digest is
|
||||
inferred from the supplied B<md> and it is not possible to specify any
|
||||
properties.
|
||||
|
||||
The EVP_PKEY_CTX_set0_rsa_oaep_label() macro sets the RSA OAEP label to
|
||||
The EVP_PKEY_CTX_get_rsa_oaep_md_name() function gets the message digest
|
||||
algorithm name used in RSA OAEP and stores it in the buffer B<name> which is of
|
||||
size B<namelen>. The padding mode must have been set to
|
||||
B<RSA_PKCS1_OAEP_PADDING>. The buffer should be sufficiently large for any
|
||||
expected digest algorithm names or the function will fail.
|
||||
|
||||
The EVP_PKEY_CTX_get_rsa_oaep_md() function does the same as
|
||||
EVP_PKEY_CTX_get_rsa_oaep_md_name() except that it returns a pointer to an
|
||||
EVP_MD object instead. Note that only known, built-in EVP_MD objects will be
|
||||
returned. The EVP_MD object may be NULL if the digest is not one of these (such
|
||||
as a digest only implemented in a third party provider).
|
||||
|
||||
The EVP_PKEY_CTX_set0_rsa_oaep_label() function sets the RSA OAEP label to
|
||||
B<label> and its length to B<len>. If B<label> is NULL or B<len> is 0,
|
||||
the label is cleared. The library takes ownership of the label so the
|
||||
caller should not free the original memory pointed to by B<label>.
|
||||
The padding mode must have been set to B<RSA_PKCS1_OAEP_PADDING>.
|
||||
|
||||
The EVP_PKEY_CTX_get0_rsa_oaep_label() macro gets the RSA OAEP label to
|
||||
The EVP_PKEY_CTX_get0_rsa_oaep_label() function gets the RSA OAEP label to
|
||||
B<label>. The return value is the label length. The padding mode
|
||||
must have been set to B<RSA_PKCS1_OAEP_PADDING>. The resulting pointer is owned
|
||||
by the library and should not be freed by the caller.
|
||||
|
||||
B<RSA_PKCS1_WITH_TLS_PADDING> is used when decrypting an RSA encrypted TLS
|
||||
pre-master secret in a TLS ClientKeyExchange message. It is the same as
|
||||
RSA_PKCS1_PADDING except that it additionally verifies that the result is the
|
||||
correct length and the first two bytes are the protocol version initially
|
||||
requested by the client. If the encrypted content is publicly invalid then the
|
||||
decryption will fail. However, if the padding checks fail then decryption will
|
||||
still appear to succeed but a random TLS premaster secret will be returned
|
||||
instead. This padding mode accepts two parameters which can be set using the
|
||||
L<EVP_PKEY_CTX_set_params(3)> function. These are
|
||||
OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION and
|
||||
OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION, both of which are expected to be
|
||||
unsigned integers. Normally only the first of these will be set and represents
|
||||
the TLS protocol version that was first requested by the client (e.g. 0x0303 for
|
||||
TLSv1.2, 0x0302 for TLSv1.1 etc). Historically some buggy clients would use the
|
||||
negotiated protocol version instead of the protocol version first requested. If
|
||||
this behaviour should be tolerated then
|
||||
OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION should be set to the actual
|
||||
negotiated protocol version. Otherwise it should be left unset.
|
||||
|
||||
=head2 DSA parameters
|
||||
|
||||
The EVP_PKEY_CTX_set_dsa_paramgen_bits() macro sets the number of bits used
|
||||
@@ -497,10 +559,9 @@ EVP_PKEY_CTX_settable_params() returns an OSSL_PARAM array on success or NULL on
|
||||
error.
|
||||
It may also return NULL if there are no settable parameters available.
|
||||
|
||||
EVP_PKEY_CTX_set_signature_md(), EVP_PKEY_CTX_set_dh_pad(), EVP_PKEY_CTX_ctrl()
|
||||
and its macros return a positive value for success and 0 or a negative value for
|
||||
failure. In particular a return value of -2 indicates the operation is not
|
||||
supported by the public key algorithm.
|
||||
All other functions and macros described on this page return a positive value
|
||||
for success and 0 or a negative value for failure. In particular a return value
|
||||
of -2 indicates the operation is not supported by the public key algorithm.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
@@ -515,13 +576,21 @@ L<EVP_PKEY_keygen(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
The
|
||||
EVP_PKEY_CTX_set1_id(), EVP_PKEY_CTX_get1_id() and EVP_PKEY_CTX_get1_id_len()
|
||||
macros were added in 1.1.1, other functions were added in OpenSSL 1.0.0.
|
||||
EVP_PKEY_CTX_get_signature_md(), EVP_PKEY_CTX_set_signature_md(),
|
||||
EVP_PKEY_CTX_set_dh_pad(), EVP_PKEY_CTX_set_rsa_padding(),
|
||||
EVP_PKEY_CTX_get_rsa_padding(), EVP_PKEY_CTX_get_rsa_mgf1_md(),
|
||||
EVP_PKEY_CTX_set_rsa_mgf1_md(), EVP_PKEY_CTX_set_rsa_oaep_md(),
|
||||
EVP_PKEY_CTX_get_rsa_oaep_md(), EVP_PKEY_CTX_set0_rsa_oaep_label(),
|
||||
EVP_PKEY_CTX_get0_rsa_oaep_label() were macros in OpenSSL 1.1.1 and below. From
|
||||
OpenSSL 3.0 they are functions.
|
||||
|
||||
EVP_PKEY_CTX_get_signature_md(), EVP_PKEY_CTX_set_signature_md() and
|
||||
EVP_PKEY_CTX_set_dh_pad() were macros in OpenSSL 1.1.1 and below. From OpenSSL
|
||||
3.0 they are functions.
|
||||
EVP_PKEY_CTX_get_rsa_oaep_md_name(), EVP_PKEY_CTX_get_rsa_mgf1_md_name(),
|
||||
EVP_PKEY_CTX_set_rsa_mgf1_md_name() and EVP_PKEY_CTX_set_rsa_oaep_md_name() were
|
||||
added in OpenSSL 3.0.
|
||||
|
||||
The EVP_PKEY_CTX_set1_id(), EVP_PKEY_CTX_get1_id() and
|
||||
EVP_PKEY_CTX_get1_id_len() macros were added in 1.1.1, other functions were
|
||||
added in OpenSSL 1.0.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
=head1 NAME
|
||||
|
||||
EVP_PKEY_CTX_new, EVP_PKEY_CTX_new_id, EVP_PKEY_CTX_new_provided,
|
||||
EVP_PKEY_CTX_dup, EVP_PKEY_CTX_free
|
||||
EVP_PKEY_CTX_new, EVP_PKEY_CTX_new_id, EVP_PKEY_CTX_new_from_name,
|
||||
EVP_PKEY_CTX_new_from_pkey, EVP_PKEY_CTX_dup, EVP_PKEY_CTX_free
|
||||
- public key algorithm context functions
|
||||
|
||||
=head1 SYNOPSIS
|
||||
@@ -12,26 +12,35 @@ EVP_PKEY_CTX_dup, EVP_PKEY_CTX_free
|
||||
|
||||
EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e);
|
||||
EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e);
|
||||
EVP_PKEY_CTX *EVP_PKEY_CTX_new_provided(const char *name,
|
||||
const char *propquery);
|
||||
EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_name(OPENSSL_CTX *libctx,
|
||||
const char *name,
|
||||
const char *propquery);
|
||||
EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_pkey(OPENSSL_CTX *libctx,
|
||||
EVP_PKEY *pkey);
|
||||
EVP_PKEY_CTX *EVP_PKEY_CTX_dup(const EVP_PKEY_CTX *ctx);
|
||||
void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The EVP_PKEY_CTX_new() function allocates public key algorithm context using
|
||||
the algorithm specified in I<pkey> and ENGINE I<e>.
|
||||
the I<pkey> key type and ENGINE I<e>.
|
||||
|
||||
The EVP_PKEY_CTX_new_id() function allocates public key algorithm context
|
||||
using the algorithm specified by I<id> and ENGINE I<e>.
|
||||
using the key type specified by I<id> and ENGINE I<e>.
|
||||
|
||||
The EVP_PKEY_CTX_new_provided() function allocates a public key
|
||||
algorithm context using the algorithm specified by I<name> and the
|
||||
property query I<propquery>. The strings aren't duplicated, so they
|
||||
must remain unchanged for the lifetime of the returned B<EVP_PKEY_CTX>
|
||||
or of any of its duplicates.
|
||||
The EVP_PKEY_CTX_new_from_name() function allocates a public key algorithm
|
||||
context using the library context I<libctx> (see L<OPENSSL_CTX(3)>), the
|
||||
key type specified by I<name> and the property query I<propquery>. None
|
||||
of the arguments are duplicated, so they must remain unchanged for the
|
||||
lifetime of the returned B<EVP_PKEY_CTX> or of any of its duplicates.
|
||||
|
||||
EVP_PKEY_CTX_new_id() and EVP_PKEY_CTX_new_provided() are normally
|
||||
The EVP_PKEY_CTX_new_from_pkey() function allocates a public key algorithm
|
||||
context using the library context I<libctx> (see L<OPENSSL_CTX(3)>) and the
|
||||
algorithm specified by I<pkey> . None of the arguments are duplicated, so they
|
||||
must remain unchanged for the lifetime of the returned B<EVP_PKEY_CTX> or of
|
||||
any of its duplicates.
|
||||
|
||||
EVP_PKEY_CTX_new_id() and EVP_PKEY_CTX_new_from_name() are normally
|
||||
used when no B<EVP_PKEY> structure is associated with the operations,
|
||||
for example during parameter generation or key generation for some
|
||||
algorithms.
|
||||
@@ -43,11 +52,25 @@ If I<ctx> is NULL, nothing is done.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
=over 4
|
||||
|
||||
=item 1.
|
||||
|
||||
The B<EVP_PKEY_CTX> structure is an opaque public key algorithm context used
|
||||
by the OpenSSL high level public key API. Contexts B<MUST NOT> be shared between
|
||||
threads: that is it is not permissible to use the same context simultaneously
|
||||
in two threads.
|
||||
|
||||
=item 2.
|
||||
|
||||
We mention "key type" in this manual, which is the same
|
||||
as "algorithm" in most cases, allowing either term to be used
|
||||
interchangeably. There are algorithms where the I<key type> and the
|
||||
I<algorithm> of the operations that use the keys are not the same,
|
||||
such as EC keys being used for ECDSA and ECDH operations.
|
||||
|
||||
=back
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
EVP_PKEY_CTX_new(), EVP_PKEY_CTX_new_id(), EVP_PKEY_CTX_dup() returns either
|
||||
@@ -61,7 +84,11 @@ L<EVP_PKEY_new(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
These functions were added in OpenSSL 1.0.0.
|
||||
The EVP_PKEY_CTX_new(), EVP_PKEY_CTX_new_id(), EVP_PKEY_CTX_dup() and
|
||||
EVP_PKEY_CTX_free() functions were added in OpenSSL 1.0.0.
|
||||
|
||||
The EVP_PKEY_CTX_new_from_name() and EVP_PKEY_CTX_new_from_pkey() functions were
|
||||
added in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
|
||||
@@ -35,10 +35,10 @@ to the B<RSA> operation except detection of the salt length (using
|
||||
RSA_PSS_SALTLEN_AUTO) is not supported for verification if the key has
|
||||
usage restrictions.
|
||||
|
||||
The EVP_PKEY_CTX_set_signature_md() and EVP_PKEY_CTX_set_rsa_mgf1_md() macros
|
||||
are used to set the digest and MGF1 algorithms respectively. If the key has
|
||||
usage restrictions then an error is returned if an attempt is made to set the
|
||||
digest to anything other than the restricted value. Otherwise these are
|
||||
The L<EVP_PKEY_CTX_set_signature_md(3)> and L<EVP_PKEY_CTX_set_rsa_mgf1_md(3)>
|
||||
fuunctions are used to set the digest and MGF1 algorithms respectively. If the
|
||||
key has usage restrictions then an error is returned if an attempt is made to
|
||||
set the digest to anything other than the restricted value. Otherwise these are
|
||||
similar to the B<RSA> versions.
|
||||
|
||||
=head2 Key Generation
|
||||
|
||||
@@ -2,43 +2,34 @@
|
||||
|
||||
=head1 NAME
|
||||
|
||||
EVP_PKEY_derive_init, EVP_PKEY_derive_init_ex, EVP_PKEY_derive_set_peer,
|
||||
EVP_PKEY_derive - derive public key algorithm shared secret
|
||||
EVP_PKEY_derive_init, EVP_PKEY_derive_set_peer, EVP_PKEY_derive
|
||||
- derive public key algorithm shared secret
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/evp.h>
|
||||
|
||||
int EVP_PKEY_derive_init_ex(EVP_PKEY_CTX *ctx, EVP_KEYEXCH *exchange);
|
||||
int EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx);
|
||||
int EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer);
|
||||
int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The EVP_PKEY_derive_init_ex() function initializes a public key algorithm
|
||||
context for shared secret derivation using the key exchange algorithm
|
||||
B<exchange>.
|
||||
The key exchange algorithm B<exchange> should be fetched using a call to
|
||||
L<EVP_KEYEXCH_fetch(3)>.
|
||||
The EVP_PKEY object associated with B<ctx> must be compatible with that
|
||||
algorithm.
|
||||
B<exchange> may be NULL in which case the EVP_KEYEXCH algorithm is fetched
|
||||
implicitly based on the type of EVP_PKEY associated with B<ctx>.
|
||||
See L<provider(7)/Implicit fetch> for more information about implict fetches.
|
||||
EVP_PKEY_derive_init() initializes a public key algorithm context I<ctx> for
|
||||
shared secret derivation using the algorithm given when the context was created
|
||||
using L<EVP_PKEY_CTX_new(3)> or variants thereof. The algorithm is used to
|
||||
fetch a B<EVP_KEYEXCH> method implicitly, see L<provider(7)/Implicit fetch> for
|
||||
more information about implict fetches.
|
||||
|
||||
The EVP_PKEY_derive_init() function is the same as EVP_PKEY_derive_init_ex()
|
||||
except that the EVP_KEYEXCH algorithm is always implicitly fetched.
|
||||
|
||||
The EVP_PKEY_derive_set_peer() function sets the peer key: this will normally
|
||||
EVP_PKEY_derive_set_peer() sets the peer key: this will normally
|
||||
be a public key.
|
||||
|
||||
The EVP_PKEY_derive() derives a shared secret using B<ctx>.
|
||||
If B<key> is B<NULL> then the maximum size of the output buffer is written to
|
||||
the B<keylen> parameter. If B<key> is not B<NULL> then before the call the
|
||||
B<keylen> parameter should contain the length of the B<key> buffer, if the call
|
||||
is successful the shared secret is written to B<key> and the amount of data
|
||||
written to B<keylen>.
|
||||
EVP_PKEY_derive() derives a shared secret using I<ctx>.
|
||||
If I<key> is NULL then the maximum size of the output buffer is written to the
|
||||
I<keylen> parameter. If I<key> is not NULL then before the call the I<keylen>
|
||||
parameter should contain the length of the I<key> buffer, if the call is
|
||||
successful the shared secret is written to I<key> and the amount of data
|
||||
written to I<keylen>.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
EVP_PKEY_param_fromdata_init, EVP_PKEY_key_fromdata_init, EVP_PKEY_fromdata,
|
||||
EVP_PKEY_param_fromdata_settable, EVP_PKEY_key_fromdata_settable
|
||||
- functions to create domain parameters and keys from user data
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/evp.h>
|
||||
|
||||
int EVP_PKEY_param_fromdata_init(EVP_PKEY_CTX *ctx);
|
||||
int EVP_PKEY_key_fromdata_init(EVP_PKEY_CTX *ctx);
|
||||
int EVP_PKEY_fromdata(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey, OSSL_PARAM params[]);
|
||||
const OSSL_PARAM *EVP_PKEY_param_fromdata_settable(EVP_PKEY_CTX *ctx);
|
||||
const OSSL_PARAM *EVP_PKEY_key_fromdata_settable(EVP_PKEY_CTX *ctx);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
EVP_PKEY_param_fromdata_init() initializes a public key algorithm context
|
||||
for creating domain parameters from user data.
|
||||
|
||||
EVP_PKEY_key_fromdata_init() initializes a public key algorithm context for
|
||||
creating a key from user data.
|
||||
|
||||
EVP_PKEY_fromdata() creates domain parameters or a key, given data from
|
||||
I<params> and a context that's been initialized with
|
||||
EVP_PKEY_param_fromdata_init() or EVP_PKEY_key_fromdata_init(). The result is
|
||||
written to I<*ppkey>.
|
||||
|
||||
EVP_PKEY_param_fromdata_settable() and EVP_PKEY_key_fromdata_settable()
|
||||
get a constant B<OSSL_PARAM> array that describes the settable parameters
|
||||
that can be used with EVP_PKEY_fromdata().
|
||||
See L<OSSL_PARAM(3)> for the use of B<OSSL_PARAM> as parameter descriptor.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
These functions only work with key management methods coming from a
|
||||
provider.
|
||||
|
||||
=for comment We may choose to make this available for legacy methods too...
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
EVP_PKEY_key_fromdata_init(), EVP_PKEY_param_fromdata_init() and
|
||||
EVP_PKEY_fromdata() return 1 for success and 0 or a negative value for
|
||||
failure. In particular a return value of -2 indicates the operation is
|
||||
not supported by the public key algorithm.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<EVP_PKEY_CTX_new(3)>, L<provider(7)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
These functions were added in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
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
|
||||
|
||||
@@ -8,14 +8,18 @@ EVP_PKEY_meth_set_init, EVP_PKEY_meth_set_copy, EVP_PKEY_meth_set_cleanup,
|
||||
EVP_PKEY_meth_set_paramgen, EVP_PKEY_meth_set_keygen, EVP_PKEY_meth_set_sign,
|
||||
EVP_PKEY_meth_set_verify, EVP_PKEY_meth_set_verify_recover, EVP_PKEY_meth_set_signctx,
|
||||
EVP_PKEY_meth_set_verifyctx, EVP_PKEY_meth_set_encrypt, EVP_PKEY_meth_set_decrypt,
|
||||
EVP_PKEY_meth_set_derive, EVP_PKEY_meth_set_ctrl, EVP_PKEY_meth_set_check,
|
||||
EVP_PKEY_meth_set_derive, EVP_PKEY_meth_set_ctrl,
|
||||
EVP_PKEY_meth_set_digestsign, EVP_PKEY_meth_set_digestverify,
|
||||
EVP_PKEY_meth_set_check,
|
||||
EVP_PKEY_meth_set_public_check, EVP_PKEY_meth_set_param_check,
|
||||
EVP_PKEY_meth_set_digest_custom,
|
||||
EVP_PKEY_meth_get_init, EVP_PKEY_meth_get_copy, EVP_PKEY_meth_get_cleanup,
|
||||
EVP_PKEY_meth_get_paramgen, EVP_PKEY_meth_get_keygen, EVP_PKEY_meth_get_sign,
|
||||
EVP_PKEY_meth_get_verify, EVP_PKEY_meth_get_verify_recover, EVP_PKEY_meth_get_signctx,
|
||||
EVP_PKEY_meth_get_verifyctx, EVP_PKEY_meth_get_encrypt, EVP_PKEY_meth_get_decrypt,
|
||||
EVP_PKEY_meth_get_derive, EVP_PKEY_meth_get_ctrl, EVP_PKEY_meth_get_check,
|
||||
EVP_PKEY_meth_get_derive, EVP_PKEY_meth_get_ctrl,
|
||||
EVP_PKEY_meth_get_digestsign, EVP_PKEY_meth_get_digestverify,
|
||||
EVP_PKEY_meth_get_check,
|
||||
EVP_PKEY_meth_get_public_check, EVP_PKEY_meth_get_param_check,
|
||||
EVP_PKEY_meth_get_digest_custom,
|
||||
EVP_PKEY_meth_remove
|
||||
@@ -112,6 +116,18 @@ EVP_PKEY_meth_remove
|
||||
int (*ctrl_str) (EVP_PKEY_CTX *ctx,
|
||||
const char *type,
|
||||
const char *value));
|
||||
void EVP_PKEY_meth_set_digestsign(EVP_PKEY_METHOD *pmeth,
|
||||
int (*digestsign) (EVP_MD_CTX *ctx,
|
||||
unsigned char *sig,
|
||||
size_t *siglen,
|
||||
const unsigned char *tbs,
|
||||
size_t tbslen));
|
||||
void EVP_PKEY_meth_set_digestverify(EVP_PKEY_METHOD *pmeth,
|
||||
int (*digestverify) (EVP_MD_CTX *ctx,
|
||||
const unsigned char *sig,
|
||||
size_t siglen,
|
||||
const unsigned char *tbs,
|
||||
size_t tbslen));
|
||||
void EVP_PKEY_meth_set_check(EVP_PKEY_METHOD *pmeth,
|
||||
int (*check) (EVP_PKEY *pkey));
|
||||
void EVP_PKEY_meth_set_public_check(EVP_PKEY_METHOD *pmeth,
|
||||
@@ -200,6 +216,18 @@ EVP_PKEY_meth_remove
|
||||
int (**pctrl_str) (EVP_PKEY_CTX *ctx,
|
||||
const char *type,
|
||||
const char *value));
|
||||
void EVP_PKEY_meth_get_digestsign(EVP_PKEY_METHOD *pmeth,
|
||||
int (**digestsign) (EVP_MD_CTX *ctx,
|
||||
unsigned char *sig,
|
||||
size_t *siglen,
|
||||
const unsigned char *tbs,
|
||||
size_t tbslen));
|
||||
void EVP_PKEY_meth_get_digestverify(EVP_PKEY_METHOD *pmeth,
|
||||
int (**digestverify) (EVP_MD_CTX *ctx,
|
||||
const unsigned char *sig,
|
||||
size_t siglen,
|
||||
const unsigned char *tbs,
|
||||
size_t tbslen));
|
||||
void EVP_PKEY_meth_get_check(const EVP_PKEY_METHOD *pmeth,
|
||||
int (**pcheck) (EVP_PKEY *pkey));
|
||||
void EVP_PKEY_meth_get_public_check(const EVP_PKEY_METHOD *pmeth,
|
||||
|
||||
@@ -95,8 +95,8 @@ general private key without reference to any particular algorithm.
|
||||
|
||||
The structure returned by EVP_PKEY_new() is empty. To add a private or public
|
||||
key to this empty structure use the appropriate functions described in
|
||||
L<EVP_PKEY_set1_RSA(3)>, L<EVP_PKEY_set1_DSA>, L<EVP_PKEY_set1_DH> or
|
||||
L<EVP_PKEY_set1_EC_KEY>.
|
||||
L<EVP_PKEY_set1_RSA(3)>, L<EVP_PKEY_set1_DSA(3)>, L<EVP_PKEY_set1_DH(3)> or
|
||||
L<EVP_PKEY_set1_EC_KEY(3)>.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
@@ -109,8 +109,8 @@ EVP_PKEY_get_raw_public_key() return 1 for success and 0 for failure.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<EVP_PKEY_set1_RSA(3)>, L<EVP_PKEY_set1_DSA>, L<EVP_PKEY_set1_DH> or
|
||||
L<EVP_PKEY_set1_EC_KEY>
|
||||
L<EVP_PKEY_set1_RSA(3)>, L<EVP_PKEY_set1_DSA(3)>, L<EVP_PKEY_set1_DH(3)> or
|
||||
L<EVP_PKEY_set1_EC_KEY(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
|
||||
+12
-20
@@ -2,14 +2,13 @@
|
||||
|
||||
=head1 NAME
|
||||
|
||||
EVP_PKEY_sign_init_ex, EVP_PKEY_sign_init, EVP_PKEY_sign
|
||||
EVP_PKEY_sign_init, EVP_PKEY_sign
|
||||
- sign using a public key algorithm
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/evp.h>
|
||||
|
||||
int EVP_PKEY_sign_init_ex(EVP_PKEY_CTX *ctx, EVP_SIGNATURE *signature);
|
||||
int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx);
|
||||
int EVP_PKEY_sign(EVP_PKEY_CTX *ctx,
|
||||
unsigned char *sig, size_t *siglen,
|
||||
@@ -17,26 +16,19 @@ EVP_PKEY_sign_init_ex, EVP_PKEY_sign_init, EVP_PKEY_sign
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The EVP_PKEY_sign_init_ex() function initializes a public key algorithm
|
||||
context for performing signing using the signature algorithm B<signature>.
|
||||
The signature algorithm B<signature> should be fetched using a call to
|
||||
L<EVP_SIGNATURE_fetch(3)>.
|
||||
The EVP_PKEY object associated with B<ctx> must be compatible with that
|
||||
algorithm.
|
||||
B<signature> may be NULL in which case the EVP_SIGNATURE algorithm is fetched
|
||||
implicitly based on the type of EVP_PKEY associated with B<ctx>.
|
||||
See L<provider(7)/Implicit fetch> for more information about implict fetches.
|
||||
|
||||
The EVP_PKEY_sign_init() function is the same as EVP_PKEY_sign_init_ex() except
|
||||
that the EVP_SIGNATURE algorithm is always implicitly fetched.
|
||||
EVP_PKEY_sign_init() initializes a public key algorithm context I<ctx> for
|
||||
signing using the algorithm given when the context was created
|
||||
using L<EVP_PKEY_CTX_new(3)> or variants thereof. The algorithm is used to
|
||||
fetch a B<EVP_SIGNATURE> method implicitly, see L<provider(7)/Implicit fetch>
|
||||
for more information about implict fetches.
|
||||
|
||||
The EVP_PKEY_sign() function performs a public key signing operation
|
||||
using B<ctx>. The data to be signed is specified using the B<tbs> and
|
||||
B<tbslen> parameters. If B<sig> is B<NULL> then the maximum size of the output
|
||||
buffer is written to the B<siglen> parameter. If B<sig> is not B<NULL> then
|
||||
before the call the B<siglen> parameter should contain the length of the
|
||||
B<sig> buffer, if the call is successful the signature is written to
|
||||
B<sig> and the amount of data written to B<siglen>.
|
||||
using I<ctx>. The data to be signed is specified using the I<tbs> and
|
||||
I<tbslen> parameters. If I<sig> is NULL then the maximum size of the output
|
||||
buffer is written to the I<siglen> parameter. If I<sig> is not NULL then
|
||||
before the call the I<siglen> parameter should contain the length of the
|
||||
I<sig> buffer, if the call is successful the signature is written to
|
||||
I<sig> and the amount of data written to I<siglen>.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
EVP_PKEY_size, EVP_PKEY_bits, EVP_PKEY_security_bits
|
||||
- EVP_PKEY information functions
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/evp.h>
|
||||
|
||||
int EVP_PKEY_size(const EVP_PKEY *pkey);
|
||||
int EVP_PKEY_bits(const EVP_PKEY *pkey);
|
||||
int EVP_PKEY_security_bits(const EVP_PKEY *pkey);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
EVP_PKEY_size() returns the maximum suitable size for the output
|
||||
buffers for almost all operations that can be done with I<pkey>.
|
||||
The primary documented use is with L<EVP_SignFinal(3)> and
|
||||
L<EVP_SealInit(3)>, but it isn't limited there. The returned size is
|
||||
also large enough for the output buffer of L<EVP_PKEY_sign(3)>,
|
||||
L<EVP_PKEY_encrypt(3)>, L<EVP_PKEY_decrypt(3)>, L<EVP_PKEY_derive(3)>.
|
||||
|
||||
It must be stressed that, unless the documentation for the operation
|
||||
that's being performed says otherwise, the size returned by
|
||||
EVP_PKEY_size() is only preliminary and not exact, so the final
|
||||
contents of the target buffer may be smaller. It is therefore crucial
|
||||
to take note of the size given back by the function that performs the
|
||||
operation, such as L<EVP_PKEY_sign(3)> (the I<siglen> argument will
|
||||
receive that length), to avoid bugs.
|
||||
|
||||
EVP_PKEY_bits() returns the cryptographic length of the cryptosystem
|
||||
to which the key in I<pkey> belongs, in bits. Note that the definition
|
||||
of cryptographic length is specific to the key cryptosystem.
|
||||
|
||||
EVP_PKEY_security_bits() returns the number of security bits of the given
|
||||
I<pkey>, bits of security is defined in NIST SP800-57.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
EVP_PKEY_size(), EVP_PKEY_bits() and EVP_PKEY_security_bits() return a
|
||||
positive number, or 0 if this size isn't available.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
Most functions that have an output buffer and are mentioned with
|
||||
EVP_PKEY_size() have a functionality where you can pass NULL for the
|
||||
buffer and still pass a pointer to an integer and get the exact size
|
||||
that this function call delivers in the context that it's called in.
|
||||
This allows those functions to be called twice, once to find out the
|
||||
exact buffer size, then allocate the buffer in between, and call that
|
||||
function again actually output the data. For those functions, it
|
||||
isn't strictly necessary to call EVP_PKEY_size() to find out the
|
||||
buffer size, but may be useful in cases where it's desirable to know
|
||||
the upper limit in advance.
|
||||
|
||||
It should also be especially noted that EVP_PKEY_size() shouldn't be
|
||||
used to get the output size for EVP_DigestSignFinal(), according to
|
||||
L<EVP_DigestSignFinal(3)/NOTES>.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<EVP_SignFinal(3)>,
|
||||
L<EVP_SealInit(3)>,
|
||||
L<EVP_PKEY_sign(3)>,
|
||||
L<EVP_PKEY_encrypt(3)>,
|
||||
L<EVP_PKEY_decrypt(3)>,
|
||||
L<EVP_PKEY_derive(3)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
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
|
||||
@@ -2,14 +2,13 @@
|
||||
|
||||
=head1 NAME
|
||||
|
||||
EVP_PKEY_verify_init_ex, EVP_PKEY_verify_init, EVP_PKEY_verify
|
||||
EVP_PKEY_verify_init, EVP_PKEY_verify
|
||||
- signature verification using a public key algorithm
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/evp.h>
|
||||
|
||||
int EVP_PKEY_verify_init_ex(EVP_PKEY_CTX *ctx, EVP_SIGNATURE *signature);
|
||||
int EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx);
|
||||
int EVP_PKEY_verify(EVP_PKEY_CTX *ctx,
|
||||
const unsigned char *sig, size_t siglen,
|
||||
@@ -17,24 +16,16 @@ EVP_PKEY_verify_init_ex, EVP_PKEY_verify_init, EVP_PKEY_verify
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The EVP_PKEY_verify_init_ex() function initializes a public key algorithm
|
||||
context for performing signature verification using the signature algorithm
|
||||
B<signature>.
|
||||
The signature algorithm B<signature> should be fetched using a call to
|
||||
L<EVP_SIGNATURE_fetch(3)>.
|
||||
The EVP_PKEY object associated with B<ctx> must be compatible with that
|
||||
algorithm.
|
||||
B<signature> may be NULL in which case the EVP_SIGNATURE algorithm is fetched
|
||||
implicitly based on the type of EVP_PKEY associated with B<ctx>.
|
||||
See L<provider(7)/Implicit fetch> for more information about implict fetches.
|
||||
|
||||
The EVP_PKEY_verify_init() function is the same as EVP_PKEY_verify_init_ex()
|
||||
except that the EVP_SIGNATURE algorithm is always implicitly fetched.
|
||||
EVP_PKEY_verify_init() initializes a public key algorithm context I<ctx> for
|
||||
signing using the algorithm given when the context was created
|
||||
using L<EVP_PKEY_CTX_new(3)> or variants thereof. The algorithm is used to
|
||||
fetch a B<EVP_SIGNATURE> method implicitly, see L<provider(7)/Implicit fetch>
|
||||
for more information about implict fetches.
|
||||
|
||||
The EVP_PKEY_verify() function performs a public key verification operation
|
||||
using B<ctx>. The signature is specified using the B<sig> and
|
||||
B<siglen> parameters. The verified data (i.e. the data believed originally
|
||||
signed) is specified using the B<tbs> and B<tbslen> parameters.
|
||||
using I<ctx>. The signature is specified using the I<sig> and
|
||||
I<siglen> parameters. The verified data (i.e. the data believed originally
|
||||
signed) is specified using the I<tbs> and I<tbslen> parameters.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
|
||||
@@ -2,15 +2,13 @@
|
||||
|
||||
=head1 NAME
|
||||
|
||||
EVP_PKEY_verify_recover_init_ex, EVP_PKEY_verify_recover_init,
|
||||
EVP_PKEY_verify_recover - recover signature using a public key algorithm
|
||||
EVP_PKEY_verify_recover_init, EVP_PKEY_verify_recover
|
||||
- recover signature using a public key algorithm
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/evp.h>
|
||||
|
||||
int EVP_PKEY_verify_recover_init_ex(EVP_PKEY_CTX *ctx,
|
||||
EVP_SIGNATURE *signature);
|
||||
int EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx);
|
||||
int EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx,
|
||||
unsigned char *rout, size_t *routlen,
|
||||
@@ -18,28 +16,19 @@ EVP_PKEY_verify_recover - recover signature using a public key algorithm
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The EVP_PKEY_verify_recover_init_ex() function initializes a public key
|
||||
algorithm context for performing signature signed data recovery using the
|
||||
signature algorithm B<signature>.
|
||||
The signature algorithm B<signature> should be fetched using a call to
|
||||
L<EVP_SIGNATURE_fetch(3)>.
|
||||
The EVP_PKEY object associated with B<ctx> must be compatible with that
|
||||
algorithm.
|
||||
B<signature> may be NULL in which case the EVP_SIGNATURE algorithm is fetched
|
||||
implicitly based on the type of EVP_PKEY associated with B<ctx>.
|
||||
See L<provider(7)/Implicit fetch> for more information about implict fetches.
|
||||
|
||||
The EVP_PKEY_verify_recover_init() function is the same as
|
||||
EVP_PKEY_verify_recover_init_ex() except that the EVP_SIGNATURE algorithm is
|
||||
always implicitly fetched.
|
||||
EVP_PKEY_verify_recover_init() initializes a public key algorithm context
|
||||
I<ctx> for signing using the algorithm given when the context was created
|
||||
using L<EVP_PKEY_CTX_new(3)> or variants thereof. The algorithm is used to
|
||||
fetch a B<EVP_SIGNATURE> method implicitly, see L<provider(7)/Implicit fetch>
|
||||
for more information about implict fetches.
|
||||
|
||||
The EVP_PKEY_verify_recover() function recovers signed data
|
||||
using B<ctx>. The signature is specified using the B<sig> and
|
||||
B<siglen> parameters. If B<rout> is B<NULL> then the maximum size of the output
|
||||
buffer is written to the B<routlen> parameter. If B<rout> is not B<NULL> then
|
||||
before the call the B<routlen> parameter should contain the length of the
|
||||
B<rout> buffer, if the call is successful recovered data is written to
|
||||
B<rout> and the amount of data written to B<routlen>.
|
||||
using I<ctx>. The signature is specified using the I<sig> and
|
||||
I<siglen> parameters. If I<rout> is NULL then the maximum size of the output
|
||||
buffer is written to the I<routlen> parameter. If I<rout> is not NULL then
|
||||
before the call the I<routlen> parameter should contain the length of the
|
||||
I<rout> buffer, if the call is successful recovered data is written to
|
||||
I<rout> and the amount of data written to I<routlen>.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
|
||||
+15
-29
@@ -2,10 +2,8 @@
|
||||
|
||||
=head1 NAME
|
||||
|
||||
EVP_PKEY_size,
|
||||
EVP_SignInit, EVP_SignInit_ex, EVP_SignUpdate, EVP_SignFinal,
|
||||
EVP_PKEY_security_bits - EVP signing
|
||||
functions
|
||||
EVP_SignInit, EVP_SignInit_ex, EVP_SignUpdate, EVP_SignFinal
|
||||
- EVP signing functions
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -17,49 +15,36 @@ functions
|
||||
|
||||
void EVP_SignInit(EVP_MD_CTX *ctx, const EVP_MD *type);
|
||||
|
||||
int EVP_PKEY_size(const EVP_PKEY *pkey);
|
||||
int EVP_PKEY_security_bits(const EVP_PKEY *pkey);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The EVP signature routines are a high level interface to digital
|
||||
signatures.
|
||||
|
||||
EVP_SignInit_ex() sets up signing context B<ctx> to use digest
|
||||
B<type> from ENGINE B<impl>. B<ctx> must be created with
|
||||
EVP_SignInit_ex() sets up signing context I<ctx> to use digest
|
||||
I<type> from B<ENGINE> I<impl>. I<ctx> must be created with
|
||||
EVP_MD_CTX_new() before calling this function.
|
||||
|
||||
EVP_SignUpdate() hashes B<cnt> bytes of data at B<d> into the
|
||||
signature context B<ctx>. This function can be called several times on the
|
||||
same B<ctx> to include additional data.
|
||||
EVP_SignUpdate() hashes I<cnt> bytes of data at I<d> into the
|
||||
signature context I<ctx>. This function can be called several times on the
|
||||
same I<ctx> to include additional data.
|
||||
|
||||
EVP_SignFinal() signs the data in B<ctx> using the private key B<pkey> and
|
||||
places the signature in B<sig>. B<sig> must be at least EVP_PKEY_size(pkey)
|
||||
bytes in size. B<s> is an OUT parameter, and not used as an IN parameter.
|
||||
EVP_SignFinal() signs the data in I<ctx> using the private key I<pkey> and
|
||||
places the signature in I<sig>. I<sig> must be at least C<EVP_PKEY_size(pkey)>
|
||||
bytes in size. I<s> is an OUT parameter, and not used as an IN parameter.
|
||||
The number of bytes of data written (i.e. the length of the signature)
|
||||
will be written to the integer at B<s>, at most EVP_PKEY_size(pkey) bytes
|
||||
will be written to the integer at I<s>, at most C<EVP_PKEY_size(pkey)> bytes
|
||||
will be written.
|
||||
|
||||
EVP_SignInit() initializes a signing context B<ctx> to use the default
|
||||
implementation of digest B<type>.
|
||||
|
||||
EVP_PKEY_size() returns the maximum size of a signature in bytes. The actual
|
||||
signature returned by EVP_SignFinal() may be smaller.
|
||||
|
||||
EVP_PKEY_security_bits() returns the number of security bits of the given B<pkey>,
|
||||
bits of security is defined in NIST SP800-57.
|
||||
EVP_SignInit() initializes a signing context I<ctx> to use the default
|
||||
implementation of digest I<type>.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
EVP_SignInit_ex(), EVP_SignUpdate() and EVP_SignFinal() return 1
|
||||
for success and 0 for failure.
|
||||
|
||||
EVP_PKEY_size() returns the maximum size of a signature in bytes.
|
||||
|
||||
The error codes can be obtained by L<ERR_get_error(3)>.
|
||||
|
||||
EVP_PKEY_security_bits() returns the number of security bits.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
The B<EVP> interface to digital signatures should almost always be used in
|
||||
@@ -95,11 +80,12 @@ The previous two bugs are fixed in the newer EVP_SignDigest*() function.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<EVP_PKEY_size(3)>, L<EVP_PKEY_bits(3)>, L<EVP_PKEY_security_bits(3)>,
|
||||
L<EVP_VerifyInit(3)>,
|
||||
L<EVP_DigestInit(3)>,
|
||||
L<evp(7)>, L<HMAC(3)>, L<MD2(3)>,
|
||||
L<MD5(3)>, L<MDC2(3)>, L<RIPEMD160(3)>,
|
||||
L<SHA1(3)>, L<dgst(1)>
|
||||
L<SHA1(3)>, L<openssl-dgst(1)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ L<EVP_SignInit(3)>,
|
||||
L<EVP_DigestInit(3)>,
|
||||
L<evp(7)>, L<HMAC(3)>, L<MD2(3)>,
|
||||
L<MD5(3)>, L<MDC2(3)>, L<RIPEMD160(3)>,
|
||||
L<SHA1(3)>, L<dgst(1)>
|
||||
L<SHA1(3)>, L<openssl-dgst(1)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ The latter adds an error on the error stack.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<EVP_MD_fetch>
|
||||
L<EVP_MD_fetch(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
|
||||
@@ -9,6 +9,10 @@ MD4_Final, MD5_Init, MD5_Update, MD5_Final - MD2, MD4, and MD5 hash functions
|
||||
|
||||
#include <openssl/md2.h>
|
||||
|
||||
Deprecated since OpenSSL 3.0, can be hidden entirely by defining
|
||||
B<OPENSSL_API_COMPAT> with a suitable version value, see
|
||||
L<openssl_user_macros(7)>:
|
||||
|
||||
unsigned char *MD2(const unsigned char *d, unsigned long n, unsigned char *md);
|
||||
|
||||
int MD2_Init(MD2_CTX *c);
|
||||
@@ -18,6 +22,10 @@ MD4_Final, MD5_Init, MD5_Update, MD5_Final - MD2, MD4, and MD5 hash functions
|
||||
|
||||
#include <openssl/md4.h>
|
||||
|
||||
Deprecated since OpenSSL 3.0, can be hidden entirely by defining
|
||||
B<OPENSSL_API_COMPAT> with a suitable version value, see
|
||||
L<openssl_user_macros(7)>:
|
||||
|
||||
unsigned char *MD4(const unsigned char *d, unsigned long n, unsigned char *md);
|
||||
|
||||
int MD4_Init(MD4_CTX *c);
|
||||
@@ -35,6 +43,10 @@ MD4_Final, MD5_Init, MD5_Update, MD5_Final - MD2, MD4, and MD5 hash functions
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
All of the functions described on this page are deprecated.
|
||||
Applications should instead use L<EVP_DigestInit_ex(3)>, L<EVP_DigestUpdate(3)>
|
||||
and L<EVP_DigestFinal_ex(3)>.
|
||||
|
||||
MD2, MD4, and MD5 are cryptographic hash functions with a 128 bit output.
|
||||
|
||||
MD2(), MD4(), and MD5() compute the MD2, MD4, and MD5 message digest
|
||||
@@ -83,6 +95,10 @@ RFC 1319, RFC 1320, RFC 1321
|
||||
|
||||
L<EVP_DigestInit(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
All of these functions were deprecated in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
@@ -8,6 +8,10 @@ MDC2, MDC2_Init, MDC2_Update, MDC2_Final - MDC2 hash function
|
||||
|
||||
#include <openssl/mdc2.h>
|
||||
|
||||
Deprecated since OpenSSL 3.0, can be hidden entirely by defining
|
||||
B<OPENSSL_API_COMPAT> with a suitable version value, see
|
||||
L<openssl_user_macros(7)>:
|
||||
|
||||
unsigned char *MDC2(const unsigned char *d, unsigned long n,
|
||||
unsigned char *md);
|
||||
|
||||
@@ -18,6 +22,10 @@ MDC2, MDC2_Init, MDC2_Update, MDC2_Final - MDC2 hash function
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
All of the functions described on this page are deprecated.
|
||||
Applications should instead use L<EVP_DigestInit_ex(3)>, L<EVP_DigestUpdate(3)>
|
||||
and L<EVP_DigestFinal_ex(3)>.
|
||||
|
||||
MDC2 is a method to construct hash functions with 128 bit output from
|
||||
block ciphers. These functions are an implementation of MDC2 with
|
||||
DES.
|
||||
@@ -56,6 +64,10 @@ ISO/IEC 10118-2:2000 Hash-Function 2, with DES as the underlying block cipher.
|
||||
|
||||
L<EVP_DigestInit(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
All of these functions were deprecated in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC,
|
||||
OPENSSL_MSTR, OPENSSL_MSTR_HELPER
|
||||
- generic C programming utility macros
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/macros.h>
|
||||
|
||||
#define OPENSSL_FILE /* typically: __FILE__ */
|
||||
#define OPENSSL_LINE /* typically: __LINE__ */
|
||||
#define OPENSSL_FUNC /* typically: __func__ */
|
||||
|
||||
#define OPENSSL_MSTR_HELPER(x) #x
|
||||
#define OPENSSL_MSTR(x) OPENSSL_MSTR_HELPER(x)
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The macros B<OPENSSL_FILE> and B<OPENSSL_LINE>
|
||||
typically yield the current filename and line number during C compilation.
|
||||
When B<OPENSSL_NO_FILENAMES> is defined they yield B<""> and B<0>, respectively.
|
||||
|
||||
The macro B<OPENSSL_FUNC> attempts to yield the name of the C function
|
||||
currently being compiled, as far as language and compiler versions allow.
|
||||
Otherwise, it yields "(unknown function)".
|
||||
|
||||
The macro B<OPENSSL_MSTR> yields the expansion of the macro given as argument,
|
||||
which is useful for concatenation with string constants.
|
||||
The macro B<OPENSSL_MSTR_HELPER> is an auxiliary macro for this purpose.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
see above
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<crypto(7)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
B<OPENSSL_FUNC>, B<OPENSSL_MSTR>, and B<OPENSSL_MSTR_HELPER>
|
||||
were added in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2018-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
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
|
||||
@@ -69,10 +69,10 @@ executed on SSE2 capable CPU, but under control of OS that does not
|
||||
enable XMM registers. Historically address of the capability vector copy
|
||||
was exposed to application through OPENSSL_ia32cap_loc(), but not
|
||||
anymore. Now the only way to affect the capability detection is to set
|
||||
OPENSSL_ia32cap environment variable prior target application start. To
|
||||
give a specific example, on Intel P4 processor 'env
|
||||
OPENSSL_ia32cap=0x16980010 apps/openssl', or better yet 'env
|
||||
OPENSSL_ia32cap=~0x1000000 apps/openssl' would achieve the desired
|
||||
B<OPENSSL_ia32cap> environment variable prior target application start. To
|
||||
give a specific example, on Intel P4 processor
|
||||
C<env OPENSSL_ia32cap=0x16980010 apps/openssl>, or better yet
|
||||
C<env OPENSSL_ia32cap=~0x1000000 apps/openssl> would achieve the desired
|
||||
effect. Alternatively you can reconfigure the toolkit with no-sse2
|
||||
option and recompile.
|
||||
|
||||
@@ -116,9 +116,9 @@ a.k.a. AVX512IFMA extension;
|
||||
|
||||
=back
|
||||
|
||||
To control this extended capability word use ':' as delimiter when
|
||||
setting up OPENSSL_ia32cap environment variable. For example assigning
|
||||
':~0x20' would disable AVX2 code paths, and ':0' - all post-AVX
|
||||
To control this extended capability word use C<:> as delimiter when
|
||||
setting up B<OPENSSL_ia32cap> environment variable. For example assigning
|
||||
C<:~0x20> would disable AVX2 code paths, and C<:0> - all post-AVX
|
||||
extensions.
|
||||
|
||||
It should be noted that whether or not some of the most "fancy"
|
||||
|
||||
@@ -197,7 +197,7 @@ Attempts to call OPENSSL_init_crypto() will fail and an ERR_R_INIT_FAIL error
|
||||
will be added to the error stack. Note that because initialisation has failed
|
||||
OpenSSL error strings will not be available, only an error code. This code can
|
||||
be put through the openssl errstr command line application to produce a human
|
||||
readable error (see L<errstr(1)>).
|
||||
readable error (see L<openssl-errstr(1)>).
|
||||
|
||||
The OPENSSL_atexit() function enables the registration of a
|
||||
function to be called during OPENSSL_cleanup(). Stop handlers are
|
||||
|
||||
+19
-51
@@ -60,20 +60,18 @@ OPENSSL_MALLOC_FD
|
||||
|
||||
void CRYPTO_get_alloc_counts(int *m, int *r, int *f)
|
||||
|
||||
int CRYPTO_set_mem_debug(int onoff)
|
||||
|
||||
env OPENSSL_MALLOC_FAILURES=... <application>
|
||||
env OPENSSL_MALLOC_FD=... <application>
|
||||
|
||||
int CRYPTO_mem_ctrl(int mode);
|
||||
Deprecated:
|
||||
|
||||
int CRYPTO_mem_leaks(BIO *b);
|
||||
int CRYPTO_mem_leaks_fp(FILE *fp);
|
||||
int CRYPTO_mem_leaks_cb(int (*cb)(const char *str, size_t len, void *u),
|
||||
void *u);
|
||||
|
||||
Deprecated:
|
||||
|
||||
int CRYPTO_set_mem_debug(int onoff)
|
||||
int CRYPTO_mem_ctrl(int mode);
|
||||
int OPENSSL_mem_debug_push(const char *info)
|
||||
int OPENSSL_mem_debug_pop(void);
|
||||
int CRYPTO_mem_debug_push(const char *info, const char *file, int line);
|
||||
@@ -115,37 +113,15 @@ OPENSSL_strlcat() and OPENSSL_strnlen() are equivalents of the common C
|
||||
library functions and are provided for portability.
|
||||
|
||||
If no allocations have been done, it is possible to "swap out" the default
|
||||
implementations for OPENSSL_malloc(), OPENSSL_realloc and OPENSSL_free()
|
||||
and replace them with alternate versions (hooks).
|
||||
implementations for OPENSSL_malloc(), OPENSSL_realloc() and OPENSSL_free()
|
||||
and replace them with alternate versions.
|
||||
CRYPTO_get_mem_functions() function fills in the given arguments with the
|
||||
function pointers for the current implementations.
|
||||
With CRYPTO_set_mem_functions(), you can specify a different set of functions.
|
||||
If any of B<m>, B<r>, or B<f> are NULL, then the function is not changed.
|
||||
|
||||
The default implementation can include some debugging capability (if enabled
|
||||
at build-time).
|
||||
This adds some overhead by keeping a list of all memory allocations, and
|
||||
removes items from the list when they are free'd.
|
||||
This is most useful for identifying memory leaks.
|
||||
CRYPTO_set_mem_debug() turns this tracking on and off. In order to have
|
||||
any effect, is must be called before any of the allocation functions
|
||||
(e.g., CRYPTO_malloc()) are called, and is therefore normally one of the
|
||||
first lines of main() in an application.
|
||||
CRYPTO_mem_ctrl() provides fine-grained control of memory leak tracking.
|
||||
To enable tracking call CRYPTO_mem_ctrl() with a B<mode> argument of
|
||||
the B<CRYPTO_MEM_CHECK_ON>.
|
||||
To disable tracking call CRYPTO_mem_ctrl() with a B<mode> argument of
|
||||
the B<CRYPTO_MEM_CHECK_OFF>.
|
||||
|
||||
At the end of the program, calling CRYPTO_mem_leaks() or
|
||||
CRYPTO_mem_leaks_fp() will report all "leaked" memory, writing it
|
||||
to the specified BIO B<b> or FILE B<fp>. These functions return 1 if
|
||||
there are no leaks, 0 if there are leaks and -1 if an error occurred.
|
||||
|
||||
CRYPTO_mem_leaks_cb() does the same as CRYPTO_mem_leaks(), but instead
|
||||
of writing to a given BIO, the callback function is called for each
|
||||
output string with the string, length, and userdata B<u> as the callback
|
||||
parameters.
|
||||
While it's permitted to swap out only a few and not all the functions
|
||||
with CRYPTO_set_mem_functions(), it's recommended to swap them all out
|
||||
at once.
|
||||
|
||||
If the library is built with the C<crypto-mdebug> option, then one
|
||||
function, CRYPTO_get_alloc_counts(), and two additional environment
|
||||
@@ -180,19 +156,12 @@ to use this (will not work on all platforms):
|
||||
export OPENSSL_MALLOC_FD
|
||||
...app invocation... 3>/tmp/log$$
|
||||
|
||||
OPENSSL_mem_debug_push(), OPENSSL_mem_debug_pop(),
|
||||
CRYPTO_mem_debug_push(), and CRYPTO_mem_debug_pop()
|
||||
have been deprecated and replaced with functions that only return zero.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
OPENSSL_malloc_init(), OPENSSL_free(), OPENSSL_clear_free()
|
||||
CRYPTO_free(), CRYPTO_clear_free() and CRYPTO_get_mem_functions()
|
||||
return no value.
|
||||
|
||||
CRYPTO_mem_leaks(), CRYPTO_mem_leaks_fp() and CRYPTO_mem_leaks_cb() return 1 if
|
||||
there are no leaks, 0 if there are leaks and -1 if an error occurred.
|
||||
|
||||
OPENSSL_malloc(), OPENSSL_zalloc(), OPENSSL_realloc(),
|
||||
OPENSSL_clear_realloc(),
|
||||
CRYPTO_malloc(), CRYPTO_zalloc(), CRYPTO_realloc(),
|
||||
@@ -200,25 +169,24 @@ CRYPTO_clear_realloc(),
|
||||
OPENSSL_strdup(), and OPENSSL_strndup()
|
||||
return a pointer to allocated memory or NULL on error.
|
||||
|
||||
CRYPTO_set_mem_functions() and CRYPTO_set_mem_debug()
|
||||
return 1 on success or 0 on failure (almost
|
||||
CRYPTO_set_mem_functions() returns 1 on success or 0 on failure (almost
|
||||
always because allocations have already happened).
|
||||
|
||||
CRYPTO_mem_ctrl() returns -1 if an error occurred, otherwise the
|
||||
previous value of the mode.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
While it's permitted to swap out only a few and not all the functions
|
||||
with CRYPTO_set_mem_functions(), it's recommended to swap them all out
|
||||
at once, especially if OpenSSL was built with the
|
||||
configuration option> C<crypto-mdebug>.
|
||||
CRYPTO_mem_leaks(), CRYPTO_mem_leaks_fp(), CRYPTO_mem_leaks_cb(),
|
||||
CRYPTO_set_mem_debug(), and CRYPTO_mem_ctrl() are deprecated and return -1.
|
||||
OPENSSL_mem_debug_push(), OPENSSL_mem_debug_pop(),
|
||||
CRYPTO_mem_debug_push(), and CRYPTO_mem_debug_pop()
|
||||
are deprecated and return 0.
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
OPENSSL_mem_debug_push(), OPENSSL_mem_debug_pop(),
|
||||
CRYPTO_mem_debug_push(), and CRYPTO_mem_debug_pop()
|
||||
CRYPTO_mem_debug_push(), CRYPTO_mem_debug_pop(),
|
||||
CRYPTO_mem_leaks(), CRYPTO_mem_leaks_fp(),
|
||||
CRYPTO_mem_leaks_cb(), CRYPTO_set_mem_debug(), CRYPTO_mem_ctrl()
|
||||
were deprecated in OpenSSL 3.0.
|
||||
The memory-leak checking has been deprecated in OpenSSL 3.0 in favor of
|
||||
clang's memory and leak sanitizer.
|
||||
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
@@ -16,7 +16,7 @@ When libcrypto is initialized, the bits returned by the STFLE instruction
|
||||
and by the QUERY functions are stored in the vector.
|
||||
|
||||
To change the set of instructions available to an application, you can
|
||||
set the OPENSSL_s390xcap environment variable before you start the
|
||||
set the B<OPENSSL_s390xcap> environment variable before you start the
|
||||
application. After initialization, the capability vector is ANDed bitwise
|
||||
with a mask which is derived from the environment variable.
|
||||
|
||||
@@ -34,14 +34,16 @@ There are three types of tokens:
|
||||
The name of a processor generation. A bit in the environment variable's
|
||||
mask is set to one if and only if the specified processor generation
|
||||
implements the corresponding instruction set extension. Possible values
|
||||
are z900, z990, z9, z10, z196, zEC12, z13, z14 and z15.
|
||||
are B<z900>, B<z990>, B<z9>, B<z10>, B<z196>, B<zEC12>, B<z13>, B<z14>
|
||||
and B<z15>.
|
||||
|
||||
=item <string>:<mask>:<mask>
|
||||
|
||||
The name of an instruction followed by two 64-bit masks. The part of the
|
||||
environment variable's mask corresponding to the specified instruction is
|
||||
set to the specified 128-bit mask. Possible values are kimd, klmd, km, kmc,
|
||||
kmac, kmctr, kmo, kmf, prno, kma, pcc and kdsa.
|
||||
set to the specified 128-bit mask. Possible values are B<kimd>, B<klmd>,
|
||||
B<km>, B<kmc>, B<kmac>, B<kmctr>, B<kmo>, B<kmf>, B<prno>, B<kma>, B<pcc>
|
||||
and B<kdsa>.
|
||||
|
||||
=item stfle:<mask>:<mask>:<mask>
|
||||
|
||||
@@ -52,7 +54,7 @@ instruction is set to the specified 192-bit mask.
|
||||
=back
|
||||
|
||||
The 64-bit masks are specified in hexadecimal notation. The 0x prefix is
|
||||
optional. Prefix a mask with a tilde (~) to denote a bitwise NOT operation.
|
||||
optional. Prefix a mask with a tilde, C<~>, to denote a bitwise NOT operation.
|
||||
|
||||
The following is a list of significant bits for each instruction. Colon
|
||||
rows separate the individual 64-bit masks. The bit numbers in the first
|
||||
|
||||
@@ -7,6 +7,7 @@ CRYPTO_secure_malloc_done, OPENSSL_secure_malloc, CRYPTO_secure_malloc,
|
||||
OPENSSL_secure_zalloc, CRYPTO_secure_zalloc, OPENSSL_secure_free,
|
||||
CRYPTO_secure_free, OPENSSL_secure_clear_free,
|
||||
CRYPTO_secure_clear_free, OPENSSL_secure_actual_size,
|
||||
CRYPTO_secure_allocated,
|
||||
CRYPTO_secure_used - secure heap storage
|
||||
|
||||
=head1 SYNOPSIS
|
||||
@@ -33,6 +34,7 @@ CRYPTO_secure_used - secure heap storage
|
||||
|
||||
size_t OPENSSL_secure_actual_size(const void *ptr);
|
||||
|
||||
int CRYPTO_secure_allocated(const void *ptr);
|
||||
size_t CRYPTO_secure_used();
|
||||
|
||||
=head1 DESCRIPTION
|
||||
@@ -90,6 +92,8 @@ OPENSSL_secure_actual_size() tells the actual size allocated to the
|
||||
pointer; implementations may allocate more space than initially
|
||||
requested, in order to "round up" and reduce secure heap fragmentation.
|
||||
|
||||
OPENSSL_secure_allocated() tells if a pointer is allocated in the secure heap.
|
||||
|
||||
CRYPTO_secure_used() returns the number of bytes allocated in the
|
||||
secure heap.
|
||||
|
||||
|
||||
@@ -16,9 +16,11 @@ OSSL_CMP_CTX_set_serverPort,
|
||||
OSSL_CMP_CTX_set1_proxyName,
|
||||
OSSL_CMP_CTX_set_proxyPort,
|
||||
OSSL_CMP_DEFAULT_PORT,
|
||||
OSSL_cmp_http_cb_t,
|
||||
OSSL_CMP_CTX_set_http_cb,
|
||||
OSSL_CMP_CTX_set_http_cb_arg,
|
||||
OSSL_CMP_CTX_get_http_cb_arg,
|
||||
OSSL_cmp_transfer_cb_t,
|
||||
OSSL_CMP_CTX_set_transfer_cb,
|
||||
OSSL_CMP_CTX_set_transfer_cb_arg,
|
||||
OSSL_CMP_CTX_get_transfer_cb_arg,
|
||||
@@ -46,6 +48,7 @@ OSSL_CMP_CTX_push0_policy,
|
||||
OSSL_CMP_CTX_set1_oldCert,
|
||||
OSSL_CMP_CTX_set1_p10CSR,
|
||||
OSSL_CMP_CTX_push0_genm_ITAV,
|
||||
OSSL_cmp_certConf_cb_t,
|
||||
OSSL_CMP_CTX_set_certConf_cb,
|
||||
OSSL_CMP_CTX_set_certConf_cb_arg,
|
||||
OSSL_CMP_CTX_get_certConf_cb_arg,
|
||||
@@ -81,14 +84,14 @@ OSSL_CMP_CTX_set1_senderNonce
|
||||
int OSSL_CMP_CTX_set1_proxyName(OSSL_CMP_CTX *ctx, const char *name);
|
||||
int OSSL_CMP_CTX_set_proxyPort(OSSL_CMP_CTX *ctx, int port);
|
||||
#define OSSL_CMP_DEFAULT_PORT 80
|
||||
typedef BIO (*OSSL_cmp_http_cb_t) (OSSL_CMP_CTX *ctx, BIO *hbio,
|
||||
typedef BIO *(*OSSL_cmp_http_cb_t)(OSSL_CMP_CTX *ctx, BIO *hbio,
|
||||
unsigned long detail);
|
||||
int OSSL_CMP_CTX_set_http_cb(OSSL_CMP_CTX *ctx, OSSL_cmp_http_cb_t cb);
|
||||
int OSSL_CMP_CTX_set_http_cb_arg(OSSL_CMP_CTX *ctx, void *arg);
|
||||
void *OSSL_CMP_CTX_get_http_cb_arg(const OSSL_CMP_CTX *ctx);
|
||||
typedef int (*OSSL_cmp_transfer_cb_t) (OSSL_CMP_CTX *ctx,
|
||||
const OSSL_CMP_MSG *req,
|
||||
OSSL_CMP_MSG **res);
|
||||
typedef int (*OSSL_cmp_transfer_cb_t)(OSSL_CMP_CTX *ctx,
|
||||
const OSSL_CMP_MSG *req,
|
||||
OSSL_CMP_MSG **res);
|
||||
int OSSL_CMP_CTX_set_transfer_cb(OSSL_CMP_CTX *ctx,
|
||||
OSSL_cmp_transfer_cb_t cb);
|
||||
int OSSL_CMP_CTX_set_transfer_cb_arg(OSSL_CMP_CTX *ctx, void *arg);
|
||||
@@ -135,8 +138,8 @@ OSSL_CMP_CTX_set1_senderNonce
|
||||
int OSSL_CMP_CTX_push0_genm_ITAV(OSSL_CMP_CTX *ctx, OSSL_CMP_ITAV *itav);
|
||||
|
||||
/* certificate confirmation: */
|
||||
typedef int (*OSSL_cmp_certConf_cb_t) (OSSL_CMP_CTX *ctx, X509 *cert,
|
||||
int fail_info, const char **txt);
|
||||
typedef int (*OSSL_cmp_certConf_cb_t)(OSSL_CMP_CTX *ctx, X509 *cert,
|
||||
int fail_info, const char **txt);
|
||||
int OSSL_CMP_CTX_set_certConf_cb(OSSL_CMP_CTX *ctx, OSSL_cmp_certConf_cb_t cb);
|
||||
int OSSL_CMP_CTX_set_certConf_cb_arg(OSSL_CMP_CTX *ctx, void *arg);
|
||||
void *OSSL_CMP_CTX_get_certConf_cb_arg(const OSSL_CMP_CTX *ctx);
|
||||
@@ -532,7 +535,8 @@ CertRepMessage or Revocation Response or error message, or NULL if unset.
|
||||
|
||||
OSSL_CMP_CTX_get_failInfoCode() returns the error code from the failInfo field
|
||||
of the last received CertRepMessage or Revocation Response or error message.
|
||||
This is a bit field and the flags for it are specified in L<cmp.h>.
|
||||
This is a bit field and the flags for it are specified in the header file
|
||||
F<< <openssl/cmp.h> >>.
|
||||
The flags start with OSSL_CMP_CTX_FAILINFO, for example:
|
||||
OSSL_CMP_CTX_FAILINFO_badAlg. Returns -1 if the failInfoCode field is unset.
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
OSSL_CMP_CTX_snprint_PKIStatus
|
||||
- function(s) for managing the CMP PKIStatus
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/cmp.h>
|
||||
|
||||
char *OSSL_CMP_CTX_snprint_PKIStatus(OSSL_CMP_CTX *ctx, char *buf, int bufsize);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This is the PKIStatus API for using CMP (Certificate Management Protocol) with
|
||||
OpenSSL.
|
||||
|
||||
OSSL_CMP_CTX_snprint_PKIStatus() takes the PKIStatusInfo components contained
|
||||
in the given CMP context and places a human-readable string created from them
|
||||
in the given buffer, with the given maximal length.
|
||||
On success it returns a copy of the buffer pointer containing the string.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
CMP is defined in RFC 4210 (and CRMF in RFC 4211).
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
OSSL_CMP_CTX_snprint_PKIStatus()
|
||||
returns the intended pointer value as described above or NULL on error.
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
The OpenSSL CMP support was added in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
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
|
||||
@@ -0,0 +1,47 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
OSSL_CMP_HDR_get0_transactionID,
|
||||
OSSL_CMP_HDR_get0_recipNonce
|
||||
- functions manipulating CMP message headers
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/cmp.h>
|
||||
|
||||
ASN1_OCTET_STRING *OSSL_CMP_HDR_get0_transactionID(const
|
||||
OSSL_CMP_PKIHEADER *hdr);
|
||||
ASN1_OCTET_STRING *OSSL_CMP_HDR_get0_recipNonce(const
|
||||
OSSL_CMP_PKIHEADER *hdr);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
OSSL_CMP_HDR_get0_transactionID returns the transaction ID of the given
|
||||
PKIHeader.
|
||||
|
||||
OSSL_CMP_HDR_get0_recipNonce returns the recipient nonce of the given PKIHeader.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
CMP is defined in RFC 4210.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
The functions return the intended pointer value as described above
|
||||
or NULL if the respective entry does not exist and on error.
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
The OpenSSL CMP support was added in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
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
|
||||
@@ -0,0 +1,40 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
OSSL_CMP_MSG_get0_header
|
||||
- function(s) manipulating CMP messages
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/cmp.h>
|
||||
|
||||
OSSL_CMP_PKIHEADER *OSSL_CMP_MSG_get0_header(const OSSL_CMP_MSG *msg);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
OSSL_CMP_MSG_get0_header returns the header of the given CMP message.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
CMP is defined in RFC 4210.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
CMP_MSG_get0_header() returns the intended pointer value as described above
|
||||
or NULL if the respective entry does not exist and on error.
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
The OpenSSL CMP support was added in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
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
|
||||
@@ -23,6 +23,7 @@ OSSL_CMP_LOG_WARNING,
|
||||
OSSL_CMP_LOG_NOTICE,
|
||||
OSSL_CMP_LOG_INFO,
|
||||
OSSL_CMP_LOG_DEBUG,
|
||||
OSSL_cmp_log_cb_t,
|
||||
OSSL_CMP_print_errors_cb
|
||||
- functions for logging and error reporting
|
||||
|
||||
@@ -53,9 +54,9 @@ OSSL_CMP_print_errors_cb
|
||||
#define OSSL_CMP_LOG_NOTICE 5
|
||||
#define OSSL_CMP_LOG_INFO 6
|
||||
#define OSSL_CMP_LOG_DEBUG 7
|
||||
typedef int (*OSSL_cmp_log_cb_t) (const char *component,
|
||||
const char *file, int line,
|
||||
OSSL_CMP_severity level, const char *msg);
|
||||
typedef int (*OSSL_cmp_log_cb_t)(const char *component,
|
||||
const char *file, int line,
|
||||
OSSL_CMP_severity level, const char *msg);
|
||||
|
||||
void OSSL_CMP_print_errors_cb(OSSL_cmp_log_cb_t log_fn);
|
||||
|
||||
|
||||
+18
-6
@@ -100,10 +100,12 @@ accepted, otherwise it specifies the maximum size allowed.
|
||||
=item I<return_size>
|
||||
|
||||
When an array of B<OSSL_PARAM> is used to request data, the
|
||||
I<responder> must set this field to indicate the actual size of the
|
||||
parameter data.
|
||||
In case the I<data_size> is too small for the data, the I<responder>
|
||||
must still set this field to indicate the minimum data size required.
|
||||
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).
|
||||
|
||||
When the B<OSSL_PARAM> is used as a parameter descriptor,
|
||||
I<return_size> should be ignored.
|
||||
@@ -238,8 +240,18 @@ B<OSSL_PARAM_OCTET_STRING>), but this is in no way mandatory.
|
||||
|
||||
If a I<responder> finds that some data sizes are too small for the
|
||||
requested data, it must set I<return_size> for each such
|
||||
B<OSSL_PARAM> item to the required size, and eventually return an
|
||||
error.
|
||||
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>.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ Can be written like this instead:
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<OSSL_PARAM(3)>, L<OSSL_PARAM_TYPE(3)>
|
||||
L<OSSL_PARAM(3)>, L<OSSL_PARAM_int(3)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
OSSL_SELF_TEST_set_callback,
|
||||
OSSL_SELF_TEST_get_callback - specify a callback for processing self tests
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/self_test.h>
|
||||
|
||||
void OSSL_SELF_TEST_set_callback(OPENSSL_CTX *ctx, OSSL_CALLBACK *cb, void *cbarg);
|
||||
void OSSL_SELF_TEST_get_callback(OPENSSL_CTX *ctx, OSSL_CALLBACK **cb, void **cbarg);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Set or gets the optional application callback (and the callback argument) that
|
||||
is called during self testing.
|
||||
The application callback B<OSSL_CALLBACK> is associated with a B<OPENSSL_CTX>.
|
||||
The application callback function receives information about a running self test,
|
||||
and may return a result to the calling self test.
|
||||
See L<openssl-core.h(7)> for further information on the callback.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
OSSL_SELF_TEST_get_callback() returns the callback and callback argument that
|
||||
has been set via OSSL_SELF_TEST_set_callback() for the given library context B<ctx>.
|
||||
These returned parameters will be NULL if OSSL_SELF_TEST_set_callback() has
|
||||
not been called.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<openssl-core.h(7)>,
|
||||
L<OSSL_PROVIDER-FIPS(7)>
|
||||
L<OPENSSL_CTX(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
The functions described here were added in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
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
|
||||
@@ -0,0 +1,129 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
OSSL_SERIALIZER,
|
||||
OSSL_SERIALIZER_fetch,
|
||||
OSSL_SERIALIZER_up_ref,
|
||||
OSSL_SERIALIZER_free,
|
||||
OSSL_SERIALIZER_provider,
|
||||
OSSL_SERIALIZER_properties,
|
||||
OSSL_SERIALIZER_is_a,
|
||||
OSSL_SERIALIZER_number,
|
||||
OSSL_SERIALIZER_do_all_provided,
|
||||
OSSL_SERIALIZER_names_do_all
|
||||
- Serializer method routines
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/serializer.h>
|
||||
|
||||
typedef struct ossl_serializer_st OSSL_SERIALIZER;
|
||||
|
||||
OSSL_SERIALIZER *OSSL_SERIALIZER_fetch(OPENSSL_CTX *ctx, const char *name,
|
||||
const char *properties);
|
||||
int OSSL_SERIALIZER_up_ref(OSSL_SERIALIZER *serializer);
|
||||
void OSSL_SERIALIZER_free(OSSL_SERIALIZER *serializer);
|
||||
const OSSL_PROVIDER *OSSL_SERIALIZER_provider(const OSSL_SERIALIZER
|
||||
*serializer);
|
||||
const char *OSSL_SERIALIZER_properties(const OSSL_SERIALIZER *ser);
|
||||
int OSSL_SERIALIZER_is_a(const OSSL_SERIALIZER *serializer,
|
||||
const char *name);
|
||||
int OSSL_SERIALIZER_number(const OSSL_SERIALIZER *serializer);
|
||||
void OSSL_SERIALIZER_do_all_provided(OPENSSL_CTX *libctx,
|
||||
void (*fn)(OSSL_SERIALIZER *serializer,
|
||||
void *arg),
|
||||
void *arg);
|
||||
void OSSL_SERIALIZER_names_do_all(const OSSL_SERIALIZER *serializer,
|
||||
void (*fn)(const char *name, void *data),
|
||||
void *data);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
=for comment Future development should also talk about deserialization
|
||||
|
||||
B<OSSL_SERIALIZER> is a method for serializers, which know how to
|
||||
serialize an object of some kind to a serialized form, such as PEM,
|
||||
DER, or even human readable text.
|
||||
|
||||
OSSL_SERIALIZER_fetch() looks for an algorithm within the provider that
|
||||
has been loaded into the B<OPENSSL_CTX> given by I<ctx>, having the
|
||||
name given by I<name> and the properties given by I<properties>.
|
||||
The I<name> determines what type of object the fetched serializer
|
||||
method is expected to be able to serialize, and the properties are
|
||||
used to determine the expected output type.
|
||||
For known properties and the values they may have, please have a look
|
||||
in L<provider-serializer(7)/Names and properties>.
|
||||
|
||||
OSSL_SERIALIZER_up_ref() increments the reference count for the given
|
||||
I<serializer>.
|
||||
|
||||
OSSL_SERIALIZER_free() decrements the reference count for the given
|
||||
I<serializer>, and when the count reaches zero, frees it.
|
||||
|
||||
OSSL_SERIALIZER_provider() returns the provider of the given
|
||||
I<serializer>.
|
||||
|
||||
OSSL_SERIALIZER_provider() returns the property definition associated
|
||||
with the given I<serializer>.
|
||||
|
||||
OSSL_SERIALIZER_is_a() checks if I<serializer> is an implementation of an
|
||||
algorithm that's identifiable with I<name>.
|
||||
|
||||
OSSL_SERIALIZER_number() returns the internal dynamic number assigned to
|
||||
the given I<serializer>.
|
||||
|
||||
OSSL_SERIALIZER_names_do_all() traverses all names for the given
|
||||
I<serializer>, and calls I<fn> with each name and I<data>.
|
||||
|
||||
OSSL_SERIALIZER_do_all_provided() traverses all serializer
|
||||
implementations by all activated providers in the library context
|
||||
I<libctx>, and for each of the implementations, calls I<fn> with the
|
||||
implementation method and I<data> as arguments.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
OSSL_SERIALIZER_fetch() may be called implicitly by other fetching
|
||||
functions, using the same library context and properties.
|
||||
Any other API that uses keys will typically do this.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
OSSL_SERIALIZER_fetch() returns a pointer to the key management
|
||||
implementation represented by an OSSL_SERIALIZER object, or NULL on
|
||||
error.
|
||||
|
||||
OSSL_SERIALIZER_up_ref() returns 1 on success, or 0 on error.
|
||||
|
||||
OSSL_SERIALIZER_free() doesn't return any value.
|
||||
|
||||
OSSL_SERIALIZER_provider() returns a pointer to a provider object, or
|
||||
NULL on error.
|
||||
|
||||
OSSL_SERIALIZER_properties() returns a pointer to a property
|
||||
definition string, or NULL on error.
|
||||
|
||||
OSSL_SERIALIZER_is_a() returns 1 of I<serializer> was identifiable,
|
||||
otherwise 0.
|
||||
|
||||
OSSL_SERIALIZER_number() returns an integer.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<provider(7)>, L<OSSL_SERIALIZER_CTX(3)>, L<OSSL_SERIALIZER_to_bio(3)>,
|
||||
L<OSSL_SERIALIZER_CTX_new_by_EVP_PKEY(3)>, L<OPENSSL_CTX(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
The functions described here were added in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
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
|
||||
@@ -0,0 +1,94 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
OSSL_SERIALIZER_CTX,
|
||||
OSSL_SERIALIZER_CTX_new,
|
||||
OSSL_SERIALIZER_CTX_get_serializer,
|
||||
OSSL_SERIALIZER_settable_ctx_params,
|
||||
OSSL_SERIALIZER_CTX_set_params,
|
||||
OSSL_SERIALIZER_CTX_free
|
||||
- Serializer context routines
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/serializer.h>
|
||||
|
||||
typedef struct ossl_serializer_ctx_st OSSL_SERIALIZER_CTX;
|
||||
|
||||
OSSL_SERIALIZER_CTX *OSSL_SERIALIZER_CTX_new(OSSL_SERIALIZER *ser);
|
||||
const OSSL_SERIALIZER *
|
||||
OSSL_SERIALIZER_CTX_get_serializer(OSSL_SERIALIZER_CTX *ctx);
|
||||
const OSSL_PARAM *OSSL_SERIALIZER_settable_ctx_params(OSSL_SERIALIZER *ser);
|
||||
int OSSL_SERIALIZER_CTX_set_params(OSSL_SERIALIZER_CTX *ctx,
|
||||
const OSSL_PARAM params[]);
|
||||
void OSSL_SERIALIZER_CTX_free(OSSL_SERIALIZER_CTX *ctx);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
B<OSSL_SERIALIZER_CTX> is a context with which B<OSSL_SERIALIZER>
|
||||
operations are performed. The context typically holds values, both
|
||||
internal and supplied by the application, which are useful for the
|
||||
implementations supplied by providers.
|
||||
|
||||
OSSL_SERIALIZER_CTX_new() creates a B<OSSL_SERIALIZER_CTX> associated
|
||||
with the serializer I<ser>. NULL is a valid I<ser>, the context will
|
||||
be created anyway, it's just not very useful. This is intentional, to
|
||||
distinguish between errors in allocating the context or assigning it
|
||||
values on one hand, and the lack of serializer support on the other.
|
||||
|
||||
=begin comment
|
||||
|
||||
The above distinction makes it possible for other routines to sense if
|
||||
they need to report an error or fall back on other methods to
|
||||
serialize.
|
||||
|
||||
=end comment
|
||||
|
||||
OSSL_SERIALIZER_CTX_get_serializer() gets the serializer method
|
||||
currently associated with the context I<ctx>.
|
||||
|
||||
OSSL_SERIALIZER_settable_ctx_params() returns an L<OSSL_PARAM(3)>
|
||||
array of parameter descriptors.
|
||||
|
||||
OSSL_SERIALIZER_CTX_set_params() attempts to set parameters specified
|
||||
with an L<OSSL_PARAM(3)> array I<params>. Parameters that the
|
||||
implementation doesn't recognise should be ignored.
|
||||
|
||||
OSSL_SERIALIZER_CTX_free() frees the given context I<ctx>.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
OSSL_SERIALIZER_CTX_new() returns a pointer to a
|
||||
B<OSSL_SERIALIZER_CTX>, or NULL if the context structure couldn't be
|
||||
allocated.
|
||||
|
||||
OSSL_SERIALIZER_CTX_get_serializer() returns a pointer to the
|
||||
serializer method associated with I<ctx>. NULL is a valid return
|
||||
value and signifies that there is no associated serializer method.
|
||||
|
||||
OSSL_SERIALIZER_settable_ctx_params() returns an L<OSSL_PARAM(3)>
|
||||
array, or NULL if none is available.
|
||||
|
||||
OSSL_SERIALIZER_CTX_set_params() returns 1 if all recognised
|
||||
parameters were valid, or 0 if one of them was invalid or caused some
|
||||
other failure in the implementation.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<provider(7)>, L<OSSL_SERIALIZER(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
The functions described here were added in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
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
|
||||
@@ -0,0 +1,134 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
OSSL_SERIALIZER_CTX_new_by_EVP_PKEY,
|
||||
OSSL_SERIALIZER_CTX_set_cipher,
|
||||
OSSL_SERIALIZER_CTX_set_passphrase,
|
||||
OSSL_SERIALIZER_CTX_set_passphrase_cb,
|
||||
OSSL_SERIALIZER_CTX_set_passphrase_ui,
|
||||
OSSL_SERIALIZER_PUBKEY_TO_PEM_PQ,
|
||||
OSSL_SERIALIZER_PrivateKey_TO_PEM_PQ,
|
||||
OSSL_SERIALIZER_Parameters_TO_PEM_PQ,
|
||||
OSSL_SERIALIZER_PUBKEY_TO_TEXT_PQ,
|
||||
OSSL_SERIALIZER_PrivateKey_TO_TEXT_PQ,
|
||||
OSSL_SERIALIZER_Parameters_TO_TEXT_PQ
|
||||
- Serializer routines to serialize EVP_PKEYs
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/serializer.h>
|
||||
|
||||
OSSL_SERIALIZER_CTX *OSSL_SERIALIZER_CTX_new_by_EVP_PKEY(const EVP_PKEY *pkey,
|
||||
const char *propquery);
|
||||
|
||||
int OSSL_SERIALIZER_CTX_set_cipher(OSSL_SERIALIZER_CTX *ctx,
|
||||
const char *cipher_name,
|
||||
const char *propquery);
|
||||
int OSSL_SERIALIZER_CTX_set_passphrase(OSSL_SERIALIZER_CTX *ctx,
|
||||
const unsigned char *kstr,
|
||||
size_t klen);
|
||||
int OSSL_SERIALIZER_CTX_set_passphrase_cb(OSSL_SERIALIZER_CTX *ctx, int enc,
|
||||
pem_password_cb *cb, void *cbarg);
|
||||
int OSSL_SERIALIZER_CTX_set_passphrase_ui(OSSL_SERIALIZER_CTX *ctx,
|
||||
const UI_METHOD *ui_method,
|
||||
void *ui_data);
|
||||
|
||||
#define OSSL_SERIALIZER_PUBKEY_TO_PEM_PQ "format=pem,type=public"
|
||||
#define OSSL_SERIALIZER_PrivateKey_TO_PEM_PQ "format=pem,type=private"
|
||||
#define OSSL_SERIALIZER_Parameters_TO_PEM_PQ "format=pem,type=domainparams"
|
||||
|
||||
#define OSSL_SERIALIZER_PUBKEY_TO_TEXT_PQ "format=text,type=public"
|
||||
#define OSSL_SERIALIZER_PrivateKey_TO_TEXT_PQ "format=text,type=private"
|
||||
#define OSSL_SERIALIZER_Parameters_TO_TEXT_PQ "format=text,type=domainparams"
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
OSSL_SERIALIZER_CTX_new_by_EVP_PKEY() creates a B<OSSL_SERIALIZER_CTX>
|
||||
with a suitable attached output routine for B<EVP_PKEY>s. It will
|
||||
search for a serializer implementation that matches the algorithm of
|
||||
the B<EVP_PKEY> and the property query given with I<propquery>. It
|
||||
will prefer to find a serializer from the same provider as the key
|
||||
data of the B<EVP_PKEY> itself, but failing that, it will choose the
|
||||
first serializer that supplies a generic serializing function.
|
||||
|
||||
If no suitable serializer was found, OSSL_SERIALIZER_CTX_new_by_EVP_PKEY()
|
||||
still creates a B<OSSL_SERIALIZER_CTX>, but with no associated
|
||||
serializer (L<OSSL_SERIALIZER_CTX_get_serializer(3)> returns NULL).
|
||||
This helps the caller distinguish between an error when creating
|
||||
the B<OSSL_SERIALIZER_CTX>, and the lack the serializer support and
|
||||
act accordingly.
|
||||
|
||||
OSSL_SERIALIZER_CTX_set_cipher() tells the implementation what cipher
|
||||
should be used to encrypt serialized keys. The cipher is given by
|
||||
name I<cipher_name>. The interpretation of that I<cipher_name> is
|
||||
implementation dependent. The implementation may implement the digest
|
||||
directly itself or by other implementations, or it may choose to fetch
|
||||
it. If the implementation supports fetching the cipher, then it may
|
||||
use I<propquery> as properties to be queried for when fetching.
|
||||
I<cipher_name> may also be NULL, which will result in unencrypted
|
||||
serialization.
|
||||
|
||||
OSSL_SERIALIZER_CTX_set_passphrase() gives the implementation a
|
||||
pass phrase to use when encrypting the serialized private key.
|
||||
Alternatively, a pass phrase callback may be specified with the
|
||||
following functions.
|
||||
|
||||
OSSL_SERIALIZER_CTX_set_passphrase_cb() and
|
||||
OSSL_SERIALIZER_CTX_set_passphrase_ui() sets up a callback method that
|
||||
the implementation can use to prompt for a pass phrase.
|
||||
|
||||
=for comment Note that the callback method is called indirectly,
|
||||
through an internal B<OSSL_PASSPHRASE_CALLBACK> function.
|
||||
|
||||
The macros B<OSSL_SERIALIZER_PUBKEY_TO_PEM_PQ>,
|
||||
B<OSSL_SERIALIZER_PrivateKey_TO_PEM_PQ>,
|
||||
B<OSSL_SERIALIZER_Parameters_TO_PEM_PQ>,
|
||||
B<OSSL_SERIALIZER_PUBKEY_TO_TEXT_PQ>,
|
||||
B<OSSL_SERIALIZER_PrivateKey_TO_TEXT_PQ>,
|
||||
B<OSSL_SERIALIZER_Parameters_TO_TEXT_PQ> are convenience macros with
|
||||
property queries to serialize the B<EVP_PKEY> as a public key, private
|
||||
key or parameters to B<PEM>, or to text.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
OSSL_SERIALIZER_CTX_new_by_EVP_PKEY() returns a pointer to a
|
||||
B<OSSL_SERIALIZER_CTX>, or NULL if it couldn't be created.
|
||||
|
||||
OSSL_SERIALIZER_CTX_set_cipher(),
|
||||
OSSL_SERIALIZER_CTX_set_passphrase(),
|
||||
OSSL_SERIALIZER_CTX_set_passphrase_cb(), and
|
||||
OSSL_SERIALIZER_CTX_set_passphrase_ui() all return 1 on success, or 0
|
||||
on failure.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
Parts of the function and macro names are made to match already
|
||||
existing OpenSSL names.
|
||||
|
||||
B<EVP_PKEY> in OSSL_SERIALIZER_CTX_new_by_EVP_PKEY() matches the type
|
||||
name, thus making for the naming pattern
|
||||
B<OSSL_SERIALIZER_CTX_new_by_I<TYPE>>() when new types are handled.
|
||||
|
||||
B<PUBKEY>, B<PrivateKey> and B<Parameters> in the macro names match
|
||||
the B<I<TYPE>> part of of B<PEM_write_bio_I<TYPE>> functions as well
|
||||
as B<i2d_I<TYPE>_bio> functions.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<provider(7)>, L<OSSL_SERIALIZER(3)>, L<OSSL_SERIALIZER_CTX(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
The functions described here were added in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
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
|
||||
@@ -0,0 +1,59 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
OSSL_SERIALIZER_to_bio,
|
||||
OSSL_SERIALIZER_to_fp
|
||||
- Serializer file output routines
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/serializer.h>
|
||||
|
||||
int OSSL_SERIALIZER_to_bio(OSSL_SERIALIZER_CTX *ctx, BIO *out);
|
||||
int OSSL_SERIALIZER_to_fp(OSSL_SERIALIZER_CTX *ctx, FILE *fp);
|
||||
|
||||
Feature availability macros:
|
||||
|
||||
=over 4
|
||||
|
||||
=item OSSL_SERIALIZER_to_fp() is only available when B<OPENSSL_NO_STDIO>
|
||||
is undefined.
|
||||
|
||||
=back
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
OSSL_SERIALIZER_to_bio() runs the serialization process for the
|
||||
context I<ctx>, with the output going to the B<BIO> I<out>. The
|
||||
application is required to set up the B<BIO> properly, for example to
|
||||
have it in text or binary mode if that's appropriate.
|
||||
|
||||
=for comment Know your serializer!
|
||||
|
||||
OSSL_SERIALIZER_to_fp() does the same thing as OSSL_SERIALIZER_to_bio(),
|
||||
except that the output is going to the B<FILE> I<fp>.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
OSSL_SERIALIZER_to_bio() and OSSL_SERIALIZER_to_fp() return 1 on
|
||||
success, or 0 on failure.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<provider(7)>, L<OSSL_SERIALIZER_CTX(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
The functions described here were added in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
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
|
||||
@@ -32,7 +32,7 @@ grained search of objects.
|
||||
|
||||
OSSL_STORE_supports_search() checks if the loader of the given OSSL_STORE
|
||||
context supports the given search type.
|
||||
See L<OSSL_STORE_SEARCH/SUPPORTED CRITERION TYPES> for information on the
|
||||
See L<OSSL_STORE_SEARCH(3)/SUPPORTED CRITERION TYPES> for information on the
|
||||
supported search criterion types.
|
||||
|
||||
OSSL_STORE_expect() and OSSL_STORE_find I<must> be called before the first
|
||||
|
||||
@@ -130,11 +130,11 @@ registered very early with L<atexit(3)>.
|
||||
|
||||
=item C<OSSL_TRACE_CATEGORY_TLS>
|
||||
|
||||
Traces the TLS/SSL protocoll.
|
||||
Traces the TLS/SSL protocol.
|
||||
|
||||
=item C<OSSL_TRACE_CATEGORY_TLS_CIPHER>
|
||||
|
||||
Traces the ciphers used by the TLS/SSL protocoll.
|
||||
Traces the ciphers used by the TLS/SSL protocol.
|
||||
|
||||
=item C<OSSL_TRACE_CATEGORY_ENGINE_CONF>
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
OPENSSL_VERSION_MAJOR, OPENSSL_VERSION_MINOR, OPENSSL_VERSION_PATCH,
|
||||
OPENSSL_VERSION_PRE_RELEASE, OPENSSL_VERSION_BUILD_METADATA,
|
||||
OPENSSL_VERSION_PRE_RELEASE_STR, OPENSSL_VERSION_BUILD_METADATA_STR,
|
||||
OPENSSL_VERSION_TEXT,
|
||||
OPENSSL_version_major, OPENSSL_version_minor, OPENSSL_version_patch,
|
||||
OPENSSL_version_pre_release, OPENSSL_version_build_metadata, OpenSSL_version,
|
||||
@@ -20,21 +19,19 @@ OPENSSL_VERSION_NUMBER, OpenSSL_version_num, OPENSSL_info
|
||||
#define OPENSSL_VERSION_PATCH z
|
||||
|
||||
/* The definitions here are typical release values */
|
||||
#undef OPENSSL_VERSION_PRE_RELEASE
|
||||
#undef OPENSSL_VERSION_BUILD_METADATA
|
||||
#define OPENSSL_VERSION_PRE_RELEASE_STR ""
|
||||
#define OPENSSL_VERSION_BUILD_METADATA_STR ""
|
||||
#define OPENSSL_VERSION_PRE_RELEASE ""
|
||||
#define OPENSSL_VERSION_BUILD_METADATA ""
|
||||
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL x.y.z xx XXX xxxx"
|
||||
|
||||
#include <openssl/crypto.h>
|
||||
|
||||
unsigned int OPENSSL_version_major(void);
|
||||
unsigned int OPENSSL_version_minor(void);
|
||||
unsigned int OPENSSL_version_patch(void);
|
||||
const char *OPENSSL_version_pre_release(void);
|
||||
const char *OPENSSL_version_build_metadata(void);
|
||||
|
||||
#include <openssl/crypto.h>
|
||||
|
||||
const char *OpenSSL_version(int t);
|
||||
|
||||
const char *OPENSSL_info(int t);
|
||||
@@ -52,25 +49,24 @@ Deprecated:
|
||||
=head2 Macros
|
||||
|
||||
The three macros B<OPENSSL_VERSION_MAJOR>, B<OPENSSL_VERSION_MINOR> and
|
||||
B<OPENSSL_VERSION_PATCH> represent the three parts of a 3 numbered version
|
||||
number, MAJOR.MINOR.PATCH.
|
||||
B<OPENSSL_VERSION_PATCH> represent the three parts of a version
|
||||
identifier, B<I<MAJOR>.I<MINOR>.I<PATCH>>.
|
||||
|
||||
The macro B<OPENSSL_VERSION_PRE_RELEASE> is an added bit of text that,
|
||||
when defined, indicates that this is a pre-release version, such as
|
||||
C<"-dev"> for an ongoing development snapshot, C<"-alpha3"> for an
|
||||
alpha release, etc...
|
||||
The macro B<OPENSSL_VERSION_PRE_RELEASE> is an added bit of text that
|
||||
indicates that this is a pre-release version, such as C<"-dev"> for an
|
||||
ongoing development snapshot or C<"-alpha3"> for an alpha release.
|
||||
The value must be a string.
|
||||
|
||||
The macro B<OPENSSL_VERSION_BUILD_METADATA> is extra metadata, reserved
|
||||
for other parties (examples: C<"+fips">, C<"+vendor.1">).
|
||||
The OpenSSL project will not touch this macro.
|
||||
The macro B<OPENSSL_VERSION_BUILD_METADATA> is extra information, reserved
|
||||
for other parties, such as C<"+fips">, or C<"+vendor.1">).
|
||||
The OpenSSL project will not touch this macro (will leave it an empty string).
|
||||
The value must be a string.
|
||||
|
||||
B<OPENSSL_VERSION_STR> is a convenience macro to get the short version
|
||||
number string, "MAJOR.MINOR.PATCH".
|
||||
identifier string, C<"I<MAJOR>.I<MINOR>.I<PATCH>">.
|
||||
|
||||
B<OPENSSL_FULL_VERSION_STR> is a convenience macro to get the longer
|
||||
version number string, which combines B<OPENSSL_VERSION_STR>,
|
||||
version identifier string, which combines B<OPENSSL_VERSION_STR>,
|
||||
B<OPENSSL_VERSION_PRE_RELEASE> and B<OPENSSL_VERSION_BUILD_METADATA>.
|
||||
|
||||
B<OPENSSL_VERSION_TEXT> is a convenience macro to get a full descriptive
|
||||
@@ -83,7 +79,7 @@ OPENSSL_version_major(), OPENSSL_version_minor(), OPENSSL_version_patch(),
|
||||
OPENSSL_version_pre_release(), and OPENSSL_version_build_metadata() return
|
||||
the values of the macros above for the build of the library, respectively.
|
||||
|
||||
OpenSSL_version() returns different strings depending on B<t>:
|
||||
OpenSSL_version() returns different strings depending on I<t>:
|
||||
|
||||
=over 4
|
||||
|
||||
@@ -102,33 +98,34 @@ The value of B<OPENSSL_FULL_VERSION_STR>
|
||||
=item OPENSSL_CFLAGS
|
||||
|
||||
The compiler flags set for the compilation process in the form
|
||||
"compiler: ..." if available or "compiler: information not available"
|
||||
C<compiler: ...> if available, or C<compiler: information not available>
|
||||
otherwise.
|
||||
|
||||
=item OPENSSL_BUILT_ON
|
||||
|
||||
The date of the build process in the form "built on: ..." if available
|
||||
or "built on: date not available" otherwise.
|
||||
The date of the build process in the form C<built on: ...> if available
|
||||
or C<built on: date not available> otherwise.
|
||||
The date would not be available in a reproducible build, for example.
|
||||
|
||||
=item OPENSSL_PLATFORM
|
||||
|
||||
The "Configure" target of the library build in the form "platform: ..."
|
||||
if available or "platform: information not available" otherwise.
|
||||
The "Configure" target of the library build in the form C<platform: ...>
|
||||
if available, or C<platform: information not available> otherwise.
|
||||
|
||||
=item OPENSSL_DIR
|
||||
|
||||
The "OPENSSLDIR" setting of the library build in the form "OPENSSLDIR: "...""
|
||||
if available or "OPENSSLDIR: N/A" otherwise.
|
||||
The B<OPENSSLDIR> setting of the library build in the form C<OPENSSLDIR: "...">
|
||||
if available, or C<OPENSSLDIR: N/A> otherwise.
|
||||
|
||||
=item OPENSSL_ENGINES_DIR
|
||||
|
||||
The "ENGINESDIR" setting of the library build in the form "ENGINESDIR: "...""
|
||||
if available or "ENGINESDIR: N/A" otherwise.
|
||||
The B<ENGINESDIR> setting of the library build in the form C<ENGINESDIR: "...">
|
||||
if available, or C<ENGINESDIR: N/A> otherwise.
|
||||
|
||||
=item OPENSSL_MODULES_DIR
|
||||
|
||||
The "MODULESDIR" setting of the library build in the form "MODULESDIR: "...""
|
||||
if available or "MODULESDIR: N/A" otherwise.
|
||||
The B<MODULESDIR> setting of the library build in the form C<MODULESDIR: "...">
|
||||
if available, or C<MODULESDIR: N/A> otherwise.
|
||||
|
||||
=item OPENSSL_CPU_INFO
|
||||
|
||||
@@ -136,14 +133,14 @@ The current OpenSSL cpu settings.
|
||||
This is the current setting of the cpu capability flags. It is usually
|
||||
automatically configured but may be set via an environment variable.
|
||||
The value has the same syntax as the environment variable.
|
||||
For x86 the string looks like "CPUINFO: OPENSSL_ia32cap=0x123:0x456".
|
||||
Or "CPUINFO: N/A" if not available, e.g. no-asm build.
|
||||
For x86 the string looks like C<CPUINFO: OPENSSL_ia32cap=0x123:0x456>
|
||||
or C<CPUINFO: N/A> if not available.
|
||||
|
||||
=back
|
||||
|
||||
For an unknown B<t>, the text "not available" is returned.
|
||||
For an unknown I<t>, the text C<not available> is returned.
|
||||
|
||||
OPENSSL_info() also returns different strings depending on B<t>:
|
||||
OPENSSL_info() also returns different strings depending on I<t>:
|
||||
|
||||
=over 4
|
||||
|
||||
@@ -177,8 +174,8 @@ separator between directory elements.
|
||||
The OpenSSL list separator.
|
||||
This is typically used in strings that are lists of items, such as the
|
||||
value of the environment variable C<$PATH> on Unix (where the
|
||||
separator is ":") or C<%PATH%> on Windows (where the separator is
|
||||
";").
|
||||
separator is C<:>) or C<%PATH%> on Windows (where the separator is
|
||||
C<;>).
|
||||
|
||||
=item OPENSSL_INFO_CPU_SETTINGS
|
||||
|
||||
@@ -186,11 +183,11 @@ The current OpenSSL cpu settings.
|
||||
This is the current setting of the cpu capability flags. It is usually
|
||||
automatically configured but may be set via an environment variable.
|
||||
The value has the same syntax as the environment variable.
|
||||
For x86 the string looks like "OPENSSL_ia32cap=0x123:0x456".
|
||||
For x86 the string looks like C<OPENSSL_ia32cap=0x123:0x456>.
|
||||
|
||||
=back
|
||||
|
||||
For an unknown B<t>, NULL is returned.
|
||||
For an unknown I<t>, NULL is returned.
|
||||
|
||||
=head1 BACKWARD COMPATIBILITY
|
||||
|
||||
|
||||
@@ -35,7 +35,11 @@ PEM_write_bio_PKCS8_PRIV_KEY_INFO,
|
||||
PEM_read_SSL_SESSION,
|
||||
PEM_read_bio_SSL_SESSION,
|
||||
PEM_write_SSL_SESSION,
|
||||
PEM_write_bio_SSL_SESSION
|
||||
PEM_write_bio_SSL_SESSION,
|
||||
PEM_read_X509_PUBKEY,
|
||||
PEM_read_bio_X509_PUBKEY,
|
||||
PEM_write_X509_PUBKEY,
|
||||
PEM_write_bio_X509_PUBKEY
|
||||
- PEM object encoding routines
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
PKCS12_SAFEBAG_get0_attrs, PKCS12_get_attr_gen - Retrieve attributes from a PKCS#12 safeBag
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/pkcs12.h>
|
||||
|
||||
const STACK_OF(X509_ATTRIBUTE) *PKCS12_SAFEBAG_get0_attrs(const PKCS12_SAFEBAG *bag);
|
||||
|
||||
ASN1_TYPE *PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs,
|
||||
int attr_nid)
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
PKCS12_SAFEBAG_get0_attrs() retrieves the stack of B<X509_ATTRIBUTE>s from a
|
||||
PKCS#12 safeBag. I<bag> is the B<PKCS12_SAFEBAG> to retrieve the attributes from.
|
||||
|
||||
PKCS12_get_attr_gen() retrieves an attribute by NID from a stack of
|
||||
B<X509_ATTRIBUTE>s. I<attr_nid> is the NID of the attribute to retrieve.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
PKCS12_SAFEBAG_get0_attrs() returns the stack of B<X509_ATTRIBUTE>s from a
|
||||
PKCS#12 safeBag, which could be empty.
|
||||
|
||||
PKCS12_get_attr_gen() returns an B<ASN1_TYPE> object containing the attribute,
|
||||
or NULL if the attribute was either not present or an error occurred.
|
||||
|
||||
PKCS12_get_attr_gen() does not allocate a new attribute. The returned attribute
|
||||
is still owned by the B<PKCS12_SAFEBAG> in which it resides.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<PKCS12_get_friendlyname(3)>,
|
||||
L<PKCS12_get_localkeyid(3)>,
|
||||
L<PKCS12_add_friendlyname_asc(3)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
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
|
||||
@@ -0,0 +1,36 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
PKCS12_add_CSPName_asc - Add a Microsoft CSP Name attribute to a PKCS#12 safeBag
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/pkcs12.h>
|
||||
|
||||
int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name, int namelen);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
PKCS12_add_CSPName_asc() adds an ASCII string representation of the Microsoft CSP Name attribute to a PKCS#12 safeBag.
|
||||
|
||||
I<bag> is the B<PKCS12_SAFEBAG> to add the attribute to.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
Returns 1 for success or 0 for failure.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<PKCS12_add_friendlyname_asc(3)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
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
|
||||
@@ -0,0 +1,52 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
PKCS12_add_friendlyname_asc, PKCS12_add_friendlyname_utf8,
|
||||
PKCS12_add_friendlyname_uni - Functions to add the friendlyname attribute to a
|
||||
PKCS#12 safeBag
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/pkcs12.h>
|
||||
|
||||
int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name,
|
||||
int namelen);
|
||||
|
||||
int PKCS12_add_friendlyname_utf8(PKCS12_SAFEBAG *bag, const char *name,
|
||||
int namelen);
|
||||
|
||||
int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag,
|
||||
const unsigned char *name, int namelen);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
PKCS12_add_friendlyname_asc() adds an ASCII string representation of the PKCS#9
|
||||
friendlyName attribute to a PKCS#12 safeBag.
|
||||
|
||||
PKCS12_add_friendlyname_utf8() adds a UTF-8 string representation of the PKCS#9
|
||||
friendlyName attribute to a PKCS#12 safeBag.
|
||||
|
||||
PKCS12_add_friendlyname_uni() adds a Unicode string representation of the PKCS#9
|
||||
friendlyName attribute to a PKCS#12 safeBag.
|
||||
|
||||
I<bag> is the B<PKCS12_SAFEBAG> to add the attribute to.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
Returns 1 for success or 0 for failure.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<PKCS12_get_friendlyname(3)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
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
|
||||
@@ -0,0 +1,38 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
PKCS12_add_localkeyid - Add the localKeyId attribute to a PKCS#12 safeBag
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/pkcs12.h>
|
||||
|
||||
int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, const char *name,
|
||||
int namelen);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
PKCS12_add_localkeyid() adds an octet string representation of the PKCS#9
|
||||
localKeyId attribute to a PKCS#12 safeBag.
|
||||
|
||||
I<bag> is the B<PKCS12_SAFEBAG> to add the attribute to.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
Returns 1 for success or 0 for failure.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<PKCS12_add_friendlyname_asc(3)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
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
|
||||
@@ -0,0 +1,39 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
PKCS12_get_friendlyname - Retrieve the friendlyname attribute from a PKCS#12 safeBag
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/pkcs12.h>
|
||||
|
||||
char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
PKCS12_get_friendlyname() retrieves a UTF-8 string representation of the PKCS#9
|
||||
friendlyName attribute for a PKCS#12 safeBag item.
|
||||
|
||||
I<bag> is the B<PKCS12_SAFEBAG> to retrieve the attribute from.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
A UTF-8 string, or NULL if the attribute was either not present or an error occurred.
|
||||
|
||||
The returned string is allocated by OpenSSL and should be freed by the user.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<PKCS12_add_friendlyname_asc(3)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
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
|
||||
@@ -1,68 +0,0 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
RAND_DRBG_set_ex_data,
|
||||
RAND_DRBG_get_ex_data,
|
||||
RAND_DRBG_get_ex_new_index
|
||||
- store and retrieve extra data from the DRBG instance
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/rand_drbg.h>
|
||||
|
||||
int RAND_DRBG_set_ex_data(RAND_DRBG *drbg, int idx, void *data);
|
||||
|
||||
void *RAND_DRBG_get_ex_data(const RAND_DRBG *drbg, int idx);
|
||||
|
||||
int RAND_DRBG_get_ex_new_index(long argl, void *argp,
|
||||
CRYPTO_EX_new *new_func,
|
||||
CRYPTO_EX_dup *dup_func,
|
||||
CRYPTO_EX_free *free_func);
|
||||
|
||||
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
RAND_DRBG_set_ex_data() enables an application to store arbitrary application
|
||||
specific data B<data> in a RAND_DRBG instance B<drbg>. The index B<idx> should
|
||||
be a value previously returned from a call to RAND_DRBG_get_ex_new_index().
|
||||
|
||||
RAND_DRBG_get_ex_data() retrieves application specific data previously stored
|
||||
in an RAND_DRBG instance B<drbg>. The B<idx> value should be the same as that
|
||||
used when originally storing the data.
|
||||
|
||||
For more detailed information see L<CRYPTO_get_ex_data(3)> and
|
||||
L<CRYPTO_set_ex_data(3)> which implement these functions and
|
||||
L<CRYPTO_get_ex_new_index(3)> for generating a unique index.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
RAND_DRBG_set_ex_data() returns 1 for success or 0 for failure.
|
||||
|
||||
RAND_DRBG_get_ex_data() returns the previously stored value or NULL on
|
||||
failure. NULL may also be a valid value.
|
||||
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
RAND_DRBG_get_ex_new_index(...) is implemented as a macro and equivalent to
|
||||
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_DRBG,...).
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<CRYPTO_get_ex_data(3)>,
|
||||
L<CRYPTO_set_ex_data(3)>,
|
||||
L<CRYPTO_get_ex_new_index(3)>,
|
||||
L<RAND_DRBG(7)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
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
|
||||
@@ -48,7 +48,7 @@ Each pointer may be NULL if the function is not implemented.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
RAND_set_rand_method() returns 1 on success and 0 on failue.
|
||||
RAND_set_rand_method() returns 1 on success and 0 on failure.
|
||||
RAND_get_rand_method() and RAND_OpenSSL() return pointers to the respective
|
||||
methods.
|
||||
|
||||
|
||||
@@ -8,6 +8,10 @@ RC4_set_key, RC4 - RC4 encryption
|
||||
|
||||
#include <openssl/rc4.h>
|
||||
|
||||
Deprecated since OpenSSL 3.0, can be hidden entirely by defining
|
||||
B<OPENSSL_API_COMPAT> with a suitable version value, see
|
||||
L<openssl_user_macros(7)>:
|
||||
|
||||
void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);
|
||||
|
||||
void RC4(RC4_KEY *key, unsigned long len, const unsigned char *indata,
|
||||
@@ -15,6 +19,10 @@ RC4_set_key, RC4 - RC4 encryption
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
All of the functions described on this page are deprecated. Applications should
|
||||
instead use L<EVP_EncryptInit_ex(3)>, L<EVP_EncryptUpdate(3)> and
|
||||
L<EVP_EncryptFinal_ex(3)> or the equivalently named decrypt functions.
|
||||
|
||||
This library implements the Alleged RC4 cipher, which is described for
|
||||
example in I<Applied Cryptography>. It is believed to be compatible
|
||||
with RC4[TM], a proprietary cipher of RSA Security Inc.
|
||||
@@ -54,6 +62,10 @@ multiple encryptions using the same key stream.
|
||||
|
||||
L<EVP_EncryptInit(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
All of these functions were deprecated in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
@@ -9,6 +9,10 @@ RIPEMD-160 hash function
|
||||
|
||||
#include <openssl/ripemd.h>
|
||||
|
||||
Deprecated since OpenSSL 3.0, can be hidden entirely by defining
|
||||
B<OPENSSL_API_COMPAT> with a suitable version value, see
|
||||
L<openssl_user_macros(7)>:
|
||||
|
||||
unsigned char *RIPEMD160(const unsigned char *d, unsigned long n,
|
||||
unsigned char *md);
|
||||
|
||||
@@ -18,6 +22,10 @@ RIPEMD-160 hash function
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
All of the functions described on this page are deprecated.
|
||||
Applications should instead use L<EVP_DigestInit_ex(3)>, L<EVP_DigestUpdate(3)>
|
||||
and L<EVP_DigestFinal_ex(3)>.
|
||||
|
||||
RIPEMD-160 is a cryptographic hash function with a
|
||||
160 bit output.
|
||||
|
||||
@@ -59,6 +67,10 @@ ISO/IEC 10118-3:2016 Dedicated Hash-Function 1 (RIPEMD-160).
|
||||
|
||||
L<EVP_DigestInit(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
All of these functions were deprecated in OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
RSA_set0_key, RSA_set0_factors, RSA_set0_crt_params, RSA_get0_key,
|
||||
RSA_get0_factors, RSA_get0_crt_params,
|
||||
RSA_get0_n, RSA_get0_e, RSA_get0_d, RSA_get0_p, RSA_get0_q,
|
||||
RSA_get0_dmp1, RSA_get0_dmq1, RSA_get0_iqmp,
|
||||
RSA_get0_dmp1, RSA_get0_dmq1, RSA_get0_iqmp, RSA_get0_pss_params,
|
||||
RSA_clear_flags,
|
||||
RSA_test_flags, RSA_set_flags, RSA_get0_engine, RSA_get_multi_prime_extra_count,
|
||||
RSA_get0_multi_prime_factors, RSA_get0_multi_prime_crt_params,
|
||||
@@ -33,6 +33,7 @@ RSA_set0_multi_prime_params, RSA_get_version
|
||||
const BIGNUM *RSA_get0_dmp1(const RSA *r);
|
||||
const BIGNUM *RSA_get0_dmq1(const RSA *r);
|
||||
const BIGNUM *RSA_get0_iqmp(const RSA *r);
|
||||
const RSA_PSS_PARAMS *RSA_get0_pss_params(const RSA *r);
|
||||
void RSA_clear_flags(RSA *r, int flags);
|
||||
int RSA_test_flags(const RSA *r, int flags);
|
||||
void RSA_set_flags(RSA *r, int flags);
|
||||
@@ -98,6 +99,8 @@ retrieved separately by the corresponding function
|
||||
RSA_get0_n(), RSA_get0_e(), RSA_get0_d(), RSA_get0_p(), RSA_get0_q(),
|
||||
RSA_get0_dmp1(), RSA_get0_dmq1(), and RSA_get0_iqmp(), respectively.
|
||||
|
||||
RSA_get0_pss_params() is used to retrieve the RSA-PSS parameters.
|
||||
|
||||
RSA_set_flags() sets the flags in the B<flags> parameter on the RSA
|
||||
object. Multiple flags can be passed in one go (bitwise ORed together).
|
||||
Any flags that are already set are left set. RSA_test_flags() tests to
|
||||
@@ -136,6 +139,9 @@ RSA_get0_n(), RSA_get0_e(), RSA_get0_d(), RSA_get0_p(), RSA_get0_q(),
|
||||
RSA_get0_dmp1(), RSA_get0_dmq1(), and RSA_get0_iqmp()
|
||||
return the respective value.
|
||||
|
||||
RSA_get0_pss_params() returns a B<RSA_PSS_PARAMS> pointer, or NULL if
|
||||
there is none.
|
||||
|
||||
RSA_get0_multi_prime_factors() and RSA_get0_multi_prime_crt_params() return
|
||||
1 on success or 0 on failure.
|
||||
|
||||
@@ -157,6 +163,8 @@ L<RSA_new(3)>, L<RSA_size(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
The RSA_get0_pss_params() function was added in OpenSSL 1.1.1e.
|
||||
|
||||
The
|
||||
RSA_get_multi_prime_extra_count(), RSA_get0_multi_prime_factors(),
|
||||
RSA_get0_multi_prime_crt_params(), RSA_set0_multi_prime_params(),
|
||||
|
||||
@@ -125,8 +125,7 @@ RSA_meth_get_multi_prime_keygen, RSA_meth_set_multi_prime_keygen
|
||||
|
||||
The B<RSA_METHOD> type is a structure used for the provision of custom
|
||||
RSA implementations. It provides a set of functions used by OpenSSL
|
||||
for the implementation of the various RSA capabilities. See the L<rsa>
|
||||
page for more information.
|
||||
for the implementation of the various RSA capabilities.
|
||||
|
||||
RSA_meth_new() creates a new B<RSA_METHOD> structure. It should be
|
||||
given a unique B<name> and a set of B<flags>. The B<name> should be a
|
||||
|
||||
@@ -16,7 +16,7 @@ Prints Signed Certificate Timestamps in a human-readable way
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
SCT_print() prints a single Signed Certificate Timestamp (SCT) to a L<bio> in
|
||||
SCT_print() prints a single Signed Certificate Timestamp (SCT) to a B<BIO> in
|
||||
a human-readable format. SCT_LIST_print() prints an entire list of SCTs in a
|
||||
similar way. A separator can be specified to delimit each SCT in the output.
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ The verifier file is a text file containing multiple entries, whose format is:
|
||||
flag base64(verifier) base64(salt) username gNid userinfo(optional)
|
||||
where the flag can be 'V' (valid) or 'R' (revoked).
|
||||
Note that the base64 encoding used here is non-standard so it is recommended
|
||||
to use L<srp(1)> to generate this file.
|
||||
to use L<openssl-srp(1)> to generate this file.
|
||||
|
||||
The SRP_VBASE_add0_user() function adds the B<user_pwd> verifier information
|
||||
to the B<vb> structure. See L<SRP_user_pwd_new(3)> to create and populate this
|
||||
@@ -76,7 +76,7 @@ SRP_VBASE_add0_user() returns 1 on success and 0 on failure.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<srp(1)>,
|
||||
L<openssl-srp(1)>,
|
||||
L<SRP_create_verifier(3)>,
|
||||
L<SRP_user_pwd_new(3)>,
|
||||
L<SSL_CTX_set_srp_password(3)>
|
||||
|
||||
@@ -90,7 +90,7 @@ omitted for clarity):
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<srp(1)>,
|
||||
L<openssl-srp(1)>,
|
||||
L<SRP_VBASE_new(3)>,
|
||||
L<SRP_user_pwd_new(3)>
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ SRP_user_pwd_set0_sv() returns 1 if both B<s> and B<v> are not NULL, 0 otherwise
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<srp(1)>,
|
||||
L<openssl-srp(1)>,
|
||||
L<SRP_create_verifier(3)>,
|
||||
L<SRP_VBASE_new(3)>,
|
||||
L<SSL_CTX_set_srp_password(3)>
|
||||
|
||||
@@ -183,7 +183,7 @@ protocol-specific ID.
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<ssl(7)>, L<SSL_get_current_cipher(3)>,
|
||||
L<SSL_get_ciphers(3)>, L<ciphers(1)>
|
||||
L<SSL_get_ciphers(3)>, L<openssl-ciphers(1)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ SSL_CONF_CTX_free() does not return a value.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<ssl(7)>,
|
||||
L<SSL_CONF_CTX_set_flags(3)>,
|
||||
L<SSL_CONF_CTX_set_ssl_ctx(3)>,
|
||||
L<SSL_CONF_CTX_set1_prefix(3)>,
|
||||
|
||||
@@ -36,6 +36,7 @@ SSL_CONF_CTX_set1_prefix() returns 1 for success and 0 for failure.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<ssl(7)>,
|
||||
L<SSL_CONF_CTX_new(3)>,
|
||||
L<SSL_CONF_CTX_set_flags(3)>,
|
||||
L<SSL_CONF_CTX_set_ssl_ctx(3)>,
|
||||
|
||||
@@ -62,6 +62,7 @@ value after setting or clearing flags.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<ssl(7)>,
|
||||
L<SSL_CONF_CTX_new(3)>,
|
||||
L<SSL_CONF_CTX_set_ssl_ctx(3)>,
|
||||
L<SSL_CONF_CTX_set1_prefix(3)>,
|
||||
|
||||
@@ -34,6 +34,7 @@ SSL_CONF_CTX_set_ssl_ctx() and SSL_CTX_set_ssl() do not return a value.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<ssl(7)>,
|
||||
L<SSL_CONF_CTX_new(3)>,
|
||||
L<SSL_CONF_CTX_set_flags(3)>,
|
||||
L<SSL_CONF_CTX_set1_prefix(3)>,
|
||||
|
||||
@@ -113,7 +113,7 @@ associated with B<cctx>.
|
||||
Sets the available ciphersuites for TLSv1.3 to value. This is a simple colon
|
||||
(":") separated list of TLSv1.3 ciphersuite names in order of preference. This
|
||||
list will be combined any configured TLSv1.2 and below ciphersuites.
|
||||
See L<ciphers(1)> for more information.
|
||||
See L<openssl-ciphers(1)> for more information.
|
||||
|
||||
|
||||
=item B<-cert>
|
||||
@@ -264,7 +264,7 @@ structure is associated with B<cctx>.
|
||||
Sets the available ciphersuites for TLSv1.3 to B<value>. This is a simple colon
|
||||
(":") separated list of TLSv1.3 ciphersuite names in order of preference. This
|
||||
list will be combined any configured TLSv1.2 and below ciphersuites.
|
||||
See L<ciphers(1)> for more information.
|
||||
See L<openssl-ciphers(1)> for more information.
|
||||
|
||||
=item B<Certificate>
|
||||
|
||||
@@ -671,6 +671,7 @@ Set supported curves to P-256, P-384:
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<ssl(7)>,
|
||||
L<SSL_CONF_CTX_new(3)>,
|
||||
L<SSL_CONF_CTX_set_flags(3)>,
|
||||
L<SSL_CONF_CTX_set1_prefix(3)>,
|
||||
|
||||
@@ -29,6 +29,7 @@ to an error: for example a syntax error in the argument.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<ssl(7)>,
|
||||
L<SSL_CONF_CTX_new(3)>,
|
||||
L<SSL_CONF_CTX_set_flags(3)>,
|
||||
L<SSL_CONF_CTX_set1_prefix(3)>,
|
||||
|
||||
@@ -140,6 +140,7 @@ All other functions return 1 for success and 0 for failure.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<ssl(7)>,
|
||||
L<SSL_CTX_add_extra_chain_cert(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
@@ -71,6 +71,7 @@ the need for any additional application code.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<ssl(7)>,
|
||||
L<config(5)>,
|
||||
L<SSL_CONF_cmd(3)>,
|
||||
L<CONF_modules_load_file(3)>
|
||||
|
||||
@@ -348,6 +348,7 @@ L<SSL_set_verify(3)> with B<mode> equal to B<SSL_VERIFY_NONE>.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<ssl(7)>,
|
||||
L<SSL_new(3)>,
|
||||
L<SSL_add1_host(3)>,
|
||||
L<SSL_set_hostflags(3)>,
|
||||
|
||||
@@ -46,6 +46,7 @@ Check hostname matches "www.foo.com" in peer certificate:
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<ssl(7)>,
|
||||
L<X509_VERIFY_PARAM_set_flags(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
@@ -2,36 +2,52 @@
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SSL_CTX_load_verify_locations, SSL_CTX_set_default_verify_paths,
|
||||
SSL_CTX_set_default_verify_dir, SSL_CTX_set_default_verify_file - set
|
||||
default locations for trusted CA certificates
|
||||
SSL_CTX_load_verify_dir, SSL_CTX_load_verify_file,
|
||||
SSL_CTX_load_verify_store, SSL_CTX_set_default_verify_paths,
|
||||
SSL_CTX_set_default_verify_dir, SSL_CTX_set_default_verify_file,
|
||||
SSL_CTX_set_default_verify_store, SSL_CTX_load_verify_locations
|
||||
- set default locations for trusted CA certificates
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#include <openssl/ssl.h>
|
||||
|
||||
int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile,
|
||||
const char *CApath);
|
||||
int SSL_CTX_load_verify_dir(SSL_CTX *ctx, const char *CApath);
|
||||
int SSL_CTX_load_verify_file(SSL_CTX *ctx, const char *CAfile);
|
||||
int SSL_CTX_load_verify_store(SSL_CTX *ctx, const char *CAstore);
|
||||
|
||||
int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx);
|
||||
|
||||
int SSL_CTX_set_default_verify_dir(SSL_CTX *ctx);
|
||||
|
||||
int SSL_CTX_set_default_verify_file(SSL_CTX *ctx);
|
||||
int SSL_CTX_set_default_verify_store(SSL_CTX *ctx);
|
||||
|
||||
Deprecated since OpenSSL 3.0, can be hidden entirely by defining
|
||||
B<OPENSSL_API_COMPAT> with a suitable version value, see
|
||||
L<openssl_user_macros(7)>:
|
||||
|
||||
int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile,
|
||||
const char *CApath);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
SSL_CTX_load_verify_locations() specifies the locations for B<ctx>, at
|
||||
which CA certificates for verification purposes are located. The certificates
|
||||
available via B<CAfile> and B<CApath> are trusted.
|
||||
SSL_CTX_load_verify_dir(), SSL_CTX_load_verify_file(),
|
||||
SSL_CTX_load_verify_store() specifies the locations for B<ctx>, at
|
||||
which CA certificates for verification purposes are located. The
|
||||
certificates available via B<CAfile>, B<CApath> and B<CAstore> are
|
||||
trusted.
|
||||
|
||||
SSL_CTX_set_default_verify_paths() specifies that the default locations from
|
||||
which CA certificates are loaded should be used. There is one default directory
|
||||
and one default file. The default CA certificates directory is called "certs" in
|
||||
the default OpenSSL directory. Alternatively the SSL_CERT_DIR environment
|
||||
variable can be defined to override this location. The default CA certificates
|
||||
file is called "cert.pem" in the default OpenSSL directory. Alternatively the
|
||||
SSL_CERT_FILE environment variable can be defined to override this location.
|
||||
which CA certificates are loaded should be used. There is one default directory,
|
||||
one default file and one default store.
|
||||
The default CA certificates directory is called F<certs> in the default OpenSSL
|
||||
directory, and this is also the default store.
|
||||
Alternatively the B<SSL_CERT_DIR> environment variable can be defined to
|
||||
override this location.
|
||||
The default CA certificates file is called F<cert.pem> in the default
|
||||
OpenSSL directory.
|
||||
Alternatively the B<SSL_CERT_FILE> environment variable can be defined to
|
||||
override this location.
|
||||
|
||||
SSL_CTX_set_default_verify_dir() is similar to
|
||||
SSL_CTX_set_default_verify_paths() except that just the default directory is
|
||||
@@ -41,6 +57,10 @@ SSL_CTX_set_default_verify_file() is similar to
|
||||
SSL_CTX_set_default_verify_paths() except that just the default file is
|
||||
used.
|
||||
|
||||
SSL_CTX_set_default_verify_store() is similar to
|
||||
SSL_CTX_set_default_verify_paths() except that just the default store is
|
||||
used.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
If B<CAfile> is not NULL, it points to a file of CA certificates in PEM
|
||||
@@ -78,6 +98,11 @@ matching the parameters is found, the verification process will be performed;
|
||||
no other certificates for the same parameters will be searched in case of
|
||||
failure.
|
||||
|
||||
If B<CAstore> is not NULL, it's a URI for to a store, which may
|
||||
represent a single container or a whole catalogue of containers.
|
||||
Apart from the B<CAstore> not necessarily being a local file or
|
||||
directory, it's generally treated the same way as a B<CApath>.
|
||||
|
||||
In server mode, when requesting a client certificate, the server must send
|
||||
the list of CAs of which it will accept client certificates. This list
|
||||
is not influenced by the contents of B<CAfile> or B<CApath> and must
|
||||
|
||||
@@ -54,12 +54,18 @@ session cache is realized via callback functions. Inside these callback
|
||||
functions, session can be saved to disk or put into a database using the
|
||||
L<d2i_SSL_SESSION(3)> interface.
|
||||
|
||||
The new_session_cb() is called, whenever a new session has been negotiated
|
||||
and session caching is enabled (see
|
||||
L<SSL_CTX_set_session_cache_mode(3)>).
|
||||
The new_session_cb() is passed the B<ssl> connection and the ssl session
|
||||
B<sess>. If the callback returns B<0>, the session will be immediately
|
||||
removed again. Note that in TLSv1.3, sessions are established after the main
|
||||
The new_session_cb() is called whenever a new session has been negotiated and
|
||||
session caching is enabled (see L<SSL_CTX_set_session_cache_mode(3)>). The
|
||||
new_session_cb() is passed the B<ssl> connection and the ssl session B<sess>.
|
||||
Since sessions are reference-counted objects, the reference count on the
|
||||
session is incremented before the callback, on behalf of the application. If
|
||||
the callback returns B<0>, the session will be immediately removed from the
|
||||
internal cache and the reference count released. If the callback returns B<1>,
|
||||
the application retains the reference (for an entry in the
|
||||
application-maintained "external session cache"), and is responsible for
|
||||
calling SSL_SESSION_free() when the session reference is no longer in use.
|
||||
|
||||
Note that in TLSv1.3, sessions are established after the main
|
||||
handshake has completed. The server decides when to send the client the session
|
||||
information and this may occur some time after the end of the handshake (or not
|
||||
at all). This means that applications should expect the new_session_cb()
|
||||
|
||||
@@ -106,6 +106,7 @@ group.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<ssl(7)>,
|
||||
L<SSL_CTX_add_extra_chain_cert(3)>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
@@ -72,6 +72,7 @@ All these functions return 1 for success and 0 for failure.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<ssl(7)>,
|
||||
L<SSL_CTX_add_extra_chain_cert(3)>
|
||||
L<SSL_CTX_set0_chain(3)>
|
||||
L<SSL_CTX_set1_chain(3)>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user