diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2020-10-13 14:30:12 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2020-10-22 20:47:02 +1000 |
commit | 1ba21239ddbd1b18a3676efaa8dd9402e1468818 (patch) | |
tree | c10c21d0fb1f57bddc2d0fee7cac078ac8a07c32 | |
parent | 90a2576b9bbb327141df0bd244830b462fcaeee6 (diff) | |
download | openssl-new-1ba21239ddbd1b18a3676efaa8dd9402e1468818.tar.gz |
Rename EVP_KDF_size() to EVP_KDF_CTX_get_kdf_size().
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13116)
-rw-r--r-- | crypto/evp/kdf_lib.c | 2 | ||||
-rw-r--r-- | doc/man3/EVP_KDF.pod | 14 | ||||
-rw-r--r-- | doc/man7/EVP_KDF-HKDF.pod | 6 | ||||
-rw-r--r-- | doc/man7/EVP_KDF-KB.pod | 2 | ||||
-rw-r--r-- | doc/man7/EVP_KDF-KRB5KDF.pod | 4 | ||||
-rw-r--r-- | doc/man7/EVP_KDF-SS.pod | 2 | ||||
-rw-r--r-- | doc/man7/EVP_KDF-SSHKDF.pod | 4 | ||||
-rw-r--r-- | doc/man7/EVP_KDF-X942.pod | 2 | ||||
-rw-r--r-- | doc/man7/EVP_KDF-X963.pod | 2 | ||||
-rw-r--r-- | include/openssl/kdf.h | 4 |
10 files changed, 21 insertions, 21 deletions
diff --git a/crypto/evp/kdf_lib.c b/crypto/evp/kdf_lib.c index 9ccaec8cc1..10ff88e053 100644 --- a/crypto/evp/kdf_lib.c +++ b/crypto/evp/kdf_lib.c @@ -119,7 +119,7 @@ void EVP_KDF_reset(EVP_KDF_CTX *ctx) ctx->meth->reset(ctx->data); } -size_t EVP_KDF_size(EVP_KDF_CTX *ctx) +size_t EVP_KDF_CTX_get_kdf_size(EVP_KDF_CTX *ctx) { OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END }; size_t s; diff --git a/doc/man3/EVP_KDF.pod b/doc/man3/EVP_KDF.pod index 3dba50cdb6..fefb3c6dde 100644 --- a/doc/man3/EVP_KDF.pod +++ b/doc/man3/EVP_KDF.pod @@ -4,8 +4,8 @@ EVP_KDF, EVP_KDF_fetch, EVP_KDF_free, EVP_KDF_up_ref, EVP_KDF_CTX, EVP_KDF_CTX_new, EVP_KDF_CTX_free, EVP_KDF_CTX_dup, -EVP_KDF_reset, EVP_KDF_derive, -EVP_KDF_size, EVP_KDF_provider, EVP_KDF_CTX_kdf, EVP_KDF_is_a, +EVP_KDF_CTX_reset, EVP_KDF_derive, +EVP_KDF_CTX_get_kdf_size, EVP_KDF_provider, EVP_KDF_CTX_kdf, EVP_KDF_is_a, EVP_KDF_number, EVP_KDF_name, EVP_KDF_names_do_all, EVP_KDF_CTX_get_params, EVP_KDF_CTX_set_params, EVP_KDF_do_all_provided, EVP_KDF_get_params, EVP_KDF_gettable_ctx_params, EVP_KDF_settable_ctx_params, @@ -22,8 +22,8 @@ EVP_KDF_gettable_params - EVP KDF routines const EVP_KDF *EVP_KDF_CTX_kdf(EVP_KDF_CTX *ctx); void EVP_KDF_CTX_free(EVP_KDF_CTX *ctx); EVP_KDF_CTX *EVP_KDF_CTX_dup(const EVP_KDF_CTX *src); - void EVP_KDF_reset(EVP_KDF_CTX *ctx); - size_t EVP_KDF_size(EVP_KDF_CTX *ctx); + void EVP_KDF_CTX_reset(EVP_KDF_CTX *ctx); + size_t EVP_KDF_CTX_get_kdf_size(EVP_KDF_CTX *ctx); int EVP_KDF_derive(EVP_KDF_CTX *ctx, unsigned char *key, size_t keylen); int EVP_KDF_up_ref(EVP_KDF *kdf); void EVP_KDF_free(EVP_KDF *kdf); @@ -99,7 +99,7 @@ had just been created. EVP_KDF_derive() derives I<keylen> bytes of key material and places it in the I<key> buffer. If the algorithm produces a fixed amount of output then an error will occur unless the I<keylen> parameter is equal to that output size, -as returned by EVP_KDF_size(). +as returned by EVP_KDF_CTX_get_kdf_size(). EVP_KDF_get_params() retrieves details about the implementation I<kdf>. @@ -133,7 +133,7 @@ See L<OSSL_PARAM(3)> for the use of B<OSSL_PARAM> as parameter descriptor. =head2 Information functions -EVP_KDF_size() returns the output size if the algorithm produces a fixed amount +EVP_KDF_CTX_get_kdf_size() returns the output size if the algorithm produces a fixed amount of output and B<SIZE_MAX> otherwise. If an error occurs then 0 is returned. For some algorithms an error may result if input parameters necessary to calculate a fixed output size have not yet been supplied. @@ -247,7 +247,7 @@ B<EVP_KDF_CTX> structure or NULL if an error occurred. EVP_KDF_CTX_free() and EVP_KDF_reset() do not return a value. -EVP_KDF_size() returns the output size. B<SIZE_MAX> is returned to indicate +EVP_KDF_CTX_get_kdf_size() returns the output size. B<SIZE_MAX> is returned to indicate that the algorithm produces a variable amount of output; 0 to indicate failure. EVP_KDF_name() returns the name of the KDF, or NULL on error. diff --git a/doc/man7/EVP_KDF-HKDF.pod b/doc/man7/EVP_KDF-HKDF.pod index a8bb5dacd9..830bf90e92 100644 --- a/doc/man7/EVP_KDF-HKDF.pod +++ b/doc/man7/EVP_KDF-HKDF.pod @@ -64,7 +64,7 @@ derived otherwise an error will occur. 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 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. +up by calling EVP_KDF_CTX_get_kdf_size() after setting the mode and digest. The digest, key and salt values must be set before a key is derived otherwise an error will occur. @@ -93,7 +93,7 @@ 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() +For that mode, the fixed output size can be looked up by calling EVP_KDF_CTX_get_kdf_size() after setting the mode and digest on the B<EVP_KDF_CTX>. =head1 EXAMPLES @@ -137,7 +137,7 @@ RFC 5869 L<EVP_KDF(3)>, L<EVP_KDF_CTX_new(3)>, L<EVP_KDF_CTX_free(3)>, -L<EVP_KDF_size(3)>, +L<EVP_KDF_CTX_get_kdf_size(3)>, L<EVP_KDF_CTX_set_params(3)>, L<EVP_KDF_derive(3)>, L<EVP_KDF(3)/PARAMETERS> diff --git a/doc/man7/EVP_KDF-KB.pod b/doc/man7/EVP_KDF-KB.pod index 0a84e925d9..fdaa483e77 100644 --- a/doc/man7/EVP_KDF-KB.pod +++ b/doc/man7/EVP_KDF-KB.pod @@ -137,7 +137,7 @@ NIST SP800-108, IETF RFC 6803, IETF RFC 8009. L<EVP_KDF(3)>, L<EVP_KDF_CTX_free(3)>, -L<EVP_KDF_size(3)>, +L<EVP_KDF_CTX_get_kdf_size(3)>, L<EVP_KDF_derive(3)>, L<EVP_KDF(3)/PARAMETERS> diff --git a/doc/man7/EVP_KDF-KRB5KDF.pod b/doc/man7/EVP_KDF-KRB5KDF.pod index 62f941c3ca..8d730d40b8 100644 --- a/doc/man7/EVP_KDF-KRB5KDF.pod +++ b/doc/man7/EVP_KDF-KRB5KDF.pod @@ -51,7 +51,7 @@ parameter to the L<EVP_KDF_derive(3)> function, and MUST match the key length for the chosen cipher or an error is returned. Moreover, the constant's length must not exceed the block size of the cipher. Since the KRB5KDF output length depends on the chosen cipher, calling -L<EVP_KDF_size(3)> to obtain the requisite length returns the correct length +L<EVP_KDF_CTX_get_kdf_size(3)> to obtain the requisite length returns the correct length only after the cipher is set. Prior to that B<EVP_MAX_KEY_LENGTH> is returned. The caller must allocate a buffer of the correct length for the chosen cipher, and pass that buffer to the L<EVP_KDF_derive(3)> function along @@ -98,7 +98,7 @@ RFC 3961 L<EVP_KDF(3)>, L<EVP_KDF_CTX_free(3)>, L<EVP_KDF_ctrl(3)>, -L<EVP_KDF_size(3)>, +L<EVP_KDF_CTX_get_kdf_size(3)>, L<EVP_KDF_derive(3)>, L<EVP_KDF(3)/PARAMETERS> diff --git a/doc/man7/EVP_KDF-SS.pod b/doc/man7/EVP_KDF-SS.pod index e64417388f..088ffe0ea7 100644 --- a/doc/man7/EVP_KDF-SS.pod +++ b/doc/man7/EVP_KDF-SS.pod @@ -176,7 +176,7 @@ L<EVP_KDF(3)>, L<EVP_KDF_CTX_new(3)>, L<EVP_KDF_CTX_free(3)>, L<EVP_KDF_CTX_set_params(3)>, -L<EVP_KDF_size(3)>, +L<EVP_KDF_CTX_get_kdf_size(3)>, L<EVP_KDF_derive(3)>, L<EVP_KDF(3)/PARAMETERS> diff --git a/doc/man7/EVP_KDF-SSHKDF.pod b/doc/man7/EVP_KDF-SSHKDF.pod index e91858c051..454bb6b699 100644 --- a/doc/man7/EVP_KDF-SSHKDF.pod +++ b/doc/man7/EVP_KDF-SSHKDF.pod @@ -91,7 +91,7 @@ A context for SSHKDF can be obtained by calling: 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(3)> +Since the SSHKDF output length is variable, calling L<EVP_KDF_CTX_get_kdf_size(3)> 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. @@ -142,7 +142,7 @@ L<EVP_KDF(3)>, L<EVP_KDF_CTX_new(3)>, L<EVP_KDF_CTX_free(3)>, L<EVP_KDF_CTX_set_params(3)>, -L<EVP_KDF_size(3)>, +L<EVP_KDF_CTX_get_kdf_size(3)>, L<EVP_KDF_derive(3)>, L<EVP_KDF(3)/PARAMETERS> diff --git a/doc/man7/EVP_KDF-X942.pod b/doc/man7/EVP_KDF-X942.pod index e607212b28..70da41437b 100644 --- a/doc/man7/EVP_KDF-X942.pod +++ b/doc/man7/EVP_KDF-X942.pod @@ -102,7 +102,7 @@ L<EVP_KDF(3)>, L<EVP_KDF_CTX_new(3)>, L<EVP_KDF_CTX_free(3)>, L<EVP_KDF_CTX_set_params(3)>, -L<EVP_KDF_size(3)>, +L<EVP_KDF_CTX_get_kdf_size(3)>, L<EVP_KDF_derive(3)>, L<EVP_KDF(3)/PARAMETERS> diff --git a/doc/man7/EVP_KDF-X963.pod b/doc/man7/EVP_KDF-X963.pod index 93ec14c837..b814fe5b47 100644 --- a/doc/man7/EVP_KDF-X963.pod +++ b/doc/man7/EVP_KDF-X963.pod @@ -91,7 +91,7 @@ L<EVP_KDF(3)>, L<EVP_KDF_CTX_new(3)>, L<EVP_KDF_CTX_free(3)>, L<EVP_KDF_CTX_set_params(3)>, -L<EVP_KDF_size(3)>, +L<EVP_KDF_CTX_get_kdf_size(3)>, L<EVP_KDF_derive(3)>, L<EVP_KDF(3)/PARAMETERS> diff --git a/include/openssl/kdf.h b/include/openssl/kdf.h index 96521922ed..7f89f75270 100644 --- a/include/openssl/kdf.h +++ b/include/openssl/kdf.h @@ -39,8 +39,8 @@ const char *EVP_KDF_name(const EVP_KDF *kdf); const OSSL_PROVIDER *EVP_KDF_provider(const EVP_KDF *kdf); const EVP_KDF *EVP_KDF_CTX_kdf(EVP_KDF_CTX *ctx); -void EVP_KDF_reset(EVP_KDF_CTX *ctx); -size_t EVP_KDF_size(EVP_KDF_CTX *ctx); +void EVP_KDF_CTX_reset(EVP_KDF_CTX *ctx); +size_t EVP_KDF_CTX_get_kdf_size(EVP_KDF_CTX *ctx); int EVP_KDF_derive(EVP_KDF_CTX *ctx, unsigned char *key, size_t keylen); int EVP_KDF_get_params(EVP_KDF *kdf, OSSL_PARAM params[]); int EVP_KDF_CTX_get_params(EVP_KDF_CTX *ctx, OSSL_PARAM params[]); |