Browse Source

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)
master
Shane Lontis 2 years ago
parent
commit
1ba21239dd
10 changed files with 21 additions and 21 deletions
  1. +1
    -1
      crypto/evp/kdf_lib.c
  2. +7
    -7
      doc/man3/EVP_KDF.pod
  3. +3
    -3
      doc/man7/EVP_KDF-HKDF.pod
  4. +1
    -1
      doc/man7/EVP_KDF-KB.pod
  5. +2
    -2
      doc/man7/EVP_KDF-KRB5KDF.pod
  6. +1
    -1
      doc/man7/EVP_KDF-SS.pod
  7. +2
    -2
      doc/man7/EVP_KDF-SSHKDF.pod
  8. +1
    -1
      doc/man7/EVP_KDF-X942.pod
  9. +1
    -1
      doc/man7/EVP_KDF-X963.pod
  10. +2
    -2
      include/openssl/kdf.h

+ 1
- 1
crypto/evp/kdf_lib.c View File

@ -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;


+ 7
- 7
doc/man3/EVP_KDF.pod View File

@ -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.


+ 3
- 3
doc/man7/EVP_KDF-HKDF.pod View File

@ -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>


+ 1
- 1
doc/man7/EVP_KDF-KB.pod View File

@ -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>


+ 2
- 2
doc/man7/EVP_KDF-KRB5KDF.pod View File

@ -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>


+ 1
- 1
doc/man7/EVP_KDF-SS.pod View File

@ -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>


+ 2
- 2
doc/man7/EVP_KDF-SSHKDF.pod View File

@ -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>


+ 1
- 1
doc/man7/EVP_KDF-X942.pod View File

@ -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>


+ 1
- 1
doc/man7/EVP_KDF-X963.pod View File

@ -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>


+ 2
- 2
include/openssl/kdf.h View File

@ -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[]);


Loading…
Cancel
Save