Rename EVP_KDF_size() to EVP_KDF_CTX_get_kdf_size().
authorShane Lontis <shane.lontis@oracle.com>
Tue, 13 Oct 2020 04:30:12 +0000 (14:30 +1000)
committerShane Lontis <shane.lontis@oracle.com>
Thu, 22 Oct 2020 10:47:02 +0000 (20:47 +1000)
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13116)

crypto/evp/kdf_lib.c
doc/man3/EVP_KDF.pod
doc/man7/EVP_KDF-HKDF.pod
doc/man7/EVP_KDF-KB.pod
doc/man7/EVP_KDF-KRB5KDF.pod
doc/man7/EVP_KDF-SS.pod
doc/man7/EVP_KDF-SSHKDF.pod
doc/man7/EVP_KDF-X942.pod
doc/man7/EVP_KDF-X963.pod
include/openssl/kdf.h

index 9ccaec8cc12463ad7219916fba38eee953638e0a..10ff88e0533671e01d0f436985c21908c4c38a2d 100644 (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;
index 3dba50cdb678f83f39b64039910b147ad4053ff9..fefb3c6dde47e487321380bac1f8a8dea8ca7e2f 100644 (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.
index a8bb5dacd9f1c04f73e798b6ce33f4dc5c5d9167..830bf90e92cdbb0832e47cafae3a5f44bfc7779b 100644 (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>
index 0a84e925d9c082a84a35dee9ea255f3b89b50c0c..fdaa483e77641db1de7c03345d378f6ef15aabd1 100644 (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>
 
index 62f941c3ca7db1049464538adb2112fa30648d63..8d730d40b823f6f073736aac2fa5f946c4667f6e 100644 (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>
 
index e64417388f6704ce81028c91c44f41e40270620e..088ffe0ea7f561da184dcc6446334a2137fcc8f2 100644 (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>
 
index e91858c051525d5ce3208c5eeb128ae24739aa11..454bb6b699b0d53f587f6724bcd3413f59b88044 100644 (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>
 
index e607212b284ac283c0469ce2cae3a1ffc96ff2f0..70da41437bd99a81b37bdcbe1170725c6bdada60 100644 (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>
 
index 93ec14c837b31d3564d7ffcf90c11ed34e2878c8..b814fe5b47ae559e69bf92d41a3f01e19ae962d0 100644 (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>
 
index 96521922edb3836ceaa89d422a263fa29f441e0f..7f89f7527062dadeb033ea6ce45fbababa4828f5 100644 (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[]);