diff --git a/bin/named/win32/named.vcxproj.in b/bin/named/win32/named.vcxproj.in index a4f3575da6..ff301da561 100644 --- a/bin/named/win32/named.vcxproj.in +++ b/bin/named/win32/named.vcxproj.in @@ -59,7 +59,7 @@ Level4 false Disabled - WIN32;@USE_GSSAPI@BUILDER="Visual Studio";_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;BUILDER="Visual Studio";_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true .\$(Configuration)\$(TargetName).pch .\$(Configuration)\ @@ -87,7 +87,7 @@ MaxSpeed true @INTRINSIC@ - WIN32;@USE_GSSAPI@BUILDER="Visual Studio";NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;BUILDER="Visual Studio";NDEBUG;_CONSOLE;%(PreprocessorDefinitions) OnlyExplicitInline false true diff --git a/bin/nsupdate/win32/nsupdate.vcxproj.in b/bin/nsupdate/win32/nsupdate.vcxproj.in index 38921aaa75..a7543e7c80 100644 --- a/bin/nsupdate/win32/nsupdate.vcxproj.in +++ b/bin/nsupdate/win32/nsupdate.vcxproj.in @@ -59,7 +59,7 @@ Level4 false Disabled - WIN32;@USE_GSSAPI@USE_READLINE_STATIC;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;USE_READLINE_STATIC;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true .\$(Configuration)\$(TargetName).pch .\$(Configuration)\ @@ -87,7 +87,7 @@ MaxSpeed true @INTRINSIC@ - WIN32;@USE_GSSAPI@USE_READLINE_STATIC;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;USE_READLINE_STATIC;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) OnlyExplicitInline false true diff --git a/bin/win32/BINDInstall/BINDInstall.vcxproj.in b/bin/win32/BINDInstall/BINDInstall.vcxproj.in index 66c3d2691c..cbeafc7bb6 100644 --- a/bin/win32/BINDInstall/BINDInstall.vcxproj.in +++ b/bin/win32/BINDInstall/BINDInstall.vcxproj.in @@ -61,7 +61,7 @@ Level4 false Disabled - WIN32;@USE_GSSAPI@@USE_PYTHON@_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + WIN32;@USE_PYTHON@_DEBUG;_WINDOWS;%(PreprocessorDefinitions) ..\..\..;..\include;..\..\..\include;..\..\named\win32\include;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;%(AdditionalIncludeDirectories) @@ -92,7 +92,7 @@ MaxSpeed true false - WIN32;@USE_GSSAPI@@USE_PYTHON@NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + WIN32;@USE_PYTHON@NDEBUG;_WINDOWS;%(PreprocessorDefinitions) ..\..\..;..\include;..\..\..\include;..\..\named\win32\include;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;%(AdditionalIncludeDirectories) OnlyExplicitInline true @@ -130,8 +130,8 @@ NotUsing - UNICODE;WIN32;@USE_GSSAPI@@USE_PYTHON@NDEBUG;_WINDOWS;_MBCS - UNICODE;WIN32;@USE_GSSAPI@@USE_PYTHON@_DEBUG;_WINDOWS;_MBCS + UNICODE;WIN32;@USE_PYTHON@NDEBUG;_WINDOWS;_MBCS + UNICODE;WIN32;@USE_PYTHON@_DEBUG;_WINDOWS;_MBCS diff --git a/config.h.win32 b/config.h.win32 index 4f3dc96d30..1cff19f062 100644 --- a/config.h.win32 +++ b/config.h.win32 @@ -354,6 +354,15 @@ typedef __int64 off_t; /* Define to 1 if you have the `uv_import' function. */ @HAVE_UV_IMPORT@ +/* GSSAPI Related defines */ +@HAVE_GSSAPI@ +@HAVE_GSSAPI_H@ +@HAVE_GSSAPI_GSSAPI_H@ +@HAVE_GSSAPI_KRB5_H@ +@HAVE_GSSAPI_GSSAPI_KRB5_H@ +@HAVE_KRB5_H@ +@HAVE_KRB5_KRB5_H@ + /* * Define to nothing if C supports flexible array members, and to 1 if it does * not. That way, with a declaration like `struct s { int n; double diff --git a/lib/dns/Makefile.am b/lib/dns/Makefile.am index 8280d9a65f..5f6abc14db 100644 --- a/lib/dns/Makefile.am +++ b/lib/dns/Makefile.am @@ -183,6 +183,7 @@ libdns_la_SOURCES = \ ecs.c \ fixedname.c \ forward.c \ + gssapictx.c \ hmac_link.c \ ipkeylist.c \ iptable.c \ @@ -253,11 +254,7 @@ libdns_la_SOURCES = \ if HAVE_GSSAPI libdns_la_SOURCES += \ - gssapi_link.c \ - gssapictx.c -else !HAVE_GSSAPI -libdns_la_SOURCES += \ - gssapictx-dummy.c + gssapi_link.c endif if HAVE_PKCS11 diff --git a/lib/dns/gssapi_link.c b/lib/dns/gssapi_link.c index fe3bc7562f..9b18601d03 100644 --- a/lib/dns/gssapi_link.c +++ b/lib/dns/gssapi_link.c @@ -365,5 +365,3 @@ dst__gssapi_init(dst_func_t **funcp) { } return (ISC_R_SUCCESS); } - -/*! \file */ diff --git a/lib/dns/gssapictx-dummy.c b/lib/dns/gssapictx-dummy.c deleted file mode 100644 index b155ef710b..0000000000 --- a/lib/dns/gssapictx-dummy.c +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (C) Internet Systems Consortium, Inc. ("ISC") - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * See the COPYRIGHT file distributed with this work for additional - * information regarding copyright ownership. - */ - -#include -#include - -#include -#include -#include - -#include - -#include - -isc_result_t -dst_gssapi_acquirecred(const dns_name_t *name, bool initiate, - gss_cred_id_t *cred) { - REQUIRE(cred != NULL && *cred == NULL); - - UNUSED(name); - UNUSED(initiate); - UNUSED(cred); - - return (ISC_R_NOTIMPLEMENTED); -} - -bool -dst_gssapi_identitymatchesrealmkrb5(const dns_name_t *signer, - const dns_name_t *name, - const dns_name_t *realm, bool subdomain) { - UNUSED(signer); - UNUSED(name); - UNUSED(realm); - UNUSED(subdomain); - - return (false); -} - -bool -dst_gssapi_identitymatchesrealmms(const dns_name_t *signer, - const dns_name_t *name, - const dns_name_t *realm, bool subdomain) { - UNUSED(signer); - UNUSED(name); - UNUSED(realm); - UNUSED(subdomain); - - return (false); -} - -isc_result_t -dst_gssapi_releasecred(gss_cred_id_t *cred) { - UNUSED(cred); - - return (ISC_R_NOTIMPLEMENTED); -} - -isc_result_t -dst_gssapi_initctx(const dns_name_t *name, isc_buffer_t *intoken, - isc_buffer_t *outtoken, gss_ctx_id_t *gssctx, - isc_mem_t *mctx, char **err_message) { - UNUSED(name); - UNUSED(intoken); - UNUSED(outtoken); - UNUSED(gssctx); - UNUSED(mctx); - UNUSED(err_message); - - return (ISC_R_NOTIMPLEMENTED); -} - -isc_result_t -dst_gssapi_acceptctx(gss_cred_id_t cred, const char *gssapi_keytab, - isc_region_t *intoken, isc_buffer_t **outtoken, - gss_ctx_id_t *ctxout, dns_name_t *principal, - isc_mem_t *mctx) { - UNUSED(cred); - UNUSED(gssapi_keytab); - UNUSED(intoken); - UNUSED(outtoken); - UNUSED(ctxout); - UNUSED(principal); - UNUSED(mctx); - - return (ISC_R_NOTIMPLEMENTED); -} - -isc_result_t -dst_gssapi_deletectx(isc_mem_t *mctx, gss_ctx_id_t *gssctx) { - UNUSED(mctx); - UNUSED(gssctx); - return (ISC_R_NOTIMPLEMENTED); -} - -/*! \file */ diff --git a/lib/dns/gssapictx.c b/lib/dns/gssapictx.c index bf75147ef3..5852b5e35d 100644 --- a/lib/dns/gssapictx.c +++ b/lib/dns/gssapictx.c @@ -61,6 +61,8 @@ #include "dst_internal.h" +#if HAVE_GSSAPI + #ifndef GSS_KRB5_MECHANISM static unsigned char krb5_mech_oid_bytes[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x01, 0x02, 0x02 }; @@ -831,6 +833,98 @@ gss_error_tostring(uint32_t major, uint32_t minor, char *buf, size_t buflen) { return (buf); } +#else + +isc_result_t +dst_gssapi_acquirecred(const dns_name_t *name, bool initiate, + gss_cred_id_t *cred) { + REQUIRE(cred != NULL && *cred == NULL); + + UNUSED(name); + UNUSED(initiate); + UNUSED(cred); + + return (ISC_R_NOTIMPLEMENTED); +} + +bool +dst_gssapi_identitymatchesrealmkrb5(const dns_name_t *signer, + const dns_name_t *name, + const dns_name_t *realm, bool subdomain) { + UNUSED(signer); + UNUSED(name); + UNUSED(realm); + UNUSED(subdomain); + + return (false); +} + +bool +dst_gssapi_identitymatchesrealmms(const dns_name_t *signer, + const dns_name_t *name, + const dns_name_t *realm, bool subdomain) { + UNUSED(signer); + UNUSED(name); + UNUSED(realm); + UNUSED(subdomain); + + return (false); +} + +isc_result_t +dst_gssapi_releasecred(gss_cred_id_t *cred) { + UNUSED(cred); + + return (ISC_R_NOTIMPLEMENTED); +} + +isc_result_t +dst_gssapi_initctx(const dns_name_t *name, isc_buffer_t *intoken, + isc_buffer_t *outtoken, gss_ctx_id_t *gssctx, + isc_mem_t *mctx, char **err_message) { + UNUSED(name); + UNUSED(intoken); + UNUSED(outtoken); + UNUSED(gssctx); + UNUSED(mctx); + UNUSED(err_message); + + return (ISC_R_NOTIMPLEMENTED); +} + +isc_result_t +dst_gssapi_acceptctx(gss_cred_id_t cred, const char *gssapi_keytab, + isc_region_t *intoken, isc_buffer_t **outtoken, + gss_ctx_id_t *ctxout, dns_name_t *principal, + isc_mem_t *mctx) { + UNUSED(cred); + UNUSED(gssapi_keytab); + UNUSED(intoken); + UNUSED(outtoken); + UNUSED(ctxout); + UNUSED(principal); + UNUSED(mctx); + + return (ISC_R_NOTIMPLEMENTED); +} + +isc_result_t +dst_gssapi_deletectx(isc_mem_t *mctx, gss_ctx_id_t *gssctx) { + UNUSED(mctx); + UNUSED(gssctx); + return (ISC_R_NOTIMPLEMENTED); +} + +char * +gss_error_tostring(uint32_t major, uint32_t minor, char *buf, size_t buflen) { + snprintf(buf, buflen, "GSSAPI error: Major = %u, Minor = %u.", major, + minor); + + return (buf); +} + +#endif + void gss_log(int level, const char *fmt, ...) { va_list ap; @@ -840,5 +934,3 @@ gss_log(int level, const char *fmt, ...) { ISC_LOG_DEBUG(level), fmt, ap); va_end(ap); } - -/*! \file */ diff --git a/lib/dns/win32/libdns.vcxproj.filters.in b/lib/dns/win32/libdns.vcxproj.filters.in index 4608114871..5ba61623f0 100644 --- a/lib/dns/win32/libdns.vcxproj.filters.in +++ b/lib/dns/win32/libdns.vcxproj.filters.in @@ -284,9 +284,11 @@ Dst Source Files +@IF GSSAPI Dst Source Files +@END GSSAPI Dst Source Files @@ -325,9 +327,6 @@ Dst Source Files @END PKCS11 - - Dst Source Files - @@ -655,8 +654,5 @@ Dst Header Files @END PKCS11 - - Dst Header Files - diff --git a/lib/dns/win32/libdns.vcxproj.in b/lib/dns/win32/libdns.vcxproj.in index 20b06f1de2..b169789f31 100644 --- a/lib/dns/win32/libdns.vcxproj.in +++ b/lib/dns/win32/libdns.vcxproj.in @@ -59,7 +59,7 @@ Level4 false Disabled - BIND9;WIN32;@USE_GSSAPI@@USE_ISC_SPNEGO@_DEBUG;_WINDOWS;_USRDLL;LIBDNS_EXPORTS;%(PreprocessorDefinitions);%(PreprocessorDefinitions);%(PreprocessorDefinitions) + BIND9;WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBDNS_EXPORTS;%(PreprocessorDefinitions);%(PreprocessorDefinitions);%(PreprocessorDefinitions) ..\..\..\config.h .\;..\..\..\;include;..\include;..\..\isc;..\..\isc\win32;..\..\isc\win32\include;..\..\isc\include;@LIBXML2_INC@@OPENSSL_INC@@GSSAPI_INC@@GEOIP_INC@%(AdditionalIncludeDirectories) true @@ -89,7 +89,7 @@ MaxSpeed true @INTRINSIC@ - BIND9;WIN32;@USE_GSSAPI@@USE_ISC_SPNEGO@NDEBUG;_WINDOWS;_USRDLL;LIBDNS_EXPORTS;%(PreprocessorDefinitions);%(PreprocessorDefinitions);%(PreprocessorDefinitions) + BIND9;WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBDNS_EXPORTS;%(PreprocessorDefinitions);%(PreprocessorDefinitions);%(PreprocessorDefinitions) ..\..\..\config.h .\;..\..\..\;include;..\include;..\..\isc;..\..\isc\win32;..\..\isc\win32\include;..\..\isc\include;@LIBXML2_INC@@OPENSSL_INC@@GSSAPI_INC@@GEOIP_INC@%(AdditionalIncludeDirectories) OnlyExplicitInline @@ -148,7 +148,9 @@ @END GEOIP +@IF GSSAPI +@END GSSAPI @@ -202,7 +204,6 @@ - @@ -336,7 +337,6 @@ - diff --git a/lib/ns/win32/libns.vcxproj.in b/lib/ns/win32/libns.vcxproj.in index 125699e16e..8d2073c6bb 100644 --- a/lib/ns/win32/libns.vcxproj.in +++ b/lib/ns/win32/libns.vcxproj.in @@ -58,7 +58,7 @@ Level4 false Disabled - WIN32;@USE_GSSAPI@_DEBUG;_USRDLL;LIBNS_EXPORTS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_USRDLL;LIBNS_EXPORTS;%(PreprocessorDefinitions) ..\..\..\config.h .\;..\..\..\;include;..\include;..\..\isc\win32;..\..\isc\win32\include;..\..\isc\include;..\..\..\lib\dns\include;@LIBXML2_INC@@OPENSSL_INC@@GSSAPI_INC@@GEOIP_INC@%(AdditionalIncludeDirectories) true @@ -88,7 +88,7 @@ MaxSpeed true @INTRINSIC@ - WIN32;@USE_GSSAPI@NDEBUG;_USRDLL;LIBNS_EXPORTS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_USRDLL;LIBNS_EXPORTS;%(PreprocessorDefinitions) ..\..\..\config.h .\;..\..\..\;include;..\include;..\..\isc\win32;..\..\isc\win32\include;..\..\isc\include;..\..\..\lib\dns\include;@LIBXML2_INC@@OPENSSL_INC@@GSSAPI_INC@@GEOIP_INC@%(AdditionalIncludeDirectories) OnlyExplicitInline diff --git a/util/copyrights b/util/copyrights index 119596c90b..2246d58bb3 100644 --- a/util/copyrights +++ b/util/copyrights @@ -1308,7 +1308,6 @@ ./lib/dns/gen.c C 1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2012,2013,2014,2015,2016,2017,2018,2019,2020 ./lib/dns/geoip2.c C 2019,2020 ./lib/dns/gssapi_link.c C 2000,2001,2002,2004,2005,2006,2007,2008,2009,2011,2012,2013,2014,2015,2016,2018,2019,2020 -./lib/dns/gssapictx-dummy.c C 2020 ./lib/dns/gssapictx.c C 2000,2001,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020 ./lib/dns/hmac_link.c C.NAI 1999,2000,2001,2002,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020 ./lib/dns/include/dns/acl.h C 1999,2000,2001,2002,2004,2005,2006,2007,2009,2011,2013,2014,2016,2017,2018,2019,2020 diff --git a/win32utils/Configure b/win32utils/Configure index f15680f400..871ec3d7b3 100644 --- a/win32utils/Configure +++ b/win32utils/Configure @@ -176,6 +176,13 @@ my %configdefh; my @substdefh = ("PACKAGE_CONFIGARGS", "DNS_RDATASET_FIXED", "HAVE_GEOIP2", + "HAVE_GSSAPI", + "HAVE_GSSAPI_H", + "HAVE_GSSAPI_KRB5_H", + "HAVE_KRB5_H", + "HAVE_GSSAPI_GSSAPI_H", + "HAVE_GSSAPI_GSSAPI_KRB5_H", + "HAVE_KRB5_KRB5_H", "HAVE_LIBXML2", "HAVE_OPENSSL_ED25519", "HAVE_OPENSSL_ED448", @@ -303,9 +310,7 @@ my @substvar = ("BIND9_VERSION", my %configdefd; my @substdefd = ("PK11_LIB_LOCATION", - "USE_GSSAPI", - "USE_PYTHON", - "USE_ISC_SPNEGO"); + "USE_PYTHON"); # conditions @@ -334,7 +339,6 @@ my @allcond = (@substcond, "NOTYET", "NOLONGER"); my @enablelist = ("developer", "fixed-rrset", "intrinsics", - "isc-spnego", "native-pkcs11", "openssl-hash", "querytrace"); @@ -388,7 +392,6 @@ my @help = ( " enable-intrinsics enable intrinsic/atomic functions [default=yes]\n", " enable-native-pkcs11 use native PKCS#11 for all crypto [default=no]\n", " enable-openssl-hash use OpenSSL for hash functions [default=yes]\n", -" enable-isc-spnego use SPNEGO from lib/dns [default=yes]\n", " enable-fixed-rrset enable fixed rrset ordering [default=no]\n", " enable-developer enable developer build settings [default=no]\n", " enable-querytrace enable very verbose query trace [default=no]\n", @@ -431,7 +434,6 @@ my $enable_intrinsics = "yes"; my $cryptolib = ""; my $enable_native_pkcs11 = "no"; my $enable_crypto_rand = "yes"; -my $enable_isc_spnego = "yes"; my $enable_fixed_rrset = "no"; my $enable_developer = "no"; my $enable_querytrace = "no"; @@ -642,10 +644,6 @@ sub myenable { if ($val =~ /^yes$/i) { $enable_native_pkcs11 = "yes"; } - } elsif ($key =~ /^isc-spnego$/i) { - if ($val =~ /^no$/i) { - $enable_isc_spnego = "no"; - } } elsif ($key =~ /^fixed-rrset$/i) { if ($val =~ /^yes$/i) { $enable_fixed_rrset = "yes"; @@ -896,11 +894,6 @@ if ($verbose) { print "native-pkcs11: disabled\n"; } print "openssl-hash: enabled\n"; - if ($enable_isc_spnego eq "yes") { - print "isc-spnego: enabled\n"; - } else { - print "isc-spnego: disabled\n"; - } if ($enable_fixed_rrset eq "yes") { print "fixed-rrset: enabled\n"; } else { @@ -1630,18 +1623,33 @@ if ($use_gssapi eq "no") { if ($verbose) { print "checking for gssapi directory at \"$gssapi_path\"\n"; } - $configcond{"GSSAPI"} = 1; - $configdefd{"USE_GSSAPI"} = "GSSAPI"; - if (!-f File::Spec->catfile($gssapi_path, "include", + $configcond{"GEOIP"} = 1; + $configdefh{"HAVE_GSSAPI"} = 1; + if (-f File::Spec->catfile($gssapi_path, "include", "gssapi", "gssapi.h")) { - die "can't find gssapi.h include\n"; + $configdefh{"HAVE_GSSAPI_GSSAPI_H"} = 1; + } elsif (-f File::Spec->catfile($gssapi_path, "include", + "gssapi", "gssapi.h")) { + $configdefh{"HAVE_GSSAPI_H"} = 1; + } else { + die "can't find gssapi.h include\n"; } - if (!-f File::Spec->catfile($gssapi_path, "include", + if (-f File::Spec->catfile($gssapi_path, "include", "gssapi", "gssapi_krb5.h")) { + $configdefh{"HAVE_GSSAPI_GSSAPI_KRB5_H"} = 1; + } elsif (-f File::Spec->catfile($gssapi_path, "include", + "gssapi_krb5.h")) { + $configdefh{"HAVE_GSSAPI_KRB5_H"} = 1; + } else { die "can't find gssapi_krb5.h include\n"; } - if (!-f File::Spec->catfile($gssapi_path, "include", + if (-f File::Spec->catfile($gssapi_path, "include", "krb5", "krb5.h")) { + $configdefh{"HAVE_KRB5_KRB5_H"} = 1; + } elsif (-f File::Spec->catfile($gssapi_path, "include", + "krb5", "krb5.h")) { + $configdefh{"HAVE_KRB5_H"} = 1; + } else { die "can't find krb5.h include\n"; } $configinc{"GSSAPI_INC"} = File::Spec->catdir($gssapi_path, "include"); @@ -1713,16 +1721,6 @@ if ($use_gssapi eq "no") { $configdll{"WSHELP_DLL"} = "$wshelp_dll"; } -# enable-isc-spnego -if ($use_gssapi ne "yes") { - $enable_isc_spnego = "no"; -} elsif ($enable_isc_spnego eq "yes") { - if ($use_gssapi eq "no") { - die "No GSSAPI for SPNEGO\n"; - } - $configdefd{"USE_ISC_SPNEGO"} = "USE_ISC_SPNEGO"; -} - # disable-auto-validation $configdefh{"VALIDATION_DEFAULT"} = "\"$validation_default\""; @@ -2765,7 +2763,6 @@ exit 0; # --enable-symtable incompatible with DLLs (or libtool) # --enable-ipv6 included without a way to disable it # --enable-atomic supported (renamed to intrinsic) -# --enable-isc-spnego supported (part of GSSAPI) # --enable-fixed-rrset supported # --enable-querytrace supported # --enable-full-report supported by verbose