Latest update.

This commit is contained in:
2020-04-15 18:45:34 +09:00
parent be29e7bcc6
commit 2015c00c43
573 changed files with 22943 additions and 6714 deletions
+46
View File
@@ -0,0 +1,46 @@
=pod
=head1 NAME
EVP_MD-BLAKE2 - The BLAKE2 EVP_MD implementation
=head1 DESCRIPTION
Support for computing SHA2 digests through the B<EVP_MD> API.
=head2 Identities
This implementation is only available with the default provider, and
includes the following varieties:
=over 4
=item BLAKE2S-256
Known names are "BLAKE2S-256" and "BLAKE2s256".
=item BLAKE2B-512
Known names are "BLAKE2B-512" and "BLAKE2b512".
=back
=head2 Gettable Parameters
This implementation supports the common gettable parameters described
in L<EVP_MD-common(7)>.
=head1 SEE ALSO
L<provider-digest(7)>, L<OSSL_PROVIDER-default(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
+34
View File
@@ -0,0 +1,34 @@
=pod
=head1 NAME
EVP_MD-MD2 - The MD2 EVP_MD implementation
=head1 DESCRIPTION
Support for computing MD2 digests through the B<EVP_MD> API.
=head2 Identity
This implementation is only available with the legacy provider, and is
identified with the name "MD2".
=head2 Gettable Parameters
This implementation supports the common gettable parameters described
in L<EVP_MD-common(7)>.
=head1 SEE ALSO
L<provider-digest(7)>, L<OSSL_PROVIDER-default(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
+34
View File
@@ -0,0 +1,34 @@
=pod
=head1 NAME
EVP_MD-MD4 - The MD4 EVP_MD implementation
=head1 DESCRIPTION
Support for computing MD4 digests through the B<EVP_MD> API.
=head2 Identity
This implementation is only available with the legacy provider, and is
identified with the name "MD4".
=head2 Gettable Parameters
This implementation supports the common gettable parameters described
in L<EVP_MD-common(7)>.
=head1 SEE ALSO
L<provider-digest(7)>, L<OSSL_PROVIDER-default(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
+56
View File
@@ -0,0 +1,56 @@
=pod
=head1 NAME
EVP_MD-MD5-SHA1 - The MD5-SHA1 EVP_MD implementation
=head1 DESCRIPTION
Support for computing MD5-SHA1 digests through the B<EVP_MD> API.
MD5-SHA1 is a rather special digest that's used with SSLv3.
=head2 Identity
This implementation is only available with the default provider, and is
identified with the name "MD5-SHA1".
=head2 Gettable Parameters
This implementation supports the common gettable parameters described
in L<EVP_MD-common(7)>.
=head2 Settable Context Parameters
This implementation supports the following L<OSSL_PARAM(3)> entries,
settable for an B<EVP_MD_CTX> with L<EVP_MD_CTX_set_params(3)>:
=over 4
=item "ssl3-ms" (B<OSSL_DIGEST_PARAM_SSL3_MS>) <octet string>
This parameter is set by libssl in order to calculate a signature hash for an
SSLv3 CertificateVerify message as per RFC6101.
It is only set after all handshake messages have already been digested via
OP_digest_update() calls.
The parameter provides the master secret value to be added to the digest.
The digest implementation should calculate the complete digest as per RFC6101
section 5.6.8.
The next call after setting this parameter should be OP_digest_final().
=back
=head1 SEE ALSO
L<EVP_MD_CTX_set_params(3)>, L<provider-digest(7)>, L<OSSL_PROVIDER-default(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
+34
View File
@@ -0,0 +1,34 @@
=pod
=head1 NAME
EVP_MD-MD5 - The MD5 EVP_MD implementation
=head1 DESCRIPTION
Support for computing MD5 digests through the B<EVP_MD> API.
=head2 Identity
This implementation is only available with the default provider, and is
identified with the name "MD5".
=head2 Gettable Parameters
This implementation supports the common gettable parameters described
in L<EVP_MD-common(7)>.
=head1 SEE ALSO
L<provider-digest(7)>, L<OSSL_PROVIDER-default(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
+50
View File
@@ -0,0 +1,50 @@
=pod
=head1 NAME
EVP_MD-MDC2 - The MDC2 EVP_MD implementation
=head1 DESCRIPTION
Support for computing MDC2 digests through the B<EVP_MD> API.
=head2 Identity
This implementation is only available with the legacy provider, and is
identified with the name "MDC2".
=head2 Gettable Parameters
This implementation supports the common gettable parameters described
in L<EVP_MD-common(7)>.
=head2 Settable Context Parameters
This implementation supports the following L<OSSL_PARAM(3)> entries,
settable for an B<EVP_MD_CTX> with L<EVP_MD_CTX_set_params(3)>:
=over 4
=item "pad_type" (B<OSSL_DIGEST_PARAM_PAD_TYPE>) <unsigned integer>
Sets the padding type to be used.
Normally the final MDC2 block is padded with zeros.
If the pad type is set to 2 then the final block is padded with 0x80 followed by
zeros.
=back
=head1 SEE ALSO
L<EVP_MD_CTX_set_params(3)>, L<provider-digest(7)>, L<OSSL_PROVIDER-legacy(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
+35
View File
@@ -0,0 +1,35 @@
=pod
=head1 NAME
EVP_MD-RIPEMD160 - The RIPEMD160 EVP_MD implementation
=head1 DESCRIPTION
Support for computing RIPEMD160 digests through the B<EVP_MD> API.
=head2 Identities
This implementation is only available with the legacy provider, and is
identified with any of the names "RIPEMD-160", "RIPEMD160", "RIPEMD" and
"RMD160".
=head2 Gettable Parameters
This implementation supports the common gettable parameters described
in L<EVP_MD-common(7)>.
=head1 SEE ALSO
L<provider-digest(7)>, L<OSSL_PROVIDER-default(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
+55
View File
@@ -0,0 +1,55 @@
=pod
=head1 NAME
EVP_MD-SHA1 - The SHA1 EVP_MD implementation
=head1 DESCRIPTION
Support for computing SHA1 digests through the B<EVP_MD> API.
=head2 Identities
This implementation is available with the FIPS provider as well as the
default provider, and is identified with the names "SHA1" and "SHA-1".
=head2 Gettable Parameters
This implementation supports the common gettable parameters described
in L<EVP_MD-common(7)>.
=head2 Settable Context Parameters
This implementation supports the following L<OSSL_PARAM(3)> entries,
settable for an B<EVP_MD_CTX> with L<EVP_MD_CTX_set_params(3)>:
=over 4
=item "ssl3-ms" (B<OSSL_DIGEST_PARAM_SSL3_MS>) <octet string>
This parameter is set by libssl in order to calculate a signature hash for an
SSLv3 CertificateVerify message as per RFC6101.
It is only set after all handshake messages have already been digested via
OP_digest_update() calls.
The parameter provides the master secret value to be added to the digest.
The digest implementation should calculate the complete digest as per RFC6101
section 5.6.8.
The next call after setting this parameter should be OP_digest_final().
=back
=head1 SEE ALSO
L<EVP_MD_CTX_set_params(3)>, L<provider-digest(7)>,
L<OSSL_PROVIDER-FIPS(7)>, L<OSSL_PROVIDER-default(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
+77
View File
@@ -0,0 +1,77 @@
=pod
=head1 NAME
EVP_MD-SHA2 - The SHA2 EVP_MD implementation
=head1 DESCRIPTION
Support for computing SHA2 digests through the B<EVP_MD> API.
=head2 Identities
This implementation includes the following varieties:
=over 4
=item *
Available with the FIPS provider as well as the default provider:
=over 4
=item SHA2-224
Known names are "SHA2-224", "SHA-224" and "SHA224".
=item SHA2-256
Known names are "SHA2-256", "SHA-256" and "SHA256".
=item SHA2-384
Known names are "SHA2-384", "SHA-384" and "SHA384".
=item SHA2-512
Known names are "SHA2-512", "SHA-512" and "SHA512".
=back
=item *
Available with the default provider:
=over 4
=item SHA2-512/224
Known names are "SHA2-512/224", "SHA-512/224" and "SHA512-224".
=item SHA2-512/256
Known names are "SHA2-512/256", "SHA-512/256" and "SHA512-256".
=back
=back
=head2 Gettable Parameters
This implementation supports the common gettable parameters described
in L<EVP_MD-common(7)>.
=head1 SEE ALSO
L<provider-digest(7)>, L<OSSL_PROVIDER-FIPS(7)>, L<OSSL_PROVIDER-default(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
+46
View File
@@ -0,0 +1,46 @@
=pod
=head1 NAME
EVP_MD-SHA3 - The SHA3 EVP_MD implementations
=head1 DESCRIPTION
Support for computing SHA3 digests through the B<EVP_MD> API.
=head2 Identities
This implementation is available with the FIPS provider as well as the
default provider, and includes the following varieties:
=over 4
=item "SHA3-224"
=item "SHA3-256"
=item "SHA3-384"
=item "SHA3-512"
=back
=head2 Gettable Parameters
This implementation supports the common gettable parameters described
in L<EVP_MD-common(7)>.
=head1 SEE ALSO
L<provider-digest(7)>, L<OSSL_PROVIDER-FIPS(7)>, L<OSSL_PROVIDER-default(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
+73
View File
@@ -0,0 +1,73 @@
=pod
=head1 NAME
EVP_MD-SHAKE, EVP_MD-KECCAK-KMAC
- The SHAKE / KECCAK family EVP_MD implementations
=head1 DESCRIPTION
Support for computing SHAKE or KECCAK-KMAC digests through the
B<EVP_MD> API.
KECCAK-KMAC is a special digest that's used by the KMAC EVP_MAC
implementation (see L<EVP_MAC-KMAC(7)>).
=head2 Identities
This implementation is only available with the default provider, and
includes the following varieties:
=over 4
=item KECCAK-KMAC-128
Known names are "KECCAK-KMAC-128" and "KECCAK-KMAC128"
=item KECCAK-KMAC-256
Known names are "KECCAK-KMAC-256" and "KECCAK-KMAC256"
=item SHAKE-128
Known names are "SHAKE-128" and "SHAKE128"
=item SHAKE-256
Known names are "SHAKE-256" and "SHAKE256"
=back
=head2 Gettable Parameters
This implementation supports the common gettable parameters described
in L<EVP_MD-common(7)>.
=head2 Settable Context Parameters
These implementations support the following L<OSSL_PARAM(3)> entries,
settable for an B<EVP_MD_CTX> with L<EVP_MD_CTX_set_params(3)>:
=over 4
=item "xoflen" (B<OSSL_DIGEST_PARAM_XOFLEN>) <unsigned integer>
Sets the digest length for extendable output functions.
The length of the "xoflen" parameter should not exceed that of a B<size_t>.
=back
=head1 SEE ALSO
L<EVP_MD_CTX_set_params(3)>, L<provider-digest(7)>, L<OSSL_PROVIDER-default(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
+34
View File
@@ -0,0 +1,34 @@
=pod
=head1 NAME
EVP_MD-SM3 - The SM3 EVP_MD implementations
=head1 DESCRIPTION
Support for computing SM3 digests through the B<EVP_MD> API.
=head2 Identity
This implementation is only available with the default provider, and is
identified with the name "SM3".
=head2 Gettable Parameters
This implementation supports the common gettable parameters described
in L<EVP_MD-common(7)>.
=head1 SEE ALSO
L<provider-digest(7)>, L<OSSL_PROVIDER-default(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
+34
View File
@@ -0,0 +1,34 @@
=pod
=head1 NAME
EVP_MD-WHIRLPOOL - The WHIRLPOOL EVP_MD implementation
=head1 DESCRIPTION
Support for computing WHIRLPOOL digests through the B<EVP_MD> API.
=head2 Identity
This implementation is only available with the legacy provider, and is
identified with the name "WHIRLPOOL".
=head2 Gettable Parameters
This implementation supports the common gettable parameters described
in L<EVP_MD-common(7)>.
=head1 SEE ALSO
L<provider-digest(7)>, L<OSSL_PROVIDER-default(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
+67
View File
@@ -0,0 +1,67 @@
=pod
=head1 NAME
EVP_MD-common - The OpenSSL EVP_MD implementations, common things
=head1 DESCRIPTION
All the OpenSSL EVP_MD implementations understand the following
L<OSSL_PARAM(3)> entries:
=over 4
Gettable with L<EVP_MD_get_params(3)>:
=over 4
=item "blocksize" (B<OSSL_DIGEST_PARAM_BLOCK_SIZE>) <unsigned integer>
The digest block size.
The length of the "blocksize" parameter should not exceed that of a
B<size_t>.
This value can also be retrieved with L<EVP_MD_block_size(3)>.
=item "size" (B<OSSL_DIGEST_PARAM_SIZE>) <unsigned integer>
The digest output size.
The length of the "size" parameter should not exceed that of a B<size_t>.
This value can also be retrieved with L<EVP_MD_size(3)>.
=item "flags" (B<OSSL_DIGEST_PARAM_FLAGS>) <unsigned integer>
Diverse flags that describe exceptional behaviour for the digest.
These flags are described in L<EVP_MD_meth_set_flags(3)/DESCRIPTION>.
The length of the "flags" parameter should equal that of an
B<unsigned long int>.
=begin comment
The description of these flags should probably be moved. Also,
EVP_MD_FLAG_FIPS isn't relevant any more.
=end comment
This value can also be retrieved with L<EVP_MD_flags(3)>.
=back
=back
=head1 SEE ALSO
L<EVP_MD_get_params(3)>, L<provider-digest(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
+1 -1
View File
@@ -11,7 +11,7 @@ Ed448
The B<Ed25519> and B<Ed448> EVP_PKEY implementation supports key generation,
one-shot digest sign and digest verify using PureEdDSA and B<Ed25519> or B<Ed448>
(see RFC8032). It has associated private and public key formats compatible with
draft-ietf-curdle-pkix-04.
RFC 8410.
No additional parameters can be set during key generation, one-shot signing or
verification. In particular, because PureEdDSA is used, a digest must B<NOT> be
+130 -5
View File
@@ -2,15 +2,136 @@
=head1 NAME
OSSL_PROVIDER-FIPS - OPENSSL FIPS provider
OSSL_PROVIDER-FIPS - OpenSSL FIPS provider
=head1 DESCRIPTION
The OPENSSL FIPS provider is a special provider that conforms to the Federal
The OpenSSL FIPS provider is a special provider that conforms to the Federal
Information Processing Standards (FIPS) specified in FIPS 140-2. This 'module'
contains an approved set of cryptographic algorithms that is validated by an
accredited testing laboratory.
=head2 Properties
The implementations in this provider specifically have these properties
defined:
=over 4
"provider=default"
"fips=yes"
=back
It may be used in a property query string with fetching functions such as
L<EVP_MD_fetch(3)> or L<EVP_CIPHER_fetch(3)>, as well as with other
functions that take a property query string, such as
L<EVP_PKEY_CTX_new_from_name(3)>.
It isn't mandatory to query for any of these properties, except to
make sure to get implementations of this provider and none other.
The "fips=yes" property can be use to make sure only FIPS approved
implementations are used for crypto operations. This may also include
other non-crypto support operations that are not in the fips provider,
such as asymmetric key serializers,
see L<OSSL_PROVIDER-default(7)/Asymmetric Key Management>.
=head1 OPERATIONS AND ALGORITHMS
The OpenSSL FIPS provider supports these operations and algorithms:
=head2 Hashing Algorithms / Message Digests
=over 4
=item SHA1, see L<EVP_MD-SHA1(7)>
=item SHA2, see L<EVP_MD-SHA2(7)>
=item SHA3, see L<EVP_MD-SHA3(7)>
=item KECCAK-KMAC, see L<EVP_MD-KECCAK-KMAC(7)>
=back
=head2 Symmetric Ciphers
=over 4
=item AES, see L<EVP_CIPHER-AES(7)>
=item DES-EDE3 (TrippleDES), see L<EVP_CIPHER-DES(7)>
=back
=head2 Message Authentication Code (MAC)
=over 4
=item CMAC, see L<EVP_MAC-CMAC(7)>
=item GMAC, see L<EVP_MAC-GMAC(7)>
=item HMAC, see L<EVP_MAC-HMAC(7)>
=item KMAC, see L<EVP_MAC-KMAC(7)>
=back
=head2 Key Derivation Function (KDF)
=over 4
=item HKDF, see L<EVP_KDF-HKDF(7)>
=item SSKDF, see L<EVP_KDF-SSKDF(7)>
=item PBKDF2, see L<EVP_KDF-PBKDF2(7)>
=item TLS1-PRF, see L<EVP_KDF-TLS1-PRF(7)>
=item KBKDF, see L<EVP_KDF-KBKDF(7)>
=back
=head2 Key Exchange
=over 4
=item DH, see L<EVP_KEYEXCH-DH(7)>
=back
=head2 Asymmetric Signature
=over 4
=item DSA, see L<EVP_KEYEXCH-DSA(7)>
=back
=head2 Asymmetric Cipher
=over 4
=item RSA, see L<EVP_KEYEXCH-RSA(7)>
=back
=head2 Asymmetric Key Management
=over 4
=item DH, see L<EVP_KEYMGMT-DH(7)>
=item DSA, see L<EVP_KEYMGMT-DSA(7)>
=item RSA, see L<EVP_KEYMGMT-RSA(7)>
=back
=head1 SELF TESTING
One of the requirements for the FIPS module is self testing. An optional callback
@@ -19,7 +140,7 @@ 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
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
@@ -124,12 +245,14 @@ Signature tests used with the "KAT_Signature" type.
=item "ECDH" (B<OSSL_SELF_TEST_DESC_KA_ECDH>)
=item "ECDSA" (B<OSSL_SELF_TEST_DESC_KA_ECDSA>)
=item "DH" (B<OSSL_SELF_TEST_DESC_KA_DH>)
Key agreement tests used with the "KAT_KA" type.
=item "HKDF" (B<OSSL_SELF_TEST_DESC_KDF_HKDF>)
=item "SSKDF" (B<OSSL_SELF_TEST_DESC_KDF_SSKDF>)
Key Derivation Function tests used with the "KAT_KDF" type.
=item "CTR" (B<OSSL_SELF_TEST_DESC_DRBG_CTR>)
@@ -196,7 +319,9 @@ 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)>
L<openssl-core.h(7)>,
L<openssl-core_numbers.h(7)>,
L<provider(7)>
=head1 HISTORY
+226
View File
@@ -0,0 +1,226 @@
=pod
=head1 NAME
OSSL_PROVIDER-default - OpenSSL default provider
=head1 DESCRIPTION
The OpenSSL default provider supplies the majority of OpenSSL's diverse
algorithm implementations. It also acts as a fallback when no other
provider has been loaded.
=head2 Properties
The implementations in this provider specifically have this property
defined:
=over 4
"provider=default"
=back
It may be used in a property query string with fetching functions such as
L<EVP_MD_fetch(3)> or L<EVP_CIPHER_fetch(3)>, as well as with other
functions that take a property query string, such as
L<EVP_PKEY_CTX_new_from_name(3)>.
It isn't mandatory to query for this property, except to make sure to get
implementations of this provider and none other.
Some implementations may define additional properties. Exact information is
listed below
=head1 OPERATIONS AND ALGORITHMS
The OpenSSL default provider supports these operations and algorithms:
=head2 Hashing Algorithms / Message Digests
=over 4
=item SHA1, see L<EVP_MD-SHA1(7)>
=item SHA2, see L<EVP_MD-SHA2(7)>
=item SHA3, see L<EVP_MD-SHA3(7)>
=item KECCAK-KMAC, see L<EVP_MD-KECCAK-KMAC(7)>
=item SHAKE, see L<EVP_MD-SHAKE(7)>
=item BLAKE2, see L<EVP_MD-BLAKE2(7)>
=item SM3, see L<EVP_MD-SM3(7)>
=item MD5, see L<EVP_MD-MD5(7)>
=item MD5-SHA1, see L<EVP_MD-MD5-SHA1(7)>
=back
=head2 Symmetric Ciphers
=over 4
=item AES, see L<EVP_CIPHER-AES(7)>
=item ARIA, see L<EVP_CIPHER-ARIA(7)>
=item CAMELLIA, see L<EVP_CIPHER-CAMELLIA(7)>
=item DES, see L<EVP_CIPHER-DES(7)>
=item BF, see L<EVP_CIPHER-BF(7)>
=item IDEA, see L<EVP_CIPHER-IDEA(7)>
=item CAST5, see L<EVP_CIPHER-CAST5(7)>
=item SEED, see L<EVP_CIPHER-SEED(7)>
=item SM4, see L<EVP_CIPHER-SM4(7)>
=item RC2, see L<EVP_CIPHER-RC2(7)>
=item RC4, see L<EVP_CIPHER-RC4(7)>
=item RC5, see L<EVP_CIPHER-RC5(7)>
=item ChaCha20, see L<EVP_CIPHER-ChaCha20(7)>
=item ChaCha20-Poly1305, see L<EVP_CIPHER-ChaCha20-Poly1305(7)>
=back
=head2 Message Authentication Code (MAC)
=over 4
=item BLAKE2, see L<EVP_MAC-BLAKE2(7)>
=item CMAC, see L<EVP_MAC-CMAC(7)>
=item GMAC, see L<EVP_MAC-GMAC(7)>
=item HMAC, see L<EVP_MAC-HMAC(7)>
=item KMAC, see L<EVP_MAC-KMAC(7)>
=item SIPHASH, see L<EVP_MAC-Siphash(7)>
=item POLY1305, see L<EVP_MAC-Poly1305(7)>
=back
=head2 Key Derivation Function (KDF)
=over 4
=item HKDF, see L<EVP_KDF-HKDF(7)>
=item SSKDF, see L<EVP_KDF-SS(7)>
=item PBKDF2, see L<EVP_KDF-PBKDF2(7)>
=item SSHKDF, see L<EVP_KDF-SSHKDF(7)>
=item TLS1-PRF, see L<EVP_KDF-TLS1_PRF(7)>
=item KBKDF, see L<EVP_KDF-KB(7)>
=item X942KDF, see L<EVP_KDF-X942(7)>
=item SCRYPT, see L<EVP_KDF-SCRYPT(7)>
=item KRB5KDF, see L<EVP_KDF-KRB5KDF(7)>
=back
=head2 Key Exchange
=over 4
=item DH, see L<EVP_KEYEXCH-DH(7)>
=item ECDH, see L<EVP_KEYEXCH-ECDH(7)>
=item X25519, see L<EVP_KEYEXCH-X25519(7)>
=item X448, see L<EVP_KEYEXCH-X448(7)>
=back
=head2 Asymmetric Signature
=over 4
=item DSA, see L<EVP_SIGNATURE-DSA(7)>
=item RSA, see L<EVP_SIGNATURE-RSA(7)>
=back
=head2 Asymmetric Cipher
=over 4
=item RSA, see L<EVP_ASYM_CIPHER-RSA(7)>
=back
=head2 Asymmetric Key Management
=over 4
=item DH, see L<EVP_KEYMGMT-DH(7)>
=item DSA, see L<EVP_KEYMGMT-DSA(7)>
=item RSA, see L<EVP_KEYMGMT-RSA(7)>
=item EC, see L<EVP_KEYMGMT-EC(7)>
=item X25519, see L<EVP_KEYMGMT-X25519(7)>
=item X448, see L<EVP_KEYMGMT-X448(7)>
=back
=head2 Asymmetric Key Serializer
In addition to "provider=default", this set of implementations define the
property "fips=yes", to allow them to be used together with the FIPS
provider.
=over 4
=item RSA, see L<OSSL_SERIALIZER-RSA(7)>
=item DH, see L<OSSL_SERIALIZER-DH(7)>
=item DSA, see L<OSSL_SERIALIZER-DSA(7)>
=item EC, see L<OSSL_SERIALIZER-EC(7)>
=item X25519, see L<OSSL_SERIALIZER-X25519(7)>
=item X448, see L<OSSL_SERIALIZER-X448(7)>
=back
=head1 SEE ALSO
L<openssl-core.h(7)>, L<openssl-core_numbers.h(7)>, L<provider(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
+92
View File
@@ -0,0 +1,92 @@
=pod
=head1 NAME
OSSL_PROVIDER-legacy - OpenSSL legacy provider
=head1 DESCRIPTION
The OpenSSL legacy provider supplies OpenSSL implementations of algorithms
that have been deemed legacy. Such algorithms have commonly fallen out of
use, have been deemed insecure by the cryptography community, or something
similar.
We can consider this the retirement home of cryptographic algorithms.
=head2 Properties
The implementations in this provider specifically have these property
defined:
=over 4
"provider=legacy"
=back
It may be used in a property query string with fetching functions such as
L<EVP_MD_fetch(3)> or L<EVP_CIPHER_fetch(3)>, as well as with other
functions that take a property query string, such as
L<EVP_PKEY_CTX_new_from_name(3)>.
It isn't mandatory to query for any of these properties, except to
make sure to get implementations of this provider and none other.
=head1 OPERATIONS AND ALGORITHMS
The OpenSSL legacy provider supports these operations and algorithms:
=head2 Hashing Algorithms / Message Digests
=over 4
=item MD2, see L<EVP_MD-MD2(7)>
=item MD4, see L<EVP_MD-MD4(7)>
=item MDC2, see L<EVP_MD-MDC2(7)>
=item WHIRLPOOL, see L<EVP_MD-WHIRLPOOL(7)>
=item RIPEMD160, see L<EVP_MD-RIPEMD160(7)>
=back
=begin comment
When algorithms for other operations start appearing, the
following =head2 titles are appropriate to use:
- Symmetric Ciphers
- Message Authentication Code (MAC)
- Key Derivation Function (KDF)
- Key Exchange
- Signature
- Asymmetric Cipher
- Asymmetric Key Management
=end comment
=head1 SEE ALSO
L<OSSL_PARAM(3)>,
L<openssl-core.h(7)>,
L<openssl-core_numbers.h(7)>,
L<provider(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
+35
View File
@@ -0,0 +1,35 @@
=pod
=head1 NAME
OSSL_PROVIDER-null - OpenSSL null provider
=head1 DESCRIPTION
The OpenSSL null provider supplies no algorithms.
It can used to guarantee that the default library context and a fallback
provider will not be accidentally accessed.
=head2 Properties
The null provider defines no properties.
=head1 OPERATIONS AND ALGORITHMS
The OpenSSL null provider supports no operations and algorithms.
=head1 SEE ALSO
L<provider(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
+1 -1
View File
@@ -10,7 +10,7 @@ X448
The B<X25519> and B<X448> EVP_PKEY implementation supports key generation and
key derivation using B<X25519> and B<X448>. It has associated private and public
key formats compatible with draft-ietf-curdle-pkix-03.
key formats compatible with RFC 8410.
No additional parameters can be set during key generation.
+2 -39
View File
@@ -227,44 +227,6 @@ values associated with the give provider side digest context I<dctx>
and stores them in I<params>.
See L<OSSL_PARAM(3)> for further details on the parameters structure.
Parameters currently recognised by built-in digests are as follows. Not all
parameters are relevant to, or are understood by all digests:
=over 4
=item "xoflen" (B<OSSL_DIGEST_PARAM_XOFLEN>) <unsigned integer>
Sets the digest length for extendable output functions.
The length of the "xoflen" parameter should not exceed that of a B<size_t>.
=item "ssl3-ms" (B<OSSL_DIGEST_PARAM_SSL3_MS>) <octet string>
This parameter is set by libssl in order to calculate a signature hash for an
SSLv3 CertificateVerify message as per RFC6101.
It is only set after all handshake messages have already been digested via
OP_digest_update() calls.
The parameter provides the master secret value to be added to the digest.
The digest implementation should calculate the complete digest as per RFC6101
section 5.6.8.
The next call after setting this parameter will be OP_digest_final().
This is only relevant for implementations of SHA1 or MD5_SHA1.
=item "pad_type" (B<OSSL_DIGEST_PARAM_PAD_TYPE>) <unsigned integer>
Sets the pad type to be used.
The only built-in digest that uses this is MDC2.
Normally the final MDC2 block is padded with 0s.
If the pad type is set to 2 then the final block is padded with 0x80 followed by
0s.
=item "micalg" (B<OSSL_DIGEST_PARAM_MICALG>) <UTF8 string>
Gets the digest Message Integrity Check algorithm string.
This is used when creating S/MIME multipart/signed messages, as specified in
RFC 5751.
=back
=head1 RETURN VALUES
OP_digest_newctx() and OP_digest_dupctx() should return the newly created
@@ -281,7 +243,8 @@ algorithm.
=head1 SEE ALSO
L<provider(7)>
L<provider(7)>, L<OSSL_PROVIDER-FIPS(7)>, L<OSSL_PROVIDER-default(7)>,
L<OSSL_PROVIDER-legacy(7)>
=head1 HISTORY
+136 -25
View File
@@ -18,6 +18,15 @@ provider-keymgmt - The KEYMGMT library E<lt>-E<gt> provider functions
void *OP_keymgmt_new(void *provctx);
void OP_keymgmt_free(void *keydata);
void *OP_keymgmt_gen_init(void *provctx, int selection);
int OP_keymgmt_gen_set_template(void *genctx, void *template);
int OP_keymgmt_gen_set_params(void *genctx, const OSSL_PARAM params[]);
const OSSL_PARAM *OP_keymgmt_gen_settable_params(void *provctx);
int OP_keymgmt_gen_get_params(void *genctx, const OSSL_PARAM params[]);
const OSSL_PARAM *OP_keymgmt_gen_gettable_params(void *provctx);
void *OP_keymgmt_gen(void *genctx, OSSL_CALLBACK *cb, void *cbarg);
void OP_keymgmt_gen_cleanup(void *genctx);
/* Key object information */
int OP_keymgmt_get_params(void *keydata, OSSL_PARAM params[]);
const OSSL_PARAM *OP_keymgmt_gettable_params(void);
@@ -80,6 +89,15 @@ macros in L<openssl-core_numbers.h(7)>, as follows:
OP_keymgmt_new OSSL_FUNC_KEYMGMT_NEW
OP_keymgmt_free OSSL_FUNC_KEYMGMT_FREE
OP_keymgmt_gen_init OSSL_FUNC_KEYMGMT_GEN_INIT
OP_keymgmt_gen_set_template OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE
OP_keymgmt_gen_set_params OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS
OP_keymgmt_gen_settable_params OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS
OP_keymgmt_gen_get_params OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS
OP_keymgmt_gen_gettable_params OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS
OP_keymgmt_gen OSSL_FUNC_KEYMGMT_GEN
OP_keymgmt_gen_cleanup OSSL_FUNC_KEYMGMT_GEN_CLEANUP
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
@@ -193,12 +211,49 @@ key object, but that is not mandatory.
OP_keymgmt_free() should free the passed I<keydata>.
The constructor and destructor are mandatory, a KEYMGMT implementation
without them will not be accepted.
OP_keymgmt_gen_init(), OP_keymgmt_gen_set_template(),
OP_keymgmt_gen_set_params(), OP_keymgmt_gen_settable_params(),
OP_keymgmt_gen_get_params(), OP_keymgmt_gen_gettable_params(),
OP_keymgmt_gen() and OP_keymgmt_gen_cleanup() work together as a more
elaborate context based key object constructor.
=for comment when new constructors appear, it's sufficient if only one
of them is present. The remark above will have to change to reflect
that.
OP_keymgmt_gen_init() should create the key object generation context
and initialize it with I<selections>, which will determine what kind
of contents the key object to be generated should get.
OP_keymgmt_gen_set_template() should add I<template> to the context
I<genctx>. The I<template> is assumed to be a key object constructed
with the same KEYMGMT, and from which content that the implementation
chooses can be used as a template for the key object to be generated.
Typically, the generation of a DSA or DH key would get the domain
parameters from this I<template>.
OP_keymgmt_gen_set_params() should set additional parameters from
I<params> in the key object generation context I<genctx>.
OP_keymgmt_gen_settable_params() should return a constant array of
descriptor B<OSSL_PARAM>, for parameters that OP_keymgmt_gen_set_params()
can handle.
OP_keymgmt_gen_get_params() should extract information data associated
with the key object generation context I<genctx>.
OP_keymgmt_gen_gettable_params() should return a constant array of
descriptor B<OSSL_PARAM>, for parameters that OP_keymgmt_gen_get_params()
can handle.
OP_keymgmt_gen() should perform the key object generation itself, and
return the result. The callback I<cb> should be called at regular
intervals with indications on how the key object generation
progresses.
OP_keymgmt_gen_cleanup() should clean up and free the key object
generation context I<genctx>
At least one of OP_keymgmt_new() and OP_keymgmt_gen() are mandatory,
as well as OP_keymgmt_free(). Additionally, if OP_keymgmt_gen() is
present, OP_keymgmt_gen_init() and OP_keymgmt_gen_cleanup() must be
present as well.
=head2 Key Object Information Functions
@@ -279,32 +334,86 @@ The following Import/Export types are available for the built-in RSA algorithm:
=over 4
=item "n" (B<OSSL_PKEY_PARAM_RSA_N>) <integer>
=item "n" (B<OSSL_PKEY_PARAM_RSA_N>) <unsigned integer>
The RSA "n" value.
=item "e" (B<OSSL_PKEY_PARAM_RSA_E>) <integer>
=item "e" (B<OSSL_PKEY_PARAM_RSA_E>) <unsigned integer>
The RSA "e" value.
=item "d" (B<OSSL_PKEY_PARAM_RSA_D>) <integer>
=item "d" (B<OSSL_PKEY_PARAM_RSA_D>) <unsigned integer>
The RSA "d" value.
=item "rsa-factor" (B<OSSL_PKEY_PARAM_RSA_FACTOR>) <integer>
=item "rsa-factor1" (B<OSSL_PKEY_PARAM_RSA_FACTOR1>) <unsigned 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-factor2" (B<OSSL_PKEY_PARAM_RSA_FACTOR2>) <unsigned integer>
=item "rsa-exponent" (B<OSSL_PKEY_PARAM_RSA_EXPONENT>) <integer>
=item "rsa-factor3" (B<OSSL_PKEY_PARAM_RSA_FACTOR3>) <unsigned integer>
An RSA CRT (Chinese Remainder Theorem) exponent. This value may be repeated up
to 10 times in a single key.
=item "rsa-factor4" (B<OSSL_PKEY_PARAM_RSA_FACTOR4>) <unsigned integer>
=item "rsa-coefficient" (B<OSSL_PKEY_PARAM_RSA_COEFFICIENT>) <integer>
=item "rsa-factor5" (B<OSSL_PKEY_PARAM_RSA_FACTOR5>) <unsigned integer>
An RSA CRT (Chinese Remainder Theorem) coefficient. This value may be repeated
up to 9 times in a single key.
=item "rsa-factor6" (B<OSSL_PKEY_PARAM_RSA_FACTOR6>) <unsigned integer>
=item "rsa-factor7" (B<OSSL_PKEY_PARAM_RSA_FACTOR7>) <unsigned integer>
=item "rsa-factor8" (B<OSSL_PKEY_PARAM_RSA_FACTOR8>) <unsigned integer>
=item "rsa-factor9" (B<OSSL_PKEY_PARAM_RSA_FACTOR9>) <unsigned integer>
=item "rsa-factor10" (B<OSSL_PKEY_PARAM_RSA_FACTOR10>) <unsigned integer>
RSA prime factors. The factors are known as "p", "q" and "r_i" in RFC8017.
Up to eight additional "r_i" prime factors are supported.
=item "rsa-exponent1" (B<OSSL_PKEY_PARAM_RSA_EXPONENT1>) <unsigned integer>
=item "rsa-exponent2" (B<OSSL_PKEY_PARAM_RSA_EXPONENT2>) <unsigned integer>
=item "rsa-exponent3" (B<OSSL_PKEY_PARAM_RSA_EXPONENT3>) <unsigned integer>
=item "rsa-exponent4" (B<OSSL_PKEY_PARAM_RSA_EXPONENT4>) <unsigned integer>
=item "rsa-exponent5" (B<OSSL_PKEY_PARAM_RSA_EXPONENT5>) <unsigned integer>
=item "rsa-exponent6" (B<OSSL_PKEY_PARAM_RSA_EXPONENT6>) <unsigned integer>
=item "rsa-exponent7" (B<OSSL_PKEY_PARAM_RSA_EXPONENT7>) <unsigned integer>
=item "rsa-exponent8" (B<OSSL_PKEY_PARAM_RSA_EXPONENT8>) <unsigned integer>
=item "rsa-exponent9" (B<OSSL_PKEY_PARAM_RSA_EXPONENT9>) <unsigned integer>
=item "rsa-exponent10" (B<OSSL_PKEY_PARAM_RSA_EXPONENT10>) <unsigned integer>
RSA CRT (Chinese Remainder Theorem) exponents. The exponents are known
as "dP", "dQ" and "d_i in RFC8017".
Up to eight additional "d_i" exponents are supported.
=item "rsa-coefficient1" (B<OSSL_PKEY_PARAM_RSA_COEFFICIENT1>) <unsigned integer>
=item "rsa-coefficient2" (B<OSSL_PKEY_PARAM_RSA_COEFFICIENT2>) <unsigned integer>
=item "rsa-coefficient3" (B<OSSL_PKEY_PARAM_RSA_COEFFICIENT3>) <unsigned integer>
=item "rsa-coefficient4" (B<OSSL_PKEY_PARAM_RSA_COEFFICIENT4>) <unsigned integer>
=item "rsa-coefficient5" (B<OSSL_PKEY_PARAM_RSA_COEFFICIENT5>) <unsigned integer>
=item "rsa-coefficient6" (B<OSSL_PKEY_PARAM_RSA_COEFFICIENT6>) <unsigned integer>
=item "rsa-coefficient7" (B<OSSL_PKEY_PARAM_RSA_COEFFICIENT7>) <unsigned integer>
=item "rsa-coefficient8" (B<OSSL_PKEY_PARAM_RSA_COEFFICIENT8>) <unsigned integer>
=item "rsa-coefficient9" (B<OSSL_PKEY_PARAM_RSA_COEFFICIENT9>) <unsigned integer>
RSA CRT (Chinese Remainder Theorem) coefficients. The coefficients are known as
"qInv" and "t_i".
Up to eight additional "t_i" exponents are supported.
=back
@@ -315,23 +424,23 @@ Diffie-Hellman algorithms:
=over 4
=item "pub" (B<OSSL_PKEY_PARAM_PUB_KEY>) <integer> or <octet string>
=item "pub" (B<OSSL_PKEY_PARAM_PUB_KEY>) <unsigned integer>
The public key value.
=item "priv" (B<OSSL_PKEY_PARAM_PRIV_KEY>) <integer> or <octet string>
=item "priv" (B<OSSL_PKEY_PARAM_PRIV_KEY>) <unsigned integer>
The private key value.
=item "p" (B<OSSL_PKEY_PARAM_FFC_P>) <integer>
=item "p" (B<OSSL_PKEY_PARAM_FFC_P>) <unsigned integer>
A DSA or Diffie-Hellman "p" value.
=item "q" (B<OSSL_PKEY_PARAM_FFC_Q>) <integer>
=item "q" (B<OSSL_PKEY_PARAM_FFC_Q>) <unsigned integer>
A DSA or Diffie-Hellman "q" value.
=item "g" (B<OSSL_PKEY_PARAM_FFC_G>) <integer>
=item "g" (B<OSSL_PKEY_PARAM_FFC_G>) <unsigned integer>
A DSA or Diffie-Hellman "g" value.
@@ -374,7 +483,7 @@ EC curve's cofactor (note for some curves the cofactor is 1).
The public key value in EC point format.
=item "priv" (B<OSSL_PKEY_PARAM_PRIV_KEY>) <integer>
=item "priv" (B<OSSL_PKEY_PARAM_PRIV_KEY>) <unsigned integer>
The private key value.
@@ -384,11 +493,13 @@ The private key value.
See L<OSSL_PARAM(3)> for further details on the parameters structure.
Parameters currently recognised by built-in keymgmt algorithms
are as follows.
The Built-in Import/Export Types listed above are also Information Parameters.
Not all parameters are relevant to, or are understood by all keymgmt
algorithms:
Parameters currently recognised by built-in keymgmt algorithms
also include the following.
=over 4
=item "bits" (B<OSSL_PKEY_PARAM_BITS>) <integer>
+177 -6
View File
@@ -38,12 +38,40 @@ provider-signature - The signature library E<lt>-E<gt> provider functions
size_t *routlen, size_t routsize,
const unsigned char *sig, size_t siglen);
/* Digest Sign */
int OP_signature_digest_sign_init(void *ctx, const char *mdname,
const char *props, void *provkey);
int OP_signature_digest_sign_update(void *ctx, const unsigned char *data,
size_t datalen);
int OP_signature_digest_sign_final(void *ctx, unsigned char *sig,
size_t *siglen, size_t sigsize);
int OP_signature_digest_sign(void *ctx, unsigned char *sigret, size_t *siglen,
size_t sigsize, const unsigned char *tbs,
size_t tbslen);
/* Digest Verify */
int OP_signature_digest_verify_init(void *ctx, const char *mdname,
const char *props, void *provkey);
int OP_signature_digest_verify_update(void *ctx, const unsigned char *data,
size_t datalen);
int OP_signature_digest_verify_final(void *ctx, const unsigned char *sig,
size_t siglen);
int OP_signature_digest_verify(void *ctx, const unsigned char *sig,
size_t siglen, const unsigned char *tbs,
size_t tbslen);
/* Signature parameters */
int OP_signature_get_ctx_params(void *ctx, OSSL_PARAM params[]);
const OSSL_PARAM *OP_signature_gettable_ctx_params(void);
int OP_signature_set_ctx_params(void *ctx, const OSSL_PARAM params[]);
const OSSL_PARAM *OP_signature_settable_ctx_params(void);
/* MD parameters */
int OP_signature_get_ctx_md_params(void *ctx, OSSL_PARAM params[]);
const OSSL_PARAM * OP_signature_gettable_ctx_md_params(void *ctx);
int OP_signature_set_ctx_md_params(void *ctx, const OSSL_PARAM params[]);
const OSSL_PARAM * OP_signature_settable_ctx_md_params(void *ctx);
=head1 DESCRIPTION
This documentation is primarily aimed at provider authors. See L<provider(7)>
@@ -88,18 +116,53 @@ macros in L<openssl-core_numbers.h(7)>, as follows:
OP_signature_verify_recover_init OSSL_FUNC_SIGNATURE_VERIFY_RECOVER_INIT
OP_signature_verify_recover OSSL_FUNC_SIGNATURE_VERIFY_RECOVER
OP_signature_digest_sign_init OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT
OP_signature_digest_sign_update OSSL_FUNC_SIGNATURE_DIGEST_SIGN_UPDATE
OP_signature_digest_sign_final OSSL_FUNC_SIGNATURE_DIGEST_SIGN_FINAL
OP_signature_digest_sign OSSL_FUNC_SIGNATURE_DIGEST_SIGN
OP_signature_digest_verify_init OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT
OP_signature_digest_verify_update OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_UPDATE
OP_signature_digest_verify_final OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_FINAL
OP_signature_digest_verify OSSL_FUNC_SIGNATURE_DIGEST_VERIFY
OP_signature_get_ctx_params OSSL_FUNC_SIGNATURE_GET_CTX_PARAMS
OP_signature_gettable_ctx_params OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS
OP_signature_set_ctx_params OSSL_FUNC_SIGNATURE_SET_CTX_PARAMS
OP_signature_settable_ctx_params OSSL_FUNC_SIGNATURE_SETTABLE_CTX_PARAMS
OP_signature_get_ctx_md_params OSSL_FUNC_SIGNATURE_GET_CTX_MD_PARAMS
OP_signature_gettable_ctx_md_params OSSL_FUNC_SIGNATURE_GETTABLE_CTX_MD_PARAMS
OP_signature_set_ctx_md_params OSSL_FUNC_SIGNATURE_SET_CTX_MD_PARAMS
OP_signature_settable_ctx_md_params OSSL_FUNC_SIGNATURE_SETTABLE_CTX_MD_PARAMS
A signature algorithm implementation may not implement all of these functions.
In order to be a consistent set of functions a provider must implement
OP_signature_newctx and OP_signature_freectx.
It must also implement both of OP_signature_sign_init and OP_signature_sign,
or both of OP_signature_verify_init and OP_signature_verify, or both of
OP_signature_verify_recover_init and OP_signature_verify_recover.
All other functions are optional.
In order to be a consistent set of functions we must have at least a set of
context functions (OP_signature_newctx and OP_signature_freectx) as well as a
set of "signature" functions, i.e. at least one of:
=over 4
=item OP_signature_sign_init and OP_signature_sign
=item OP_signature_verify_init and OP_signature_verify
=item OP_signature_verify_recover_init and OP_signature_verify_init
=item OP_signature_digest_sign_init, OP_signature_digest_sign_update and OP_signature_digest_sign_final
=item OP_signature_digest_verify_init, OP_signature_digest_verify_update and OP_signature_digest_verify_final
=item OP_signature_digest_sign_init and OP_signature_digest_sign
=item OP_signature_digest_verify_init and OP_signature_digest_verify
=back
OP_signature_set_ctx_params and OP_signature_settable_ctx_params are optional,
but if one of them is present then the other one must also be present. The same
applies to OP_signature_get_ctx_params and OP_signature_gettable_ctx_params, as
well as the "md_params" functions. The OP_signature_dupctx function is optional.
A signature algorithm must also implement some mechanism for generating,
loading or importing keys via the key management (OSSL_OP_KEYMGMT) operation.
@@ -176,6 +239,70 @@ The length of the recovered data should be written to I<*routlen>.
If I<rout> is NULL then the maximum size of the output buffer is written to
the I<routlen> parameter.
=head2 Digest Sign Functions
OP_signature_digeset_sign_init() initialises a context for signing given a
provider side signature context in the I<ctx> parameter, and a pointer to a
provider key object in the I<provkey> parameter. The key object should have been
previously generated, loaded or imported into the provider using the
key management (OSSL_OP_KEYMGMT) operation (see provider-keymgmt(7)>.
The name of the digest to be used will be in the I<mdname> parameter. There may
also be properties to be used in fetching the digest in the I<props> parameter,
although this may be ignored by providers.
OP_signature_digest_sign_update() provides data to be signed in the I<data>
parameter which should be of length I<datalen>. A previously initialised
signature context is passed in the I<ctx> parameter. This function may be called
multiple times to cummulatively add data to be signed.
OP_signature_digest_sign_final() finalises a signature operation previously
started through OP_signature_digest_sign_init() and
OP_signature_digest_sign_update() calls. Once finalised no more data will be
added through OP_signature_digest_sign_update(). A previously initialised
signature context is passed in the I<ctx> parameter. Unless I<sig> is NULL, the
signature should be written to the location pointed to by the I<sig> parameter
and it should not exceed I<sigsize> bytes in length. The length of the signature
should be written to I<*siglen>. If I<sig> is NULL then the maximum length of
the signature should be written to I<*siglen>.
OP_signature_digest_sign() implements a "one shot" digest sign operation
previously started through OP_signature_digeset_sign_init(). A previously
initialised signature context is passed in the I<ctx> parameter. The data to be
signed is in I<tbs> which should be I<tbslen> bytes long. Unless I<sig> is NULL,
the signature should be written to the location pointed to by the I<sig>
parameter and it should not exceed I<sigsize> bytes in length. The length of the
signature should be written to I<*siglen>. If I<sig> is NULL then the maximum
length of the signature should be written to I<*siglen>.
=head2 Digest Verify Functions
OP_signature_digeset_verify_init() initialises a context for verifying given a
provider side verification context in the I<ctx> parameter, and a pointer to a
provider key object in the I<provkey> parameter. The key object should have been
previously generated, loaded or imported into the provider using the
key management (OSSL_OP_KEYMGMT) operation (see provider-keymgmt(7)>.
The name of the digest to be used will be in the I<mdname> parameter. There may
also be properties to be used in fetching the digest in the I<props> parameter,
although this may be ignored by providers.
OP_signature_digest_verify_update() provides data to be verified in the I<data>
parameter which should be of length I<datalen>. A previously initialised
verification context is passed in the I<ctx> parameter. This function may be
called multiple times to cummulatively add data to be verified.
OP_signature_digest_verify_final() finalises a verification operation previously
started through OP_signature_digest_verify_init() and
OP_signature_digest_verify_update() calls. Once finalised no more data will be
added through OP_signature_digest_verify_update(). A previously initialised
verification context is passed in the I<ctx> parameter. The signature to be
verified is in I<sig> which is I<siglen> bytes long.
OP_signature_digest_verify() implements a "one shot" digest verify operation
previously started through OP_signature_digeset_verify_init(). A previously
initialised verification context is passed in the I<ctx> parameter. The data to be
verified is in I<tbs> which should be I<tbslen> bytes long. The signature to be
verified is in I<sig> which is I<siglen> bytes long.
=head2 Signature Parameters
See L<OSSL_PARAM(3)> for further details on the parameters structure used by
@@ -205,6 +332,23 @@ Gets or sets the output size of the digest algorithm used for the input to the
signature functions.
The length of the "digest-size" parameter should not exceed that of a B<size_t>.
= item "algorithm-id" (B<OSSL_SIGNATURE_PARAM_ALGORITHM_ID>) <octet string>
Gets the DER encoded AlgorithmIdentifier that corresponds to the combination of
signature algorithm and digest algorithm for the signature operation.
=item "kat" (B<OSSL_SIGNATURE_PARAM_KAT>) <unsigned integer>
Sets a flag to modify the sign operation to return an error if the initial
calculated signature is invalid.
In the normal mode of operation - new random values are chosen until the
signature operation succeeds.
By default it retries until a signature is calculated.
Setting the value to 0 causes the sign operation to retry,
otherwise the sign operation is only tried once and returns whether or not it
was successful.
Known answer tests can be performed if the random generator is overriden to
supply known values that either pass or fail.
=back
@@ -214,11 +358,38 @@ i.e. parameters that can be used with OP_signature_get_ctx_params() and
OP_signature_set_ctx_params() respectively.
See L<OSSL_PARAM(3)> for the use of B<OSSL_PARAM> as parameter descriptor.
=head2 MD Parameters
See L<OSSL_PARAM(3)> for further details on the parameters structure used by
the OP_signature_get_md_ctx_params() and OP_signature_set_md_ctx_params()
functions.
OP_signature_get_md_ctx_params() gets digest parameters associated with the
given provider side digest signature context I<ctx> and stores them in I<params>.
OP_signature_set_ms_ctx_params() sets the digest parameters associated with the
given provider side digest signature context I<ctx> to I<params>.
Any parameter settings are additional to any that were previously set.
Parameters currently recognised by built-in signature algorithms are the same
as those for built-in digest algorithms. See
L<provider-digest(7)/Digest Parameters> for further information.
OP_signature_gettable_md_ctx_params() and OP_signature_settable_md_ctx_params()
get a constant B<OSSL_PARAM> array that describes the gettable and settable
digest parameters, i.e. parameters that can be used with
OP_signature_get_md_ctx_params() and OP_signature_set_md_ctx_params()
respectively. See L<OSSL_PARAM(3)> for the use of B<OSSL_PARAM> as parameter
descriptor.
=head1 RETURN VALUES
OP_signature_newctx() and OP_signature_dupctx() should return the newly created
provider side signature, or NULL on failure.
OP_signature_gettable_ctx_params(), OP_signature_settable_ctx_params(),
OP_signature_gettable_md_ctx_params() and OP_signature_settable_md_ctx_params(),
return the gettable or settable parameters in a constant B<OSSL_PARAM> array.
All other functions should return 1 for success or 0 on error.
=head1 SEE ALSO