]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Set OpenSSL API compat macros centrally
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 3 Jan 2022 21:23:50 +0000 (15:23 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 3 Jan 2022 21:23:50 +0000 (15:23 -0600)
src/lib/tls/base-h
src/lib/tls/bio.h
src/lib/tls/cache.h
src/lib/tls/conf-h
src/lib/tls/engine.h
src/lib/tls/log.h
src/lib/tls/openssl_user_macros.h [new file with mode: 0644]
src/lib/tls/session.h
src/lib/tls/utils.h
src/lib/tls/verify.h

index 41394fc68b23efce16f98d294d9fe1a390c89e61..06334b3a1510d958fe3caf486e340c8825468ed4 100644 (file)
  */
 RCSIDH(tls_h, "$Id$")
 
+#include "openssl_user_macros.h"
+
 #include <freeradius-devel/server/cf_parse.h>
 #include <freeradius-devel/server/tmpl.h>
 #include <freeradius-devel/unlang/function.h>
 
 #undef HAVE_OPENSSL_OCSP_H
 
-/*
- *     This changed in OpenSSL 1.1.0 (they allow deprecated interfaces)
- *     But because we're always ahead of the curve we don't need them.
- */
-#ifndef OPENSSL_NO_DEPRECATED
-#  define OPENSSL_NO_DEPRECATED
-#endif
-
-/*
- *     For RH 9, which apparently needs this.
- */
-#ifndef OPENSSL_NO_KRB5
-#  define OPENSSL_NO_KRB5
-#endif
-
 #ifdef HAVE_OPENSSL_ENGINE_H
 #  include <openssl/engine.h>
 #endif
index d058609db07c7286729cc4d29bbc13225a09340c..8d48580aad105d56c71cde107dcc084f7c0e00b8 100644 (file)
@@ -25,6 +25,8 @@
  */
 RCSIDH(bio_h, "$Id$")
 
+#include "openssl_user_macros.h"
+
 #include <openssl/bio.h>
 #include <freeradius-devel/util/dbuff.h>
 
index 648ab0e648e37ba56dd6f110060e38979bbca8d4..d0a191abf9ff2afb411193d8bd23064c1d7d77f5 100644 (file)
@@ -25,6 +25,8 @@
  */
 RCSIDH(cache_h, "$Id$")
 
+#include "openssl_user_macros.h"
+
 #include <openssl/ssl.h>
 #include <openssl/err.h>
 
index dc36c2c4bdcd6318ffdd5413c777e0bef4d6c97c..bc6772df1a32a34be82ec9d6d11eaf7f4623572e 100644 (file)
@@ -25,6 +25,8 @@
  */
 RCSIDH(conf_h, "$Id$")
 
+#include "openssl_user_macros.h"
+
 #include <openssl/ssl.h>
 #include <openssl/err.h>
 
index e2291a0cb6f167091c101bef0823a4403c5ba9bd..0cb21f8057994813fa81466b8ede2d271cfd0d7c 100644 (file)
@@ -26,6 +26,8 @@
  */
 RCSIDH(tls_engine_h, "$Id$")
 
+#include "openssl_user_macros.h"
+
 #include <freeradius-devel/util/dlist.h>
 #include <openssl/engine.h>
 
index 9ba21018960e37da347364bb0d74efc9a2a84360..d0064ef3763c2b1a4a847270bbd20a168a048c9e 100644 (file)
@@ -26,6 +26,8 @@
  */
 RCSIDH(tls_log_h, "$Id$")
 
+#include "openssl_user_macros.h"
+
 #include <stdbool.h>
 #include <stdint.h>
 
diff --git a/src/lib/tls/openssl_user_macros.h b/src/lib/tls/openssl_user_macros.h
new file mode 100644 (file)
index 0000000..ca078c5
--- /dev/null
@@ -0,0 +1,44 @@
+#pragma once
+/*
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+#ifdef WITH_TLS
+/**
+ * $Id$
+ *
+ *  https://www.openssl.org/docs/manmaster/man7/OPENSSL_NO_DEPRECATED.html
+ *
+ * @file lib/tls/openssl_user_macros.h
+ * @brief Definitions which control which OpenSSL API functions are exposed
+ *
+ * @copyright 2021 Arran Cudbard-Bell (a.cudbardb@freeradius.org)
+ */
+RCSIDH(openssl_user_macros_h, "$Id$")
+
+/*
+ *     This changed in OpenSSL 1.1.0 (they allow deprecated interfaces)
+ *     But because we're always ahead of the curve we don't need them.
+ */
+#ifndef OPENSSL_NO_DEPRECATED
+#  define OPENSSL_NO_DEPRECATED
+#endif
+
+/*
+ *     For RH 9, which apparently needs this.
+ */
+#ifndef OPENSSL_NO_KRB5
+#  define OPENSSL_NO_KRB5
+#endif
+#endif
index 396a0943dde7cd5a34e417f6c66eadafacf355e6..478864a6bc3a208554074bc376f867c4918d8c96 100644 (file)
@@ -25,6 +25,8 @@
  */
 RCSIDH(session_h, "$Id$")
 
+#include "openssl_user_macros.h"
+
 #include <openssl/ssl.h>
 #include <openssl/err.h>
 
index af6d72334aac60ee125bc3c8c1aee643c1290894..5d9c3e501c6971e9d7e02c10c4f927de66d86cbc 100644 (file)
@@ -25,6 +25,8 @@
  */
 RCSIDH(utils_h, "$Id$")
 
+#include "openssl_user_macros.h"
+
 #include <openssl/ssl.h>
 
 #include <freeradius-devel/util/time.h>
index 4300967ee239777783a345f388a2ec782bb1ad4d..18ee4f23654526ead1949e66139721e027bf2a3d 100644 (file)
@@ -25,6 +25,8 @@
  */
 RCSIDH(validate_h, "$Id$")
 
+#include "openssl_user_macros.h"
+
 #include <openssl/ssl.h>
 #include <openssl/err.h>