Make conf_method_st and conf_st deprecated
authorRich Salz <rsalz@akamai.com>
Tue, 25 May 2021 16:57:06 +0000 (12:57 -0400)
committerPauli <pauli@openssl.org>
Wed, 2 Jun 2021 02:40:02 +0000 (12:40 +1000)
So they can be made opaque in a future release.

Fixes #15101

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15466)

CHANGES.md
crypto/conf/conf_api.c
crypto/conf/conf_def.c
crypto/conf/conf_lib.c
crypto/conf/conf_local.h
crypto/conf/conf_mod.c
crypto/conf/conf_sap.c
include/openssl/conf.h.in
include/openssl/conftypes.h [new file with mode: 0644]

index 0eb7f1428978b51073653165a82c3f1ca00b1e5e..ed9ad1ce8f13c118e28cd1fad78665c396fcaa8a 100644 (file)
@@ -44,6 +44,11 @@ breaking changes, and mappings for the large list of deprecated functions.
 
    *Rich Salz*
 
+ * The public definitions of conf_method_st and conf_st have been
+   deprecated. They will be made opaque in a future release.
+
+   * Rich Salz *
+
  * Client-initiated renegotiation is disabled by default. To allow it, use
    the -client_renegotiation option, the SSL_OP_ALLOW_CLIENT_RENEGOTIATION
    flag, or the "ClientRenegotiation" config parameter as appropriate.
index 41a09c42bc994469dc81011f2b8a0d9401984b6b..e4e305c714f0d8bf4789a6e19e282efe66b5d44a 100644 (file)
@@ -15,6 +15,7 @@
 #include <string.h>
 #include <openssl/conf.h>
 #include <openssl/conf_api.h>
+#include "conf_local.h"
 
 static void value_free_hash(const CONF_VALUE *a, LHASH_OF(CONF_VALUE) *conf);
 static void value_free_stack_doall(CONF_VALUE *a);
index 25fcc0400cecc6d6237670a7a9e3fb0c1cfe01c4..7b67854c8b702ecb5310e86b4ed086b2824b70ec 100644 (file)
@@ -21,6 +21,7 @@
 #include <openssl/lhash.h>
 #include <openssl/conf.h>
 #include <openssl/conf_api.h>
+#include "conf_local.h"
 #include "conf_def.h"
 #include <openssl/buffer.h>
 #include <openssl/err.h>
index 1f106d8c071d09eccecd1c59094c92497825a7a9..99a33765adec9e85376ee9402201704cf933bd83 100644 (file)
@@ -16,6 +16,7 @@
 #include <openssl/err.h>
 #include <openssl/conf.h>
 #include <openssl/conf_api.h>
+#include "conf_local.h"
 #include <openssl/lhash.h>
 
 static CONF_METHOD *default_CONF_method = NULL;
index 1ee8424c500fab4cb666f88b57308373c4923ff3..f3b16f1138525c4c0051d717bd3a956234534c8c 100644 (file)
@@ -7,4 +7,5 @@
  * https://www.openssl.org/source/license.html
  */
 
+#include <openssl/conftypes.h>
 void ossl_config_add_ssl_module(void);
index d82f0c7f2c9355d0895f23f960c157032e725dd3..36b054ca516f47538e7d42abc2733b7cab075f98 100644 (file)
@@ -21,6 +21,7 @@
 #include <openssl/x509.h>
 #include <openssl/trace.h>
 #include <openssl/engine.h>
+#include "conf_local.h"
 
 DEFINE_STACK_OF(CONF_MODULE)
 DEFINE_STACK_OF(CONF_IMODULE)
index 5cd018c1678908f954a2ab6c6e584c88067d9205..6742ecf87f2d915c2383bdb121138c373e2d1ee0 100644 (file)
@@ -11,6 +11,7 @@
 #include <openssl/crypto.h>
 #include "internal/cryptlib.h"
 #include "internal/conf.h"
+#include "conf_local.h"
 #include <openssl/x509.h>
 #include <openssl/asn1.h>
 #include <openssl/engine.h>
index 0911a38f8b8672af6487978def262d5c730da5bd..928b14c28fb1ec6bf3ebabb4e9b3fef2ce59c8b6 100644 (file)
@@ -48,21 +48,11 @@ struct conf_st;
 struct conf_method_st;
 typedef struct conf_method_st CONF_METHOD;
 
-struct conf_method_st {
-    const char *name;
-    CONF *(*create) (CONF_METHOD *meth);
-    int (*init) (CONF *conf);
-    int (*destroy) (CONF *conf);
-    int (*destroy_data) (CONF *conf);
-    int (*load_bio) (CONF *conf, BIO *bp, long *eline);
-    int (*dump) (const CONF *conf, BIO *bp);
-    int (*is_number) (const CONF *conf, char c);
-    int (*to_int) (const CONF *conf, char c);
-    int (*load) (CONF *conf, const char *name, long *eline);
-};
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+#  include <openssl/conftypes.h>
+# endif
 
 /* Module definitions */
-
 typedef struct conf_imodule_st CONF_IMODULE;
 typedef struct conf_module_st CONF_MODULE;
 
@@ -115,16 +105,6 @@ OSSL_DEPRECATEDIN_1_1_0 void OPENSSL_config(const char *config_name);
  * that wasn't the case, the above functions would have been replaced
  */
 
-struct conf_st {
-    CONF_METHOD *meth;
-    void *meth_data;
-    LHASH_OF(CONF_VALUE) *data;
-    int flag_dollarid;
-    int flag_abspath;
-    char *includedir;
-    OSSL_LIB_CTX *libctx;
-};
-
 CONF *NCONF_new_ex(OSSL_LIB_CTX *libctx, CONF_METHOD *meth);
 CONF *NCONF_new(CONF_METHOD *meth);
 CONF_METHOD *NCONF_default(void);
diff --git a/include/openssl/conftypes.h b/include/openssl/conftypes.h
new file mode 100644 (file)
index 0000000..17cefaa
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef  OPENSSL_CONFTYPES_H
+# define OPENSSL_CONFTYPES_H
+# pragma once
+
+#ifndef  OPENSSL_CONF_H
+# include <openssl/conf.h>
+#endif
+
+/*
+ * The contents of this file are deprecated and will be made opaque
+ */
+struct conf_method_st {
+    const char *name;
+    CONF *(*create) (CONF_METHOD *meth);
+    int (*init) (CONF *conf);
+    int (*destroy) (CONF *conf);
+    int (*destroy_data) (CONF *conf);
+    int (*load_bio) (CONF *conf, BIO *bp, long *eline);
+    int (*dump) (const CONF *conf, BIO *bp);
+    int (*is_number) (const CONF *conf, char c);
+    int (*to_int) (const CONF *conf, char c);
+    int (*load) (CONF *conf, const char *name, long *eline);
+};
+
+struct conf_st {
+    CONF_METHOD *meth;
+    void *meth_data;
+    LHASH_OF(CONF_VALUE) *data;
+    int flag_dollarid;
+    int flag_abspath;
+    char *includedir;
+    OSSL_LIB_CTX *libctx;
+};
+
+#endif