From: Arran Cudbard-Bell Date: Mon, 3 Jan 2022 21:23:50 +0000 (-0600) Subject: Set OpenSSL API compat macros centrally X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2460c143bb85b170cb466c204538b2a36b2750c2;p=thirdparty%2Ffreeradius-server.git Set OpenSSL API compat macros centrally --- diff --git a/src/lib/tls/base-h b/src/lib/tls/base-h index 41394fc68b2..06334b3a151 100644 --- a/src/lib/tls/base-h +++ b/src/lib/tls/base-h @@ -26,27 +26,14 @@ */ RCSIDH(tls_h, "$Id$") +#include "openssl_user_macros.h" + #include #include #include #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 #endif diff --git a/src/lib/tls/bio.h b/src/lib/tls/bio.h index d058609db07..8d48580aad1 100644 --- a/src/lib/tls/bio.h +++ b/src/lib/tls/bio.h @@ -25,6 +25,8 @@ */ RCSIDH(bio_h, "$Id$") +#include "openssl_user_macros.h" + #include #include diff --git a/src/lib/tls/cache.h b/src/lib/tls/cache.h index 648ab0e648e..d0a191abf9f 100644 --- a/src/lib/tls/cache.h +++ b/src/lib/tls/cache.h @@ -25,6 +25,8 @@ */ RCSIDH(cache_h, "$Id$") +#include "openssl_user_macros.h" + #include #include diff --git a/src/lib/tls/conf-h b/src/lib/tls/conf-h index dc36c2c4bdc..bc6772df1a3 100644 --- a/src/lib/tls/conf-h +++ b/src/lib/tls/conf-h @@ -25,6 +25,8 @@ */ RCSIDH(conf_h, "$Id$") +#include "openssl_user_macros.h" + #include #include diff --git a/src/lib/tls/engine.h b/src/lib/tls/engine.h index e2291a0cb6f..0cb21f80579 100644 --- a/src/lib/tls/engine.h +++ b/src/lib/tls/engine.h @@ -26,6 +26,8 @@ */ RCSIDH(tls_engine_h, "$Id$") +#include "openssl_user_macros.h" + #include #include diff --git a/src/lib/tls/log.h b/src/lib/tls/log.h index 9ba21018960..d0064ef3763 100644 --- a/src/lib/tls/log.h +++ b/src/lib/tls/log.h @@ -26,6 +26,8 @@ */ RCSIDH(tls_log_h, "$Id$") +#include "openssl_user_macros.h" + #include #include diff --git a/src/lib/tls/openssl_user_macros.h b/src/lib/tls/openssl_user_macros.h new file mode 100644 index 00000000000..ca078c5e731 --- /dev/null +++ b/src/lib/tls/openssl_user_macros.h @@ -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 diff --git a/src/lib/tls/session.h b/src/lib/tls/session.h index 396a0943dde..478864a6bc3 100644 --- a/src/lib/tls/session.h +++ b/src/lib/tls/session.h @@ -25,6 +25,8 @@ */ RCSIDH(session_h, "$Id$") +#include "openssl_user_macros.h" + #include #include diff --git a/src/lib/tls/utils.h b/src/lib/tls/utils.h index af6d72334aa..5d9c3e501c6 100644 --- a/src/lib/tls/utils.h +++ b/src/lib/tls/utils.h @@ -25,6 +25,8 @@ */ RCSIDH(utils_h, "$Id$") +#include "openssl_user_macros.h" + #include #include diff --git a/src/lib/tls/verify.h b/src/lib/tls/verify.h index 4300967ee23..18ee4f23654 100644 --- a/src/lib/tls/verify.h +++ b/src/lib/tls/verify.h @@ -25,6 +25,8 @@ */ RCSIDH(validate_h, "$Id$") +#include "openssl_user_macros.h" + #include #include