Latest update.

This commit is contained in:
2020-03-03 19:16:19 +09:00
parent f85de4da03
commit b412d79e8b
310 changed files with 32765 additions and 19720 deletions
+41
View File
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
id="svg2"
viewBox="0 0 973.70528 248.96588"
height="70.263748mm"
width="274.80124mm">
<defs
id="defs4" />
<g
transform="translate(60.758696,-843.33549)"
id="layer1">
<text
id="text3336"
y="1012.3623"
x="3.8487569e-06"
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:180px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold'"
y="1012.3623"
x="3.8487569e-06"
id="tspan3338"><tspan
id="tspan3340"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:180px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#480e0c;fill-opacity:1">Open</tspan>SSL</tspan></text>
<text
id="text817"
y="1049.0681"
x="176.75166"
style="font-style:normal;font-weight:normal;font-size:17.49999619px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.93749976"
xml:space="preserve"><tspan
style="font-size:37.49998856px;stroke-width:0.93749976"
y="1049.0681"
x="176.75166"
id="tspan815">Cryptography and SSL/TLS Toolkit</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

+2 -3
View File
@@ -18,12 +18,11 @@ evp_keymgmt_export, evp_keymgmt_export_types
int evp_keymgmt_get_params(const EVP_KEYMGMT *keymgmt,
void *keydata, OSSL_PARAM params[]);
const OSSL_PARAM *evp_keymgmt_gettable_params(const EVP_KEYMGMT *keymgmt);
int evp_keymgmt_has(const EVP_KEYMGMT *keymgmt, void *keyddata, int selection);
int evp_keymgmt_validate(const EVP_KEYMGMT *keymgmt, void *keydata,
int selection);
int evp_keymgmt_import(const EVP_KEYMGMT *keymgmt, void *keydata,
int selection, const OSSL_PARAM params[]);
const OSSL_PARAM *evp_keymgmt_import_types(const EVP_KEYMGMT *keymgmt,
@@ -3,8 +3,10 @@
=head1 NAME
evp_keymgmt_util_export_to_provider,
evp_keymgmt_util_clear_pkey_cache,
evp_keymgmt_util_cache_pkey,
evp_keymgmt_util_find_operation_cache_index,
evp_keymgmt_util_clear_operation_cache,
evp_keymgmt_util_cache_keydata,
evp_keymgmt_util_cache_keyinfo,
evp_keymgmt_util_fromdata
- internal KEYMGMT utility functions
@@ -13,32 +15,41 @@ evp_keymgmt_util_fromdata
#include "crypto/evp.h"
void *evp_keymgmt_util_export_to_provider(EVP_PKEY *pk, EVP_KEYMGMT *keymgmt);
void evp_keymgmt_util_clear_pkey_cache(EVP_PKEY *pk);
void evp_keymgmt_util_cache_pkey(EVP_PKEY *pk, size_t index,
EVP_KEYMGMT *keymgmt, void *keydata);
size_t evp_keymgmt_util_find_operation_cache_index(EVP_PKEY *pk,
EVP_KEYMGMT *keymgmt);
void evp_keymgmt_util_clear_operation_cache(EVP_PKEY *pk);
void evp_keymgmt_util_cache_keydata(EVP_PKEY *pk, size_t index,
EVP_KEYMGMT *keymgmt, void *keydata);
void evp_keymgmt_util_cache_keyinfo(EVP_PKEY *pk);
void *evp_keymgmt_util_fromdata(EVP_PKEY *target, EVP_KEYMGMT *keymgmt,
int selection, const OSSL_PARAM params[]);
=head1 DESCRIPTION
evp_keymgmt_util_export_to_provider() exports the key material from
the given key I<pk> to a provider via a B<EVP_KEYMGMT> interface, if
this hasn't already been done.
evp_keymgmt_util_export_to_provider() exports cached key material
(provider side key material) from the given key I<pk> to a provider
via a B<EVP_KEYMGMT> interface, if this hasn't already been done.
It maintains a cache of provider key references in I<pk> to keep track
of all such exports.
of all provider side keys.
If I<pk> has an assigned legacy key, a check is done to see if any of
its key material has changed since last export, i.e. the legacy key's
is_dirty() method returns 1.
If it has, the cache of already exported keys is cleared, and a new
export is made with the new key material.
To export a legacy key, use L<evp_pkey_export_to_provider(3)> instead,
as this function ignores any legacy key data.
evp_keymgmt_util_clear_pkey_cache() can be used to explicitly clear
the cache of provider key references.
evp_keymgmt_util_find_operation_cache_index() finds the location if
I<keymgmt> in I<pk>'s cache of provided keys for operations. If
I<keymgmt> is NULL or couldn't be found in the cache, it finds the
first empty slot instead if there is any.
evp_keymgmt_util_cache_pkey() can be used to assign a provider key
evp_keymgmt_util_clear_operation_cache() can be used to explicitly
clear the cache of operation key references.
evp_keymgmt_util_cache_keydata() can be used to assign a provider key
object to a specific cache slot in the given I<target>.
I<Use with extreme care>.
I<Use extreme care>.
evp_keymgmt_util_cache_keyinfo() can be used to get all kinds of
information from the provvider "origin" and save it in I<pk>'s
information cache.
evp_keymgmt_util_fromdata() can be used to add key object data to a
given key I<target> via a B<EVP_KEYMGMT> interface. This is used as a
@@ -50,6 +61,11 @@ evp_keymgmt_export_to_provider() and evp_keymgmt_util_fromdata()
return a pointer to the appropriate provider side key (created or
found again), or NULL on error.
evp_keymgmt_util_find_operation_cache_index() returns the index of the
operation cache slot. If I<keymgmt> is NULL, or if there is no slot
with a match for I<keymgmt>, the index of the first empty slot is
returned, or the maximum number of slots if there isn't an empty one.
=head1 NOTES
"Legacy key" is the term used for any key that has been assigned to an
@@ -0,0 +1,75 @@
=pod
=head1 NAME
evp_pkey_export_to_provider, evp_pkey_upgrade_to_provider
- internal EVP_PKEY support functions for providers
=head1 SYNOPSIS
/* Only for EVP source */
#include "evp_local.h"
void *evp_pkey_export_to_provider(EVP_PKEY *pk, OPENSSL_CTX *libctx,
EVP_KEYMGMT **keymgmt,
const char *propquery);
void *evp_pkey_upgrade_to_provider(EVP_PKEY *pk, OPENSSL_CTX *libctx,
EVP_KEYMGMT **keymgmt,
const char *propquery);
=head1 DESCRIPTION
This manual uses the term "origin", which is explained in internal
L<EVP_PKEY(7)>.
evp_pkey_export_to_provider() exports the "origin" key contained in I<pk>
to its operation cache to make it suitable for an B<EVP_KEYMGMT> given either
with I<*keymgmt> or with an implicit fetch using I<libctx> (NULL means the
default context), the name of the legacy type of I<pk>, and the I<propquery>
(NULL means the default property query settings).
If I<keymgmt> isn't NULL but I<*keymgmt> is, and the "origin" was successfully
exported, then I<*keymgmt> is assigned the implicitly fetched B<EVP_KEYMGMT>.
evp_pkey_upgrade_to_provider() exports the legacy "origin" key contained in
I<pk> to it's provider side counterpart, then clears the legacy "origin" key
along with other legacy data, and resets all the caches. Otherwise, it works
like evp_pkey_export_to_provider().
I<evp_pkey_upgrade_to_provider() must be used with great care, only if there's
no other way.>
Most of the time, it's sufficient to use evp_pkey_export_to_provider(), but in
case the key needs modification with data coming from a provided key, the key
will need an upgrade.
=head1 RETURN VALUES
evp_pkey_export_to_provider() and evp_pkey_upgrade_to_provider() both return
the provider key data that was exported if the "origin" was successfully
exported to its target. Otherwise, NULL is returned.
=head1 NOTES
Some functions calling evp_pkey_export_to_provider() or
evp_pkey_upgrade_to_provider() may have received a const key, and may
therefore have to cast the key to non-const form to call this function. Since
B<EVP_PKEY> is always dynamically allocated, this is OK.
=head1 SEE ALSO
L<OPENSSL_CTX(3)>, L<EVP_KEYMGMT(3)>
=head1 HISTORY
The functions described here were all added in OpenSSL 3.0.
=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
@@ -1,55 +0,0 @@
=pod
=head1 NAME
evp_pkey_make_provided - internal EVP_PKEY support functions for providers
=head1 SYNOPSIS
/* Only for EVP source */
#include "evp_local.h"
void *evp_pkey_make_provided(EVP_PKEY *pk, OPENSSL_CTX *libctx,
EVP_KEYMGMT **keymgmt, const char *propquery);
=head1 DESCRIPTION
evp_pkey_make_provided() ensures that the B<EVP_PKEY> I<pk> is provided within
the library context I<libctx> (NULL means the default context). I<keymgmt>
may point at a reference to a B<EVP_KEYMGMT>, and works as an input/output
parameter.
As input to this function, it can be used to specify a B<EVP_KEYMGMT> to be
used for exporting. If not (I<*keymgmt> is NULL), then this function will
fetch an B<EVP_KEYMGMT> implicitly, using I<propquery> as property query string.
As output from this function, I<*keymgmt> will be assigned the B<EVP_KEYMGMT>
that was used, if the export was successful, otherwise it will be assigned NULL.
=head1 RETURN VALUES
evp_pkey_make_provided() returns the provider key data that was exported if
I<pk> was successfully provided. Otherwise, NULL is returned.
=head1 NOTES
Some functions calling evp_pkey_make_provided() may have received a const
key, and may therefore have to cast the key to non-const form to call this
function. Since B<EVP_PKEY> is always dynamically allocated, this is OK.
=head1 SEE ALSO
L<OPENSSL_CTX(3)>, L<EVP_KEYMGMT(3)>
=head1 HISTORY
The functions described here were all added in OpenSSL 3.0.
=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
+1 -1
View File
@@ -68,7 +68,7 @@ the variable pointed to by I<level> with the severity level or -1,
the variable pointed to by I<func> with the function name string or NULL,
the variable pointed to by I<file> with the filename string or NULL, and
the variable pointed to by I<line> with the line number or -1.
Any string returned via I<*func> and I<*file> must be freeed by the caller.
Any string returned via I<*func> and I<*file> must be freed by the caller.
ossl_cmp_add_error_data() is a macro calling
L<ERR_add_error_txt(3)> with the separator being ":".
+2 -2
View File
@@ -75,7 +75,7 @@ I<val> is stored by value and an expression or auto variable can be used.
ossl_param_bld_push_BN() is a function that will create an OSSL_PARAM object
that holds the specified BIGNUM I<bn>.
If I<bn> is marked as being securely allocated, it's OSSL_PARAM representation
If I<bn> is marked as being securely allocated, its OSSL_PARAM representation
will also be securely allocated.
The I<bn> argument is stored by reference and the underlying BIGNUM object
must exist until after ossl_param_bld_to_param() has been called.
@@ -84,7 +84,7 @@ ossl_param_bld_push_BN_pad() is a function that will create an OSSL_PARAM object
that holds the specified BIGNUM I<bn>.
The object will be padded to occupy exactly I<sz> bytes, if insufficient space
is specified an error results.
If I<bn> is marked as being securely allocated, it's OSSL_PARAM representation
If I<bn> is marked as being securely allocated, its OSSL_PARAM representation
will also be securely allocated.
The I<bn> argument is stored by reference and the underlying BIGNUM object
must exist until after ossl_param_bld_to_param() has been called.
+45
View File
@@ -0,0 +1,45 @@
=pod
=head1 NAME
i2s_ASN1_UTF8STRING,
s2i_ASN1_UTF8STRING,
- convert objects from/to ASN.1/string representation
=head1 SYNOPSIS
=for openssl generic
char *i2s_ASN1_UTF8STRING(X509V3_EXT_METHOD *method,
ASN1_UTF8STRING *utf8);
ASN1_UTF8STRING *s2i_ASN1_UTF8STRING(X509V3_EXT_METHOD *method,
X509V3_CTX *ctx, const char *str);
=head1 DESCRIPTION
These functions convert OpenSSL objects to and from their ASN.1/string
representation. This function is used for B<X509v3> extentions.
=head1 NOTES
The letters B<i> and B<s> in B<i2s_ASN1_UTF8STRING>() stand for
"internal" (that is, an internal C structure) and string respectively.
So B<i2s_ASN1_UTF8STRING>() converts from internal to string.
=head1 RETURN VALUES
B<s2i_ASN1_UTF8STRING>() return a valid
B<ASN1_UTF8STRING> structure or NULL if an error occurs.
B<i2s_ASN1_UTF8STRING>() returns the pointer to a UTF-8 string
or NULL if an error occurs.
=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
+56
View File
@@ -0,0 +1,56 @@
=pod
=head1 NAME
EVP_PKEY - an internal description
=head1 SYNOPSIS
#include "crypto/evp.h"
struct evp_pkey_st;
=head1 DESCRIPTION
I<This is not a complete description yet>
B<EVP_PKEY> is a complex type that's essentially a container for
private/public key key pairs, but has had other uses as well.
=for comment "uses" could as well be "abuses"...
It can contain the legacy form of keys -- i.e. pointers to the low
level key types, such as B<RSA>, B<DSA> and B<EC> --, but also the
provided form of keys -- i.e. pointers to provider side key data.
Those two forms are mutually exclusive; an B<EVP_PKEY> instance can't
contain both a key in legacy form and in provided form. Regardless of
form, this key is commonly refered to as the "origin".
An B<EVP_PKEY> also contains a cache of provider side copies of the
key, each adapted for the provider that is going to use that copy to
perform some operation.
For a legacy "origin", the B<EVP_PKEY_ASN1_METHOD>'s functions
export_to() and dirty_cnt() must be implemented for such caching to be
possible. For a provider side "origin", the B<EVP_KEYMGMT>'s function
OP_keymgmt_export() must be implemented. In all cases, the receiving
B<EVP_KEYMGMT> must have an implemented OP_keygmt_import().
If such caching isn't supported, the operations that can be performed
with that key are limited to the same backend as the "origin" key
(ENGINE for legacy "origin" keys, provider for provider side "origin"
keys).
=head1 SEE ALSO
L<provider-keymgmt(7)>
=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
+39 -17
View File
@@ -24,7 +24,7 @@ B<MODULES=> I<name> ...
B<SCRIPTS=> I<name> ...
B<DEPEND[>I<item>B<]=> I<otheritem> ...
B<DEPEND[>I<items>B<]=> I<otheritem> ...
B<GENERATE[>I<item>B<]=> I<generator> I<generator-args> ...
@@ -32,9 +32,9 @@ B<SOURCE[>I<item>B<]=> I<file> ...
B<SHARED_SOURCE[>I<item>B<]=> I<file> ...
B<DEFINE[>I<item>B<]=> I<name>[B<=>I<value>] ...
B<DEFINE[>I<items>B<]=> I<name>[B<=>I<value>] ...
B<INCLUDE[>I<item>B<]=> I<dir> ...
B<INCLUDE[>I<items>B<]=> I<dir> ...
B<$>I<VARIABLE>B<=>I<value>
@@ -122,7 +122,7 @@ syntax is one of:
=item B<I<KEYWORD>> B<=> I<value> ...
=item B<I<KEYWORD>[>I<item>B<]> B<=> I<value> ...
=item B<I<KEYWORD>[>I<items>B<]> B<=> I<value> ...
=back
@@ -154,8 +154,14 @@ F<foo.c> and F<details.c>, and that it depends on the library
C<libcookie> (in other words, the library will be included when
linking that program together).
For any indexed statement for which the item hasn't been specified
through any plain statement, or where the item exists but the indexed
Multiple space separated items are allowed too:
SOURCE[foo]=foo.c
SOURCE[details]=details.c
DEPEND[foo details]=libcookie
For any indexed statement for which the items haven't been specified
through any plain statement, or where the items exists but the indexed
statement does not apply, the value is simply ignored by the build
file generators.
@@ -169,7 +175,7 @@ variations on how they are treated.
=item B<I<KEYWORD>{> I<attrib> | I<attrib>B<=>I<attrib-value> [,...]B<}>
B<=> I<value> ...
=item B<I<KEYWORD>[>I<item>B<]{> I<attrib> | I<attrib>B<=>I<attrib-value>
=item B<I<KEYWORD>[>I<items>B<]{> I<attrib> | I<attrib>B<=>I<attrib-value>
[,...]B<}> B<=> I<value> ...
=back
@@ -264,6 +270,22 @@ part of is tokenized>.
I<Variable assignment values are not tokenized.>
Variable references can be one of:
=over 4
=item B<$>I<NAME> or B<${>I<NAME>B<}>
Simple reference; the variable reference is replaced with its value,
verbatim.
=item B<${>I<NAME>B</>I<str>B</>I<subst>B<}>
Substitution reference; the variable reference is replaced with its
value, modified by replacing all occurences of I<str> with I<subst>.
=back
=head2 Scope
Most of the statement values are accumulated globally from all the
@@ -411,15 +433,15 @@ C<noinst>, while the script C<bar> will.
=over 4
=item B<DEPEND[>I<item>B<]> B<=> I<file> ...
=item B<DEPEND[>I<items>B<]> B<=> I<file> ...
Collects dependencies, where I<item> depends on the given I<file>s.
Collects dependencies, where I<items> depend on the given I<file>s.
As a special case, the I<item> may be empty, for which the build file
As a special case, the I<items> may be empty, for which the build file
generators should make the whole build depend on the given I<file>s,
rather than some specific I<item>.
rather than the specific I<items>.
The I<item> may be any program, library, module, script, or any
The I<items> may be any program, library, module, script, or any
filename used as a value anywhere.
B<DEPEND> statements may have attributes, which apply to each
@@ -473,19 +495,19 @@ given with B<LIBS> or B<MODULES>. For libraries, the given filenames
are only used for their shared form, so if the item is a library name
ending with C<.a>, the filenames will be ignored.
=item B<DEFINE[>I<item>B<]> B<=> I<name>[B<=>I<value>] ...
=item B<DEFINE[>I<items>B<]> B<=> I<name>[B<=>I<value>] ...
Collects I<name> / I<value> pairs (or just I<name> with no defined
value if no I<value> is given) associated with I<item>.
value if no I<value> is given) associated with I<items>.
The build file generators will decide what to do with them. For
example, these pairs should become C macro definitions whenever a
C<.c> file is built into an object file.
=item B<INCLUDE[>I<item>B<]> B<=> I<dir> ...
=item B<INCLUDE[>I<items>B<]> B<=> I<dir> ...
Collects inclusion directories that will be used when building the
I<item> components (object files and whatever else). This is used at
I<items> components (object files and whatever else). This is used at
the discretion of the build file generators.
=back
@@ -568,7 +590,7 @@ the exception of conditional statements and variable assignments.
=item "indexed statement"
Any F<build.info> statement of the form B<I<KEYWORD>[>I<item>B<]=>I<values>,
Any F<build.info> statement of the form B<I<KEYWORD>[>I<items>B<]=>I<values>,
with the exception of conditional statements.
=item "intermediate file"
+3
View File
@@ -127,6 +127,9 @@ a public key.
=head1 EXAMPLES
Examples equivalent to these can be found in the documentation for the
non-deprecated L<openssl-pkey(1)> command.
To remove the pass phrase on a DSA private key:
openssl dsa -in key.pem -out keyout.pem
+12 -1
View File
@@ -37,6 +37,9 @@ B<openssl> B<ec>
=head1 DESCRIPTION
This command has been deprecated.
The L<openssl-pkey(1)> command should be used instead.
The L<openssl-ec(1)> command processes EC keys. They can be converted between
various forms and their components printed out. B<Note> OpenSSL uses the
private key format specified in 'SEC 1: Elliptic Curve Cryptography'
@@ -142,6 +145,9 @@ This option checks the consistency of an EC private or public key.
=head1 EXAMPLES
Examples equivalent to these can be found in the documentation for the
non-deprecated L<openssl-pkey(1)> command.
To encrypt a private key using triple DES:
openssl ec -in key.pem -des3 -out keyout.pem
@@ -169,13 +175,18 @@ To change the point conversion form to B<compressed>:
=head1 SEE ALSO
L<openssl(1)>,
L<openssl-pkey(1)>,
L<openssl-ecparam(1)>,
L<openssl-dsa(1)>,
L<openssl-rsa(1)>
=head1 HISTORY
This command was deprecated in OpenSSL 3.0.
=head1 COPYRIGHT
Copyright 2003-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2003-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
+14 -1
View File
@@ -31,6 +31,10 @@ B<openssl ecparam>
=head1 DESCRIPTION
This command has been deprecated.
The L<openssl-genpkey(1)> and L<openssl-pkeyparam(1)> commands
should be used instead.
This command is used to manipulate or generate EC parameter files.
OpenSSL is currently not able to generate new groups and therefore
@@ -130,6 +134,9 @@ This option will generate an EC private key using the specified parameters.
=head1 EXAMPLES
Examples equivalent to these can be found in the documentation for the
non-deprecated L<openssl-genpkey(1)> and L<openssl-pkeyparam(1)> commands.
To create EC parameters with the group 'prime192v1':
openssl ecparam -out ec_param.pem -name prime192v1
@@ -157,12 +164,18 @@ To print out the EC parameters to standard output:
=head1 SEE ALSO
L<openssl(1)>,
L<openssl-pkeyparam(1)>,
L<openssl-genpkey(1)>,
L<openssl-ec(1)>,
L<openssl-dsaparam(1)>
=head1 HISTORY
This command was deprecated in OpenSSL 3.0.
=head1 COPYRIGHT
Copyright 2003-2019 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2003-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
+1 -1
View File
@@ -261,7 +261,7 @@ This command does not support authenticated encryption modes
like CCM and GCM, and will not support such modes in the future.
This is due to having to begin streaming output (e.g., to standard output
when B<-out> is not used) before the authentication tag could be validated.
When this command is used in a pipeline, the receiveing end will not be
When this command is used in a pipeline, the receiving end will not be
able to roll back upon authentication failure. The AEAD modes currently in
common use also suffer from catastrophic failure of confidentiality and/or
integrity upon reuse of key/iv/nonce, and since B<openssl enc> places the
+8
View File
@@ -36,6 +36,9 @@ B<openssl> B<genrsa>
=head1 DESCRIPTION
This command has been deprecated.
The L<openssl-genpkey(1)> command should be used instead.
This command generates an RSA private key.
=head1 OPTIONS
@@ -106,8 +109,13 @@ of a key.
=head1 SEE ALSO
L<openssl(1)>,
L<openssl-genpkey(1)>,
L<openssl-gendsa(1)>
=head1 HISTORY
This command was deprecated in OpenSSL 3.0.
=head1 COPYRIGHT
Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
+35 -28
View File
@@ -7,6 +7,8 @@ openssl-ocsp - Online Certificate Status Protocol utility
=head1 SYNOPSIS
=head2 OCSP Client
B<openssl> B<ocsp>
[B<-help>]
[B<-out> I<file>]
@@ -16,19 +18,18 @@ B<openssl> B<ocsp>
[B<-signer> I<file>]
[B<-signkey> I<file>]
[B<-sign_other> I<file>]
[B<-no_certs>]
[B<-nonce>]
[B<-no_nonce>]
[B<-req_text>]
[B<-resp_text>]
[B<-text>]
[B<-no_certs>]
[B<-reqout> I<file>]
[B<-respout> I<file>]
[B<-reqin> I<file>]
[B<-respin> I<file>]
[B<-nonce>]
[B<-no_nonce>]
[B<-url> I<URL>]
[B<-host> I<host>:I<port>]
[B<-multi> I<process-count>]
[B<-header>]
[B<-timeout> I<seconds>]
[B<-path>]
@@ -46,6 +47,10 @@ B<openssl> B<ocsp>
[B<-no_explicit>]
[B<-port> I<num>]
[B<-ignore_err>]
=head2 OCSP Server
B<openssl> B<ocsp>
[B<-index> I<file>]
[B<-CA> I<file>]
[B<-rsigner> I<file>]
@@ -60,6 +65,7 @@ B<openssl> B<ocsp>
[B<-ndays> I<n>]
[B<-resp_key_id>]
[B<-nrequest> I<n>]
[B<-multi> I<process-count>]
[B<-rcid> I<digest>]
[B<-I<digest>>]
{- $OpenSSL::safe::opt_trust_synopsis -}
@@ -171,17 +177,6 @@ the time that the responder is willing to wait for the client request.
This time is measured from the time the responder accepts the connection until
the complete request is received.
=item B<-multi> I<process-count>
Run the specified number of OCSP responder child processes, with the parent
process respawning child processes as needed.
Child processes will detect changes in the CA index file and automatically
reload it.
When running as a responder B<-timeout> option is recommended to limit the time
each child is willing to wait for the client's OCSP response.
This option is available on POSIX systems (that support the fork() and other
required unix system-calls).
=item B<-verify_other> I<file>
File containing additional certificates to search when attempting to locate
@@ -303,19 +298,6 @@ file given with B<-index>.
The certificate to sign OCSP responses with.
=item B<-rother> I<file>
Additional certificates to include in the OCSP response.
=item B<-resp_no_certs>
Don't include any certificates in the OCSP response.
=item B<-resp_key_id>
Identify the signer certificate using the key ID, default is to use the
subject name.
=item B<-rkey> I<file>
The private key to sign OCSP responses with: if not present the file
@@ -326,6 +308,10 @@ specified in the B<-rsigner> option is used.
The private key password source. For more information about the format of I<arg>
see L<openssl(1)/Pass Phrase Options>.
=item B<-rother> I<file>
Additional certificates to include in the OCSP response.
=item B<-rsigopt> I<nm>:I<v>
Pass options to the signature algorithm when signing OCSP responses.
@@ -340,6 +326,15 @@ The digest to use when signing the response.
Corrupt the response signature before writing it; this can be useful
for testing.
=item B<-resp_no_certs>
Don't include any certificates in the OCSP response.
=item B<-resp_key_id>
Identify the signer certificate using the key ID, default is to use the
subject name.
=item B<-port> I<portnum>
Port to listen for OCSP requests on. The port may also be specified
@@ -355,6 +350,18 @@ running instead of terminating upon receiving a malformed request.
The OCSP server will exit after receiving I<number> requests, default unlimited.
=item B<-multi> I<process-count>
Run the specified number of OCSP responder child processes, with the parent
process respawning child processes as needed.
Child processes will detect changes in the CA index file and automatically
reload it.
When running as a responder B<-timeout> option is recommended to limit the time
each child is willing to wait for the client's OCSP response.
This option is available on POSIX systems (that support the fork() and other
required unix system-calls).
=item B<-nmin> I<minutes>, B<-ndays> I<days>
Number of minutes or days when fresh revocation information is available:
+35 -1
View File
@@ -28,6 +28,8 @@ B<openssl> B<pkey>
[B<-pubout>]
[B<-check>]
[B<-pubcheck>]
[B<-ec_conv_form> I<arg>]
[B<-ec_param_enc> I<arg>]
{- $OpenSSL::safe::opt_engine_synopsis -}
=for openssl ifdef engine
@@ -114,13 +116,37 @@ components.
This option checks the correctness of either a public key or the public component
of a key pair.
=item B<-ec_conv_form> I<arg>
This option only applies to elliptic curve based public and private keys.
This specifies how the points on the elliptic curve are converted
into octet strings. Possible values are: B<compressed> (the default
value), B<uncompressed> and B<hybrid>. For more information regarding
the point conversion forms please read the X9.62 standard.
B<Note> Due to patent issues the B<compressed> option is disabled
by default for binary curves and can be enabled by defining
the preprocessor macro B<OPENSSL_EC_BIN_PT_COMP> at compile time.
=item B<-ec_param_enc> I<arg>
This option only applies to elliptic curve based public and private keys.
This specifies how the elliptic curve parameters are encoded.
Possible value are: B<named_curve>, i.e. the ec parameters are
specified by an OID, or B<explicit> where the ec parameters are
explicitly given (see RFC 3279 for the definition of the
EC parameters structures). The default value is B<named_curve>.
B<Note> the B<implicitlyCA> alternative, as specified in RFC 3279,
is currently not implemented in OpenSSL.
{- $OpenSSL::safe::opt_engine_item -}
=back
=head1 EXAMPLES
To remove the pass phrase on an RSA private key:
To remove the pass phrase on a private key:
openssl pkey -in key.pem -out keyout.pem
@@ -144,6 +170,14 @@ To just output the public part of a private key:
openssl pkey -in key.pem -pubout -out pubkey.pem
To change the EC parameters encoding to B<explicit>:
openssl pkey -in key.pem -ec_param_enc explicit -out keyout.pem
To change the EC point conversion form to B<compressed>:
openssl pkey -in key.pem -ec_conv_form compressed -out keyout.pem
=head1 SEE ALSO
L<openssl(1)>,
+11 -3
View File
@@ -20,8 +20,14 @@ I<num>
=head1 DESCRIPTION
This command outputs I<num> pseudo-random bytes after seeding
the random number generator once.
This command generates I<num> random bytes using a cryptographically
secure pseudo random number generator (CSPRNG).
The random bytes are generated using the L<RAND_bytes(3)> function,
which provides a security level of 256 bits, provided it managed to
seed itself successfully from a trusted operating system entropy source.
Otherwise, the command will fail with a non-zero error code.
For more details, see L<RAND_bytes(3)>, L<RAND(7)>, and L<RAND_DRBG(7)>.
=head1 OPTIONS
@@ -52,7 +58,9 @@ Show the output as a hex string.
=head1 SEE ALSO
L<openssl(1)>,
L<RAND_bytes(3)>
L<RAND_bytes(3)>,
L<RAND(7)>,
L<RAND_DRBG(7)>
=head1 COPYRIGHT
+11
View File
@@ -45,6 +45,9 @@ B<openssl> B<rsa>
=head1 DESCRIPTION
This command has been deprecated.
The L<openssl-pkey(1)> command should be used instead.
This command processes RSA keys. They can be converted between
various forms and their components printed out. B<Note> this command uses the
traditional SSLeay compatible format for private key encryption: newer
@@ -137,6 +140,9 @@ Like B<-pubin> and B<-pubout> except B<RSAPublicKey> format is used instead.
=head1 EXAMPLES
Examples equivalent to these can be found in the documentation for the
non-deprecated L<openssl-pkey(1)> command.
To remove the pass phrase on an RSA private key:
openssl rsa -in key.pem -out keyout.pem
@@ -169,11 +175,16 @@ without having to manually edit them.
=head1 SEE ALSO
L<openssl(1)>,
L<openssl-pkey(1)>,
L<openssl-pkcs8(1)>,
L<openssl-dsa(1)>,
L<openssl-genrsa(1)>,
L<openssl-gendsa(1)>
=head1 HISTORY
This command was deprecated in OpenSSL 3.0.
=head1 COPYRIGHT
Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
+11
View File
@@ -38,6 +38,9 @@ B<openssl> B<rsautl>
=head1 DESCRIPTION
This command has been deprecated.
The L<openssl-pkeyutl(1)> command should be used instead.
This command can be used to sign, verify, encrypt and decrypt
data using the RSA algorithm.
@@ -132,6 +135,9 @@ used to sign or verify small pieces of data.
=head1 EXAMPLES
Examples equivalent to these can be found in the documentation for the
non-deprecated L<openssl-pkeyutl(1)> command.
Sign some data using a private key:
openssl rsautl -sign -in file -inkey key.pem -out sig
@@ -219,10 +225,15 @@ which it can be seen agrees with the recovered value above.
=head1 SEE ALSO
L<openssl(1)>,
L<openssl-pkeyutl(1)>,
L<openssl-dgst(1)>,
L<openssl-rsa(1)>,
L<openssl-genrsa(1)>
=head1 HISTORY
This command was deprecated in OpenSSL 3.0.
=head1 COPYRIGHT
Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
+2 -2
View File
@@ -383,12 +383,12 @@ certificate is being created from another certificate (for example with
the B<-signkey> or the B<-CA> options). Normally all extensions are
retained.
=item B<-keyform> B<DER>|B<PEM>
=item B<-keyform> B<DER>|B<PEM>|B<ENGINE>
The key format; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
=item B<-CAform> B<DER>|B<PEM>, B<-CAkeyform> B<DER>|B<PEM>
=item B<-CAform> B<DER>|B<PEM>, B<-CAkeyform> B<DER>|B<PEM>|B<ENGINE>
The format for the CA certificate and key; the default is B<PEM>.
See L<openssl(1)/Format Options> for details.
+2 -2
View File
@@ -795,7 +795,7 @@ B<-xcert>, and B<-xchain> options.
=item B<-xcertform> B<DER>|B<PEM>, B<-xkeyform> B<DER>|B<PEM>
The input format for the extra certifcate and key, respectively.
The input format for the extra certificate and key, respectively.
See L<openssl(1)/Format Options> for details.
=back
@@ -1047,7 +1047,7 @@ OpenSSL provides fine-grain control over how the subject and issuer DN's are
displayed.
This is specified by using the B<-nameopt> option, which takes a
comma-separated list of options from the following set.
An option may be preceeded by a minus sign, C<->, to turn it off.
An option may be preceded by a minus sign, C<->, to turn it off.
The default value is C<oneline>.
The first four are the most commonly used.
+8 -3
View File
@@ -11,8 +11,10 @@ BIO_connect_retry
#include <openssl/bio.h>
#ifndef OPENSSL_NO_SOCK
int BIO_socket_wait(int fd, int for_read, time_t max_time);
int BIO_wait(BIO *bio, time_t max_time);
#endif
int BIO_wait(BIO *bio, time_t max_time, unsigned int milliseconds);
int BIO_connect_retry(BIO *bio, long timeout);
=head1 DESCRIPTION
@@ -21,9 +23,12 @@ BIO_socket_wait() waits on the socket B<fd> for reading if B<for_read> is not 0,
else for writing, at most until B<max_time>.
It succeeds immediately if B<max_time> == 0 (which means no timeout given).
BIO_wait() waits on the socket underlying the given B<bio>, for reading if
B<bio> is supposed to read, else for writing, at most until B<max_time>.
BIO_wait() waits at most until B<max_time> on the given B<bio>,
which is typically socket-based,
for reading if B<bio> is supposed to read, else for writing.
It succeeds immediately if B<max_time> == 0 (which means no timeout given).
If sockets are not available it succeeds after waiting at most given
B<milliseconds> in order to help avoiding a tight busy loop at the caller.
BIO_connect_retry() connects via the given B<bio>, retrying BIO_do_connect()
until success or a timeout or error condition is reached.
+13
View File
@@ -8,12 +8,20 @@ DH_generate_key, DH_compute_key - perform Diffie-Hellman key exchange
#include <openssl/dh.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)>:
int DH_generate_key(DH *dh);
int DH_compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh);
=head1 DESCRIPTION
Both of the functions described on this page are deprecated.
Applications should instead use L<EVP_PKEY_derive_init(3)>
and L<EVP_PKEY_derive(3)>.
DH_generate_key() performs the first step of a Diffie-Hellman key
exchange by generating private and public DH values. By calling
DH_compute_key(), these are combined with the other party's public
@@ -40,8 +48,13 @@ The error codes can be obtained by L<ERR_get_error(3)>.
=head1 SEE ALSO
L<EVP_PKEY_derive(3)>,
L<DH_new(3)>, L<ERR_get_error(3)>, L<RAND_bytes(3)>, L<DH_size(3)>
=head1 HISTORY
Both of these functions were deprecated in OpenSSL 3.0.
=head1 COPYRIGHT
Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
+11
View File
@@ -12,6 +12,10 @@ parameters
#include <openssl/dh.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)>:
int DH_generate_parameters_ex(DH *dh, int prime_len, int generator, BN_GENCB *cb);
int DH_check(DH *dh, int *codes);
@@ -30,6 +34,11 @@ L<openssl_user_macros(7)>:
=head1 DESCRIPTION
All of the functions described on this page are deprecated.
Applications should instead use L<EVP_PKEY_check(3)>,
L<EVP_PKEY_public_check(3)>, L<EVP_PKEY_private_check(3)> and
L<EVP_PKEY_param_check(3)>.
DH_generate_parameters_ex() generates Diffie-Hellman parameters that can
be shared among a group of users, and stores them in the provided B<DH>
structure. The pseudo-random number generator must be
@@ -144,6 +153,8 @@ L<DH_free(3)>
=head1 HISTORY
All of these functions were deprecated in OpenSSL 3.0.
DH_generate_parameters() was deprecated in OpenSSL 0.9.8; use
DH_generate_parameters_ex() instead.
+11 -2
View File
@@ -26,6 +26,11 @@ DH_get_length, DH_set_length - Routines for getting and setting data in a DH obj
void DH_clear_flags(DH *dh, int flags);
int DH_test_flags(const DH *dh, int flags);
void DH_set_flags(DH *dh, int flags);
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)>:
ENGINE *DH_get0_engine(DH *d);
long DH_get_length(const DH *dh);
int DH_set_length(DH *dh, long length);
@@ -78,12 +83,13 @@ zero if none of the flags are set. DH_clear_flags() clears the specified flags
within the DH object.
DH_get0_engine() returns a handle to the ENGINE that has been set for this DH
object, or NULL if no such ENGINE has been set.
object, or NULL if no such ENGINE has been set. This function is deprecated.
The DH_get_length() and DH_set_length() functions get and set the optional
length parameter associated with this DH object. If the length is nonzero then
it is used, otherwise it is ignored. The B<length> parameter indicates the
length of the secret exponent (private key) in bits.
length of the secret exponent (private key) in bits. These functions are
deprecated.
=head1 NOTES
@@ -114,6 +120,9 @@ L<DH_set_method(3)>, L<DH_size(3)>, L<DH_meth_new(3)>
=head1 HISTORY
The DH_get0_engine(), DH_get_length() and DH_set_length() functions were
deprecated in OpenSSL 3.0.
The functions described here were added in OpenSSL 1.1.0.
=head1 COPYRIGHT
+9
View File
@@ -14,6 +14,10 @@ DH_meth_set_generate_params - Routines to build up DH methods
#include <openssl/dh.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)>:
DH_METHOD *DH_meth_new(const char *name, int flags);
void DH_meth_free(DH_METHOD *dhm);
@@ -58,6 +62,9 @@ DH_meth_set_generate_params - Routines to build up DH methods
=head1 DESCRIPTION
All of the functions described on this page are deprecated.
Applications should instead use the provider APIs.
The B<DH_METHOD> type is a structure used for the provision of custom DH
implementations. It provides a set of functions used by OpenSSL for the
implementation of the various DH capabilities.
@@ -153,6 +160,8 @@ L<DH_set_method(3)>, L<DH_size(3)>, L<DH_get0_pqg(3)>
=head1 HISTORY
All of these functions were deprecated in OpenSSL 3.0.
The functions described here were added in OpenSSL 1.1.0.
=head1 COPYRIGHT
+10 -2
View File
@@ -8,6 +8,11 @@ DH_new_by_nid, DH_get_nid - get or find DH named parameters
#include <openssl/dh.h>
DH *DH_new_by_nid(int nid);
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 *DH_get_nid(DH *dh);
=head1 DESCRIPTION
@@ -18,10 +23,9 @@ B<NID_ffdhe4096>, B<NID_ffdhe6144>, B<NID_ffdhe8192>,
B<NID_modp_1536>, B<NID_modp_2048>, B<NID_modp_3072>,
B<NID_modp_4096>, B<NID_modp_6144> or B<NID_modp_8192>.
DH_get_nid() determines if the parameters contained in B<dh> match
any named set. It returns the NID corresponding to the matching parameters or
B<NID_undef> if there is no match.
B<NID_undef> if there is no match. This function is deprecated.
=head1 RETURN VALUES
@@ -30,6 +34,10 @@ DH_new_by_nid() returns a set of DH parameters or B<NULL> if an error occurred.
DH_get_nid() returns the NID of the matching set of parameters or
B<NID_undef> if there is no match.
=head1 HISTORY
The DH_get_nid() function was deprecated in OpenSSL 3.0.
=head1 COPYRIGHT
Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.
+11
View File
@@ -9,6 +9,10 @@ DH_set_method, DH_new_method, DH_OpenSSL - select DH method
#include <openssl/dh.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 DH_set_default_method(const DH_METHOD *meth);
const DH_METHOD *DH_get_default_method(void);
@@ -21,6 +25,9 @@ DH_set_method, DH_new_method, DH_OpenSSL - select DH method
=head1 DESCRIPTION
All of the functions described on this page are deprecated.
Applications should instead use the provider APIs.
A B<DH_METHOD> specifies the functions that OpenSSL uses for Diffie-Hellman
operations. By modifying the method, alternative implementations
such as hardware accelerators may be used. IMPORTANT: See the NOTES section for
@@ -76,6 +83,10 @@ returns a pointer to the newly allocated structure.
L<DH_new(3)>, L<DH_new(3)>, L<DH_meth_new(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.
+11
View File
@@ -9,6 +9,10 @@ security bits
#include <openssl/dh.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)>:
int DH_size(const DH *dh);
int DH_bits(const DH *dh);
@@ -17,6 +21,10 @@ security bits
=head1 DESCRIPTION
All of the functions described on this page are deprecated.
Applications should instead use L<EVP_PKEY_bits(3)>,
L<EVP_PKEY_security_bits(3)> and L<EVP_PKEY_size(3)>.
DH_size() returns the Diffie-Hellman prime size in bytes. It can be used
to determine how much memory must be allocated for the shared secret
computed by L<DH_compute_key(3)>.
@@ -38,11 +46,14 @@ DH_security_bits() returns the number of security bits.
=head1 SEE ALSO
L<EVP_PKEY_bits(3)>,
L<DH_new(3)>, L<DH_generate_key(3)>,
L<BN_num_bits(3)>
=head1 HISTORY
All of these functions were deprecated in OpenSSL 3.0.
The DH_bits() function was added in OpenSSL 1.1.0.
=head1 COPYRIGHT
+12
View File
@@ -8,10 +8,18 @@ DSA_dup_DH - create a DH structure out of DSA structure
#include <openssl/dsa.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)>:
DH *DSA_dup_DH(const DSA *r);
=head1 DESCRIPTION
The function described on this page is deprecated. There is no direct
replacement, applications should use the EVP_PKEY APIs for Diffie-Hellman
operations.
DSA_dup_DH() duplicates DSA parameters/keys as DH parameters/keys. q
is lost during that conversion, but the resulting DH parameters
contain its length.
@@ -29,6 +37,10 @@ Be careful to avoid small subgroup attacks when using this.
L<DH_new(3)>, L<DSA_new(3)>, L<ERR_get_error(3)>
=head1 HISTORY
This function was deprecated in OpenSSL 3.0.
=head1 COPYRIGHT
Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
+2 -2
View File
@@ -331,7 +331,7 @@ EVP_MAC_do_all_provided() returns nothing at all.
if (!EVP_MAC_init(ctx))
goto err;
while ( (read_l = read(STDIN_FILENO, buf, sizeof(buf))) < 0) {
while ( (read_l = read(STDIN_FILENO, buf, sizeof(buf))) > 0) {
if (!EVP_MAC_update(ctx, buf, read_l))
goto err;
}
@@ -361,7 +361,7 @@ look like this:
$ MY_MAC=cmac MY_KEY=secret0123456789 MY_MAC_CIPHER=aes-128-cbc \
LD_LIBRARY_PATH=. ./foo < foo.c
Result: ECCAAFF041B22A2299EB90A1B53B6D45
Result: C5C06683CD9DDEF904D754505C560A4E
(in this example, that program was stored in F<foo.c> and compiled to
F<./foo>)
+110 -93
View File
@@ -94,8 +94,8 @@ EVP_PKEY_CTX_set1_id, EVP_PKEY_CTX_get1_id, EVP_PKEY_CTX_get1_id_len
int EVP_PKEY_CTX_set_rsa_padding(EVP_PKEY_CTX *ctx, int pad);
int EVP_PKEY_CTX_get_rsa_padding(EVP_PKEY_CTX *ctx, int *pad);
int EVP_PKEY_CTX_set_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, int len);
int EVP_PKEY_CTX_get_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, int *len);
int EVP_PKEY_CTX_set_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, int saltlen);
int EVP_PKEY_CTX_get_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, int *saltlen);
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);
@@ -178,7 +178,7 @@ The parameters currently supported by the default provider are:
Sets the DH padding mode.
If B<OSSL_EXCHANGE_PARAM_PAD> is 1 then the shared secret is padded with zeros
up to the size of the DH prime B<p>.
up to the size of the DH prime I<p>.
If B<OSSL_EXCHANGE_PARAM_PAD> is zero (the default) then no padding is
performed.
@@ -206,29 +206,29 @@ These functions must only be called after the EVP_PKEY_CTX has been initialised
for use in an operation.
The function EVP_PKEY_CTX_ctrl() sends a control operation to the context
B<ctx>. The key type used must match B<keytype> if it is not -1. The parameter
B<optype> is a mask indicating which operations the control can be applied to.
The control command is indicated in B<cmd> and any additional arguments in
B<p1> and B<p2>.
I<ctx>. The key type used must match I<keytype> if it is not -1. The parameter
I<optype> is a mask indicating which operations the control can be applied to.
The control command is indicated in I<cmd> and any additional arguments in
I<p1> and I<p2>.
For B<cmd> = B<EVP_PKEY_CTRL_SET_MAC_KEY>, B<p1> is the length of the MAC key,
and B<p2> is MAC key. This is used by Poly1305, SipHash, HMAC and CMAC.
For I<cmd> = B<EVP_PKEY_CTRL_SET_MAC_KEY>, I<p1> is the length of the MAC key,
and I<p2> is the MAC key. This is used by Poly1305, SipHash, HMAC and CMAC.
Applications will not normally call EVP_PKEY_CTX_ctrl() directly but will
instead call one of the algorithm specific macros below.
The function EVP_PKEY_CTX_ctrl_uint64() is a wrapper that directly passes a
uint64 value as B<p2> to EVP_PKEY_CTX_ctrl().
uint64 value as I<p2> to EVP_PKEY_CTX_ctrl().
The function EVP_PKEY_CTX_ctrl_str() allows an application to send an algorithm
specific control operation to a context B<ctx> in string form. This is
specific control operation to a context I<ctx> in string form. This is
intended to be used for options specified on the command line or in text
files. The commands supported are documented in the openssl utility
command line pages for the option B<-pkeyopt> which is supported by the
B<pkeyutl>, B<genpkey> and B<req> commands.
command line pages for the option I<-pkeyopt> which is supported by the
I<pkeyutl>, I<genpkey> and I<req> commands.
The function EVP_PKEY_CTX_md() sends a message digest control operation
to the context B<ctx>. The message digest is specified by its name B<md>.
to the context I<ctx>. The message digest is specified by its name I<md>.
The EVP_PKEY_CTX_set_signature_md() function sets the message digest type used
in a signature. It can be used in the RSA, DSA and ECDSA algorithms.
@@ -251,8 +251,8 @@ supported by the L<EVP_PKEY_new_raw_private_key(3)> function.
=head2 RSA parameters
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
The EVP_PKEY_CTX_set_rsa_padding() function sets the RSA padding mode for I<ctx>.
The I<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
@@ -270,45 +270,61 @@ 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() function gets the RSA padding mode for B<ctx>.
The EVP_PKEY_CTX_get_rsa_padding() function gets the RSA padding mode for I<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
values are supported: B<RSA_PSS_SALTLEN_DIGEST> sets the salt length to the
digest length, B<RSA_PSS_SALTLEN_MAX> sets the salt length to the maximum
permissible value. When verifying B<RSA_PSS_SALTLEN_AUTO> causes the salt length
to be automatically determined based on the B<PSS> block structure. If this
macro is not called maximum salt length is used when signing and auto detection
when verifying is used by default.
The EVP_PKEY_CTX_set_rsa_pss_saltlen() function sets the RSA PSS salt
length to I<saltlen>. As its name implies it is only supported for PSS
padding. If this function is not called then the maximum salt length
is used when signing and auto detection when verifying. Three special
values are supported:
The EVP_PKEY_CTX_get_rsa_pss_saltlen() macro gets the RSA PSS salt length
for B<ctx>. The padding mode must have been set to B<RSA_PKCS1_PSS_PADDING>.
=over 4
=item B<RSA_PSS_SALTLEN_DIGEST>
sets the salt length to the digest length.
=item B<RSA_PSS_SALTLEN_MAX>
sets the salt length to the maximum permissible value.
=item B<RSA_PSS_SALTLEN_AUTO>
causes the salt length to be automatically determined based on the
B<PSS> block structure when verifying. When signing, it has the same
meaning as B<RSA_PSS_SALTLEN_MAX>.
=back
The EVP_PKEY_CTX_get_rsa_pss_saltlen() function gets the RSA PSS salt length
for I<ctx>. The padding mode must already have been set to
B<RSA_PKCS1_PSS_PADDING>.
The EVP_PKEY_CTX_set_rsa_keygen_bits() macro sets the RSA key length for
RSA key generation to B<bits>. If not specified 1024 bits is used.
RSA key generation to I<bits>. If not specified 2048 bits is used.
The EVP_PKEY_CTX_set_rsa_keygen_pubexp() macro sets the public exponent value
for RSA key generation to B<pubexp>. Currently it should be an odd integer. The
B<pubexp> pointer is used internally by this function so it should not be
for RSA key generation to I<pubexp>. Currently it should be an odd integer. The
I<pubexp> pointer is used internally by this function so it should not be
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.
RSA key generation to I<primes>. If not specified 2 is used.
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
padding schemes to the digest named I<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
fetched using the properties I<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_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
inferred from the supplied I<md> and it is not possible to specify any
properties.
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.
digest algorithm for I<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>.
@@ -319,19 +335,19 @@ 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
used in RSA OAEP to the digest named I<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
fetched using the properties I<mdprops>. 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
inferred from the supplied I<md> and it is not possible to specify any
properties.
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
algorithm name used in RSA OAEP and stores it in the buffer I<name> which is of
size I<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.
@@ -342,13 +358,13 @@ 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,
I<label> and its length to I<len>. If I<label> is NULL or I<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>.
caller should not free the original memory pointed to by I<label>.
The padding mode must have been set to B<RSA_PKCS1_OAEP_PADDING>.
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
I<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.
@@ -374,31 +390,31 @@ 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
for DSA parameter generation to B<nbits>. If not specified, 1024 is used.
for DSA parameter generation to I<nbits>. If not specified, 2048 is used.
The EVP_PKEY_CTX_set_dsa_paramgen_q_bits() macro sets the number of bits in the
subprime parameter B<q> for DSA parameter generation to B<qbits>. If not
specified, 160 is used. If a digest function is specified below, this parameter
is ignored and instead, the number of bits in B<q> matches the size of the
subprime parameter I<q> for DSA parameter generation to I<qbits>. If not
specified, 224 is used. If a digest function is specified below, this parameter
is ignored and instead, the number of bits in I<q> matches the size of the
digest.
The EVP_PKEY_CTX_set_dsa_paramgen_md() macro sets the digest function used for
DSA parameter generation to B<md>. If not specified, one of SHA-1, SHA-224, or
SHA-256 is selected to match the bit length of B<q> above.
DSA parameter generation to I<md>. If not specified, one of SHA-1, SHA-224, or
SHA-256 is selected to match the bit length of I<q> above.
=head2 DH parameters
The EVP_PKEY_CTX_set_dh_paramgen_prime_len() macro sets the length of the DH
prime parameter B<p> for DH parameter generation. If this macro is not called
prime parameter I<p> for DH parameter generation. If this macro is not called
then 2048 is used. Only accepts lengths greater than or equal to 256.
The EVP_PKEY_CTX_set_dh_paramgen_subprime_len() macro sets the length of the DH
optional subprime parameter B<q> for DH parameter generation. The default is
optional subprime parameter I<q> for DH parameter generation. The default is
256 if the prime is at least 2048 bits long or 160 otherwise. The DH
paramgen type must have been set to B<DH_PARAMGEN_TYPE_FIPS_186_2> or
B<DH_PARAMGEN_TYPE_FIPS_186_4>.
The EVP_PKEY_CTX_set_dh_paramgen_generator() macro sets DH generator to B<gen>
The EVP_PKEY_CTX_set_dh_paramgen_generator() macro sets DH generator to I<gen>
for DH parameter generation. If not specified 2 is used.
The EVP_PKEY_CTX_set_dh_paramgen_type() macro sets the key type for DH
@@ -423,12 +439,12 @@ FIPS186-4 FFC parameter generator.
The default is B<DH_PARAMGEN_TYPE_GENERATOR>.
The EVP_PKEY_CTX_set_dh_pad() function sets the DH padding mode.
If B<pad> is 1 the shared secret is padded with zeros up to the size of the DH
prime B<p>.
If B<pad> is zero (the default) then no padding is performed.
If I<pad> is 1 the shared secret is padded with zeros up to the size of the DH
prime I<p>.
If I<pad> is zero (the default) then no padding is performed.
EVP_PKEY_CTX_set_dh_nid() sets the DH parameters to values corresponding to
B<nid> as defined in RFC7919 or RFC3526. The B<nid> parameter must be
I<nid> as defined in RFC7919 or RFC3526. The I<nid> parameter must be
B<NID_ffdhe2048>, B<NID_ffdhe3072>, B<NID_ffdhe4096>, B<NID_ffdhe6144>,
B<NID_ffdhe8192>, B<NID_modp_1536>, B<NID_modp_2048>, B<NID_modp_3072>,
B<NID_modp_4096>, B<NID_modp_6144>, B<NID_modp_8192> or B<NID_undef> to clear
@@ -437,74 +453,74 @@ The nid parameter and the rfc5114 parameter are mutually exclusive.
The EVP_PKEY_CTX_set_dh_rfc5114() and EVP_PKEY_CTX_set_dhx_rfc5114() macros are
synonymous. They set the DH parameters to the values defined in RFC5114. The
B<rfc5114> parameter must be 1, 2 or 3 corresponding to RFC5114 sections
I<rfc5114> parameter must be 1, 2 or 3 corresponding to RFC5114 sections
2.1, 2.2 and 2.3. or 0 to clear the stored value. This macro can be called
during parameter generation. The B<ctx> must have a key type of
during parameter generation. The I<ctx> must have a key type of
B<EVP_PKEY_DHX>.
The rfc5114 parameter and the nid parameter are mutually exclusive.
=head2 DH key derivation function parameters
Note that all of the following functions require that the B<ctx> parameter has
Note that all of the following functions require that the I<ctx> parameter has
a private key type of B<EVP_PKEY_DHX>. When using key derivation, the output of
EVP_PKEY_derive() is the output of the KDF instead of the DH shared secret.
The KDF output is typically used as a Key Encryption Key (KEK) that in turn
encrypts a Content Encryption Key (CEK).
The EVP_PKEY_CTX_set_dh_kdf_type() macro sets the key derivation function type
to B<kdf> for DH key derivation. Possible values are B<EVP_PKEY_DH_KDF_NONE>
to I<kdf> for DH key derivation. Possible values are B<EVP_PKEY_DH_KDF_NONE>
and B<EVP_PKEY_DH_KDF_X9_42> which uses the key derivation specified in RFC2631
(based on the keying algorithm described in X9.42). When using key derivation,
the B<kdf_oid>, B<kdf_md> and B<kdf_outlen> parameters must also be specified.
the I<kdf_oid>, I<kdf_md> and I<kdf_outlen> parameters must also be specified.
The EVP_PKEY_CTX_get_dh_kdf_type() macro gets the key derivation function type
for B<ctx> used for DH key derivation. Possible values are B<EVP_PKEY_DH_KDF_NONE>
for I<ctx> used for DH key derivation. Possible values are B<EVP_PKEY_DH_KDF_NONE>
and B<EVP_PKEY_DH_KDF_X9_42>.
The EVP_PKEY_CTX_set0_dh_kdf_oid() macro sets the key derivation function
object identifier to B<oid> for DH key derivation. This OID should identify
object identifier to I<oid> for DH key derivation. This OID should identify
the algorithm to be used with the Content Encryption Key.
The library takes ownership of the object identifier so the caller should not
free the original memory pointed to by B<oid>.
free the original memory pointed to by I<oid>.
The EVP_PKEY_CTX_get0_dh_kdf_oid() macro gets the key derivation function oid
for B<ctx> used for DH key derivation. The resulting pointer is owned by the
for I<ctx> used for DH key derivation. The resulting pointer is owned by the
library and should not be freed by the caller.
The EVP_PKEY_CTX_set_dh_kdf_md() macro sets the key derivation function
message digest to B<md> for DH key derivation. Note that RFC2631 specifies
message digest to I<md> for DH key derivation. Note that RFC2631 specifies
that this digest should be SHA1 but OpenSSL tolerates other digests.
The EVP_PKEY_CTX_get_dh_kdf_md() macro gets the key derivation function
message digest for B<ctx> used for DH key derivation.
message digest for I<ctx> used for DH key derivation.
The EVP_PKEY_CTX_set_dh_kdf_outlen() macro sets the key derivation function
output length to B<len> for DH key derivation.
output length to I<len> for DH key derivation.
The EVP_PKEY_CTX_get_dh_kdf_outlen() macro gets the key derivation function
output length for B<ctx> used for DH key derivation.
output length for I<ctx> used for DH key derivation.
The EVP_PKEY_CTX_set0_dh_kdf_ukm() macro sets the user key material to
B<ukm> and its length to B<len> for DH key derivation. This parameter is optional
I<ukm> and its length to I<len> for DH key derivation. This parameter is optional
and corresponds to the partyAInfo field in RFC2631 terms. The specification
requires that it is 512 bits long but this is not enforced by OpenSSL.
The library takes ownership of the user key material so the caller should not
free the original memory pointed to by B<ukm>.
free the original memory pointed to by I<ukm>.
The EVP_PKEY_CTX_get0_dh_kdf_ukm() macro gets the user key material for B<ctx>.
The EVP_PKEY_CTX_get0_dh_kdf_ukm() macro gets the user key material for I<ctx>.
The return value is the user key material length. The resulting pointer is owned
by the library and should not be freed by the caller.
=head2 EC parameters
The EVP_PKEY_CTX_set_ec_paramgen_curve_nid() sets the EC curve for EC parameter
generation to B<nid>. For EC parameter generation this macro must be called
generation to I<nid>. For EC parameter generation this macro must be called
or an error occurs because there is no default curve.
This function can also be called to set the curve explicitly when
generating an EC key.
The EVP_PKEY_CTX_set_ec_param_enc() macro sets the EC parameter encoding to
B<param_enc> when generating EC parameters or an EC key. The encoding can be
I<param_enc> when generating EC parameters or an EC key. The encoding can be
B<OPENSSL_EC_EXPLICIT_CURVE> for explicit parameters (the default in versions
of OpenSSL before 1.1.0) or B<OPENSSL_EC_NAMED_CURVE> to use named curve form.
For maximum compatibility the named curve form should be used. Note: the
@@ -514,45 +530,45 @@ versions should use 0 instead.
=head2 ECDH parameters
The EVP_PKEY_CTX_set_ecdh_cofactor_mode() macro sets the cofactor mode to
B<cofactor_mode> for ECDH key derivation. Possible values are 1 to enable
I<cofactor_mode> for ECDH key derivation. Possible values are 1 to enable
cofactor key derivation, 0 to disable it and -1 to clear the stored cofactor
mode and fallback to the private key cofactor mode.
The EVP_PKEY_CTX_get_ecdh_cofactor_mode() macro returns the cofactor mode for
B<ctx> used for ECDH key derivation. Possible values are 1 when cofactor key
I<ctx> used for ECDH key derivation. Possible values are 1 when cofactor key
derivation is enabled and 0 otherwise.
=head2 ECDH key derivation function parameters
The EVP_PKEY_CTX_set_ecdh_kdf_type() macro sets the key derivation function type
to B<kdf> for ECDH key derivation. Possible values are B<EVP_PKEY_ECDH_KDF_NONE>
to I<kdf> for ECDH key derivation. Possible values are B<EVP_PKEY_ECDH_KDF_NONE>
and B<EVP_PKEY_ECDH_KDF_X9_63> which uses the key derivation specified in X9.63.
When using key derivation, the B<kdf_md> and B<kdf_outlen> parameters must
When using key derivation, the I<kdf_md> and I<kdf_outlen> parameters must
also be specified.
The EVP_PKEY_CTX_get_ecdh_kdf_type() macro returns the key derivation function
type for B<ctx> used for ECDH key derivation. Possible values are
type for I<ctx> used for ECDH key derivation. Possible values are
B<EVP_PKEY_ECDH_KDF_NONE> and B<EVP_PKEY_ECDH_KDF_X9_63>.
The EVP_PKEY_CTX_set_ecdh_kdf_md() macro sets the key derivation function
message digest to B<md> for ECDH key derivation. Note that X9.63 specifies
message digest to I<md> for ECDH key derivation. Note that X9.63 specifies
that this digest should be SHA1 but OpenSSL tolerates other digests.
The EVP_PKEY_CTX_get_ecdh_kdf_md() macro gets the key derivation function
message digest for B<ctx> used for ECDH key derivation.
message digest for I<ctx> used for ECDH key derivation.
The EVP_PKEY_CTX_set_ecdh_kdf_outlen() macro sets the key derivation function
output length to B<len> for ECDH key derivation.
output length to I<len> for ECDH key derivation.
The EVP_PKEY_CTX_get_ecdh_kdf_outlen() macro gets the key derivation function
output length for B<ctx> used for ECDH key derivation.
output length for I<ctx> used for ECDH key derivation.
The EVP_PKEY_CTX_set0_ecdh_kdf_ukm() macro sets the user key material to B<ukm>
The EVP_PKEY_CTX_set0_ecdh_kdf_ukm() macro sets the user key material to I<ukm>
for ECDH key derivation. This parameter is optional and corresponds to the
shared info in X9.63 terms. The library takes ownership of the user key material
so the caller should not free the original memory pointed to by B<ukm>.
so the caller should not free the original memory pointed to by I<ukm>.
The EVP_PKEY_CTX_get0_ecdh_kdf_ukm() macro gets the user key material for B<ctx>.
The EVP_PKEY_CTX_get0_ecdh_kdf_ukm() macro gets the user key material for I<ctx>.
The return value is the user key material length. The resulting pointer is owned
by the library and should not be freed by the caller.
@@ -560,14 +576,14 @@ by the library and should not be freed by the caller.
The EVP_PKEY_CTX_set1_id(), EVP_PKEY_CTX_get1_id() and EVP_PKEY_CTX_get1_id_len()
macros are used to manipulate the special identifier field for specific signature
algorithms such as SM2. The EVP_PKEY_CTX_set1_id() sets an ID pointed by B<id> with
the length B<id_len> to the library. The library takes a copy of the id so that
the caller can safely free the original memory pointed to by B<id>. The
algorithms such as SM2. The EVP_PKEY_CTX_set1_id() sets an ID pointed by I<id> with
the length I<id_len> to the library. The library takes a copy of the id so that
the caller can safely free the original memory pointed to by I<id>. The
EVP_PKEY_CTX_get1_id_len() macro returns the length of the ID set via a previous
call to EVP_PKEY_CTX_set1_id(). The length is usually used to allocate adequate
memory for further calls to EVP_PKEY_CTX_get1_id(). The EVP_PKEY_CTX_get1_id()
macro returns the previously set ID value to caller in B<id>. The caller should
allocate adequate memory space for the B<id> before calling EVP_PKEY_CTX_get1_id().
macro returns the previously set ID value to caller in I<id>. The caller should
allocate adequate memory space for the I<id> before calling EVP_PKEY_CTX_get1_id().
=head1 RETURN VALUES
@@ -598,8 +614,9 @@ 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_get0_rsa_oaep_label(), EVP_PKEY_CTX_set_rsa_pss_saltlen(),
EVP_PKEY_CTX_get_rsa_pss_saltlen(), 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
+3 -1
View File
@@ -27,7 +27,9 @@ creating a key from user data.
EVP_PKEY_fromdata() creates key 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>.
written to I<*ppkey>. The parameters that can be used for various types of key
are as described in the "Built-in RSA Import/Export Types" section on the
L<provider-keymgmt(7)> page.
EVP_PKEY_param_fromdata_settable() and EVP_PKEY_key_fromdata_settable()
get a constant B<OSSL_PARAM> array that describes the settable parameters
+4 -2
View File
@@ -53,8 +53,10 @@ put all intermediate values and computations there.
CRYPTO_secure_malloc_init() creates the secure heap, with the specified
C<size> in bytes. The C<minsize> parameter is the minimum size to
allocate from the heap. Both C<size> and C<minsize> must be a power
of two.
allocate from the heap or zero to use a reasonable default value.
Both C<size> and, if specified, C<minsize> must be a power of two and
C<minsize> should generally be small, for example 16 or 32.
C<minsize> must be less than a quarter of C<size> in any case.
CRYPTO_secure_malloc_initialized() indicates whether or not the secure
heap as been initialized and is available.
+6 -2
View File
@@ -12,7 +12,8 @@ OSSL_PARAM_allocate_from_text
int OSSL_PARAM_allocate_from_text(OSSL_PARAM *to,
const OSSL_PARAM *paramdefs,
const char *key, const char *value,
size_t value_n);
size_t value_n,
int *found);
=head1 DESCRIPTION
@@ -37,6 +38,9 @@ left untouched, allowing a caller to find out how large the buffer
should be.
I<buf> needs to be correctly aligned for the type of the B<OSSL_PARAM>
I<key>.
If <found> is not NULL, it is set to 1 if the parameter can be located and
to 0 otherwise.
The caller must remember to free the data of I<to> when it's not
useful any more.
@@ -127,7 +131,7 @@ Can be written like this instead:
*vtmp++ = '\0';
if (!OSSL_PARAM_allocate_from_text(&params[params_n],
paramdefs, stmp,
vtmp, strlen(vtmp)))
vtmp, strlen(vtmp), NULL))
goto err;
}
params[params_n] = OSSL_PARAM_construct_end();
+172
View File
@@ -0,0 +1,172 @@
=pod
=head1 NAME
OSSL_SELF_TEST_new,
OSSL_SELF_TEST_free,
OSSL_SELF_TEST_onbegin,
OSSL_SELF_TEST_oncorrupt_byte,
OSSL_SELF_TEST_onend - functionality to trigger a callback during a self test
=head1 SYNOPSIS
#include <openssl/self_test.h>
OSSL_SELF_TEST *OSSL_SELF_TEST_new(OSSL_CALLBACK *cb, void *cbarg);
void OSSL_SELF_TEST_free(OSSL_SELF_TEST *st);
void OSSL_SELF_TEST_onbegin(OSSL_SELF_TEST *st, const char *type,
const char *desc);
void OSSL_SELF_TEST_oncorrupt_byte(OSSL_SELF_TEST *st, unsigned char *bytes);
void OSSL_SELF_TEST_onend(OSSL_SELF_TEST *st, int ret);
=head1 DESCRIPTION
These methods are intended for use by provider implementors, to display
diagnostic information during self testing.
OSSL_SELF_TEST_new() allocates an opaque B<OSSL_SELF_TEST> object that has a
callback and callback argument associated with it.
The callback I<cb> may be triggered multiple times by a self test to indicate
different phases.
OSSL_SELF_TEST_free() frees the space allocated by OSSL_SELF_TEST_new().
OSSL_SELF_TEST_onbegin() may be inserted at the start of a block of self test
code. It can be used for diagnostic purposes.
If this method is called the callback I<cb> will receive the following
B<OSSL_PARAM> object.
=over 4
=item "st-phase" (B<OSSL_PROV_PARAM_SELF_TEST_PHASE>) <UTF8 string>
The value is the string "Start"
=back
OSSL_SELF_TEST_oncorrupt_byte() may be inserted just after the known answer is
calculated, but before the self test compares the result. The first byte in the
passed in array of I<bytes> will be corrupted if the callback returns 0,
otherwise it leaves the array unaltered. It can be used for failure testing.
The I<type> and I<desc> can be used to identify an individual self test to
target for failure testing.
If this method is called the callback I<cb> will receive the following
B<OSSL_PARAM> object.
=over 4
=item "st-phase" (B<OSSL_PROV_PARAM_SELF_TEST_PHASE>) <UTF8 string>
The value is the string "Corrupt"
=back
OSSL_SELF_TEST_onend() may be inserted at the end of a block of self test code
just before cleanup to indicate if the test passed or failed. It can be used for
diagnostic purposes.
If this method is called the callback I<cb> will receive the following
B<OSSL_PARAM> object.
=over 4
=item "st-phase" (B<OSSL_PROV_PARAM_SELF_TEST_PHASE>) <UTF8 string>
The value of the string is "Pass" if I<ret> is non zero, otherwise it has the
value "Fail".
=back
After the callback I<cb> has been called the values that were set by
OSSL_SELF_TEST_onbegin() for I<type> and I<desc> are set to the value "None".
If OSSL_SELF_TEST_onbegin(), OSSL_SELF_TEST_oncorrupt_byte() or
OSSL_SELF_TEST_onend() is called the following additional B<OSSL_PARAM> are
passed to the callback.
=over 4
=item "st-type" (B<OSSL_PROV_PARAM_SELF_TEST_TYPE>) <UTF8 string>
The value is setup by the I<type> passed to OSSL_SELF_TEST_onbegin().
This allows the callback to identify the type of test being run.
=item "st-desc" (B<OSSL_PROV_PARAM_SELF_TEST_DESC>) <UTF8 string>
The value is setup by the I<type> passed to OSSL_SELF_TEST_onbegin().
This allows the callback to identify the sub category of the test being run.
=back
=head1 RETURN VALUES
OSSL_SELF_TEST_new() returns the allocated B<OSSL_SELF_TEST> object, or NULL if
it fails.
=head1 EXAMPLES
A single self test could be set up in the following way:
OSSL_SELF_TEST *st = NULL;
OSSL_CALLBACK *cb;
void *cbarg;
int ok = 0;
unsigned char out[EVP_MAX_MD_SIZE];
unsigned int out_len = 0;
EVP_MD_CTX *ctx = EVP_MD_CTX_new();
EVP_MD *md = EVP_MD_fetch(libctx, t->algorithm, NULL);
/*
* Retrieve the callback - will be NULL if not set by the application via
* OSSL_SELF_TEST_set_callback().
*/
OSSL_SELF_TEST_get_callback(libctx, &cb, &cbarg);
st = OSSL_SELF_TEST_new(cb, cb_arg);
/* Trigger the optional callback */
OSSL_SELF_TEST_onbegin(st, OSSL_SELF_TEST_TYPE_KAT_DIGEST,
OSSL_SELF_TEST_DESC_MD_SHA2);
if (!EVP_DigestInit_ex(ctx, md, NULL)
|| !EVP_DigestUpdate(ctx, pt, pt_len)
|| !EVP_DigestFinal(ctx, out, &out_len))
goto err;
/* Optional corruption - If the application callback returns 0 */
OSSL_SELF_TEST_oncorrupt_byte(st, out);
if (out_len != t->expected_len
|| memcmp(out, t->expected, out_len) != 0)
goto err;
ok = 1;
err:
OSSL_SELF_TEST_onend(st, ok);
EVP_MD_free(md);
EVP_MD_CTX_free(ctx);
Multiple self test's can be set up in a similar way by repeating the pattern of
OSSL_SELF_TEST_onbegin(), OSSL_SELF_TEST_oncorrupt_byte(), OSSL_SELF_TEST_onend()
for each test.
=head1 SEE ALSO
L<OSSL_SELF_TEST_set_callback(3)>,
L<openssl-core.h(7)>,
L<OSSL_PROVIDER-FIPS(7)>
=head1 HISTORY
The functions described here were added in OpenSSL 3.0.
=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
+1
View File
@@ -32,6 +32,7 @@ not been called.
L<openssl-core.h(7)>,
L<OSSL_PROVIDER-FIPS(7)>
L<OSSL_SELF_TEST_new(3)>
L<OPENSSL_CTX(3)>
=head1 HISTORY
+18 -6
View File
@@ -23,8 +23,8 @@ L<openssl_user_macros(7)>:
=head1 DESCRIPTION
RAND_bytes() puts B<num> cryptographically strong pseudo-random bytes
into B<buf>.
RAND_bytes() generates B<num> random bytes using a cryptographically
secure pseudo random generator (CSPRNG) and stores them in B<buf>.
RAND_priv_bytes() has the same semantics as RAND_bytes(). It is intended to
be used for generating values that should remain private. If using the
@@ -44,10 +44,22 @@ ignored.
=head1 NOTES
Always check the error return value of RAND_bytes() and
RAND_priv_bytes() and do not take randomness for granted: an error occurs
if the CSPRNG has not been seeded with enough randomness to ensure an
unpredictable byte sequence.
By default, the OpenSSL CSPRNG supports a security level of 256 bits, provided it
was able to seed itself from a trusted entropy source.
On all major platforms supported by OpenSSL (including the Unix-like platforms
and Windows), OpenSSL is configured to automatically seed the CSPRNG on first use
using the operating systems's random generator.
If the entropy source fails or is not available, the CSPRNG will enter an
error state and refuse to generate random bytes. For that reason, it is important
to always check the error return value of RAND_bytes() and RAND_priv_bytes() and
not take randomness for granted.
On other platforms, there might not be a trusted entropy source available
or OpenSSL might have been explicitly configured to use different entropy sources.
If you are in doubt about the quality of the entropy source, don't hesitate to ask
your operating system vendor or post a question on GitHub or the openssl-users
mailing list.
=head1 RETURN VALUES
+10
View File
@@ -8,12 +8,20 @@ RSA_check_key_ex, RSA_check_key - validate private RSA keys
#include <openssl/rsa.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)>:
int RSA_check_key_ex(RSA *rsa, BN_GENCB *cb);
int RSA_check_key(RSA *rsa);
=head1 DESCRIPTION
Both of the functions described on this page are deprecated.
Applications should instead use L<EVP_PKEY_public_check(3)>,
L<EVP_PKEY_private_check(3)> and L<EVP_PKEY_pairwise_check(3)>.
RSA_check_key_ex() function validates RSA keys.
It checks that B<p> and B<q> are
in fact prime, and that B<n = p*q>.
@@ -70,6 +78,8 @@ L<ERR_get_error(3)>
=head1 HISTORY
All of these functions were deprecated in OpenSSL 3.0.
RSA_check_key_ex() appeared after OpenSSL 1.0.2.
=head1 COPYRIGHT
+10
View File
@@ -9,6 +9,10 @@ RSA_generate_multi_prime_key - generate RSA key pair
#include <openssl/rsa.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)>:
int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
int RSA_generate_multi_prime_key(RSA *rsa, int bits, int primes, BIGNUM *e, BN_GENCB *cb);
@@ -21,6 +25,10 @@ L<openssl_user_macros(7)>:
=head1 DESCRIPTION
All of the functions described on this page are deprecated.
Applications should instead use L<EVP_PKEY_keygen_init(3)> and
L<EVP_PKEY_keygen(3)>.
RSA_generate_key_ex() generates a 2-prime RSA key pair and stores it in the
B<RSA> structure provided in B<rsa>. The pseudo-random number generator must
be seeded prior to calling RSA_generate_key_ex().
@@ -95,6 +103,8 @@ L<RAND(7)>
=head1 HISTORY
All of these functions were deprecated in OpenSSL 3.0.
RSA_generate_key() was deprecated in OpenSSL 0.9.8; use
RSA_generate_key_ex() instead.
+9
View File
@@ -20,6 +20,10 @@ RSA_meth_get_multi_prime_keygen, RSA_meth_set_multi_prime_keygen
#include <openssl/rsa.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)>:
RSA_METHOD *RSA_meth_new(const char *name, int flags);
void RSA_meth_free(RSA_METHOD *meth);
@@ -123,6 +127,9 @@ RSA_meth_get_multi_prime_keygen, RSA_meth_set_multi_prime_keygen
=head1 DESCRIPTION
All of the functions described on this page are deprecated.
Applications should instead use the OSSL_PROVIDER APIs.
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.
@@ -244,6 +251,8 @@ L<RSA_generate_multi_prime_key(3)>
=head1 HISTORY
All of these functions were deprecated in OpenSSL 3.0.
RSA_meth_get_multi_prime_keygen() and RSA_meth_set_multi_prime_keygen() were
added in OpenSSL 1.1.1.
+11
View File
@@ -14,6 +14,10 @@ padding
#include <openssl/rsa.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)>:
int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen,
const unsigned char *f, int fl);
@@ -58,6 +62,9 @@ padding
=head1 DESCRIPTION
All of the functions described on this page are deprecated.
Applications should instead use the EVP PKEY APIs.
The RSA_padding_xxx_xxx() functions are called from the RSA encrypt,
decrypt, sign and verify functions. Normally they should not be called
from application programs.
@@ -148,6 +155,10 @@ L<RSA_private_decrypt(3)>,
L<RSA_sign(3)>, L<RSA_verify(3)>,
L<RAND(7)>
=head1 HISTORY
All of these functions were deprecated in OpenSSL 3.0.
=head1 COPYRIGHT
Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
+12
View File
@@ -8,6 +8,10 @@ RSA_private_encrypt, RSA_public_decrypt - low level signature operations
#include <openssl/rsa.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)>:
int RSA_private_encrypt(int flen, unsigned char *from,
unsigned char *to, RSA *rsa, int padding);
@@ -16,6 +20,10 @@ RSA_private_encrypt, RSA_public_decrypt - low level signature operations
=head1 DESCRIPTION
Both of the functions described on this page are deprecated.
Applications should instead use L<EVP_PKEY_encrypt_init(3)>,
L<EVP_PKEY_encrypt(3)>, L<EVP_PKEY_decrypt_init(3)> and L<EVP_PKEY_decrypt(3)>.
These functions handle RSA signatures at a low level.
RSA_private_encrypt() signs the B<flen> bytes at B<from> (usually a
@@ -62,6 +70,10 @@ obtained by L<ERR_get_error(3)>.
L<ERR_get_error(3)>,
L<RSA_sign(3)>, L<RSA_verify(3)>
=head1 HISTORY
Both of these functions were deprecated in OpenSSL 3.0.
=head1 COPYRIGHT
Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
+12
View File
@@ -8,6 +8,10 @@ RSA_public_encrypt, RSA_private_decrypt - RSA public key cryptography
#include <openssl/rsa.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)>:
int RSA_public_encrypt(int flen, const unsigned char *from,
unsigned char *to, RSA *rsa, int padding);
@@ -16,6 +20,10 @@ RSA_public_encrypt, RSA_private_decrypt - RSA public key cryptography
=head1 DESCRIPTION
Both of the functions described on this page are deprecated.
Applications should instead use L<EVP_PKEY_encrypt_init(3)>,
L<EVP_PKEY_encrypt(3)>, L<EVP_PKEY_decrypt_init(3)> and L<EVP_PKEY_decrypt(3)>.
RSA_public_encrypt() encrypts the B<flen> bytes at B<from> (usually a
session key) using the public key B<rsa> and stores the ciphertext in
B<to>. B<to> must point to RSA_size(B<rsa>) bytes of memory.
@@ -97,6 +105,10 @@ SSL, PKCS #1 v2.0
L<ERR_get_error(3)>, L<RAND_bytes(3)>,
L<RSA_size(3)>
=head1 HISTORY
Both of these functions were deprecated in OpenSSL 3.0.
=head1 COPYRIGHT
Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
+9
View File
@@ -10,6 +10,10 @@ RSA_new_method - select RSA method
#include <openssl/rsa.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 RSA_set_default_method(const RSA_METHOD *meth);
RSA_METHOD *RSA_get_default_method(void);
@@ -26,6 +30,9 @@ RSA_new_method - select RSA method
=head1 DESCRIPTION
All of the functions described on this page are deprecated.
Applications should instead use the OSSL_PROVIDER APIs.
An B<RSA_METHOD> specifies the functions that OpenSSL uses for RSA
operations. By modifying the method, alternative implementations such as
hardware accelerators may be used. IMPORTANT: See the NOTES section for
@@ -171,6 +178,8 @@ L<RSA_new(3)>
=head1 HISTORY
All of these functions were deprecated in OpenSSL 3.0.
The RSA_null_method(), which was a partial attempt to avoid patent issues,
was replaced to always return NULL in OpenSSL 1.1.1.
+12
View File
@@ -8,6 +8,10 @@ RSA_sign, RSA_verify - RSA signatures
#include <openssl/rsa.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)>:
int RSA_sign(int type, const unsigned char *m, unsigned int m_len,
unsigned char *sigret, unsigned int *siglen, RSA *rsa);
@@ -16,6 +20,10 @@ RSA_sign, RSA_verify - RSA signatures
=head1 DESCRIPTION
All of the functions described on this page are deprecated.
Applications should instead use L<EVP_PKEY_sign_init(3)>, L<EVP_PKEY_sign(3)>,
L<EVP_PKEY_verify_init(3)> and L<EVP_PKEY_verify(3)>.
RSA_sign() signs the message digest B<m> of size B<m_len> using the
private key B<rsa> using RSASSA-PKCS1-v1_5 as specified in RFC 3447. It
stores the signature in B<sigret> and the signature size in B<siglen>.
@@ -53,6 +61,10 @@ L<ERR_get_error(3)>,
L<RSA_private_encrypt(3)>,
L<RSA_public_decrypt(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.
+11
View File
@@ -8,6 +8,10 @@ RSA_sign_ASN1_OCTET_STRING, RSA_verify_ASN1_OCTET_STRING - RSA signatures
#include <openssl/rsa.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)>:
int RSA_sign_ASN1_OCTET_STRING(int dummy, unsigned char *m,
unsigned int m_len, unsigned char *sigret,
unsigned int *siglen, RSA *rsa);
@@ -18,6 +22,9 @@ RSA_sign_ASN1_OCTET_STRING, RSA_verify_ASN1_OCTET_STRING - RSA signatures
=head1 DESCRIPTION
All of the functions described on this page are deprecated.
Applications should instead use EVP PKEY APIs.
RSA_sign_ASN1_OCTET_STRING() signs the octet string B<m> of size
B<m_len> using the private key B<rsa> represented in DER using PKCS #1
padding. It stores the signature in B<sigret> and the signature size
@@ -55,6 +62,10 @@ L<RAND_bytes(3)>, L<RSA_sign(3)>,
L<RSA_verify(3)>,
L<RAND(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.
+10
View File
@@ -8,6 +8,10 @@ RSA_size, RSA_bits, RSA_security_bits - get RSA modulus size or security bits
#include <openssl/rsa.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)>:
int RSA_size(const RSA *rsa);
int RSA_bits(const RSA *rsa);
@@ -16,6 +20,10 @@ RSA_size, RSA_bits, RSA_security_bits - get RSA modulus size or security bits
=head1 DESCRIPTION
All of the functions described on this page are deprecated.
Applications should instead use L<EVP_PKEY_size(3)>, L<EVP_PKEY_bits(3)>
and L<EVP_PKEY_security_bits(3)>.
RSA_size() returns the RSA modulus size in bytes. It can be used to
determine how much memory must be allocated for an RSA encrypted
value.
@@ -41,6 +49,8 @@ L<BN_num_bits(3)>
=head1 HISTORY
All of these functions were deprecated in OpenSSL 3.0.
The RSA_bits() function was added in OpenSSL 1.1.0.
=head1 COPYRIGHT
+191
View File
@@ -0,0 +1,191 @@
=pod
=head1 NAME
X509_LOOKUP, X509_LOOKUP_TYPE,
X509_LOOKUP_new, X509_LOOKUP_free, X509_LOOKUP_init,
X509_LOOKUP_shutdown,
X509_LOOKUP_set_method_data, X509_LOOKUP_get_method_data,
X509_LOOKUP_ctrl,
X509_LOOKUP_load_file, X509_LOOKUP_add_dir, X509_LOOKUP_add_store,
X509_LOOKUP_load_store,
X509_LOOKUP_get_store, X509_LOOKUP_by_subject,
X509_LOOKUP_by_issuer_serial, X509_LOOKUP_by_fingerprint,
X509_LOOKUP_by_alias
- OpenSSL certificate lookup mechanisms
=head1 SYNOPSIS
#include <openssl/x509_vfy.h>
typedef x509_lookup_st X509_LOOKUP;
typedef enum X509_LOOKUP_TYPE;
X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method);
int X509_LOOKUP_init(X509_LOOKUP *ctx);
int X509_LOOKUP_shutdown(X509_LOOKUP *ctx);
void X509_LOOKUP_free(X509_LOOKUP *ctx);
int X509_LOOKUP_set_method_data(X509_LOOKUP *ctx, void *data);
void *X509_LOOKUP_get_method_data(const X509_LOOKUP *ctx);
int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
long argl, char **ret);
int X509_LOOKUP_load_file(X509_LOOKUP *ctx, char *name, long type);
int X509_LOOKUP_add_dir(X509_LOOKUP *ctx, char *name, long type);
int X509_LOOKUP_add_store(X509_LOOKUP *ctx, char *uri);
int X509_LOOKUP_load_store(X509_LOOKUP *ctx, char *uri);
X509_STORE *X509_LOOKUP_get_store(const X509_LOOKUP *ctx);
int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
X509_NAME *name, X509_OBJECT *ret);
int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
X509_NAME *name, ASN1_INTEGER *serial,
X509_OBJECT *ret);
int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
const unsigned char *bytes, int len,
X509_OBJECT *ret);
int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
const char *str, int len, X509_OBJECT *ret);
=head1 DESCRIPTION
The B<X509_LOOKUP> structure holds the information needed to look up
certificates and CRLs according to an associated L<X509_LOOKUP_METHOD(3)>.
Multiple B<X509_LOOKUP> instances can be added to an L<X509_STORE(3)>
to enable lookup in that store.
X509_LOOKUP_new() creates a new B<X509_LOOKUP> using the given lookup
I<method>.
It can also be created by calling L<X509_STORE_add_lookup(3)>, which
will associate a B<X509_STORE> with the lookup mechanism.
X509_LOOKUP_init() initializes the internal state and resources as
needed by the given B<X509_LOOKUP> to do its work.
X509_LOOKUP_shutdown() tears down the internal state and resources of
the given B<X509_LOOKUP>.
X509_LOOKUP_free() destructs the given B<X509_LOOKUP>.
X509_LOOKUP_set_method_data() and X509_LOOKUP_get_method_data()
associates and retrieves a pointer to application data to and from the
given B<X509_LOOKUP>, respectively.
X509_LOOKUP_ctrl() is used to set or get additional data to or from a
B<X509_LOOKUP> structure or its associated L<X509_LOOKUP_METHOD(3)>.
The arguments of the control command are passed via I<argc> and I<argl>,
its return value via I<*ret>.
The meaning of the arguments depends on the I<cmd> number of the
control command. In general, this function is not called directly, but
wrapped by a macro call, see below.
The control I<cmd>s known to OpenSSL are discussed in more depth
in L</Control Commands>.
X509_LOOKUP_load_file() passes a filename to be loaded immediately
into the associated B<X509_STORE>.
I<type> indicates what type of object is expected.
This can only be used with a lookup using the implementation
L<X509_LOOKUP_file(3)>.
X509_LOOKUP_add_dir() passes a directory specification from which
certificates and CRLs are loaded on demand into the associated
B<X509_STORE>.
I<type> indicates what type of object is expected.
This can only be used with a lookup using the implementation
L<X509_LOOKUP_hash_dir(3)>.
X509_LOOKUP_add_store() passes a URI for a directory-like structure
from which containers with certificates and CRLs are loaded on demand
into the associated B<X509_STORE>.
X509_LOOKUP_load_store() passes a URI for a single container from
which certificates and CRLs are immediately loaded into the associated
B<X509_STORE>.
These functions can only be used with a lookup using the
implementation L<X509_LOOKUP_store(3)>.
X509_LOOKUP_load_file(), X509_LOOKUP_add_dir(),
X509_LOOKUP_add_store(), and X509_LOOKUP_load_store() are implemented
as macros that use X509_LOOKUP_ctrl().
X509_LOOKUP_by_subject(), X509_LOOKUP_by_issuer_serial(),
X509_LOOKUP_by_fingerprint(), and X509_LOOKUP_by_alias() look up
certificates and CRLs in the L<X509_STORE(3)> associated with the
B<X509_LOOKUP> using different criteria, where the looked up object is
stored in I<ret>.
Some of the underlying B<X509_LOOKUP_METHOD>s will also cache objects
matching the criteria in the associated B<X509_STORE>, which makes it
possible to handle cases where the criteria have more than one hit.
=head2 Control Commands
The B<X509_LOOKUP_METHOD>s built into OpenSSL recognise the following
X509_LOOKUP_ctrl() I<cmd>s:
=over 4
=item B<X509_L_FILE_LOAD>
This is the command that X509_LOOKUP_load_file() uses.
The filename is passed in I<argc>, and the type in I<argl>.
=item B<X509_L_ADD_DIR>
This is the command that X509_LOOKUP_add_dir() uses.
The directory specification is passed in I<argc>, and the type in
I<argl>.
=item B<X509_L_ADD_STORE>
This is the command that X509_LOOKUP_add_store() uses.
The URI is passed in I<argc>.
=item B<X509_L_LOAD_STORE>
This is the command that X509_LOOKUP_load_store() uses.
The URI is passed in I<argc>.
=back
=head1 RETURN VALUES
X509_LOOKUP_new() returns a B<X509_LOOKUP> pointer when successful,
or NULL on error.
X509_LOOKUP_init() and X509_LOOKUP_shutdown() return 1 on success, or
0 on error.
X509_LOOKUP_ctrl() returns -1 if the B<X509_LOOKUP> doesn't have an
associated B<X509_LOOKUP_METHOD>, or 1 if the X<509_LOOKUP_METHOD>
doesn't have a control function.
Otherwise, it returns what the control function in the
B<X509_LOOKUP_METHOD> returns, which is usually 1 on success and 0 in
error.
X509_LOOKUP_get_store() returns a B<X509_STORE> pointer if there is
one, otherwise NULL.
X509_LOOKUP_by_subject(), X509_LOOKUP_by_issuer_serial(),
X509_LOOKUP_by_fingerprint(), and X509_LOOKUP_by_alias() all return 0
if there is no B<X509_LOOKUP_METHOD> or that method doesn't implement
the corresponding function.
Otherwise, it returns what the corresponding function in the
B<X509_LOOKUP_METHOD> returns, which is usually 1 on success and 0 in
error.
=head1 SEE ALSO
L<X509_LOOKUP_METHOD(3)>, L<X509_STORE(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
+9 -12
View File
@@ -2,6 +2,7 @@
=head1 NAME
X509_LOOKUP_METHOD,
X509_LOOKUP_meth_new, X509_LOOKUP_meth_free, X509_LOOKUP_meth_set_new_item,
X509_LOOKUP_meth_get_new_item, X509_LOOKUP_meth_set_free,
X509_LOOKUP_meth_get_free, X509_LOOKUP_meth_set_init,
@@ -16,14 +17,15 @@ X509_LOOKUP_get_by_fingerprint_fn, X509_LOOKUP_meth_set_get_by_fingerprint,
X509_LOOKUP_meth_get_get_by_fingerprint,
X509_LOOKUP_get_by_alias_fn, X509_LOOKUP_meth_set_get_by_alias,
X509_LOOKUP_meth_get_get_by_alias,
X509_LOOKUP_set_method_data, X509_LOOKUP_get_method_data,
X509_LOOKUP_get_store, X509_OBJECT_set1_X509, X509_OBJECT_set1_X509_CRL
X509_OBJECT_set1_X509, X509_OBJECT_set1_X509_CRL
- Routines to build up X509_LOOKUP methods
=head1 SYNOPSIS
#include <openssl/x509_vfy.h>
typedef x509_lookup_method_st X509_LOOKUP_METHOD;
X509_LOOKUP_METHOD *X509_LOOKUP_meth_new(const char *name);
void X509_LOOKUP_meth_free(X509_LOOKUP_METHOD *method);
@@ -92,11 +94,6 @@ X509_LOOKUP_get_store, X509_OBJECT_set1_X509, X509_OBJECT_set1_X509_CRL
X509_LOOKUP_get_by_alias_fn X509_LOOKUP_meth_get_get_by_alias(
const X509_LOOKUP_METHOD *method);
int X509_LOOKUP_set_method_data(X509_LOOKUP *ctx, void *data);
void *X509_LOOKUP_get_method_data(const X509_LOOKUP *ctx);
X509_STORE *X509_LOOKUP_get_store(const X509_LOOKUP *ctx);
int X509_OBJECT_set1_X509(X509_OBJECT *a, X509 *obj);
int X509_OBJECT_set1_X509_CRL(X509_OBJECT *a, X509_CRL *obj);
@@ -118,7 +115,7 @@ X509_LOOKUP_get_new_item() and X509_LOOKUP_set_new_item() get and set the
function that is called when an B<X509_LOOKUP> object is created with
X509_LOOKUP_new(). If an X509_LOOKUP_METHOD requires any per-X509_LOOKUP
specific data, the supplied new_item function should allocate this data and
invoke X509_LOOKUP_set_method_data().
invoke L<X509_LOOKUP_set_method_data(3)>.
X509_LOOKUP_get_free() and X509_LOOKUP_set_free() get and set the function
that is used to free any method data that was allocated and set from within
@@ -126,7 +123,7 @@ new_item function.
X509_LOOKUP_meth_get_init() and X509_LOOKUP_meth_set_init() get and set the
function that is used to initialize the method data that was set with
X509_LOOKUP_set_method_data() as part of the new_item routine.
L<X509_LOOKUP_set_method_data(3)> as part of the new_item routine.
X509_LOOKUP_meth_get_shutdown() and X509_LOOKUP_meth_set_shutdown() get and set
the function that is used to shut down the method data whose state was
@@ -164,9 +161,9 @@ increments the result's reference count.
Any method data that was created as a result of the new_item function
set by X509_LOOKUP_meth_set_new_item() can be accessed with
X509_LOOKUP_get_method_data(). The B<X509_STORE> object that owns the
X509_LOOKUP may be accessed with X509_LOOKUP_get_store(). Successful lookups
should return 1, and unsuccessful lookups should return 0.
L<X509_LOOKUP_get_method_data(3)>. The B<X509_STORE> object that owns the
X509_LOOKUP may be accessed with L<X509_LOOKUP_get_store(3)>. Successful
lookups should return 1, and unsuccessful lookups should return 0.
X509_LOOKUP_get_get_by_subject(), X509_LOOKUP_get_get_by_issuer_serial(),
X509_LOOKUP_get_get_by_fingerprint(), X509_LOOKUP_get_get_by_alias() retrieve
+15
View File
@@ -2,8 +2,10 @@
=head1 NAME
X509_STORE,
X509_STORE_add_cert, X509_STORE_add_crl, X509_STORE_set_depth,
X509_STORE_set_flags, X509_STORE_set_purpose, X509_STORE_set_trust,
X509_STORE_add_lookup,
X509_STORE_load_file, X509_STORE_load_path, X509_STORE_load_store,
X509_STORE_set_default_paths,
X509_STORE_load_locations
@@ -13,6 +15,8 @@ X509_STORE_load_locations
#include <openssl/x509_vfy.h>
typedef x509_store_st X509_STORE;
int X509_STORE_add_cert(X509_STORE *ctx, X509 *x);
int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x);
int X509_STORE_set_depth(X509_STORE *store, int depth);
@@ -20,6 +24,9 @@ X509_STORE_load_locations
int X509_STORE_set_purpose(X509_STORE *ctx, int purpose);
int X509_STORE_set_trust(X509_STORE *ctx, int trust);
X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *store,
X509_LOOKUP_METHOD *meth);
int X509_STORE_set_default_paths(X509_STORE *ctx);
int X509_STORE_load_file(X509_STORE *ctx, const char *file);
int X509_STORE_load_path(X509_STORE *ctx, const char *dir);
@@ -72,6 +79,11 @@ for the corresponding values used in certificate chain validation. Their
behavior is documented in the corresponding B<X509_VERIFY_PARAM> manual
pages, e.g., L<X509_VERIFY_PARAM_set_depth(3)>.
X509_STORE_add_lookup() finds or creates a L<X509_LOOKUP(3)> with the
L<X509_LOOKUP_METHOD(3)> I<meth> and adds it to the B<X509_STORE>
I<store>. This also associates the B<X509_STORE> with the lookup, so
B<X509_LOOKUP> functions can look up objects in that store.
X509_STORE_load_file() loads trusted certificate(s) into an
B<X509_STORE> from a given file.
@@ -102,6 +114,9 @@ X509_STORE_load_path(), X509_STORE_load_store(),
X509_STORE_load_locations(), and X509_STORE_set_default_paths() return
1 on success or 0 on failure.
X509_STORE_add_lookup() returns the found or created
L<X509_LOOKUP(3)>, or NULL on error.
=head1 SEE ALSO
L<X509_LOOKUP_hash_dir(3)>.
+82
View File
@@ -0,0 +1,82 @@
=pod
=head1 NAME
i2s_ASN1_IA5STRING,
s2i_ASN1_IA5STRING,
i2s_ASN1_INTEGER,
s2i_ASN1_INTEGER,
i2s_ASN1_OCTET_STRING,
s2i_ASN1_OCTET_STRING,
i2s_ASN1_ENUMERATED,
i2s_ASN1_ENUMERATED_TABLE,
- convert objects from/to ASN.1/string representation
=head1 SYNOPSIS
=for openssl generic
char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method, ASN1_IA5STRING *ia5);
ASN1_IA5STRING *s2i_ASN1_IA5STRING(X509V3_EXT_METHOD *method,
X509V3_CTX *ctx, const char *str);
char *i2s_ASN1_INTEGER(X509V3_EXT_METHOD *method, const ASN1_INTEGER *a);
ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, const char *value);
char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method,
const ASN1_OCTET_STRING *oct);
ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method,
X509V3_CTX *ctx, const char *str);
char *i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *method, const ASN1_ENUMERATED *a);
char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method,
const ASN1_ENUMERATED *e);
=head1 DESCRIPTION
These functions convert OpenSSL objects to and from their ASN.1/string
representation. This function is used for B<X509v3> extentions.
=head1 NOTES
The letters B<i> and B<s> in B<i2s_ASN1_IA5STRING>() stand for
"internal" (that is, an internal C structure) and string respectively.
So B<i2s_ASN1_IA5STRING>() converts from internal to string.
It is the caller's responsibility to free the returned string.
In the B<i2s_ASN1_IA5STRING>() function the string is copied and
the ownership of the original string remains with the caller.
=head1 RETURN VALUES
B<i2s_ASN1_IA5STRING>() returns the pointer to a IA5 string
or NULL if an error occurs.
B<s2i_ASN1_IA5STRING>() return a valid
B<ASN1_IA5STRING> structure or NULL if an error occurs.
B<i2s_ASN1_INTEGER>() return a valid
string or NULL if an error occurs.
B<s2i_ASN1_INTEGER>() returns the pointer to a B<ASN1_INTEGER>
structure or NULL if an error occurs.
B<i2s_ASN1_OCTET_STRING>() returns the pointer to a OCTET_STRING string
or NULL if an error occurs.
B<s2i_ASN1_OCTET_STRING>() return a valid
B<ASN1_OCTET_STRING> structure or NULL if an error occurs.
B<i2s_ASN1_ENUMERATED>() return a valid
string or NULL if an error occurs.
B<s2i_ASN1_ENUMERATED>() returns the pointer to a B<ASN1_ENUMERATED>
structure or NULL if an error occurs.
=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
+1 -1
View File
@@ -51,7 +51,7 @@ if the B<=> character is not present but with it they just ignore
the include.
Pragmas can be specified with the B<.pragma> directive.
See L</PRAGMAS> for mor information.
See L</PRAGMAS> for more information.
Each section in a configuration file consists of a number of name and
value pairs of the form B<name=value>
+1 -1
View File
@@ -60,7 +60,7 @@ The following sections describe each supported extension in detail.
This is a multi valued extension which indicates whether a certificate is
a CA certificate. The first (mandatory) name is B<CA> followed by B<TRUE> or
B<FALSE>. If B<CA> is B<TRUE> then an optional B<pathlen> name followed by an
B<FALSE>. If B<CA> is B<TRUE> then an optional B<pathlen> name followed by a
non-negative value can be included.
For example:
+2 -2
View File
@@ -16,9 +16,9 @@ properties, to be used with EVP_MAC_fetch():
=over 4
=item "BLAKE2BMAC", "default=yes"
=item "BLAKE2BMAC", "provider=default"
=item "BLAKE2SMAC", "default=yes"
=item "BLAKE2SMAC", "provider=default"
=back
+1 -1
View File
@@ -15,7 +15,7 @@ used with EVP_MAC_fetch():
=over 4
=item "CMAC", "default=yes"
=item "CMAC", "provider=default" or "provider=fips"
=back
+1 -1
View File
@@ -15,7 +15,7 @@ used with EVP_MAC_fetch():
=over 4
=item "GMAC", "default=yes"
=item "GMAC", "provider=default" or "provider=fips"
=back
+1 -1
View File
@@ -15,7 +15,7 @@ used with EVP_MAC_fetch():
=over 4
=item "HMAC", "default=yes"
=item "HMAC", "provider=default" or "provider=fips"
=back
+2 -2
View File
@@ -16,9 +16,9 @@ properties, to be used with EVP_MAC_fetch():
=over 4
=item "KMAC-128", "default=yes"
=item "KMAC-128", "provider=default" or "provider=fips"
=item "KMAC-256", "default=yes"
=item "KMAC-256", "provider=default" or "provider=fips"
=back
+1 -1
View File
@@ -15,7 +15,7 @@ used with EVP_MAC_fetch():
=over 4
=item "POLY1305", "default=yes"
=item "POLY1305", "provider=default"
=back
+1 -1
View File
@@ -15,7 +15,7 @@ used with EVP_MAC_fetch():
=over 4
=item "SIPHASH", "default=yes"
=item "SIPHASH", "provider=default"
=back
+6 -52
View File
@@ -17,59 +17,16 @@ One of the requirements for the FIPS module is self testing. An optional callbac
mechanism is available to return information to the user using
L<OSSL_SELF_TEST_set_callback(3)>.
The parameters passed to the callback are described in L<OSSL_SELF_TEST_new(3)>
The OPENSSL FIPS module uses the following mechanism to provide information
about the self tests as they run.
This is useful for debugging if a self test is failing.
The callback also allows forcing any self test to fail, in order to check that
it operates correctly on failure.
The 'args' parameter of B<OSSL_CALLBACK> contains the B<OPENSSL_CTX> associated
with the provider that is triggering the self test. This may be useful if
multiple fips providers are present.
The OSSL_PARAM names used are:
=over 4
=item "st-phase" (B<OSSL_PROV_PARAM_SELF_TEST_PHASE>) <UTF8 string>
Each self test calls the callback 3 times with the following string values
for the phase.
=over 4
=item "Start" (B<OSSL_SELF_TEST_PHASE_START>)
This is the initial phase before the self test has run.
This is used for informational purposes only.
The value returned by the callback is ignored.
=item "Corrupt" (B<OSSL_SELF_TEST_PHASE_CORRUPT>)
The corrupt phase is run after the self test has calculated its known value.
The callback may be used to force the self test to fail by returning a value
of 0 from the callback during this phase.
Returning any other value from the callback causes the self test to run normally.
=item "Pass" (B<OSSL_SELF_TEST_PHASE_PASS>)
=item "Fail" (B<OSSL_SELF_TEST_PHASE_FAIL>)
The final phase runs after the self test is complete and indicates if a self
test passed or failed. This is used for informational purposes only.
The value returned by the callback is ignored.
"Fail" should normally only be returned if any self test was forced to fail
during the "Corrupt" phase (or if there was an error such as the integrity
check of the module failed).
Note that all self tests run even if a self test failure occurs.
=back
=item "st-type" (B<OSSL_PROV_PARAM_SELF_TEST_TYPE>) <UTF8 string>
Used as a category to identify the type of self test being run.
It includes the following string values:
The FIPS module passes the following type(s) to OSSL_SELF_TEST_onbegin().
=over 4
@@ -126,10 +83,8 @@ All other self test categories are run once at installation time, except for the
There is only one instance of the "Module_Integrity" and "Install_Integrity"
self tests. All other self tests may have multiple instances.
=item "st-desc" (B<OSSL_PROV_PARAM_SELF_TEST_DESC>) <UTF8 string>
Used as a sub category to identify an individual self test.
The following description strings are used.
The FIPS module passes the following descriptions(s) to OSSL_SELF_TEST_onbegin().
=over 4
@@ -187,8 +142,6 @@ DRBG tests used with the "DRBG" type.
=back
=back
=head1 EXAMPLES
A simple self test callback is shown below for illustrative purposes.
@@ -241,6 +194,7 @@ A simple self test callback is shown below for illustrative purposes.
L<openssl-fipsinstall(1)>,
L<fips_config(5)>,
L<OSSL_SELF_TEST_set_callback(3)>,
L<OSSL_SELF_TEST_new(3)>,
L<OSSL_PARAM(3)>,
L<openssl-core.h(7)>
@@ -250,7 +204,7 @@ The type and functions described here were added in OpenSSL 3.0.
=head1 COPYRIGHT
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
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
+6 -6
View File
@@ -52,15 +52,15 @@ The full syntax for property definitions appears below.
Each implementation of an algorithm can define any number of
properties.
For example, the default provider defines the property I<default=yes>
For example, the default provider defines the property I<provider=default>
for all of its algorithms.
Likewise, the FIPS provider defines I<fips=yes> and the legacy provider
defines I<legacy=yes> for all of their algorithms.
Likewise, OpenSSL's FIPS provider defines I<provider=fips> and the legacy
provider defines I<provider=legacy> for all of their algorithms.
=head2 Queries
A I<property query clause> is a single conditional test.
For example, "fips=yes", "default!=yes" or "?iteration.count!=3".
For example, "fips=yes", "provider!=default" or "?iteration.count!=3".
The first two represent mandatory clauses, such clauses B<must> match
for any algorithm to even be under consideration.
The third clause represents an optional clause.
@@ -117,8 +117,8 @@ Ordering of optional clauses is not significant.
=head2 Shortcut
In order to permit a more concise expression of boolean properties, there
is one short cut: a property name alone (e.g. "default") is
exactly equivalent to "default=yes" in both definitions and queries.
is one short cut: a property name alone (e.g. "my.property") is
exactly equivalent to "my.property=yes" in both definitions and queries.
=head2 Global and Local
+86 -12
View File
@@ -31,6 +31,8 @@ provider-keyexch - The keyexch library E<lt>-E<gt> provider functions
/* Key Exchange parameters */
int OP_keyexch_set_ctx_params(void *ctx, const OSSL_PARAM params[]);
const OSSL_PARAM *OP_keyexch_settable_ctx_params(void);
int OP_keyexch_get_ctx_params(void *ctx, OSSL_PARAM params[]);
const OSSL_PARAM *OP_keyexch_gettable_ctx_params(void);
=head1 DESCRIPTION
@@ -71,6 +73,8 @@ macros in L<openssl-core_numbers.h(7)>, as follows:
OP_keyexch_set_ctx_params OSSL_FUNC_KEYEXCH_SET_CTX_PARAMS
OP_keyexch_settable_ctx_params OSSL_FUNC_KEYEXCH_SETTABLE_CTX_PARAMS
OP_keyexch_get_ctx_params OSSL_FUNC_KEYEXCH_GET_CTX_PARAMS
OP_keyexch_gettable_ctx_params OSSL_FUNC_KEYEXCH_GETTABLE_CTX_PARAMS
A key exchange algorithm implementation may not implement all of these functions.
In order to be a consistent set of functions a provider must implement
@@ -123,14 +127,35 @@ The length of the shared secret should be written to I<*secretlen>.
If I<secret> is NULL then the maximum length of the shared secret should be
written to I<*secretlen>.
=head2 Key Exchange Parameters Functions
OP_keyexch_set_ctx_params() sets key exchange parameters associated with the
given provider side key exchange context I<ctx> to I<params>,
see L</Key Exchange Parameters>.
Any parameter settings are additional to any that were previously set.
OP_keyexch_get_ctx_params() gets key exchange parameters associated with the
given provider side key exchange context I<ctx> into I<params>,
see L</Key Exchange Parameters>.
OP_keyexch_settable_ctx_params() yields a constant B<OSSL_PARAM> array that
describes the settable parameters, i.e. parameters that can be used with
OP_signature_set_ctx_params().
If OP_keyexch_settable_ctx_params() is present, OP_keyexch_set_ctx_params() must
also be present, and vice versa.
Similarly, OP_keyexch_gettable_ctx_params() yields a constant B<OSSL_PARAM>
array that describes the gettable parameters, i.e. parameters that can be
handled by OP_signature_get_ctx_params().
If OP_keyexch_gettable_ctx_params() is present, OP_keyexch_get_ctx_params() must
also be present, and vice versa.
See L<OSSL_PARAM(3)> for the use of B<OSSL_PARAM> as parameter descriptor.
Notice that not all settable parameters are also gettable, and vice versa.
=head2 Key Exchange Parameters
See L<OSSL_PARAM(3)> for further details on the parameters structure used by
the OP_keyexch_set_params() function.
OP_keyexch_set_ctx_params() sets key exchange parameters associated with the
given provider side key exchange context I<ctx> to I<params>.
Any parameter settings are additional to any that were previously set.
the OP_keyexch_set_ctx_params() and OP_keyexch_get_ctx_params() functions.
Parameters currently recognised by built-in key exchange algorithms are as
follows.
@@ -150,20 +175,69 @@ If padding is on then the derived shared secret will have its first bytes filled
with 0s where necessary to make the shared secret the same size as the largest
possible secret size.
=back
=item "ecdh-cofactor-mode" (B<OSSL_EXCHANGE_PARAM_EC_ECDH_COFACTOR_MODE>) <integer>
OP_keyexch_settable_ctx_params() gets a constant B<OSSL_PARAM> array that
describes the settable parameters, i.e. parameters that can be used with
OP_signature_set_ctx_params().
See L<OSSL_PARAM(3)> for the use of B<OSSL_PARAM> as parameter descriptor.
Sets/gets the ECDH mode of operation for the associated key exchange ctx.
In the context of an Elliptic Curve Diffie-Hellman key exchange, this parameter
can be used to select between the plain Diffie-Hellman (DH) or Cofactor
Diffie-Hellman (CDH) variants of the key exchange algorithm.
When setting, the value should be 1, 0 or -1, respectively forcing cofactor mode
on, off, or resetting it to the default for the private key associated with the
given key exchange ctx.
When getting, the value should be either 1 or 0, respectively signaling if the
cofactor mode is on or off.
See also L<provider-keymgmt(7)> for the related
B<OSSL_PKEY_PARAM_USE_COFACTOR_ECDH> parameter that can be set on a
per-key basis.
=item "kdf-type" (B<OSSL_EXCHANGE_PARAM_KDF_TYPE>) <utf8_string>
Sets/gets the Key Derivation Function type to apply within the associated key
exchange ctx.
=item "kdf-digest" (B<OSSL_EXCHANGE_PARAM_KDF_DIGEST>) <utf8_string>
Sets/gets the Digest algorithm to be used as part of the Key Derivation Function
associated with the given key exchange ctx.
=item "kdf-digest-props" (B<OSSL_EXCHANGE_PARAM_KDF_DIGEST_PROPS>) <utf8_string>
Sets properties to be used upon look up of the implementation for the selected
Digest algorithm for the Key Derivation Function associated with the given key
exchange ctx.
=item "kdf-outlen" (B<OSSL_EXCHANGE_PARAM_KDF_OUTLEN>) <size_t>
Sets/gets the desired size for the output of the chosen Key Derivation Function
associated with the given key exchange ctx.
=item "kdf-ukm" (B<OSSL_EXCHANGE_PARAM_KDF_UKM>) <octet_string>
Sets/gets User Key Material to be used as part of the selected Key Derivation
Function associated with the given key exchange ctx.
=item "kdf-ukm-len" (B<OSSL_EXCHANGE_PARAM_KDF_UKM_LEN>) <size_t>
Sets/gets the size of the User Key Material to be used as part of the selected
Key Derivation Function associated with the given key exchange ctx.
=back
=head1 RETURN VALUES
OP_keyexch_newctx() and OP_keyexch_dupctx() should return the newly created
provider side key exchange context, or NULL on failure.
OP_keyexch_init(), OP_keyexch_set_peer(), OP_keyexch_derive() and
OP_keyexch_set_params() should return 1 for success or 0 on error.
OP_keyexch_init(), OP_keyexch_set_peer(), OP_keyexch_derive(),
OP_keyexch_set_params(), and OP_keyexch_get_params() should return 1 for success
or 0 on error.
OP_keyexch_settable_ctx_params() and OP_keyexch_gettable_ctx_params() should
always return a constant B<OSSL_PARAM> array.
=head1 SEE ALSO
+158 -9
View File
@@ -21,26 +21,30 @@ provider-keymgmt - The KEYMGMT library E<lt>-E<gt> provider functions
/* Key object information */
int OP_keymgmt_get_params(void *keydata, OSSL_PARAM params[]);
const OSSL_PARAM *OP_keymgmt_gettable_params(void);
int OP_keymgmt_set_params(void *keydata, const OSSL_PARAM params[]);
const OSSL_PARAM *OP_keymgmt_settable_params(void);
/* Key object content checks */
int OP_keymgmt_has(void *keydata, int selection);
int OP_keymgmt_match(const void *keydata1, const void *keydata2,
int selection);
/* Discovery of supported operations */
const char *OP_keymgmt_query_operation_name(int operation_id);
/* Key object import and export functions */
int OP_keymgmt_import(int selection, void *keydata, const OSSL_PARAM params[]);
const OSSL_PARAM *OP_keymgmt_import_types, (int selection);
const OSSL_PARAM *OP_keymgmt_import_types(int selection);
int OP_keymgmt_export(int selection, void *keydata,
OSSL_CALLBACK *param_cb, void *cbarg);
const OSSL_PARAM *OP_keymgmt_export_types(int selection);
/* Key object copy */
int OP_keymgmt_copy(void *keydata_to, const void *keydata_from, int selection);
/* Key object validation */
int OP_keymgmt_validate(void *keydata, int selection);
/* Discovery of supported operations */
const char *OP_keymgmt_query_operation_name(int operation_id);
=head1 DESCRIPTION
The KEYMGMT operation doesn't have much public visibility in OpenSSL
@@ -78,17 +82,21 @@ macros in L<openssl-core_numbers.h(7)>, as follows:
OP_keymgmt_get_params OSSL_FUNC_KEYMGMT_GET_PARAMS
OP_keymgmt_gettable_params OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS
OP_keymgmt_set_params OSSL_FUNC_KEYMGMT_SET_PARAMS
OP_keymgmt_settable_params OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS
OP_keymgmt_query_operation_name OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME
OP_keymgmt_has OSSL_FUNC_KEYMGMT_HAS
OP_keymgmt_validate OSSL_FUNC_KEYMGMT_VALIDATE
OP_keymgmt_match OSSL_FUNC_KEYMGMT_MATCH
OP_keymgmt_import OSSL_FUNC_KEYMGMT_IMPORT
OP_keymgmt_import_types OSSL_FUNC_KEYMGMT_IMPORT_TYPES
OP_keymgmt_export OSSL_FUNC_KEYMGMT_EXPORT
OP_keymgmt_export_types OSSL_FUNC_KEYMGMT_EXPORT_TYPES
OP_keymgmt_copy OSSL_FUNC_KEYMGMT_COPY
=head2 Key Objects
@@ -202,7 +210,17 @@ descriptor B<OSSL_PARAM>, for parameters that OP_keymgmt_get_params()
can handle.
If OP_keymgmt_gettable_params() is present, OP_keymgmt_get_params()
must also be present.
must also be present, and vice versa.
OP_keymgmt_set_params() should update information data associated
with the given I<keydata>, see L</Information Parameters>.
OP_keymgmt_settable_params() should return a constant array of
descriptor B<OSSL_PARAM>, for parameters that OP_keymgmt_set_params()
can handle.
If OP_keymgmt_settable_params() is present, OP_keymgmt_set_params()
must also be present, and vice versa.
=head2 Key Object Checking Functions
@@ -214,7 +232,7 @@ returns NULL, the caller is free to assume that there's an algorithm
from the same provider, of the same name as the one used to fetch the
keymgmt and try to use that.
OP_keymgmt_has() should check whether the given I<keydata> the subsets
OP_keymgmt_has() should check whether the given I<keydata> contains the subsets
of data indicated by the I<selector>. A combination of several
selector bits must consider all those subsets, not just one. An
implementation is, however, free to consider an empty subset of data
@@ -228,7 +246,12 @@ B<OSSL_KEYMGMT_SELECT_PUBLIC_KEY> (or B<OSSL_KEYMGMT_SELECT_KEYPAIR>
for short) is expected to check that the pairwise consistency of
I<keydata> is valid.
=head2 Key Object Import and Export Functions
OP_keymgmt_match() should check if the data subset indicated by
I<selection> in I<keydata1> and I<keydata2> match. It is assumed that
the caller has ensured that I<keydata1> and I<keydata2> are both owned
by the implementation of this function.
=head2 Key Object Import, Export and Copy Functions
OP_keymgmt_import() should import data indicated by I<selection> into
I<keydata> with values taken from the B<OSSL_PARAM> array I<params>.
@@ -245,12 +268,100 @@ OP_keymgmt_export_types() should return a constant array of descriptor
B<OSSL_PARAM> for data indicated by I<selection>, that the
OP_keymgmt_export() callback can expect to receive.
OP_keymgmt_copy() should copy data subsets indicated by I<selection>
from I<keydata_from> to I<keydata_to>. It is assumed that the caller
has ensured that I<keydata_to> and I<keydata_from> are both owned by
the implementation of this function.
=head2 Built-in RSA Import/Export Types
The following Import/Export types are available for the built-in RSA algorithm:
=over 4
=item "n" (B<OSSL_PKEY_PARAM_RSA_N>) <integer>
The RSA "n" value.
=item "e" (B<OSSL_PKEY_PARAM_RSA_E>) <integer>
The RSA "e" value.
=item "d" (B<OSSL_PKEY_PARAM_RSA_D>) <integer>
The RSA "d" value.
=item "rsa-factor" (B<OSSL_PKEY_PARAM_RSA_FACTOR>) <integer>
An RSA factor. In 2 prime RSA these are often known as "p" or "q". This value
may be repeated up to 10 times in a single key.
=item "rsa-exponent" (B<OSSL_PKEY_PARAM_RSA_EXPONENT>) <integer>
An RSA CRT (Chinese Remainder Theorem) exponent. This value may be repeated up
to 10 times in a single key.
=item "rsa-coefficient" (B<OSSL_PKEY_PARAM_RSA_COEFFICIENT>) <integer>
An RSA CRT (Chinese Remainder Theorem) coefficient. This value may be repeated
up to 9 times in a single key.
=back
=head2 Built-in DSA and Diffie-Hellman Import/Export Types
The following Import/Export types are available for the built-in DSA and
Diffie-Hellman algorithms:
=over 4
=item "pub" (B<OSSL_PKEY_PARAM_PUB_KEY>) <integer> or <octet string>
The public key value.
=item "priv" (B<OSSL_PKEY_PARAM_PRIV_KEY>) <integer> or <octet string>
The private key value.
=item "p" (B<OSSL_PKEY_PARAM_FFC_P>) <integer>
A DSA or Diffie-Hellman "p" value.
=item "q" (B<OSSL_PKEY_PARAM_FFC_Q>) <integer>
A DSA or Diffie-Hellman "q" value.
=item "g" (B<OSSL_PKEY_PARAM_FFC_G>) <integer>
A DSA or Diffie-Hellman "g" value.
=back
=head2 Built-in X25519, X448, ED25519 and ED448 Import/Export Types
The following Import/Export types are available for the built-in X25519, X448,
ED25519 and X448 algorithms:
=over 4
=item "pub" (B<OSSL_PKEY_PARAM_PUB_KEY>) <octet string>
The public key value.
=item "priv" (B<OSSL_PKEY_PARAM_PRIV_KEY>) <octet string>
The private key value.
=back
=head2 Information Parameters
See L<OSSL_PARAM(3)> for further details on the parameters structure.
Parameters currently recognised by built-in keymgmt algorithms'
OP_keymgmt_get_params:
Parameters currently recognised by built-in keymgmt algorithms
are as follows.
Not all parameters are relevant to, or are understood by all keymgmt
algorithms:
=over 4
@@ -278,8 +389,46 @@ dimensions handled in the rest of the same provider.
The value should be the number of security bits of the given key.
Bits of security is defined in SP800-57.
=item "use-cofactor-flag" (B<OSSL_PKEY_PARAM_USE_COFACTOR_FLAG>,
B<OSSL_PKEY_PARAM_USE_COFACTOR_ECDH>) <integer>
The value should be either 1 or 0, to respectively enable or disable
use of the cofactor in operations using this key.
In the context of a key that can be used to perform an Elliptic Curve
Diffie-Hellman key exchange, this parameter can be used to mark a requirement
for using the Cofactor Diffie-Hellman (CDH) variant of the key exchange
algorithm.
See also L<provider-keyexch(7)> for the related
B<OSSL_EXCHANGE_PARAM_EC_ECDH_COFACTOR_MODE> parameter that can be set on a
per-operation basis.
=back
=head1 RETURN VALUES
OP_keymgmt_new() should return a valid reference to the newly created provider
side key object, or NULL on failure.
OP_keymgmt_import(), OP_keymgmt_export(), OP_keymgmt_get_params() and
OP_keymgmt_set_params() should return 1 for success or 0 on error.
OP_keymgmt_validate() should return 1 on successful validation, or 0 on
failure.
OP_keymgmt_has() should return 1 if all the selected data subsets are contained
in the given I<keydata> or 0 otherwise.
OP_keymgmt_query_operation_name() should return a pointer to a string matching
the requested operation, or NULL if the same name used to fetch the keymgmt
applies.
OP_keymgmt_gettable_params() and OP_keymgmt_settable_params()
OP_keymgmt_import_types(), OP_keymgmt_export_types()
should
always return a constant B<OSSL_PARAM> array.
=head1 SEE ALSO
L<provider(7)>
+16 -10
View File
@@ -260,8 +260,12 @@ algorithm identifier to the appropriate fetching function.
The default provider is built in as part of the F<libcrypto> library.
Should it be needed (if other providers are loaded and offer
implementations of the same algorithms), the property "default=yes"
can be used as a search criterion for these implementations.
implementations of the same algorithms), the property "provider=default"
can be used as a search criterion for these implementations. Some
non-cryptographic algorithms (such as serializers for loading keys and
parameters from files) are not FIPS algorithm implementations in themselves but
support algorithms from the FIPS provider and are allowed for use in "FIPS
mode". The property "fips=yes" can be used to select such algorithms.
=head2 FIPS provider
@@ -269,8 +273,10 @@ The FIPS provider is a dynamically loadable module, and must therefore
be loaded explicitly, either in code or through OpenSSL configuration
(see L<config(5)>).
Should it be needed (if other providers are loaded and offer
implementations of the same algorithms), the property "fips=yes" can
be used as a search criterion for these implementations.
implementations of the same algorithms), the property "provider=fips" can
be used as a search criterion for these implementations. All algorithm
implementations in the FIPS provider can also be selected with the property
"fips=yes".
=head2 Legacy provider
@@ -278,7 +284,7 @@ The legacy provider is a dynamically loadable module, and must therefore
be loaded explicitly, either in code or through OpenSSL configuration
(see L<config(5)>).
Should it be needed (if other providers are loaded and offer
implementations of the same algorithms), the property "legacy=yes" can be
implementations of the same algorithms), the property "provider=legacy" can be
used as a search criterion for these implementations.
=head1 EXAMPLES
@@ -300,21 +306,21 @@ Fetch any available implementation of AES-128-CBC in the default context:
Fetch an implementation of SHA2-256 from the default provider in the default
context:
EVP_MD *md = EVP_MD_fetch(NULL, "SHA2-256", "default=yes");
EVP_MD *md = EVP_MD_fetch(NULL, "SHA2-256", "provider=default");
...
EVP_MD_meth_free(md);
Fetch an implementation of SHA2-256 that is not from the default provider in the
default context:
EVP_MD *md = EVP_MD_fetch(NULL, "SHA2-256", "default=no");
EVP_MD *md = EVP_MD_fetch(NULL, "SHA2-256", "provider!=default");
...
EVP_MD_meth_free(md);
Fetch an implementation of SHA2-256 from the default provider in the specified
context:
EVP_MD *md = EVP_MD_fetch(ctx, "SHA2-256", "default=yes");
EVP_MD *md = EVP_MD_fetch(ctx, "SHA2-256", "provider=default");
...
EVP_MD_meth_free(md);
@@ -324,11 +330,11 @@ implementation of WHIRLPOOL from it:
/* This only needs to be done once - usually at application start up */
OSSL_PROVIDER *legacy = OSSL_PROVIDER_load(NULL, "legacy");
EVP_MD *md = EVP_MD_fetch(NULL, "WHIRLPOOL", "legacy=yes");
EVP_MD *md = EVP_MD_fetch(NULL, "WHIRLPOOL", "provider=legacy");
...
EVP_MD_meth_free(md);
Note that in the above example the property string "legacy=yes" is optional
Note that in the above example the property string "provider=legacy" is optional
since, assuming no other providers have been loaded, the only implementation of
the "whirlpool" algorithm is in the "legacy" provider. Also note that the
default provider should be explicitly loaded if it is required in addition to