]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Remove unused OSSL_PARAM_construct_from_text() function.
authorPauli <paul.dale@oracle.com>
Mon, 10 Feb 2020 23:13:33 +0000 (09:13 +1000)
committerPauli <paul.dale@oracle.com>
Wed, 12 Feb 2020 09:45:42 +0000 (19:45 +1000)
This function is recently introduced and never called by the library or tests.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11053)

crypto/params_from_text.c
crypto/sm2/sm2_pmeth.c
doc/man3/OSSL_PARAM_allocate_from_text.pod [moved from doc/man3/OSSL_PARAM_construct_from_text.pod with 86% similarity]
include/openssl/params.h
util/libcrypto.num

index 053b93d2c3847912231bff1f33517c066e7daa2e..59cee5f1159bd2c6c1366ae3322d742c7c18b2d3 100644 (file)
@@ -160,37 +160,6 @@ static int construct_from_text(OSSL_PARAM *to, const OSSL_PARAM *paramdef,
     return 1;
 }
 
-int OSSL_PARAM_construct_from_text(OSSL_PARAM *to,
-                                   const OSSL_PARAM *paramdefs,
-                                   const char *key, const char *value,
-                                   size_t value_n,
-                                   void *buf, size_t *buf_n)
-{
-    const OSSL_PARAM *paramdef = NULL;
-    int ishex = 0;
-    BIGNUM *tmpbn = NULL;
-    int ok = 0;
-
-    if (to == NULL || paramdefs == NULL)
-        return 0;
-
-    if (!prepare_from_text(paramdefs, key, value, value_n,
-                           &paramdef, &ishex, buf_n, &tmpbn))
-        return 0;
-
-    /*
-     * The user gets the expected buffer size back even if the buffer isn't
-     * allocated.
-     */
-    if (buf == NULL)
-        return 1;
-
-    ok = construct_from_text(to, paramdef, value, value_n, ishex,
-                             buf, *buf_n, tmpbn);
-    BN_free(tmpbn);
-    return ok;
-}
-
 int OSSL_PARAM_allocate_from_text(OSSL_PARAM *to,
                                   const OSSL_PARAM *paramdefs,
                                   const char *key, const char *value,
index 681a0ab130a79c581f30881ff635ee5aefe1304c..c3ba9280c590e4edc8d63361268d712e8a9106c3 100644 (file)
@@ -253,8 +253,7 @@ static int pkey_sm2_ctrl_str(EVP_PKEY_CTX *ctx,
     } else if (strcmp(type, "sm2_hex_id") == 0) {
         /*
          * TODO(3.0): reconsider the name "sm2_hex_id", OR change
-         * OSSL_PARAM_construct_from_text() / OSSL_PARAM_allocate_from_text()
-         * to handle infix "_hex_"
+         * OSSL_PARAM_allocate_from_text() to handle infix "_hex_"
          */
         hex_id = OPENSSL_hexstr2buf((const char *)value, &hex_len);
         if (hex_id == NULL) {
similarity index 86%
rename from doc/man3/OSSL_PARAM_construct_from_text.pod
rename to doc/man3/OSSL_PARAM_allocate_from_text.pod
index 7e6c3e919397b568e07078857dc576f05b1e3de8..c16491e702ed5e0a6a4089dba5ca4a5f6c96b352 100644 (file)
@@ -2,18 +2,13 @@
 
 =head1 NAME
 
-OSSL_PARAM_construct_from_text, OSSL_PARAM_allocate_from_text
+OSSL_PARAM_allocate_from_text
 - OSSL_PARAM construction utilities
 
 =head1 SYNOPSIS
 
  #include <openssl/params.h>
 
- int OSSL_PARAM_construct_from_text(OSSL_PARAM *to,
-                                    const OSSL_PARAM *paramdefs,
-                                    const char *key, const char *value,
-                                    size_t value_n,
-                                    void *buf, size_t *buf_n)
  int OSSL_PARAM_allocate_from_text(OSSL_PARAM *to,
                                    const OSSL_PARAM *paramdefs,
                                    const char *key, const char *value,
@@ -30,7 +25,7 @@ OpenSSL 3.0 introduces a new mechanism to do the same thing with an
 array of parameters that contain name, value, value type and value
 size (see L<OSSL_PARAM(3)> for more information).
 
-OSSL_PARAM_construct_from_text() takes a control I<key>, I<value> and
+OSSL_PARAM_allocate_from_text() takes a control I<key>, I<value> and
 value size I<value_n>, and given a parameter descriptor array
 I<paramdefs>, it converts the value to something suitable for
 L<OSSL_PARAM(3)> and stores that in the buffer I<buf>, and modifies
@@ -42,9 +37,6 @@ left untouched, allowing a caller to find out how large the buffer
 should be.
 I<buf> needs to be correctly aligned for the type of the B<OSSL_PARAM>
 I<key>.
-
-OSSL_PARAM_allocate_from_text() works like OSSL_PARAM_construct_from_text(),
-except it allocates the buffer internally.
 The caller must remember to free the data of I<to> when it's not
 useful any more.
 
@@ -57,8 +49,7 @@ as parameter value.
 
 =head1 RETURN VALUES
 
-OSSL_PARAM_construct_from_text() and OSSL_PARAM_allocate_from_text()
-returns 1 on success, and 0 on error.
+OSSL_PARAM_allocate_from_text() returns 1 on success, and 0 on error.
 
 =head1 NOTES
 
index aec3bc18b8064d6feac72ad307a2f0eea5f0ad6e..a5d2fd4f41bba0f9a72c49a710bcdffaf4ecc456 100644 (file)
@@ -89,11 +89,6 @@ OSSL_PARAM OSSL_PARAM_construct_octet_ptr(const char *key, void **buf,
                                           size_t bsize);
 OSSL_PARAM OSSL_PARAM_construct_end(void);
 
-int OSSL_PARAM_construct_from_text(OSSL_PARAM *to,
-                                   const OSSL_PARAM *paramdefs,
-                                   const char *key, const char *value,
-                                   size_t value_n,
-                                   void *buf, size_t *buf_n);
 int OSSL_PARAM_allocate_from_text(OSSL_PARAM *to,
                                   const OSSL_PARAM *paramdefs,
                                   const char *key, const char *value,
index 29e37b4a41e0b852cdb515c602e23d19d9c6506b..a87630b6333c167e9e4810af0cc9e6ddb77bf91c 100644 (file)
@@ -4688,7 +4688,6 @@ EC_KEY_new_ex                           ? 3_0_0   EXIST::FUNCTION:EC
 EC_KEY_new_by_curve_name_ex             ?      3_0_0   EXIST::FUNCTION:EC
 OPENSSL_hexstr2buf_ex                   ?      3_0_0   EXIST::FUNCTION:
 OPENSSL_buf2hexstr_ex                   ?      3_0_0   EXIST::FUNCTION:
-OSSL_PARAM_construct_from_text          ?      3_0_0   EXIST::FUNCTION:
 OSSL_PARAM_allocate_from_text           ?      3_0_0   EXIST::FUNCTION:
 EVP_MD_gettable_params                  ?      3_0_0   EXIST::FUNCTION:
 EVP_MD_CTX_settable_params              ?      3_0_0   EXIST::FUNCTION: