]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix handling undefined GSS_SPNEGO_MECHANISM macro
authorMichał Kępień <michal@isc.org>
Fri, 16 Apr 2021 12:40:06 +0000 (14:40 +0200)
committerMichał Kępień <michal@isc.org>
Fri, 16 Apr 2021 12:40:06 +0000 (14:40 +0200)
BIND 9 attempts to look up GSSAPI OIDs for the Kerberos 5 and SPNEGO
mechanisms in the relevant header files provided by the Kerberos/GSSAPI
library used.  Due to the differences between various Kerberos/GSSAPI
implementations, if any of the expected preprocessor macros
(GSS_KRB5_MECHANISM, GSS_SPNEGO_MECHANISM) is not defined in the header
files provided by the library used, the code in lib/dns/gssapictx.c
defines its own version of each missing macro, so that BIND 9 can
attempt to use the relevant security mechanisms anyway.

Commit a875dcc66969ea3995eb6fc1545d39dafcb56b26, which contains a
partial backport of the changes introduced in commit
978c7b2e89aa37a7ddfe2f6b6ba12ce73dd04528, left a block of code in the
lib/dns/dst_internal.h header which defines the GSS_SPNEGO_MECHANISM
preprocessor macro to NULL if it is not defined by any header file
provided by the Kerberos/GSSAPI library used.  This causes the
gss_add_oid_set_member() call in the mech_oid_set_create() helper
function to always return an error.  This in turn causes the
dst_gssapi_acquirecred() function to also always return an error, which
ultimately prevents any named instance whose configuration includes the
"tkey-gssapi-credential" option from starting.

Remove the offending conditional definition of the GSS_SPNEGO_MECHANISM
preprocessor macro from lib/dns/dst_internal.h, so that a proper GSSAPI
OID is assigned to that macro in lib/dns/gssapictx.c when the
Kerberos/GSSAPI library used does not define it.

lib/dns/dst_internal.h

index 2c3b4a3edbb0d2cdd3facacec0d5d3fc589392cf..e230bdc4dc66e2be84ebe849cac00b168f37f873 100644 (file)
@@ -66,9 +66,6 @@
 #include ISC_PLATFORM_GSSAPI_KRB5_HEADER
 #endif /* ifdef ISC_PLATFORM_GSSAPI_KRB5_HEADER */
 #endif /* ifdef WIN32 */
-#ifndef GSS_SPNEGO_MECHANISM
-#define GSS_SPNEGO_MECHANISM ((void *)0)
-#endif /* ifndef GSS_SPNEGO_MECHANISM */
 #endif /* ifdef GSSAPI */
 
 ISC_LANG_BEGINDECLS