Latest update.
This commit is contained in:
+14
-14
@@ -26,23 +26,23 @@ The supported parameters are:
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_KDF_PARAM_PROPERTIES> ("properties") <UTF8 string>
|
||||
=item "properties" (B<OSSL_KDF_PARAM_PROPERTIES>) <UTF8 string>
|
||||
|
||||
=item B<OSSL_KDF_PARAM_DIGEST> ("digest") <UTF8 string>
|
||||
=item "digest" (B<OSSL_KDF_PARAM_DIGEST>) <UTF8 string>
|
||||
|
||||
=item B<OSSL_KDF_PARAM_KEY> ("key") <octet string>
|
||||
=item "key" (B<OSSL_KDF_PARAM_KEY>) <octet string>
|
||||
|
||||
=item B<OSSL_KDF_PARAM_SALT> ("salt") <octet string>
|
||||
=item "salt" (B<OSSL_KDF_PARAM_SALT>) <octet string>
|
||||
|
||||
These parameters work as described in L<EVP_KDF(3)/PARAMETERS>.
|
||||
|
||||
=item B<OSSL_KDF_PARAM_INFO> ("info") <octet string>
|
||||
=item "info" (B<OSSL_KDF_PARAM_INFO>) <octet string>
|
||||
|
||||
This parameter sets the info value.
|
||||
The length of the context info buffer cannot exceed 1024 bytes;
|
||||
this should be more than enough for any normal use of HKDF.
|
||||
|
||||
=item B<OSSL_KDF_PARAM_MODE> ("mode") <UTF8 string> or <int>
|
||||
=item "mode" (B<OSSL_KDF_PARAM_MODE>) <UTF8 string> or <integer>
|
||||
|
||||
This parameter sets the mode for the HKDF operation.
|
||||
There are three modes that are currently defined:
|
||||
@@ -51,7 +51,7 @@ There are three modes that are currently defined:
|
||||
|
||||
=item B<EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND> "EXTRACT_AND_EXPAND"
|
||||
|
||||
This is the default mode. Calling L<EVP_KDF-derive(3)> on an EVP_KDF_CTX set
|
||||
This is the default mode. Calling L<EVP_KDF_derive(3)> on an EVP_KDF_CTX set
|
||||
up for HKDF will perform an extract followed by an expand operation in one go.
|
||||
The derived key returned will be the result after the expand operation. The
|
||||
intermediate fixed-length pseudorandom key K is not returned.
|
||||
@@ -61,9 +61,9 @@ derived otherwise an error will occur.
|
||||
|
||||
=item B<EVP_KDF_HKDF_MODE_EXTRACT_ONLY> "EXTRACT_ONLY"
|
||||
|
||||
In this mode calling L<EVP_KDF-derive(3)> will just perform the extract
|
||||
In this mode calling L<EVP_KDF_derive(3)> will just perform the extract
|
||||
operation. The value returned will be the intermediate fixed-length pseudorandom
|
||||
key K. The C<keylen> parameter must match the size of K, which can be looked
|
||||
key K. The I<keylen> parameter must match the size of K, which can be looked
|
||||
up by calling EVP_KDF_size() after setting the mode and digest.
|
||||
|
||||
The digest, key and salt values must be set before a key is derived otherwise
|
||||
@@ -71,7 +71,7 @@ an error will occur.
|
||||
|
||||
=item B<EVP_KDF_HKDF_MODE_EXPAND_ONLY> "EXPAND_ONLY"
|
||||
|
||||
In this mode calling L<EVP_KDF-derive(3)> will just perform the expand
|
||||
In this mode calling L<EVP_KDF_derive(3)> will just perform the expand
|
||||
operation. The input key should be set to the intermediate fixed-length
|
||||
pseudorandom key K returned from a previous extract operation.
|
||||
|
||||
@@ -89,12 +89,12 @@ A context for HKDF can be obtained by calling:
|
||||
EVP_KDF *kdf = EVP_KDF_fetch(NULL, "HKDF", NULL);
|
||||
EVP_KDF_CTX *kctx = EVP_KDF_CTX_new(kdf);
|
||||
|
||||
The output length of an HKDF expand operation is specified via the C<keylen>
|
||||
parameter to the L<EVP_KDF-derive(3)> function. When using
|
||||
EVP_KDF_HKDF_MODE_EXTRACT_ONLY the C<keylen> parameter must equal the size of
|
||||
The output length of an HKDF expand operation is specified via the I<keylen>
|
||||
parameter to the L<EVP_KDF_derive(3)> function. When using
|
||||
EVP_KDF_HKDF_MODE_EXTRACT_ONLY the I<keylen> parameter must equal the size of
|
||||
the intermediate fixed-length pseudorandom key otherwise an error will occur.
|
||||
For that mode, the fixed output size can be looked up by calling EVP_KDF_size()
|
||||
after setting the mode and digest on the C<EVP_KDF_CTX>.
|
||||
after setting the mode and digest on the B<EVP_KDF_CTX>.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
EVP_KDF-KB - The Key-Based EVP_KDF implementation
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The EVP_KDF-KB algorithm implements the Key-Based key derivation function
|
||||
(KBKDF). KBKDF derives a key from repeated application of a keyed MAC to an
|
||||
input secret (and other optional values).
|
||||
|
||||
=head2 Identity
|
||||
|
||||
"KBKDF" is the name for this implementation; it can be used with the
|
||||
EVP_KDF_fetch() function.
|
||||
|
||||
=head2 Supported parameters
|
||||
|
||||
The supported parameters are:
|
||||
|
||||
=over 4
|
||||
|
||||
=item "properties" (B<OSSL_KDF_PARAM_PROPERTIES>) <UTF8 string>
|
||||
|
||||
=item "mode" (B<OSSL_KDF_PARAM_MODE>) <UTF8 string>
|
||||
|
||||
=item "mac" (B<OSSL_KDF_PARAM_MAC>) <UTF8 string>
|
||||
|
||||
=item "digest" (B<OSSL_KDF_PARAM_DIGEST>) <UTF8 string>
|
||||
|
||||
=item "cipher" (B<OSSL_KDF_PARAM_DIGEST>) <UTF8 string>
|
||||
|
||||
=item "key" (B<OSSL_KDF_PARAM_KEY>) <octet string>
|
||||
|
||||
=item "salt" (B<OSSL_KDF_PARAM_SALT>) <octet string>
|
||||
|
||||
=item "info (B<OSSL_KDF_PARAM_INFO>) <octet string>
|
||||
|
||||
=item "seed" (B<OSSL_KDF_PARAM_SEED>) <octet string>
|
||||
|
||||
=back
|
||||
|
||||
The mode parameter determines which flavor of KBKDF to use - currently the
|
||||
choices are "counter" and "feedback". Counter is the default, and will be
|
||||
used if unspecified. The seed parameter is unused in counter mode.
|
||||
|
||||
The parameters key, salt, info, and seed correspond to KI, Label, Context, and
|
||||
IV (respectively) in SP800-108. As in that document, salt, info, and seed are
|
||||
optional and may be omitted.
|
||||
|
||||
Depending on whether mac is CMAC or HMAC, either digest or cipher is required
|
||||
(respectively) and the other is unused.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
A context for KBKDF can be obtained by calling:
|
||||
|
||||
EVP_KDF *kdf = EVP_KDF_fetch(NULL, "KBKDF", NULL);
|
||||
EVP_KDF_CTX *kctx = EVP_KDF_CTX_new(kdf);
|
||||
|
||||
The output length of an KBKDF is specified via the C<keylen>
|
||||
parameter to the L<EVP_KDF_derive(3)> function.
|
||||
|
||||
Note that currently OpenSSL only implements counter and feedback modes. Other
|
||||
variants may be supported in the future.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
This example derives 10 bytes using COUNTER-HMAC-SHA256, with KI "secret",
|
||||
Label "label", and Context "context".
|
||||
|
||||
EVP_KDF *kdf;
|
||||
EVP_KDF_CTX *kctx;
|
||||
unsigned char out[10];
|
||||
OSSL_PARAM params[6], *p = params;
|
||||
|
||||
kdf = EVP_KDF_fetch(NULL, "KBKDF", NULL);
|
||||
kctx = EVP_KDF_CTX_new(kdf);
|
||||
EVP_KDF_free(kdf);
|
||||
|
||||
*p++ = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_DIGEST,
|
||||
"SHA256", 0);
|
||||
*p++ = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_MAC,
|
||||
"HMAC", 0);
|
||||
*p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_KEY,
|
||||
"secret", strlen("secret"))
|
||||
*p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_SALT,
|
||||
"context", strlen("context"));
|
||||
*p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_INFO,
|
||||
"label", strlen("label"));
|
||||
*p = OSSL_PARAM_construct_end();
|
||||
if (EVP_KDF_CTX_set_params(kctx, params) <= 0)
|
||||
error("EVP_KDF_CTX_set_params");
|
||||
else if (EVP_KDF_derive(kctx, out, sizeof(out)) <= 0)
|
||||
error("EVP_KDF_derive");
|
||||
|
||||
EVP_KDF_CTX_free(kctx);
|
||||
|
||||
This example derives 10 bytes using FEEDBACK-CMAC-AES256, with KI "secret",
|
||||
Label "label", and IV "sixteen bytes iv".
|
||||
|
||||
EVP_KDF *kdf;
|
||||
EVP_KDF_CTX *kctx;
|
||||
unsigned char out[10];
|
||||
OSSL_PARAM params[8], *p = params;
|
||||
unsigned char *iv = "sixteen bytes iv";
|
||||
|
||||
kdf = EVP_KDF_fetch(NULL, "KBKDF", NULL);
|
||||
kctx = EVP_KDF_CTX_new(kdf);
|
||||
EVP_KDF_free(kdf);
|
||||
|
||||
*p++ = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_CIPHER, "AES256", 0);
|
||||
*p++ = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_MAC, "CMAC", 0);
|
||||
*p++ = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_MODE, "FEEDBACK", 0);
|
||||
*p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_KEY,
|
||||
"secret", strlen("secret"));
|
||||
*p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_SALT,
|
||||
"context", strlen("context"));
|
||||
*p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_INFO,
|
||||
"label", strlen("label"));
|
||||
*p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_SEED,
|
||||
iv, strlen(iv));
|
||||
*p = OSSL_PARAM_construct_end();
|
||||
if (EVP_KDF_CTX_set_params(kctx, params) <= 0)
|
||||
error("EVP_KDF_CTX_set_params");
|
||||
else if (EVP_KDF_derive(kctx, out, sizeof(out)) <= 0)
|
||||
error("EVP_KDF_derive");
|
||||
|
||||
EVP_KDF_CTX_free(kctx);
|
||||
|
||||
=head1 CONFORMING TO
|
||||
|
||||
NIST SP800-108, IETF RFC 6803, IETF RFC 8009.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<EVP_KDF(3)>,
|
||||
L<EVP_KDF_CTX_new_id(3)>,
|
||||
L<EVP_KDF_CTX_free(3)>,
|
||||
L<EVP_KDF_ctrl(3)>,
|
||||
L<EVP_KDF_size(3)>,
|
||||
L<EVP_KDF_derive(3)>,
|
||||
L<EVP_KDF(3)/PARAMETERS>
|
||||
|
||||
=head1 HISTORY
|
||||
|
||||
This functionality was added to OpenSSL 3.0.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2019 Red Hat, Inc.
|
||||
|
||||
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
|
||||
@@ -24,21 +24,21 @@ The supported parameters are:
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_KDF_PARAM_PASSWORD> ("pass") <octet string>
|
||||
=item "pass" (B<OSSL_KDF_PARAM_PASSWORD>) <octet string>
|
||||
|
||||
=item B<OSSL_KDF_PARAM_SALT> ("salt") <octet string>
|
||||
=item "salt" (B<OSSL_KDF_PARAM_SALT>) <octet string>
|
||||
|
||||
=item B<OSSL_KDF_PARAM_ITER> ("iter") <unsigned int>
|
||||
=item "iter" (B<OSSL_KDF_PARAM_ITER>) <unsigned integer>
|
||||
|
||||
This parameter has a default value of 2048.
|
||||
|
||||
=item B<OSSL_KDF_PARAM_PROPERTIES> ("properties") <UTF8 string>
|
||||
=item "properties" (B<OSSL_KDF_PARAM_PROPERTIES>) <UTF8 string>
|
||||
|
||||
=item B<OSSL_KDF_PARAM_DIGEST> ("digest") <UTF8 string>
|
||||
=item "digest" (B<OSSL_KDF_PARAM_DIGEST>) <UTF8 string>
|
||||
|
||||
These parameters work as described in L<EVP_KDF(3)/PARAMETERS>.
|
||||
|
||||
=item B<OSSL_KDF_PARAM_PKCS5> ("pkcs5") <int>
|
||||
=item "pkcs5" (B<OSSL_KDF_PARAM_PKCS5>) <integer>
|
||||
|
||||
This parameter can be used to enable or disable SP800-132 compliance checks.
|
||||
Setting the mode to 0 enables the compliance checks.
|
||||
@@ -65,10 +65,10 @@ The value string is expected to be a decimal number 0 or 1.
|
||||
=head1 NOTES
|
||||
|
||||
A typical application of this algorithm is to derive keying material for an
|
||||
encryption algorithm from a password in the B<pass>, a salt in B<salt>,
|
||||
encryption algorithm from a password in the "pass", a salt in "salt",
|
||||
and an iteration count.
|
||||
|
||||
Increasing the B<iter> parameter slows down the algorithm which makes it
|
||||
Increasing the "iter" parameter slows down the algorithm which makes it
|
||||
harder for an attacker to perform a brute force attack using a large number
|
||||
of candidate passwords.
|
||||
|
||||
|
||||
@@ -43,21 +43,21 @@ The supported parameters are:
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_KDF_PARAM_PASSWORD> ("pass") <octet string>
|
||||
=item "pass" (B<OSSL_KDF_PARAM_PASSWORD>) <octet string>
|
||||
|
||||
=item B<OSSL_KDF_PARAM_SALT> ("salt") <octet string>
|
||||
=item "salt" (B<OSSL_KDF_PARAM_SALT>) <octet string>
|
||||
|
||||
These parameters work as described in L<EVP_KDF(3)/PARAMETERS>.
|
||||
|
||||
=item B<OSSL_KDF_PARAM_SCRYPT_N> ("n") <int>
|
||||
=item "n" (B<OSSL_KDF_PARAM_SCRYPT_N>) <unsigned integer>
|
||||
|
||||
=item B<OSSL_KDF_PARAM_SCRYPT_R> ("r") <int>
|
||||
=item "r" (B<OSSL_KDF_PARAM_SCRYPT_R>) <unsigned integer>
|
||||
|
||||
=item B<OSSL_KDF_PARAM_SCRYPT_P> ("p") <int>
|
||||
=item "p" (B<OSSL_KDF_PARAM_SCRYPT_P>) <unsigned integer>
|
||||
|
||||
These parameters configure the scrypt work factors N, r and p.
|
||||
N is a parameter of type uint64_t.
|
||||
Both r and p are parameters of type uint32_t.
|
||||
N is a parameter of type B<uint64_t>.
|
||||
Both r and p are parameters of type B<uint32_t>.
|
||||
|
||||
=back
|
||||
|
||||
@@ -69,7 +69,7 @@ A context for scrypt can be obtained by calling:
|
||||
EVP_KDF_CTX *kctx = EVP_KDF_CTX_new(kdf);
|
||||
|
||||
The output length of an scrypt key derivation is specified via the
|
||||
B<keylen> parameter to the L<EVP_KDF-derive(3)> function.
|
||||
"keylen" parameter to the L<EVP_KDF_derive(3)> function.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
|
||||
@@ -39,23 +39,23 @@ The supported parameters are:
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_KDF_PARAM_PROPERTIES> ("properties") <UTF8 string>
|
||||
=item "properties" (B<OSSL_KDF_PARAM_PROPERTIES>) <UTF8 string>
|
||||
|
||||
=item B<OSSL_KDF_PARAM_DIGEST> ("digest") <UTF8 string>
|
||||
=item "digest" (B<OSSL_KDF_PARAM_DIGEST>) <UTF8 string>
|
||||
|
||||
=item B<OSSL_KDF_PARAM_MAC> ("mac") <UTF8 string>
|
||||
=item "mac" (B<OSSL_KDF_PARAM_MAC>) <UTF8 string>
|
||||
|
||||
=item B<OSSL_KDF_PARAM_MAC_SIZE> ("maclen") <size_t>
|
||||
=item "maclen" (B<OSSL_KDF_PARAM_MAC_SIZE>) <unsigned integer>
|
||||
|
||||
=item B<OSSL_KDF_PARAM_SALT> ("salt") <octet string>
|
||||
=item "salt" (B<OSSL_KDF_PARAM_SALT>) <octet string>
|
||||
|
||||
These parameters work as described in L<EVP_KDF(3)/PARAMETERS>.
|
||||
|
||||
=item B<EVP_KDF_CTRL_SET_KEY> ("key") <octet string>
|
||||
=item "key" (B<EVP_KDF_CTRL_SET_KEY>) <octet string>
|
||||
|
||||
This parameter set the shared secret that is used for key derivation.
|
||||
|
||||
=item B<OSSL_KDF_PARAM_INFO> ("info") <octet string>
|
||||
=item "info" (B<OSSL_KDF_PARAM_INFO>) <octet string>
|
||||
|
||||
This parameter sets an optional value for fixedinfo, also known as otherinfo.
|
||||
|
||||
@@ -68,8 +68,8 @@ A context for SSKDF can be obtained by calling:
|
||||
EVP_KDF *kdf = EVP_KDF_fetch(NULL, "SSKDF", NULL);
|
||||
EVP_KDF_CTX *kctx = EVP_KDF_CTX_new(kdf);
|
||||
|
||||
The output length of an SSKDF is specified via the C<keylen>
|
||||
parameter to the L<EVP_KDF-derive(3)> function.
|
||||
The output length of an SSKDF is specified via the I<keylen>
|
||||
parameter to the L<EVP_KDF_derive(3)> function.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
|
||||
@@ -26,22 +26,22 @@ The supported parameters are:
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_KDF_PARAM_PROPERTIES> ("properties") <UTF8 string>
|
||||
=item "properties" (B<OSSL_KDF_PARAM_PROPERTIES>) <UTF8 string>
|
||||
|
||||
=item B<OSSL_KDF_PARAM_DIGEST> ("digest") <UTF8 string>
|
||||
=item "digest" (B<OSSL_KDF_PARAM_DIGEST>) <UTF8 string>
|
||||
|
||||
=item B<OSSL_KDF_PARAM_KEY> ("key") <octet string>
|
||||
=item "key" (B<OSSL_KDF_PARAM_KEY>) <octet string>
|
||||
|
||||
These parameters work as described in L<EVP_KDF(3)/PARAMETERS>.
|
||||
|
||||
=item B<OSSL_KDF_PARAM_SSHKDF_XCGHASH> ("xcghash") <octet string>
|
||||
=item "xcghash" (B<OSSL_KDF_PARAM_SSHKDF_XCGHASH>) <octet string>
|
||||
|
||||
=item B<OSSL_KDF_PARAM_SSHKDF_SESSION_ID> ("session_id") <octet string>
|
||||
=item "session_id" (B<OSSL_KDF_PARAM_SSHKDF_SESSION_ID>) <octet string>
|
||||
|
||||
These parameters set the respective values for the KDF.
|
||||
If a value is already set, the contents are replaced.
|
||||
|
||||
=item B<OSSL_KDF_PARAM_SSHKDF_TYPE> ("type") <int>
|
||||
=item "type" (B<OSSL_KDF_PARAM_SSHKDF_TYPE>) <integer>
|
||||
|
||||
This parameter sets the type for the SSHHKDF operation.
|
||||
There are six supported types:
|
||||
@@ -89,12 +89,12 @@ A context for SSHKDF can be obtained by calling:
|
||||
EVP_KDF *kdf = EVP_KDF_fetch(NULL, "SSHKDF", NULL);
|
||||
EVP_KDF_CTX *kctx = EVP_KDF_CTX_new(kdf);
|
||||
|
||||
The output length of the SSHKDF derivation is specified via the C<keylen>
|
||||
parameter to the L<EVP_KDF-derive(3)> function.
|
||||
The output length of the SSHKDF derivation is specified via the I<keylen>
|
||||
parameter to the L<EVP_KDF_derive(3)> function.
|
||||
Since the SSHKDF output length is variable, calling L<EVP_KDF-size()>
|
||||
to obtain the requisite length is not meaningful. The caller must
|
||||
allocate a buffer of the desired length, and pass that buffer to the
|
||||
L<EVP_KDF-derive(3)> function along with the desired length.
|
||||
L<EVP_KDF_derive(3)> function along with the desired length.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
|
||||
@@ -22,23 +22,23 @@ The supported parameters are:
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_KDF_PARAM_PROPERTIES> ("properties") <UTF8 string>
|
||||
=item "properties" (B<OSSL_KDF_PARAM_PROPERTIES>) <UTF8 string>
|
||||
|
||||
=item B<OSSL_KDF_PARAM_DIGEST> ("digest") <UTF8 string>
|
||||
=item "digest" (B<OSSL_KDF_PARAM_DIGEST>) <UTF8 string>
|
||||
|
||||
These parameters work as described in L<EVP_KDF(3)/PARAMETERS>.
|
||||
|
||||
The C<OSSL_KDF_PARAM_DIGEST> parameter is used to set the message digest
|
||||
The B<OSSL_KDF_PARAM_DIGEST> parameter is used to set the message digest
|
||||
associated with the TLS PRF.
|
||||
EVP_md5_sha1() is treated as a special case which uses the
|
||||
PRF algorithm using both B<MD5> and B<SHA1> as used in TLS 1.0 and 1.1.
|
||||
|
||||
=item B<OSSL_KDF_PARAM_SECRET> ("secret") <octet string>
|
||||
=item "secret" (B<OSSL_KDF_PARAM_SECRET>) <octet string>
|
||||
|
||||
This parameter sets the secret value of the TLS PRF.
|
||||
Any existing secret value is replaced.
|
||||
|
||||
=item B<OSSL_KDF_PARAM_SEED> ("seed") <octet string>
|
||||
=item "seed" (B<OSSL_KDF_PARAM_SEED>) <octet string>
|
||||
|
||||
This parameter sets the context seed.
|
||||
The length of the context seed cannot exceed 1024 bytes;
|
||||
@@ -56,7 +56,7 @@ A context for the TLS PRF can be obtained by calling:
|
||||
The digest, secret value and seed must be set before a key is derived otherwise
|
||||
an error will occur.
|
||||
|
||||
The output length of the PRF is specified by the C<keylen> parameter to the
|
||||
The output length of the PRF is specified by the I<keylen> parameter to the
|
||||
EVP_KDF_derive() function.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
@@ -22,23 +22,23 @@ The supported parameters are:
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_KDF_PARAM_PROPERTIES> ("properties") <UTF8 string>
|
||||
=item "properties" (B<OSSL_KDF_PARAM_PROPERTIES>) <UTF8 string>
|
||||
|
||||
=item B<OSSL_KDF_PARAM_DIGEST> ("digest") <UTF8 string>
|
||||
=item "digest" (B<OSSL_KDF_PARAM_DIGEST>) <UTF8 string>
|
||||
|
||||
These parameters work as described in L<EVP_KDF(3)/PARAMETERS>.
|
||||
|
||||
=item B<OSSL_KDF_PARAM_KEY> ("key") <octet string>
|
||||
=item "key" (B<OSSL_KDF_PARAM_KEY>) <octet string>
|
||||
|
||||
The shared secret used for key derivation. This parameter sets the secret.
|
||||
|
||||
=item B<OSSL_KDF_PARAM_UKM> ("ukm") <octet string>
|
||||
=item "ukm" (B<OSSL_KDF_PARAM_UKM>) <octet string>
|
||||
|
||||
This parameter is an optional random string that is provided
|
||||
by the sender called "partyAInfo".
|
||||
In CMS this is the user keying material.
|
||||
|
||||
=item B<OSSL_KDF_PARAM_CEK_ALG> ("cekalg") <UTF8 string>
|
||||
=item "cekalg" (B<OSSL_KDF_PARAM_CEK_ALG>) <UTF8 string>
|
||||
|
||||
This parameter sets the CEK wrapping algorithm name.
|
||||
|
||||
@@ -51,8 +51,8 @@ A context for X942KDF can be obtained by calling:
|
||||
EVP_KDF *kdf = EVP_KDF_fetch(NULL, "X942KDF", NULL);
|
||||
EVP_KDF_CTX *kctx = EVP_KDF_CTX_new(kdf);
|
||||
|
||||
The output length of an X942KDF is specified via the C<keylen>
|
||||
parameter to the L<EVP_KDF-derive(3)> function.
|
||||
The output length of an X942KDF is specified via the I<keylen>
|
||||
parameter to the L<EVP_KDF_derive(3)> function.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
|
||||
@@ -21,18 +21,18 @@ The supported parameters are:
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_KDF_PARAM_PROPERTIES> ("properties") <UTF8 string>
|
||||
=item "properties" (B<OSSL_KDF_PARAM_PROPERTIES>) <UTF8 string>
|
||||
|
||||
=item B<OSSL_KDF_PARAM_DIGEST> ("digest") <UTF8 string>
|
||||
=item "digest" (B<OSSL_KDF_PARAM_DIGEST>) <UTF8 string>
|
||||
|
||||
These parameters work as described in L<EVP_KDF(3)/PARAMETERS>.
|
||||
|
||||
=item B<OSSL_KDF_PARAM_KEY> ("key") <octet string>
|
||||
=item "key" (B<OSSL_KDF_PARAM_KEY>) <octet string>
|
||||
|
||||
The shared secret used for key derivation.
|
||||
This parameter sets the secret.
|
||||
|
||||
=item B<OSSL_KDF_PARAM_INFO> ("info") <octet string>
|
||||
=item "info" (B<OSSL_KDF_PARAM_INFO>) <octet string>
|
||||
|
||||
This parameter specifies an optional value for shared info.
|
||||
|
||||
@@ -48,8 +48,8 @@ A context for X963KDF can be obtained by calling:
|
||||
EVP_KDF *kdf = EVP_KDF_fetch(NULL, "X963KDF", NULL);
|
||||
EVP_KDF_CTX *kctx = EVP_KDF_CTX_new(kdf);
|
||||
|
||||
The output length of an X963KDF is specified via the C<keylen>
|
||||
parameter to the L<EVP_KDF-derive(3)> function.
|
||||
The output length of an X963KDF is specified via the I<keylen>
|
||||
parameter to the L<EVP_KDF_derive(3)> function.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
|
||||
@@ -30,27 +30,28 @@ L<EVP_MAC(3)/PARAMETERS>.
|
||||
All these parameters can be set with EVP_MAC_CTX_set_params().
|
||||
Furthermore, the "size" parameter can be retrieved with
|
||||
EVP_MAC_CTX_get_params(), or with EVP_MAC_size().
|
||||
The length of the "size" parameter should not exceed that of a B<size_t>.
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_MAC_PARAM_KEY> ("key") <octet string>
|
||||
=item "key" (B<OSSL_MAC_PARAM_KEY>) <octet string>
|
||||
|
||||
This may be at most 64 bytes for BLAKE2BMAC or 32 for BLAKE2SMAC and
|
||||
at least 1 byte in both cases.
|
||||
|
||||
=item B<OSSL_MAC_PARAM_CUSTOM> ("custom") <octet string>
|
||||
=item "custom" (B<OSSL_MAC_PARAM_CUSTOM>) <octet string>
|
||||
|
||||
This is an optional value of at most 16 bytes for BLAKE2BMAC or 8 for
|
||||
BLAKE2SMAC.
|
||||
It is empty by default.
|
||||
|
||||
=item B<OSSL_MAC_PARAM_SALT> ("salt") <octet string>
|
||||
=item "salt" (B<OSSL_MAC_PARAM_SALT>) <octet string>
|
||||
|
||||
This is an optional value of at most 16 bytes for BLAKE2BMAC or 8 for
|
||||
BLAKE2SMAC.
|
||||
It is empty by default.
|
||||
|
||||
=item B<OSSL_MAC_PARAM_SIZE> ("size") <size_t>
|
||||
=item "size" (B<OSSL_MAC_PARAM_SIZE>) <unsigned integer>
|
||||
|
||||
When set, this can be any number between between 1 and 32 for
|
||||
EVP_MAC_BLAKE2S or 64 for EVP_MAC_BLAKE2B.
|
||||
|
||||
@@ -28,13 +28,11 @@ The following parameter can be set with EVP_MAC_CTX_set_params():
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_MAC_PARAM_KEY> ("key") <octet string>
|
||||
=item "key" (B<OSSL_MAC_PARAM_KEY>) <octet string>
|
||||
|
||||
=item B<OSSL_MAC_PARAM_ENGINE> ("engine") <utf8 string>
|
||||
=item "cipher" (B<OSSL_MAC_PARAM_CIPHER>) <UTF8 string>
|
||||
|
||||
=item B<OSSL_MAC_PARAM_CIPHER> ("cipher") <utf8 string>
|
||||
|
||||
=item B<OSSL_MAC_PARAM_PROPERTIES> ("properties") <utf8 string>
|
||||
=item "properties" (B<OSSL_MAC_PARAM_PROPERTIES>) <UTF8 string>
|
||||
|
||||
=back
|
||||
|
||||
@@ -43,11 +41,12 @@ EVP_MAC_CTX_get_params():
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_MAC_PARAM_SIZE> ("size") <unsigned int>
|
||||
=item "size" (B<OSSL_MAC_PARAM_SIZE>) <unsigned integer>
|
||||
|
||||
=back
|
||||
|
||||
The "size" parameter can also be retrieved with with EVP_MAC_size().
|
||||
The length of the "size" parameter is equal to that of an B<unsigned int>.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
|
||||
@@ -28,15 +28,13 @@ The following parameter can be set with EVP_MAC_CTX_set_params():
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_MAC_PARAM_KEY> ("key") <octet string>
|
||||
=item "key" (B<OSSL_MAC_PARAM_KEY>) <octet string>
|
||||
|
||||
=item B<OSSL_MAC_PARAM_IV> ("iv") <octet string>
|
||||
=item "iv" (B<OSSL_MAC_PARAM_IV>) <octet string>
|
||||
|
||||
=item B<OSSL_MAC_PARAM_ENGINE> ("engine") <utf8 string>
|
||||
=item "cipher" (B<OSSL_MAC_PARAM_CIPHER>) <UTF8 string>
|
||||
|
||||
=item B<OSSL_MAC_PARAM_CIPHER> ("cipher") <utf8 string>
|
||||
|
||||
=item B<OSSL_MAC_PARAM_PROPERTIES> ("properties") <utf8 string>
|
||||
=item "properties" (B<OSSL_MAC_PARAM_PROPERTIES>) <UTF8 string>
|
||||
|
||||
=back
|
||||
|
||||
@@ -45,11 +43,12 @@ EVP_MAC_CTX_get_params():
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_MAC_PARAM_SIZE> ("size") <unsigned int>
|
||||
=item "size" (B<OSSL_MAC_PARAM_SIZE>) <unsigned integer>
|
||||
|
||||
=back
|
||||
|
||||
The "size" parameter can also be retrieved with EVP_MAC_size().
|
||||
The length of the "size" parameter is equal to that of an B<unsigned int>.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
|
||||
@@ -28,30 +28,29 @@ The following parameter can be set with EVP_MAC_CTX_set_params():
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_MAC_PARAM_KEY> ("key") <octet string>
|
||||
=item "key" (B<OSSL_MAC_PARAM_KEY>) <octet string>
|
||||
|
||||
=item B<OSSL_MAC_PARAM_FLAGS> ("flags") <octet string>
|
||||
=item "flags" (B<OSSL_MAC_PARAM_FLAGS>) <octet string>
|
||||
|
||||
=item B<OSSL_MAC_PARAM_ENGINE> ("engine") <utf8 string>
|
||||
=item "digest" (B<OSSL_MAC_PARAM_DIGEST>) <UTF8 string>
|
||||
|
||||
=item B<OSSL_MAC_PARAM_DIGEST> ("digest") <utf8 string>
|
||||
|
||||
=item B<OSSL_MAC_PARAM_PROPERTIES> ("properties") <utf8 string>
|
||||
=item "properties" (B<OSSL_MAC_PARAM_PROPERTIES>) <UTF8 string>
|
||||
|
||||
=back
|
||||
|
||||
The "flags" parameter is passed directly to HMAC_CTX_set_flags().
|
||||
|
||||
The following parameters can be retrieved with
|
||||
The following parameter can be retrieved with
|
||||
EVP_MAC_CTX_get_params():
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_MAC_PARAM_SIZE> ("size") <unsigned int>
|
||||
=item "size" (B<OSSL_MAC_PARAM_SIZE>) <unsigned integer>
|
||||
|
||||
=back
|
||||
|
||||
The "size" parameter can also be retrieved with EVP_MAC_size().
|
||||
The length of the "size" parameter is equal to that of an B<unsigned int>.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
|
||||
@@ -30,16 +30,17 @@ L<EVP_MAC(3)/PARAMETERS>.
|
||||
All these parameters can be set with EVP_MAC_CTX_set_params().
|
||||
Furthermore, the "size" parameter can be retrieved with
|
||||
EVP_MAC_CTX_get_params(), or with EVP_MAC_size().
|
||||
The length of the "size" parameter should not exceed that of a B<size_t>.
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_MAC_PARAM_KEY> ("key") <octet string>
|
||||
=item "key" (B<OSSL_MAC_PARAM_KEY>) <octet string>
|
||||
|
||||
=item B<OSSL_MAC_PARAM_CUSTOM> ("custom") <octet string>
|
||||
=item "custom" (B<OSSL_MAC_PARAM_CUSTOM>) <octet string>
|
||||
|
||||
=item B<OSSL_MAC_PARAM_SIZE> ("size") <size_t>
|
||||
=item "size" (B<OSSL_MAC_PARAM_SIZE>) <unsigned integer>
|
||||
|
||||
=item B<OSSL_MAC_PARAM_XOF>
|
||||
=item "xof" (B<OSSL_MAC_PARAM_XOF>) <integer>
|
||||
|
||||
=back
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ The following parameter can be set with EVP_MAC_CTX_set_params():
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_MAC_PARAM_KEY> ("key") <octet string>
|
||||
=item "key" (B<OSSL_MAC_PARAM_KEY>) <octet string>
|
||||
|
||||
=back
|
||||
|
||||
@@ -37,11 +37,12 @@ EVP_MAC_CTX_get_params():
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_MAC_PARAM_SIZE> ("size") <unsigned int>
|
||||
=item "size" (B<OSSL_MAC_PARAM_SIZE>) <unsigned integer>
|
||||
|
||||
=back
|
||||
|
||||
The "size" parameter can also be retrieved with with EVP_MAC_size().
|
||||
The length of the "size" parameter should not exceed that of an B<unsigned int>.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
|
||||
@@ -28,12 +28,13 @@ L<EVP_MAC(3)/PARAMETERS>.
|
||||
All these parameters can be set with EVP_MAC_CTX_set_params().
|
||||
Furthermore, the "size" parameter can be retrieved with
|
||||
EVP_MAC_CTX_get_params(), or with EVP_MAC_size().
|
||||
The length of the "size" parameter should not exceed that of a B<size_t>.
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_MAC_PARAM_KEY> ("key") <octet string>
|
||||
=item "key" (B<OSSL_MAC_PARAM_KEY>) <octet string>
|
||||
|
||||
=item B<OSSL_MAC_PARAM_SIZE> ("size") <size_t>
|
||||
=item "size" (B<OSSL_MAC_PARAM_SIZE>) <unsigned integer>
|
||||
|
||||
=back
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ The message to sign or verify must be passed using the one-shot
|
||||
EVP_DigestSign() and EVP_DigestVerify() functions.
|
||||
|
||||
When calling EVP_DigestSignInit() or EVP_DigestVerifyInit(), the
|
||||
digest B<type> parameter B<MUST> be set to B<NULL>.
|
||||
digest I<type> parameter B<MUST> be set to NULL.
|
||||
|
||||
Applications wishing to sign certificates (or other structures such as
|
||||
CRLs or certificate requests) using Ed25519 or Ed448 can either use X509_sign()
|
||||
|
||||
@@ -239,7 +239,7 @@ pulls the necessary entropy from its source automatically.
|
||||
However, both calls are permitted, and do reseed the RNG.
|
||||
|
||||
RAND_add() can be used to add both kinds of random input, depending on the
|
||||
value of the B<randomness> argument:
|
||||
value of the I<randomness> argument:
|
||||
|
||||
=over 4
|
||||
|
||||
@@ -267,7 +267,7 @@ from the trusted entropy sources.
|
||||
NOTE: Manual reseeding is *not allowed* in FIPS mode, because
|
||||
[NIST SP-800-90Ar1] mandates that entropy *shall not* be provided by
|
||||
the consuming application for instantiation (Section 9.1) or
|
||||
reseeding (Section 9.2). For that reason, the B<randomness>
|
||||
reseeding (Section 9.2). For that reason, the I<randomness>
|
||||
argument is ignored and the random bytes provided by the L<RAND_add(3)> and
|
||||
L<RAND_seed(3)> calls are treated as additional data.
|
||||
|
||||
|
||||
@@ -41,6 +41,9 @@ done by calling:
|
||||
And normally there is no need to pass a B<pctx> parameter to EVP_DigestSignInit()
|
||||
or EVP_DigestVerifyInit() in such a scenario.
|
||||
|
||||
SM2 can be tested within L<speed(1)> application since version 3.0.0. At current
|
||||
stage, the only valid algorithm name is B<sm2>.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
This example demonstrates the calling sequence for using an B<EVP_PKEY> to verify
|
||||
|
||||
+4
-4
@@ -6,7 +6,7 @@ bio - Basic I/O abstraction
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
=for comment generic
|
||||
=for openssl generic
|
||||
|
||||
#include <openssl/bio.h>
|
||||
|
||||
@@ -47,10 +47,10 @@ in a memory leak.
|
||||
Calling BIO_free_all() on a single BIO has the same effect as calling
|
||||
BIO_free() on it other than the discarded return value.
|
||||
|
||||
Normally the B<type> argument is supplied by a function which returns a
|
||||
Normally the I<type> argument is supplied by a function which returns a
|
||||
pointer to a BIO_METHOD. There is a naming convention for such functions:
|
||||
a source/sink BIO is normally called BIO_s_*() and a filter BIO
|
||||
BIO_f_*();
|
||||
a source/sink BIO typically starts with I<BIO_s_> and
|
||||
a filter BIO with I<BIO_f_>.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
|
||||
+6
-6
@@ -10,13 +10,13 @@ See the individual manual pages for details.
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The OpenSSL B<crypto> library implements a wide range of cryptographic
|
||||
algorithms used in various Internet standards. The services provided
|
||||
by this library are used by the OpenSSL implementations of SSL, TLS
|
||||
The OpenSSL crypto library (C<libcrypto>) implements a wide range of
|
||||
cryptographic algorithms used in various Internet standards. The services
|
||||
provided by this library are used by the OpenSSL implementations of SSL, TLS
|
||||
and S/MIME, and they have also been used to implement SSH, OpenPGP, and
|
||||
other cryptographic standards.
|
||||
|
||||
B<libcrypto> consists of a number of sub-libraries that implement the
|
||||
C<libcrypto> consists of a number of sub-libraries that implement the
|
||||
individual algorithms.
|
||||
|
||||
The functionality includes symmetric encryption, public key
|
||||
@@ -34,11 +34,11 @@ B<0> and B<1>. For example the functions:
|
||||
|
||||
The B<0> version uses the supplied structure pointer directly
|
||||
in the parent and it will be freed up when the parent is freed.
|
||||
In the above example B<crl> would be freed but B<rev> would not.
|
||||
In the above example I<crl> would be freed but I<rev> would not.
|
||||
|
||||
The B<1> function uses a copy of the supplied structure pointer
|
||||
(or in some cases increases its link count) in the parent and
|
||||
so both (B<x> and B<obj> above) should be freed up.
|
||||
so both (I<x> and I<obj> above) should be freed up.
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
|
||||
+10
-10
@@ -20,14 +20,14 @@ The types are:
|
||||
|
||||
=over 4
|
||||
|
||||
=item C<OSSL_DISPATCH>
|
||||
=item B<OSSL_DISPATCH>
|
||||
|
||||
This type is a tuple of function identity and function pointer.
|
||||
Arrays of this type are passed between the OpenSSL libraries and the
|
||||
providers to describe what functionality one side provides to the
|
||||
other.
|
||||
Arrays of this type must be terminated with a tuple having function
|
||||
identity zero and function pointer C<NULL>.
|
||||
identity zero and function pointer NULL.
|
||||
|
||||
The available function identities and corresponding function
|
||||
signatures are defined by L<openssl-core_numbers.h(7)>.
|
||||
@@ -38,41 +38,41 @@ This ensures that providers built with one OpenSSL version in mind
|
||||
will work together with any other OpenSSL version that supports this
|
||||
mechanism.
|
||||
|
||||
=item C<OSSL_ITEM>
|
||||
=item B<OSSL_ITEM>
|
||||
|
||||
This type is a tuple of integer and pointer.
|
||||
It's a generic type used as a generic descriptor, its exact meaning
|
||||
being defined by how it's used.
|
||||
Arrays of this type are passed between the OpenSSL libraries and the
|
||||
providers, and must be terminated with a tuple where the integer is
|
||||
zero and the pointer C<NULL>.
|
||||
zero and the pointer NULL.
|
||||
|
||||
=item C<OSSL_ALGORITHM>
|
||||
=item B<OSSL_ALGORITHM>
|
||||
|
||||
This type is a tuple of an algorithm name (string), a property
|
||||
definition (string) and a dispatch table (array of C<OSSL_DISPATCH>).
|
||||
definition (string) and a dispatch table (array of B<OSSL_DISPATCH>).
|
||||
Arrays of this type are passed on demand from the providers to the
|
||||
OpenSSL libraries to describe what algorithms the providers provide
|
||||
implementations of, and with what properties.
|
||||
Arrays of this type must be terminated with a tuple having function
|
||||
identity zero and function pointer C<NULL>.
|
||||
identity zero and function pointer NULL.
|
||||
|
||||
The algorithm names and property definitions are defined by the
|
||||
providers.
|
||||
|
||||
=item C<OSSL_PARAM>
|
||||
=item B<OSSL_PARAM>
|
||||
|
||||
This type is a structure that allows passing arbitrary object data
|
||||
between two parties that have no or very little shared knowledge about
|
||||
their respective internal structures for that object.
|
||||
It's normally passed in arrays, where the array is terminated with an
|
||||
element where all fields are zero (for non-pointers) or C<NULL> (for
|
||||
element where all fields are zero (for non-pointers) or NULL (for
|
||||
pointers).
|
||||
|
||||
These arrays can be used to set parameters for some object, to request
|
||||
parameters, and to describe parameters.
|
||||
|
||||
C<OSSL_PARAM> is further described in L<OSSL_PARAM(3)>
|
||||
B<OSSL_PARAM> is further described in L<OSSL_PARAM(3)>
|
||||
|
||||
=back
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ ossl_store-file - The store 'file' scheme loader
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
=for comment generic
|
||||
=for openssl generic
|
||||
|
||||
#include <openssl/store.h>
|
||||
|
||||
@@ -46,7 +46,7 @@ only).
|
||||
=head1 NOTES
|
||||
|
||||
When needed, the 'file' scheme loader will require a pass phrase by
|
||||
using the C<UI_METHOD> that was passed via OSSL_STORE_open().
|
||||
using the B<UI_METHOD> that was passed via OSSL_STORE_open().
|
||||
This pass phrase is expected to be UTF-8 encoded, anything else will
|
||||
give an undefined result.
|
||||
The files made accessible through this loader are expected to be
|
||||
|
||||
@@ -6,7 +6,7 @@ ossl_store - Store retrieval functions
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
=for comment generic
|
||||
=for openssl generic
|
||||
|
||||
#include <openssl/store.h>
|
||||
|
||||
@@ -15,7 +15,7 @@ ossl_store - Store retrieval functions
|
||||
=head2 General
|
||||
|
||||
A STORE is a layer of functionality to retrieve a number of supported
|
||||
objects from a repository of any kind, addressable as a file name or
|
||||
objects from a repository of any kind, addressable as a filename or
|
||||
as a URI.
|
||||
|
||||
The functionality supports the pattern "open a channel to the
|
||||
|
||||
@@ -6,7 +6,7 @@ provider-cipher - The cipher library E<lt>-E<gt> provider functions
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
=for comment multiple includes
|
||||
=for openssl multiple includes
|
||||
|
||||
#include <openssl/core_numbers.h>
|
||||
#include <openssl/core_names.h>
|
||||
@@ -111,65 +111,65 @@ OP_cipher_newctx() should create and return a pointer to a provider side
|
||||
structure for holding context information during a cipher operation.
|
||||
A pointer to this context will be passed back in a number of the other cipher
|
||||
operation function calls.
|
||||
The parameter B<provctx> is the provider context generated during provider
|
||||
The parameter I<provctx> is the provider context generated during provider
|
||||
initialisation (see L<provider(3)>).
|
||||
|
||||
OP_cipher_freectx() is passed a pointer to the provider side cipher context in
|
||||
the B<cctx> parameter.
|
||||
the I<cctx> parameter.
|
||||
This function should free any resources associated with that context.
|
||||
|
||||
OP_cipher_dupctx() should duplicate the provider side cipher context in the
|
||||
B<cctx> parameter and return the duplicate copy.
|
||||
I<cctx> parameter and return the duplicate copy.
|
||||
|
||||
=head2 Encryption/Decryption Functions
|
||||
|
||||
OP_cipher_encrypt_init() initialises a cipher operation for encryption given a
|
||||
newly created provider side cipher context in the B<cctx> parameter.
|
||||
The key to be used is given in B<key> which is B<keylen> bytes long.
|
||||
The IV to be used is given in B<iv> which is B<ivlen> bytes long.
|
||||
newly created provider side cipher context in the I<cctx> parameter.
|
||||
The key to be used is given in I<key> which is I<keylen> bytes long.
|
||||
The IV to be used is given in I<iv> which is I<ivlen> bytes long.
|
||||
|
||||
OP_cipher_decrypt_init() is the same as OP_cipher_encrypt_init() except that it
|
||||
initialises the context for a decryption operation.
|
||||
|
||||
OP_cipher_update() is called to supply data to be encrypted/decrypted as part of
|
||||
a previously initialised cipher operation.
|
||||
The B<cctx> parameter contains a pointer to a previously initialised provider
|
||||
The I<cctx> parameter contains a pointer to a previously initialised provider
|
||||
side context.
|
||||
OP_cipher_update() should encrypt/decrypt B<inl> bytes of data at the location
|
||||
pointed to by B<in>.
|
||||
The encrypted data should be stored in B<out> and the amount of data written to
|
||||
B<*outl> which should not exceed B<outsize> bytes.
|
||||
OP_cipher_update() should encrypt/decrypt I<inl> bytes of data at the location
|
||||
pointed to by I<in>.
|
||||
The encrypted data should be stored in I<out> and the amount of data written to
|
||||
I<*outl> which should not exceed I<outsize> bytes.
|
||||
OP_cipher_update() may be called multiple times for a single cipher operation.
|
||||
It is the responsibility of the cipher implementation to handle input lengths
|
||||
that are not multiples of the block length.
|
||||
In such cases a cipher implementation will typically cache partial blocks of
|
||||
input data until a complete block is obtained.
|
||||
B<out> may be the same location as B<in> but it should not partially overlap.
|
||||
The same expectations apply to B<outsize> as documented for
|
||||
I<out> may be the same location as I<in> but it should not partially overlap.
|
||||
The same expectations apply to I<outsize> as documented for
|
||||
L<EVP_EncryptUpdate(3)> and L<EVP_DecryptUpdate(3)>.
|
||||
|
||||
OP_cipher_final() completes an encryption or decryption started through previous
|
||||
OP_cipher_encrypt_init() or OP_cipher_decrypt_init(), and OP_cipher_update()
|
||||
calls.
|
||||
The B<cctx> parameter contains a pointer to the provider side context.
|
||||
Any final encryption/decryption output should be written to B<out> and the
|
||||
amount of data written to B<*outl> which should not exceed B<outsize> bytes.
|
||||
The same expectations apply to B<outsize> as documented for
|
||||
The I<cctx> parameter contains a pointer to the provider side context.
|
||||
Any final encryption/decryption output should be written to I<out> and the
|
||||
amount of data written to I<*outl> which should not exceed I<outsize> bytes.
|
||||
The same expectations apply to I<outsize> as documented for
|
||||
L<EVP_EncryptFinal(3)> and L<EVP_DecryptFinal(3)>.
|
||||
|
||||
OP_cipher_cipher() performs encryption/decryption using the provider side cipher
|
||||
context in the B<cctx> parameter that should have been previously initialised via
|
||||
context in the I<cctx> parameter that should have been previously initialised via
|
||||
a call to OP_cipher_encrypt_init() or OP_cipher_decrypt_init.
|
||||
This should call the raw underlying cipher function without any padding.
|
||||
This will be invoked in the provider as a result of the application calling
|
||||
L<EVP_Cipher(3)>.
|
||||
The application is responsible for ensuring that the input is a multiple of the
|
||||
block length.
|
||||
The data to be encrypted/decrypted will be in B<in>, and it will be B<inl> bytes
|
||||
The data to be encrypted/decrypted will be in I<in>, and it will be I<inl> bytes
|
||||
in length.
|
||||
The output from the encryption/decryption should be stored in B<out> and the
|
||||
amount of data stored should be put in B<*outl> which should be no more than
|
||||
B<outsize> bytes.
|
||||
The output from the encryption/decryption should be stored in I<out> and the
|
||||
amount of data stored should be put in I<*outl> which should be no more than
|
||||
I<outsize> bytes.
|
||||
|
||||
=head2 Cipher Parameters
|
||||
|
||||
@@ -177,14 +177,14 @@ See L<OSSL_PARAM(3)> for further details on the parameters structure used by
|
||||
these functions.
|
||||
|
||||
OP_cipher_get_params() gets details of the algorithm implementation
|
||||
and stores them in B<params>.
|
||||
and stores them in I<params>.
|
||||
|
||||
OP_cipher_set_ctx_params() sets cipher operation parameters for the
|
||||
provider side cipher context B<cctx> to B<params>.
|
||||
provider side cipher context I<cctx> to I<params>.
|
||||
Any parameter settings are additional to any that were previously set.
|
||||
|
||||
OP_cipher_get_ctx_params() gets cipher operation details details from
|
||||
the given provider side cipher context B<cctx> and stores them in B<params>.
|
||||
the given provider side cipher context I<cctx> and stores them in I<params>.
|
||||
|
||||
OP_cipher_gettable_params(), OP_cipher_gettable_ctx_params(), and
|
||||
OP_cipher_settable_ctx_params() all return constant B<OSSL_PARAM> arrays
|
||||
@@ -197,18 +197,18 @@ parameters are relevant to, or are understood by all ciphers:
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_CIPHER_PARAM_PADDING> (uint)
|
||||
=item "padding" (B<OSSL_CIPHER_PARAM_PADDING>) <unsigned integer>
|
||||
|
||||
Sets the padding mode for the associated cipher ctx.
|
||||
Setting a value of 1 will turn padding on.
|
||||
Setting a value of 0 will turn padding off.
|
||||
|
||||
=item B<OSSL_CIPHER_PARAM_MODE> (uint)
|
||||
=item "mode" (B<OSSL_CIPHER_PARAM_MODE>) <unsigned integer>
|
||||
|
||||
Gets the mode for the associated cipher algorithm.
|
||||
See L<EVP_CIPHER_mode(3)> for a list of valid modes.
|
||||
|
||||
=item B<OSSL_CIPHER_PARAM_BLOCK_SIZE> (size_t)
|
||||
=item "blocksize" (B<OSSL_CIPHER_PARAM_BLOCK_SIZE>) <unsigned integer>
|
||||
|
||||
Gets the block size for the associated cipher algorithm.
|
||||
The block size should be 1 for stream ciphers.
|
||||
@@ -216,44 +216,50 @@ Note that the block size for a cipher may be different to the block size for
|
||||
the underlying encryption/decryption primitive.
|
||||
For example AES in CTR mode has a block size of 1 (because it operates like a
|
||||
stream cipher), even though AES has a block size of 16.
|
||||
The length of the "blocksize" parameter should not exceed that of a B<size_t>.
|
||||
|
||||
=item B<OSSL_CIPHER_PARAM_FLAGS> (ulong)
|
||||
=item "flags" (B<OSSL_CIPHER_PARAM_FLAGS>) <unsigned integer>
|
||||
|
||||
Gets any flags for the associated cipher algorithm.
|
||||
See L<EVP_CIPHER_meth_set_flags(3)> for a list of currently defined cipher
|
||||
flags.
|
||||
The length of the "flags" parameter should equal that of an
|
||||
B<unsigned long int>.
|
||||
|
||||
=item B<OSSL_CIPHER_PARAM_KEYLEN> (size_t)
|
||||
=item "keylen" (B<OSSL_CIPHER_PARAM_KEYLEN>) <unsigned integer>
|
||||
|
||||
Gets the key length for the associated cipher algorithm.
|
||||
This can also be used to get or set the key length for the associated cipher
|
||||
ctx.
|
||||
The length of the "keylen" parameter should not exceed that of a B<size_t>.
|
||||
|
||||
=item B<OSSL_CIPHER_PARAM_IVLEN> (size_t)
|
||||
=item "ivlen" (B<OSSL_CIPHER_PARAM_IVLEN>) <unsigned integer>
|
||||
|
||||
Gets the IV length for the associated cipher algorithm.
|
||||
The length of the "ivlen" parameter should not exceed that of a B<size_t>.
|
||||
|
||||
=item B<OSSL_CIPHER_PARAM_IV> (octet_string OR octet_ptr)
|
||||
=item "iv" (B<OSSL_CIPHER_PARAM_IV>) <octet string OR octet ptr>
|
||||
|
||||
Gets the IV for the associated cipher ctx.
|
||||
|
||||
=item B<OSSL_CIPHER_PARAM_NUM> (uint)
|
||||
=item "num" (B<OSSL_CIPHER_PARAM_NUM>) <unsigned integer>
|
||||
|
||||
Gets or sets the cipher specific "num" parameter for the associated cipher ctx.
|
||||
Built-in ciphers typically use this to track how much of the current underlying
|
||||
block has been "used" already.
|
||||
|
||||
=item B<OSSL_CIPHER_PARAM_AEAD_TAG> (octet_string)
|
||||
=item "tag" (B<OSSL_CIPHER_PARAM_AEAD_TAG>) <octet string>
|
||||
|
||||
Gets or sets the AEAD tag for the associated cipher ctx.
|
||||
See L<EVP_EncryptInit(3)/AEAD Interface>.
|
||||
|
||||
=item B<OSSL_CIPHER_PARAM_AEAD_TAGLEN> (size_t)
|
||||
=item "taglen" (B<OSSL_CIPHER_PARAM_AEAD_TAGLEN>) <unsigned integer>
|
||||
|
||||
Gets the tag length to be used for an AEAD cipher for the associated cipher ctx.
|
||||
It returns a default value if it has not been set.
|
||||
The length of the "taglen" parameter should not exceed that of a B<size_t>.
|
||||
|
||||
=item B<OSSL_CIPHER_PARAM_AEAD_TLS1_AAD> (octet_string)
|
||||
=item "tlsaad" (B<OSSL_CIPHER_PARAM_AEAD_TLS1_AAD>) <octet string>
|
||||
|
||||
=for comment TODO(3.0): Consider changing this interface so that all ciphers
|
||||
use the standard AEAD interface - rather than having this special purpose
|
||||
@@ -263,12 +269,13 @@ Sets TLSv1.2 AAD information for the associated cipher ctx.
|
||||
TLSv1.2 AAD information is always 13 bytes in length and is as defined for the
|
||||
"additional_data" field described in section 6.2.3.3 of RFC5246.
|
||||
|
||||
=item B<OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD> (size_t)
|
||||
=item "tlsaadpad" (B<OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD>) <unsigned integer>
|
||||
|
||||
Gets the length of the tag that will be added to a TLS record for the AEAD
|
||||
tag for the associated cipher ctx.
|
||||
The length of the "tlsaadpad" parameter should not exceed that of a B<size_t>.
|
||||
|
||||
=item B<OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED> (octet_string)
|
||||
=item "tlsivfixed" (B<OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED>) <octet string>
|
||||
|
||||
=for comment TODO(3.0): This interface needs completely redesigning!
|
||||
|
||||
@@ -299,20 +306,42 @@ beginning of the output buffer, do "in place" encryption of the payload and
|
||||
write that to the output buffer, and finally add the tag onto the end of the
|
||||
output buffer.
|
||||
|
||||
Whether encrypting or decrypting the value written to B<*outl> in the
|
||||
Whether encrypting or decrypting the value written to I<*outl> in the
|
||||
OP_cipher_cipher call should be the length of the payload excluding the explicit
|
||||
IV length and the tag length.
|
||||
|
||||
=item B<OSSL_CIPHER_PARAM_AEAD_IVLEN> (size_t)
|
||||
=item "ivlen" (B<OSSL_CIPHER_PARAM_AEAD_IVLEN>) <unsigned integer>
|
||||
|
||||
Sets the IV length to be used for an AEAD cipher for the associated cipher ctx.
|
||||
The length of the "ivlen" parameter should not exceed that of a B<size_t>.
|
||||
|
||||
=item B<OSSL_CIPHER_PARAM_RANDOM_KEY> (octet_string)
|
||||
=item "mackey" (B<OSSL_CIPHER_PARAM_AEAD_MAC_KEY>) <octet string>
|
||||
|
||||
Sets the MAC key used by composite AEAD ciphers such as AES-CBC-HMAC-SHA256.
|
||||
|
||||
=item "randkey" (B<OSSL_CIPHER_PARAM_RANDOM_KEY>) <octet string>
|
||||
|
||||
Gets a implementation specific randomly generated key for the associated
|
||||
cipher ctx. This is currently only supported by 3DES (which sets the key to
|
||||
odd parity).
|
||||
|
||||
=item "alg_id_param" (B<OSSL_CIPHER_PARAM_ALG_ID>) <octet string>
|
||||
|
||||
Used to pass the DER encoded AlgorithmIdentifier parameter to or from
|
||||
the cipher implementation. Functions like L<EVP_CIPHER_param_to_asn1(3)>
|
||||
and L<EVP_CIPHER_asn1_to_param(3)> use this parameter for any implementation
|
||||
that has the flag B<EVP_CIPH_FLAG_CUSTOM_ASN1> set.
|
||||
|
||||
=item "rounds" (B<OSSL_CIPHER_PARAM_ROUNDS>) <unsigned integer>
|
||||
|
||||
Sets or gets the number of rounds to be used for a cipher.
|
||||
This is used by the RC5 cipher.
|
||||
|
||||
=item "keybits" (B<OSSL_CIPHER_PARAM_RC2_KEYBITS>) <unsigned integer>
|
||||
|
||||
Gets or sets the effective keybits used for a RC2 cipher.
|
||||
The length of the "keybits" parameter should not exceed that of a B<size_t>.
|
||||
|
||||
=back
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
@@ -6,7 +6,7 @@ provider-digest - The digest library E<lt>-E<gt> provider functions
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
=for comment multiple includes
|
||||
=for openssl multiple includes
|
||||
|
||||
#include <openssl/core_numbers.h>
|
||||
#include <openssl/core_names.h>
|
||||
@@ -99,43 +99,43 @@ OP_digest_newctx() should create and return a pointer to a provider side
|
||||
structure for holding context information during a digest operation.
|
||||
A pointer to this context will be passed back in a number of the other digest
|
||||
operation function calls.
|
||||
The parameter B<provctx> is the provider context generated during provider
|
||||
The parameter I<provctx> is the provider context generated during provider
|
||||
initialisation (see L<provider(3)>).
|
||||
|
||||
OP_digest_freectx() is passed a pointer to the provider side digest context in
|
||||
the B<dctx> parameter.
|
||||
the I<dctx> parameter.
|
||||
This function should free any resources associated with that context.
|
||||
|
||||
OP_digest_dupctx() should duplicate the provider side digest context in the
|
||||
B<dctx> parameter and return the duplicate copy.
|
||||
I<dctx> parameter and return the duplicate copy.
|
||||
|
||||
=head2 Digest Generation Functions
|
||||
|
||||
OP_digest_init() initialises a digest operation given a newly created
|
||||
provider side digest context in the B<dctx> parameter.
|
||||
provider side digest context in the I<dctx> parameter.
|
||||
|
||||
OP_digest_update() is called to supply data to be digested as part of a
|
||||
previously initialised digest operation.
|
||||
The B<dctx> parameter contains a pointer to a previously initialised provider
|
||||
The I<dctx> parameter contains a pointer to a previously initialised provider
|
||||
side context.
|
||||
OP_digest_update() should digest B<inl> bytes of data at the location pointed to
|
||||
by B<in>.
|
||||
OP_digest_update() should digest I<inl> bytes of data at the location pointed to
|
||||
by I<in>.
|
||||
OP_digest_update() may be called multiple times for a single digest operation.
|
||||
|
||||
OP_digest_final() generates a digest started through previous OP_digest_init()
|
||||
and OP_digest_update() calls.
|
||||
The B<dctx> parameter contains a pointer to the provider side context.
|
||||
The digest should be written to B<*out> and the length of the digest to
|
||||
B<*outl>.
|
||||
The digest should not exceed B<outsz> bytes.
|
||||
The I<dctx> parameter contains a pointer to the provider side context.
|
||||
The digest should be written to I<*out> and the length of the digest to
|
||||
I<*outl>.
|
||||
The digest should not exceed I<outsz> bytes.
|
||||
|
||||
OP_digest_digest() is a "oneshot" digest function.
|
||||
No provider side digest context is used.
|
||||
Instead the provider context that was created during provider initialisation is
|
||||
passed in the B<provctx> parameter (see L<provider(3)>).
|
||||
B<inl> bytes at B<in> should be digested and the result should be stored at
|
||||
B<out>. The length of the digest should be stored in B<*outl> which should not
|
||||
exceed B<outsz> bytes.
|
||||
passed in the I<provctx> parameter (see L<provider(3)>).
|
||||
I<inl> bytes at I<in> should be digested and the result should be stored at
|
||||
I<out>. The length of the digest should be stored in I<*outl> which should not
|
||||
exceed I<outsz> bytes.
|
||||
|
||||
=head2 Digest Parameters
|
||||
|
||||
@@ -143,14 +143,14 @@ See L<OSSL_PARAM(3)> for further details on the parameters structure used by
|
||||
these functions.
|
||||
|
||||
OP_digest_get_params() gets details of the algorithm implementation
|
||||
and stores them in B<params>.
|
||||
and stores them in I<params>.
|
||||
|
||||
OP_digest_set_ctx_params() sets digest operation parameters for the
|
||||
provider side digest context B<dctx> to B<params>.
|
||||
provider side digest context I<dctx> to I<params>.
|
||||
Any parameter settings are additional to any that were previously set.
|
||||
|
||||
OP_digest_get_ctx_params() gets digest operation details details from
|
||||
the given provider side digest context B<dctx> and stores them in B<params>.
|
||||
the given provider side digest context I<dctx> and stores them in I<params>.
|
||||
|
||||
OP_digest_gettable_params(), OP_digest_gettable_ctx_params(), and
|
||||
OP_digest_settable_ctx_params() all return constant B<OSSL_PARAM> arrays
|
||||
@@ -164,15 +164,17 @@ by all digests:
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_DIGEST_PARAM_BLOCK_SIZE> (size_t)
|
||||
=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>.
|
||||
|
||||
=item B<OSSL_DIGEST_PARAM_SIZE> (size_t)
|
||||
=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>.
|
||||
|
||||
=item B<OSSL_DIGEST_PARAM_FLAGS> (unsigned long)
|
||||
=item "flags" (B<OSSL_DIGEST_PARAM_FLAGS>) <unsigned integer>
|
||||
|
||||
Diverse flags that describe exceptional behaviour for the digest:
|
||||
|
||||
@@ -208,18 +210,21 @@ Currently unused.
|
||||
|
||||
=back
|
||||
|
||||
The length of the "flags" parameter should equal that of an
|
||||
B<unsigned long int>.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Digest Context Parameters
|
||||
|
||||
OP_digest_set_ctx_params() sets digest parameters associated with the
|
||||
given provider side digest context B<dctx> to B<params>.
|
||||
given provider side digest context I<dctx> to I<params>.
|
||||
Any parameter settings are additional to any that were previously set.
|
||||
See L<OSSL_PARAM(3)> for further details on the parameters structure.
|
||||
|
||||
OP_digest_get_ctx_params() gets details of currently set parameters
|
||||
values associated with the give provider side digest context B<dctx>
|
||||
and stores them in B<params>.
|
||||
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
|
||||
@@ -227,11 +232,12 @@ parameters are relevant to, or are understood by all digests:
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_DIGEST_PARAM_XOFLEN> (size_t)
|
||||
=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 B<OSSL_DIGEST_PARAM_SSL3_MS> (octet string)
|
||||
=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.
|
||||
@@ -243,7 +249,7 @@ 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 B<OSSL_DIGEST_PARAM_PAD_TYPE> (uint)
|
||||
=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.
|
||||
@@ -251,7 +257,7 @@ 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 B<OSSL_DIGEST_PARAM_MICALG> (utf8 string)
|
||||
=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
|
||||
|
||||
@@ -6,7 +6,7 @@ provider-keyexch - The keyexch library E<lt>-E<gt> provider functions
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
=for comment multiple includes
|
||||
=for openssl multiple includes
|
||||
|
||||
#include <openssl/core_numbers.h>
|
||||
#include <openssl/core_names.h>
|
||||
@@ -87,27 +87,27 @@ OP_keyexch_newctx() should create and return a pointer to a provider side
|
||||
structure for holding context information during a key exchange operation.
|
||||
A pointer to this context will be passed back in a number of the other key
|
||||
exchange operation function calls.
|
||||
The paramater B<provctx> is the provider context generated during provider
|
||||
The paramater I<provctx> is the provider context generated during provider
|
||||
initialisation (see L<provider(3)>).
|
||||
|
||||
OP_keyexch_freectx() is passed a pointer to the provider side key exchange
|
||||
context in the B<ctx> parameter.
|
||||
context in the I<ctx> parameter.
|
||||
This function should free any resources associated with that context.
|
||||
|
||||
OP_keyexch_dupctx() should duplicate the provider side key exchange context in
|
||||
the B<ctx> parameter and return the duplicate copy.
|
||||
the I<ctx> parameter and return the duplicate copy.
|
||||
|
||||
=head2 Shared Secret Derivation Functions
|
||||
|
||||
OP_keyexch_init() initialises a key exchange operation given a provider side key
|
||||
exchange context in the B<ctx> paramter, and a pointer to a provider key object
|
||||
in the B<provkey> parameter. The key object should have been previously
|
||||
exchange context in the I<ctx> paramter, 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)>.
|
||||
|
||||
OP_keyexch_set_peer() is called to supply the peer's public key (in the
|
||||
B<provkey> parameter) to be used when deriving the shared secret.
|
||||
It is also passed a previously initialised key exchange context in the B<ctx>
|
||||
I<provkey> parameter) to be used when deriving the shared secret.
|
||||
It is also passed a previously initialised key exchange context in the I<ctx>
|
||||
parameter.
|
||||
The key object should have been previously generated, loaded or imported into
|
||||
the provider using the key management (OSSL_OP_KEYMGMT) operation (see
|
||||
@@ -115,13 +115,13 @@ provider-keymgmt(7)>.
|
||||
|
||||
OP_keyexch_derive() performs the actual key exchange itself by deriving a shared
|
||||
secret.
|
||||
A previously initialised key exchange context is passed in the B<ctx>
|
||||
A previously initialised key exchange context is passed in the I<ctx>
|
||||
parameter.
|
||||
The derived secret should be written to the location B<secret> which should not
|
||||
exceed B<outlen> bytes.
|
||||
The length of the shared secret should be written to B<*secretlen>.
|
||||
If B<secret> is NULL then the maximum length of the shared secret should be
|
||||
written to B<*secretlen>.
|
||||
The derived secret should be written to the location I<secret> which should not
|
||||
exceed I<outlen> bytes.
|
||||
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
|
||||
|
||||
@@ -129,7 +129,7 @@ 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 B<ctx> to B<params>.
|
||||
given provider side key exchange context I<ctx> to I<params>.
|
||||
Any parameter settings are additional to any that were previously set.
|
||||
|
||||
Parameters currently recognised by built-in key exchange algorithms are as
|
||||
@@ -139,7 +139,7 @@ algorithms:
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_EXCHANGE_PARAM_PAD> (uint)
|
||||
=item "pad" (B<OSSL_EXCHANGE_PARAM_PAD>) <unsigned integer>
|
||||
|
||||
Sets the padding mode for the associated key exchange ctx.
|
||||
Setting a value of 1 will turn padding on.
|
||||
|
||||
+11
-21
@@ -6,7 +6,7 @@ provider-mac - The mac library E<lt>-E<gt> provider functions
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
=for comment multiple includes
|
||||
=for openssl multiple includes
|
||||
|
||||
#include <openssl/core_numbers.h>
|
||||
#include <openssl/core_names.h>
|
||||
@@ -151,57 +151,47 @@ parameters are relevant to, or are understood by all macs:
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<OSSL_MAC_PARAM_KEY> (octet string)
|
||||
=item "key" (B<OSSL_MAC_PARAM_KEY>) <octet string>
|
||||
|
||||
Sets the key in the associated MAC ctx.
|
||||
|
||||
=item B<OSSL_MAC_PARAM_IV> (octet string)
|
||||
=item "iv" (B<OSSL_MAC_PARAM_IV>) <octet string>
|
||||
|
||||
Sets the IV of the underlying cipher, when applicable.
|
||||
|
||||
=item B<OSSL_MAC_PARAM_CUSTOM> (utf8 string)
|
||||
=item "custom" (B<OSSL_MAC_PARAM_CUSTOM>) <UTF8 string>
|
||||
|
||||
Sets the custom string in the associated MAC ctx.
|
||||
|
||||
=item B<OSSL_MAC_PARAM_SALT> (octet string)
|
||||
=item "salt" (B<OSSL_MAC_PARAM_SALT>) <octet string>
|
||||
|
||||
Sets the salt of the underlying cipher, when applicable.
|
||||
|
||||
=item B<OSSL_MAC_PARAM_BLOCK_XOF> (int)
|
||||
=item "xof" (B<OSSL_MAC_PARAM_BLOCK_XOF>) <integer>
|
||||
|
||||
Sets XOF mode in the associated MAC ctx.
|
||||
0 means no XOF mode, 1 means XOF mode.
|
||||
|
||||
=item B<OSSL_MAC_PARAM_FLAGS> (int)
|
||||
=item "flags" (B<OSSL_MAC_PARAM_FLAGS>) <integer>
|
||||
|
||||
Gets flags associated with the MAC.
|
||||
|
||||
=for comment We need to investigate if this is the right approach
|
||||
|
||||
=item B<OSSL_MAC_PARAM_CIPHER> (utf8 string)
|
||||
=item "cipher" (B<OSSL_MAC_PARAM_CIPHER>) <UTF8 string>
|
||||
|
||||
=item B<OSSL_MAC_PARAM_DIGEST> (utf8 string)
|
||||
=item "digest" (B<OSSL_MAC_PARAM_DIGEST>) <UTF8 string>
|
||||
|
||||
Sets the name of the underlying cipher or digest to be used.
|
||||
It must name a suitable algorithm for the MAC that's being used.
|
||||
|
||||
=item B<OSSL_MAC_PARAM_ENGINE> (utf8 string)
|
||||
|
||||
Sets the name of an engine that implements the underlying algorithm.
|
||||
This must be given together with the algorithm naming parameter to be
|
||||
considered valid.
|
||||
|
||||
=item B<OSSL_MAC_PARAM_PROPERTIES> (utf8 string)
|
||||
=item "properties" (B<OSSL_MAC_PARAM_PROPERTIES>) <UTF8 string>
|
||||
|
||||
Sets the properties to be queried when trying to fetch the underlying algorithm.
|
||||
This must be given together with the algorithm naming parameter to be
|
||||
considered valid.
|
||||
|
||||
Note that both this and B<OSSL_MAC_PARAM_ENGINE> can be given at the same time.
|
||||
If the underlying algorithm ends up being fetched from a provider, offered by
|
||||
and engine, or a built in legacy function depends on what is available.
|
||||
|
||||
=item B<OSSL_MAC_PARAM_SIZE> (int)
|
||||
=item "size" (B<OSSL_MAC_PARAM_SIZE>) <integer>
|
||||
|
||||
Can be used to get the resulting MAC size.
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ provider-signature - The signature library E<lt>-E<gt> provider functions
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
=for comment multiple includes
|
||||
=for openssl multiple includes
|
||||
|
||||
#include <openssl/core_numbers.h>
|
||||
#include <openssl/core_names.h>
|
||||
@@ -111,70 +111,70 @@ OP_signature_newctx() should create and return a pointer to a provider side
|
||||
structure for holding context information during a signature operation.
|
||||
A pointer to this context will be passed back in a number of the other signature
|
||||
operation function calls.
|
||||
The parameter B<provctx> is the provider context generated during provider
|
||||
The parameter I<provctx> is the provider context generated during provider
|
||||
initialisation (see L<provider(3)>).
|
||||
|
||||
OP_signature_freectx() is passed a pointer to the provider side signature
|
||||
context in the B<ctx> parameter.
|
||||
context in the I<ctx> parameter.
|
||||
This function should free any resources associated with that context.
|
||||
|
||||
OP_signature_dupctx() should duplicate the provider side signature context in
|
||||
the B<ctx> parameter and return the duplicate copy.
|
||||
the I<ctx> parameter and return the duplicate copy.
|
||||
|
||||
=head2 Signing Functions
|
||||
|
||||
OP_signature_sign_init() initialises a context for signing given a provider side
|
||||
signature context in the B<ctx> parameter, and a pointer to a provider key object
|
||||
in the B<provkey> parameter.
|
||||
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)>.
|
||||
|
||||
OP_signature_sign() performs the actual signing itself.
|
||||
A previously initialised signature context is passed in the B<ctx>
|
||||
A previously initialised signature context is passed in the I<ctx>
|
||||
parameter.
|
||||
The data to be signed is pointed to be the B<tbs> parameter which is B<tbslen>
|
||||
The data to be signed is pointed to be the I<tbs> parameter which is I<tbslen>
|
||||
bytes long.
|
||||
Unless B<sig> is NULL, the signature should be written to the location pointed
|
||||
to by the B<sig> parameter and it should not exceed B<sigsize> bytes in length.
|
||||
The length of the signature should be written to B<*siglen>.
|
||||
If B<sig> is NULL then the maximum length of the signature should be written to
|
||||
B<*siglen>.
|
||||
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 Verify Functions
|
||||
|
||||
OP_signature_verify_init() initialises a context for verifying a signature given
|
||||
a provider side signature context in the B<ctx> parameter, and a pointer to a
|
||||
provider key object in the B<provkey> parameter.
|
||||
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)>.
|
||||
|
||||
OP_signature_verify() performs the actual verification itself.
|
||||
A previously initialised signature context is passed in the B<ctx> parameter.
|
||||
The data that the signature covers is pointed to be the B<tbs> parameter which
|
||||
is B<tbslen> bytes long.
|
||||
The signature is pointed to by the B<sig> parameter which is B<siglen> bytes
|
||||
A previously initialised signature context is passed in the I<ctx> parameter.
|
||||
The data that the signature covers is pointed to be the I<tbs> parameter which
|
||||
is I<tbslen> bytes long.
|
||||
The signature is pointed to by the I<sig> parameter which is I<siglen> bytes
|
||||
long.
|
||||
|
||||
=head2 Verify Recover Functions
|
||||
|
||||
OP_signature_verify_recover_init() initialises a context for recovering the
|
||||
signed data given a provider side signature context in the B<ctx> parameter, and
|
||||
a pointer to a provider key object in the B<provkey> parameter.
|
||||
signed data 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)>.
|
||||
|
||||
OP_signature_verify_recover() performs the actual verify recover itself.
|
||||
A previously initialised signature context is passed in the B<ctx> parameter.
|
||||
The signature is pointed to by the B<sig> parameter which is B<siglen> bytes
|
||||
A previously initialised signature context is passed in the I<ctx> parameter.
|
||||
The signature is pointed to by the I<sig> parameter which is I<siglen> bytes
|
||||
long.
|
||||
Unless B<rout> is NULL, the recovered data should be written to the location
|
||||
pointed to by B<rout> which should not exceed B<routsize> bytes in length.
|
||||
The length of the recovered data should be written to B<*routlen>.
|
||||
If B<rout> is B<NULL> then the maximum size of the output buffer is written to
|
||||
the B<routlen> parameter.
|
||||
Unless I<rout> is NULL, the recovered data should be written to the location
|
||||
pointed to by I<rout> which should not exceed I<routsize> bytes in length.
|
||||
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 Signature Parameters
|
||||
|
||||
@@ -182,9 +182,9 @@ See L<OSSL_PARAM(3)> for further details on the parameters structure used by
|
||||
the OP_signature_get_ctx_params() and OP_signature_set_ctx_params() functions.
|
||||
|
||||
OP_signature_get_ctx_params() gets signature parameters associated with the
|
||||
given provider side signature context B<ctx> and stored them in B<params>.
|
||||
given provider side signature context I<ctx> and stored them in I<params>.
|
||||
OP_signature_set_ctx_params() sets the signature parameters associated with the
|
||||
given provider side signature context B<ctx> to B<params>.
|
||||
given provider side 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 as
|
||||
@@ -194,15 +194,17 @@ algorithms:
|
||||
|
||||
=over 4
|
||||
|
||||
=item "digest" (B<OSSL_SIGNATURE_PARAM_DIGEST>) <utf8 string>
|
||||
=item "digest" (B<OSSL_SIGNATURE_PARAM_DIGEST>) <UTF8 string>
|
||||
|
||||
Get or sets the name of the digest algorithm used for the input to the signature
|
||||
functions.
|
||||
|
||||
=item "digest-size" (B<OSSL_SIGNATURE_PARAM_DIGEST_SIZE>) <size_t>
|
||||
=item "digest-size" (B<OSSL_SIGNATURE_PARAM_DIGEST_SIZE>) <unsigned integer>
|
||||
|
||||
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>.
|
||||
|
||||
|
||||
=back
|
||||
|
||||
|
||||
+3
-11
@@ -6,7 +6,7 @@ provider - OpenSSL operation implementation providers
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
=for comment generic
|
||||
=for openssl generic
|
||||
|
||||
#include <openssl/provider.h>
|
||||
|
||||
@@ -84,7 +84,7 @@ the initialization function.
|
||||
I<operation_id> is an operation identity (see L</Operations> below).
|
||||
|
||||
I<no_store> is a flag back to the OpenSSL libraries which, when
|
||||
non-zero, signifies that the OpenSSL libraries will not store a
|
||||
nonzero, signifies that the OpenSSL libraries will not store a
|
||||
reference to the returned data in their internal store of
|
||||
implementations.
|
||||
|
||||
@@ -123,8 +123,6 @@ The number for this operation is B<OSSL_OP_CIPHER>.
|
||||
The functions the provider can offer are described in
|
||||
L<provider-cipher(7)>
|
||||
|
||||
=begin comment NOT AVAILABLE YET
|
||||
|
||||
=item Message Authentication Code (MAC)
|
||||
|
||||
In the OpenSSL libraries, the corresponding method object is
|
||||
@@ -133,10 +131,6 @@ The number for this operation is B<OSSL_OP_MAC>.
|
||||
The functions the provider can offer are described in
|
||||
L<provider-mac(7)>
|
||||
|
||||
=end comment
|
||||
|
||||
=begin comment NOT AVAILABLE YET
|
||||
|
||||
=item Key Derivation Function (KDF)
|
||||
|
||||
In the OpenSSL libraries, the corresponding method object is
|
||||
@@ -145,12 +139,10 @@ The number for this operation is B<OSSL_OP_KDF>.
|
||||
The functions the provider can offer are described in
|
||||
L<provider-kdf(7)>
|
||||
|
||||
=end comment
|
||||
|
||||
=item Key Exchange
|
||||
|
||||
In the OpenSSL libraries, the corresponding method object is
|
||||
B<EVP_KEYEXCh>.
|
||||
B<EVP_KEYEXCH>.
|
||||
The number for this operation is B<OSSL_OP_KEYEXCH>.
|
||||
The functions the provider can offer are described in
|
||||
L<provider-keyexch(7)>
|
||||
|
||||
Reference in New Issue
Block a user