Consistent naming for context gettable param queries .
authorPauli <paul.dale@oracle.com>
Fri, 27 Sep 2019 06:35:45 +0000 (16:35 +1000)
committerPauli <paul.dale@oracle.com>
Fri, 27 Sep 2019 09:32:55 +0000 (19:32 +1000)
All instances of EVP_*_CTX_gettable_params functions have been renamed
to EVP_*_gettable_ctx_params.  Except for the EVP_MD ones which were changed
already.

These functions do not take EVP_*_CTX arguments so their prior naming was
misleading.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10052)

18 files changed:
apps/fipsinstall.c
apps/kdf.c
apps/list.c
apps/mac.c
apps/provider.c
crypto/evp/evp_enc.c
crypto/evp/kdf_meth.c
crypto/evp/mac_meth.c
crypto/evp/pkey_kdf.c
crypto/evp/pkey_mac.c
doc/man3/EVP_EncryptInit.pod
doc/man3/EVP_KDF.pod
doc/man3/EVP_MAC.pod
doc/man3/OSSL_PARAM_construct_from_text.pod
include/openssl/evp.h
include/openssl/kdf.h
test/evp_test.c
util/libcrypto.num

index 78200c5..fd28b48 100644 (file)
@@ -341,7 +341,7 @@ opthelp:
     if (opts != NULL) {
         int ok = 1;
         OSSL_PARAM *params =
-            app_params_new_from_opts(opts, EVP_MAC_CTX_settable_params(mac));
+            app_params_new_from_opts(opts, EVP_MAC_settable_ctx_params(mac));
 
         if (params == NULL)
             goto end;
index c230430..35cc0db 100644 (file)
@@ -96,7 +96,7 @@ opthelp:
     if (opts != NULL) {
         int ok = 1;
         OSSL_PARAM *params =
-            app_params_new_from_opts(opts, EVP_KDF_CTX_settable_params(kdf));
+            app_params_new_from_opts(opts, EVP_KDF_settable_ctx_params(kdf));
 
         if (params == NULL)
             goto err;
index 5348cc6..d7c4690 100644 (file)
@@ -76,9 +76,9 @@ static void list_ciphers(void)
             print_param_types("retrievable algorithm parameters",
                               EVP_CIPHER_gettable_params(c), 4);
             print_param_types("retrievable operation parameters",
-                              EVP_CIPHER_CTX_gettable_params(c), 4);
+                              EVP_CIPHER_gettable_ctx_params(c), 4);
             print_param_types("settable operation parameters",
-                              EVP_CIPHER_CTX_settable_params(c), 4);
+                              EVP_CIPHER_settable_ctx_params(c), 4);
         }
     }
     sk_EVP_CIPHER_pop_free(ciphers, EVP_CIPHER_free);
@@ -186,9 +186,9 @@ static void list_macs(void)
             print_param_types("retrievable algorithm parameters",
                               EVP_MAC_gettable_params(m), 4);
             print_param_types("retrievable operation parameters",
-                              EVP_MAC_CTX_gettable_params(m), 4);
+                              EVP_MAC_gettable_ctx_params(m), 4);
             print_param_types("settable operation parameters",
-                              EVP_MAC_CTX_settable_params(m), 4);
+                              EVP_MAC_settable_ctx_params(m), 4);
         }
     }
     sk_EVP_MAC_pop_free(macs, EVP_MAC_free);
@@ -236,9 +236,9 @@ static void list_kdfs(void)
             print_param_types("retrievable algorithm parameters",
                               EVP_KDF_gettable_params(m), 4);
             print_param_types("retrievable operation parameters",
-                              EVP_KDF_CTX_gettable_params(m), 4);
+                              EVP_KDF_gettable_ctx_params(m), 4);
             print_param_types("settable operation parameters",
-                              EVP_KDF_CTX_settable_params(m), 4);
+                              EVP_KDF_settable_ctx_params(m), 4);
         }
     }
     sk_EVP_KDF_pop_free(kdfs, EVP_KDF_free);
index 205d82f..8383d0d 100644 (file)
@@ -105,7 +105,7 @@ opthelp:
     if (opts != NULL) {
         int ok = 1;
         OSSL_PARAM *params =
-            app_params_new_from_opts(opts, EVP_MAC_CTX_settable_params(mac));
+            app_params_new_from_opts(opts, EVP_MAC_settable_ctx_params(mac));
 
         if (params == NULL)
             goto err;
index 29afdce..ab91e68 100644 (file)
@@ -108,8 +108,8 @@ static void do_cipher(EVP_CIPHER *cipher, void *meta)
 {
     do_method(cipher, EVP_CIPHER_name(cipher),
               EVP_CIPHER_gettable_params(cipher),
-              EVP_CIPHER_CTX_gettable_params(cipher),
-              EVP_CIPHER_CTX_settable_params(cipher),
+              EVP_CIPHER_gettable_ctx_params(cipher),
+              EVP_CIPHER_settable_ctx_params(cipher),
               meta);
 }
 
@@ -126,8 +126,8 @@ static void do_mac(EVP_MAC *mac, void *meta)
 {
     do_method(mac, EVP_MAC_name(mac),
               EVP_MAC_gettable_params(mac),
-              EVP_MAC_CTX_gettable_params(mac),
-              EVP_MAC_CTX_settable_params(mac),
+              EVP_MAC_gettable_ctx_params(mac),
+              EVP_MAC_settable_ctx_params(mac),
               meta);
 }
 
index a3fb5f7..09c49b6 100644 (file)
@@ -1181,14 +1181,14 @@ const OSSL_PARAM *EVP_CIPHER_gettable_params(const EVP_CIPHER *cipher)
     return NULL;
 }
 
-const OSSL_PARAM *EVP_CIPHER_CTX_settable_params(const EVP_CIPHER *cipher)
+const OSSL_PARAM *EVP_CIPHER_settable_ctx_params(const EVP_CIPHER *cipher)
 {
     if (cipher != NULL && cipher->settable_ctx_params != NULL)
         return cipher->settable_ctx_params();
     return NULL;
 }
 
-const OSSL_PARAM *EVP_CIPHER_CTX_gettable_params(const EVP_CIPHER *cipher)
+const OSSL_PARAM *EVP_CIPHER_gettable_ctx_params(const EVP_CIPHER *cipher)
 {
     if (cipher != NULL && cipher->gettable_ctx_params != NULL)
         return cipher->gettable_ctx_params();
index 3a2d028..e6185e9 100644 (file)
@@ -173,14 +173,14 @@ const OSSL_PARAM *EVP_KDF_gettable_params(const EVP_KDF *kdf)
     return kdf->gettable_params();
 }
 
-const OSSL_PARAM *EVP_KDF_CTX_gettable_params(const EVP_KDF *kdf)
+const OSSL_PARAM *EVP_KDF_gettable_ctx_params(const EVP_KDF *kdf)
 {
     if (kdf->gettable_ctx_params == NULL)
         return NULL;
     return kdf->gettable_ctx_params();
 }
 
-const OSSL_PARAM *EVP_KDF_CTX_settable_params(const EVP_KDF *kdf)
+const OSSL_PARAM *EVP_KDF_settable_ctx_params(const EVP_KDF *kdf)
 {
     if (kdf->settable_ctx_params == NULL)
         return NULL;
index c01f04e..f35c2d1 100644 (file)
@@ -190,14 +190,14 @@ const OSSL_PARAM *EVP_MAC_gettable_params(const EVP_MAC *mac)
     return mac->gettable_params();
 }
 
-const OSSL_PARAM *EVP_MAC_CTX_gettable_params(const EVP_MAC *mac)
+const OSSL_PARAM *EVP_MAC_gettable_ctx_params(const EVP_MAC *mac)
 {
     if (mac->gettable_ctx_params == NULL)
         return NULL;
     return mac->gettable_ctx_params();
 }
 
-const OSSL_PARAM *EVP_MAC_CTX_settable_params(const EVP_MAC *mac)
+const OSSL_PARAM *EVP_MAC_settable_ctx_params(const EVP_MAC *mac)
 {
     if (mac->settable_ctx_params == NULL)
         return NULL;
index d57ff6f..b1337f5 100644 (file)
@@ -213,7 +213,7 @@ static int pkey_kdf_ctrl_str(EVP_PKEY_CTX *ctx, const char *type,
     EVP_KDF_CTX *kctx = pkctx->kctx;
     const EVP_KDF *kdf = EVP_KDF_CTX_kdf(kctx);
     BUF_MEM **collector = NULL;
-    const OSSL_PARAM *defs = EVP_KDF_CTX_settable_params(kdf);
+    const OSSL_PARAM *defs = EVP_KDF_settable_ctx_params(kdf);
     OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
     int ok = 0;
 
index 005741d..1c8f878 100644 (file)
@@ -452,7 +452,7 @@ static int pkey_mac_ctrl_str(EVP_PKEY_CTX *ctx,
         type = OSSL_MAC_PARAM_SIZE;
 
     if (!OSSL_PARAM_allocate_from_text(&params[0],
-                                       EVP_MAC_CTX_settable_params(mac),
+                                       EVP_MAC_settable_ctx_params(mac),
                                        type, value, strlen(value) + 1))
         return 0;
     params[1] = OSSL_PARAM_construct_end();
index a2ccc6f..0f04fe0 100644 (file)
@@ -44,9 +44,9 @@ EVP_CIPHER_CTX_cipher,
 EVP_CIPHER_CTX_name,
 EVP_CIPHER_CTX_nid,
 EVP_CIPHER_CTX_get_params,
-EVP_CIPHER_CTX_gettable_params,
+EVP_CIPHER_gettable_ctx_params,
 EVP_CIPHER_CTX_set_params,
-EVP_CIPHER_CTX_settable_params,
+EVP_CIPHER_settable_ctx_params,
 EVP_CIPHER_CTX_block_size,
 EVP_CIPHER_CTX_key_length,
 EVP_CIPHER_CTX_iv_length,
@@ -135,8 +135,8 @@ EVP_CIPHER_do_all_ex
  int EVP_CIPHER_CTX_set_params(EVP_CIPHER_CTX *ctx, const OSSL_PARAM params[]);
  int EVP_CIPHER_CTX_get_params(EVP_CIPHER_CTX *ctx, OSSL_PARAM params[]);
  const OSSL_PARAM *EVP_CIPHER_gettable_params(const EVP_CIPHER *cipher);
- const OSSL_PARAM *EVP_CIPHER_CTX_settable_params(const EVP_CIPHER *cipher);
- const OSSL_PARAM *EVP_CIPHER_CTX_gettable_params(const EVP_CIPHER *cipher);
+ const OSSL_PARAM *EVP_CIPHER_settable_ctx_params(const EVP_CIPHER *cipher);
+ const OSSL_PARAM *EVP_CIPHER_gettable_ctx_params(const EVP_CIPHER *cipher);
  int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx);
  int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx);
  int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx);
@@ -278,8 +278,8 @@ context B<ctx>.
 EVP_CIPHER_CTX_get_params() retrieves the requested list of operation
 B<params> from CIPHER context B<ctx>.
 
-EVP_CIPHER_gettable_params(), EVP_CIPHER_CTX_gettable_params(), and
-EVP_CIPHER_CTX_settable_params() get a constant B<OSSL_PARAM> array
+EVP_CIPHER_gettable_params(), EVP_CIPHER_gettable_ctx_params(), and
+EVP_CIPHER_settable_ctx_params() get a constant B<OSSL_PARAM> array
 that decribes the retrievable and settable parameters, i.e. parameters
 that can be used with EVP_CIPHER_get_params(), EVP_CIPHER_CTX_get_params()
 and EVP_CIPHER_CTX_set_params(), respectively.
index 2697331..e175124 100644 (file)
@@ -7,7 +7,7 @@ EVP_KDF_name,
 EVP_KDF_CTX, EVP_KDF_CTX_new, EVP_KDF_CTX_free, EVP_KDF_CTX_kdf,
 EVP_KDF_reset, EVP_KDF_size, EVP_KDF_derive, EVP_KDF_CTX_dup,
 EVP_KDF_CTX_get_params, EVP_KDF_CTX_set_params, EVP_KDF_do_all_ex,
-EVP_KDF_get_params, EVP_KDF_CTX_gettable_params, EVP_KDF_CTX_settable_params,
+EVP_KDF_get_params, EVP_KDF_gettable_ctx_params, EVP_KDF_settable_ctx_params,
 EVP_KDF_gettable_params - EVP KDF routines
 
 =head1 SYNOPSIS
@@ -36,8 +36,8 @@ EVP_KDF_gettable_params - EVP KDF routines
  int EVP_KDF_CTX_get_params(EVP_KDF_CTX *ctx, OSSL_PARAM params[]);
  int EVP_KDF_CTX_set_params(EVP_KDF_CTX *ctx, const OSSL_PARAM params[]);
  const OSSL_PARAM *EVP_KDF_gettable_params(const EVP_KDF *kdf);
- const OSSL_PARAM *EVP_KDF_CTX_gettable_params(const EVP_KDF *kdf);
- const OSSL_PARAM *EVP_KDF_CTX_settable_params(const EVP_KDF *kdf);
+ const OSSL_PARAM *EVP_KDF_gettable_ctx_params(const EVP_KDF *kdf);
+ const OSSL_PARAM *EVP_KDF_settable_ctx_params(const EVP_KDF *kdf);
  const OSSL_PROVIDER *EVP_KDF_provider(const EVP_KDF *kdf);
 
 =head1 DESCRIPTION
@@ -114,8 +114,8 @@ simply ignored.
 Also, what happens when a needed parameter isn't passed down is
 defined by the implementation.
 
-EVP_KDF_gettable_params(), EVP_KDF_CTX_gettable_params() and
-EVP_KDF_CTX_settable_params() get a constant B<OSSL_PARAM> array that
+EVP_KDF_gettable_params(), EVP_KDF_gettable_ctx_params() and
+EVP_KDF_settable_ctx_params() get a constant B<OSSL_PARAM> array that
 decribes the retrievable and settable parameters, i.e. parameters that
 can be used with EVP_KDF_get_params(), EVP_KDF_CTX_get_params()
 and EVP_KDF_CTX_set_params(), respectively.
index b4d5b5b..c208754 100644 (file)
@@ -8,7 +8,7 @@ EVP_MAC_provider, EVP_MAC_get_params, EVP_MAC_gettable_params,
 EVP_MAC_CTX, EVP_MAC_CTX_new, EVP_MAC_CTX_free, EVP_MAC_CTX_dup,
 EVP_MAC_CTX_mac, EVP_MAC_CTX_get_params, EVP_MAC_CTX_set_params,
 EVP_MAC_size, EVP_MAC_init, EVP_MAC_update, EVP_MAC_final,
-EVP_MAC_CTX_gettable_params, EVP_MAC_CTX_settable_params,
+EVP_MAC_gettable_ctx_params, EVP_MAC_settable_ctx_params,
 EVP_MAC_do_all_ex - EVP MAC routines
 
 =head1 SYNOPSIS
@@ -41,8 +41,8 @@ EVP_MAC_do_all_ex - EVP MAC routines
                    unsigned char *out, size_t *outl, size_t outsize);
 
  const OSSL_PARAM *EVP_MAC_gettable_params(const EVP_MAC *mac);
- const OSSL_PARAM *EVP_MAC_CTX_gettable_params(const EVP_MAC *mac);
- const OSSL_PARAM *EVP_MAC_CTX_settable_params(const EVP_MAC *mac);
+ const OSSL_PARAM *EVP_MAC_gettable_ctx_params(const EVP_MAC *mac);
+ const OSSL_PARAM *EVP_MAC_settable_ctx_params(const EVP_MAC *mac);
 
  void EVP_MAC_do_all_ex(OPENSSL_CTX *libctx,
                         void (*fn)(EVP_MAC *mac, void *arg),
@@ -146,8 +146,8 @@ simply ignored.
 Also, what happens when a needed parameter isn't passed down is
 defined by the implementation.
 
-EVP_MAC_gettable_params(), EVP_MAC_CTX_gettable_params() and
-EVP_MAC_CTX_settable_params() get a constant B<OSSL_PARAM> array that
+EVP_MAC_gettable_params(), EVP_MAC_gettable_ctx_params() and
+EVP_MAC_settable_ctx_params() get a constant B<OSSL_PARAM> array that
 decribes the retrievable and settable parameters, i.e. parameters that
 can be used with EVP_MAC_get_params(), EVP_MAC_CTX_get_params()
 and EVP_MAC_CTX_set_params(), respectively.
index 6c7ff81..75ab58e 100644 (file)
@@ -120,7 +120,7 @@ Can be written like this instead:
   OSSL_PARAM *params =
       OPENSSL_zalloc(sizeof(*params)
                      * (sk_OPENSSL_STRING_num(opts) + 1));
-  const OSSL_PARAM *paramdefs = EVP_MAC_CTX_settable_params(mac);
+  const OSSL_PARAM *paramdefs = EVP_MAC_settable_ctx_params(mac);
   size_t params_n;
   char *opt = "<unknown>";
 
index 564106c..407162f 100644 (file)
@@ -723,8 +723,8 @@ int EVP_CIPHER_get_params(EVP_CIPHER *cipher, OSSL_PARAM params[]);
 int EVP_CIPHER_CTX_set_params(EVP_CIPHER_CTX *ctx, const OSSL_PARAM params[]);
 int EVP_CIPHER_CTX_get_params(EVP_CIPHER_CTX *ctx, OSSL_PARAM params[]);
 const OSSL_PARAM *EVP_CIPHER_gettable_params(const EVP_CIPHER *cipher);
-const OSSL_PARAM *EVP_CIPHER_CTX_settable_params(const EVP_CIPHER *cipher);
-const OSSL_PARAM *EVP_CIPHER_CTX_gettable_params(const EVP_CIPHER *cipher);
+const OSSL_PARAM *EVP_CIPHER_settable_ctx_params(const EVP_CIPHER *cipher);
+const OSSL_PARAM *EVP_CIPHER_gettable_ctx_params(const EVP_CIPHER *cipher);
 
 const BIO_METHOD *BIO_f_md(void);
 const BIO_METHOD *BIO_f_base64(void);
@@ -1060,8 +1060,8 @@ int EVP_MAC_update(EVP_MAC_CTX *ctx, const unsigned char *data, size_t datalen);
 int EVP_MAC_final(EVP_MAC_CTX *ctx,
                   unsigned char *out, size_t *outl, size_t outsize);
 const OSSL_PARAM *EVP_MAC_gettable_params(const EVP_MAC *mac);
-const OSSL_PARAM *EVP_MAC_CTX_gettable_params(const EVP_MAC *mac);
-const OSSL_PARAM *EVP_MAC_CTX_settable_params(const EVP_MAC *mac);
+const OSSL_PARAM *EVP_MAC_gettable_ctx_params(const EVP_MAC *mac);
+const OSSL_PARAM *EVP_MAC_settable_ctx_params(const EVP_MAC *mac);
 
 void EVP_MAC_do_all_ex(OPENSSL_CTX *libctx,
                        void (*fn)(EVP_MAC *mac, void *arg),
index 864a553..2193eae 100644 (file)
@@ -44,8 +44,8 @@ int EVP_KDF_get_params(EVP_KDF *kdf, OSSL_PARAM params[]);
 int EVP_KDF_CTX_get_params(EVP_KDF_CTX *ctx, OSSL_PARAM params[]);
 int EVP_KDF_CTX_set_params(EVP_KDF_CTX *ctx, const OSSL_PARAM params[]);
 const OSSL_PARAM *EVP_KDF_gettable_params(const EVP_KDF *kdf);
-const OSSL_PARAM *EVP_KDF_CTX_gettable_params(const EVP_KDF *kdf);
-const OSSL_PARAM *EVP_KDF_CTX_settable_params(const EVP_KDF *kdf);
+const OSSL_PARAM *EVP_KDF_gettable_ctx_params(const EVP_KDF *kdf);
+const OSSL_PARAM *EVP_KDF_settable_ctx_params(const EVP_KDF *kdf);
 
 void EVP_KDF_do_all_ex(OPENSSL_CTX *libctx,
                        void (*fn)(EVP_KDF *kdf, void *arg),
index 0b5fd5d..03581ff 100644 (file)
@@ -1161,7 +1161,7 @@ static int mac_test_run_mac(EVP_TEST *t)
     size_t params_n = 0;
     size_t params_n_allocstart = 0;
     const OSSL_PARAM *defined_params =
-        EVP_MAC_CTX_settable_params(expected->mac);
+        EVP_MAC_settable_ctx_params(expected->mac);
 
     if (expected->alg == NULL)
         TEST_info("Trying the EVP_MAC %s test", EVP_MAC_name(expected->mac));
@@ -2054,7 +2054,7 @@ static int kdf_test_ctrl(EVP_TEST *t, EVP_KDF_CTX *kctx,
     KDF_DATA *kdata = t->data;
     int rv;
     char *p, *name;
-    const OSSL_PARAM *defs = EVP_KDF_CTX_settable_params(EVP_KDF_CTX_kdf(kctx));
+    const OSSL_PARAM *defs = EVP_KDF_settable_ctx_params(EVP_KDF_CTX_kdf(kctx));
 
     if (!TEST_ptr(name = OPENSSL_strdup(value)))
         return 0;
index 7c44893..e8d7138 100644 (file)
@@ -4708,14 +4708,14 @@ EVP_CIPHER_get_params                   4824    3_0_0   EXIST::FUNCTION:
 EVP_CIPHER_CTX_set_params               4825   3_0_0   EXIST::FUNCTION:
 EVP_CIPHER_CTX_get_params               4826   3_0_0   EXIST::FUNCTION:
 EVP_CIPHER_gettable_params              4827   3_0_0   EXIST::FUNCTION:
-EVP_CIPHER_CTX_settable_params          4828   3_0_0   EXIST::FUNCTION:
-EVP_CIPHER_CTX_gettable_params          4829   3_0_0   EXIST::FUNCTION:
+EVP_CIPHER_settable_ctx_params          4828   3_0_0   EXIST::FUNCTION:
+EVP_CIPHER_gettable_ctx_params          4829   3_0_0   EXIST::FUNCTION:
 EVP_MD_get_params                       4830   3_0_0   EXIST::FUNCTION:
 EVP_MAC_fetch                           4831   3_0_0   EXIST::FUNCTION:
-EVP_MAC_CTX_settable_params             4832   3_0_0   EXIST::FUNCTION:
+EVP_MAC_settable_ctx_params             4832   3_0_0   EXIST::FUNCTION:
 EVP_MAC_CTX_set_params                  4833   3_0_0   EXIST::FUNCTION:
 EVP_MAC_CTX_get_params                  4834   3_0_0   EXIST::FUNCTION:
-EVP_MAC_CTX_gettable_params             4835   3_0_0   EXIST::FUNCTION:
+EVP_MAC_gettable_ctx_params             4835   3_0_0   EXIST::FUNCTION:
 EVP_MAC_free                            4836   3_0_0   EXIST::FUNCTION:
 EVP_MAC_up_ref                          4837   3_0_0   EXIST::FUNCTION:
 EVP_MAC_name                            4838   3_0_0   EXIST::FUNCTION:
@@ -4735,8 +4735,8 @@ EVP_KDF_get_params                      4851      3_0_0   EXIST::FUNCTION:
 EVP_KDF_CTX_get_params                  4852   3_0_0   EXIST::FUNCTION:
 EVP_KDF_CTX_set_params                  4853   3_0_0   EXIST::FUNCTION:
 EVP_KDF_gettable_params                 4854   3_0_0   EXIST::FUNCTION:
-EVP_KDF_CTX_gettable_params             4855   3_0_0   EXIST::FUNCTION:
-EVP_KDF_CTX_settable_params             4856   3_0_0   EXIST::FUNCTION:
+EVP_KDF_gettable_ctx_params             4855   3_0_0   EXIST::FUNCTION:
+EVP_KDF_settable_ctx_params             4856   3_0_0   EXIST::FUNCTION:
 EVP_KDF_do_all_ex                       4857   3_0_0   EXIST::FUNCTION:
 EVP_SIGNATURE_free                      4858   3_0_0   EXIST::FUNCTION:
 EVP_SIGNATURE_up_ref                    4859   3_0_0   EXIST::FUNCTION: