summaryrefslogtreecommitdiff
path: root/usr.sbin/bind
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2020-01-07 19:09:27 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2020-01-07 19:09:27 +0000
commit0220c039694ebfdb79758e464a432e1d8b6e7898 (patch)
tree7c84a8029cc516ecf2c5520296fecd3e870d7ae3 /usr.sbin/bind
parent2776fbe413fb180e5835cf7628eb3876894b2203 (diff)
We are not windows. Minus 500 lines.
OK millert
Diffstat (limited to 'usr.sbin/bind')
-rw-r--r--usr.sbin/bind/bin/dig/dig.c16
-rw-r--r--usr.sbin/bind/lib/dns/dst_api.c7
-rw-r--r--usr.sbin/bind/lib/dns/dst_parse.c8
-rw-r--r--usr.sbin/bind/lib/dns/gen-win32.h285
-rw-r--r--usr.sbin/bind/lib/dns/gen.c17
-rw-r--r--usr.sbin/bind/lib/dns/gssapictx.c6
-rw-r--r--usr.sbin/bind/lib/dns/include/dst/gssapi.h10
-rw-r--r--usr.sbin/bind/lib/dns/opensslrsa_link.c9
-rw-r--r--usr.sbin/bind/lib/dns/rbtdb.c7
-rw-r--r--usr.sbin/bind/lib/dns/rdata/in_1/wks_11.c25
-rw-r--r--usr.sbin/bind/lib/isc/Makefile.in5
-rw-r--r--usr.sbin/bind/lib/isc/hmacmd5.c14
-rw-r--r--usr.sbin/bind/lib/isc/include/isc/socket.h55
-rw-r--r--usr.sbin/bind/lib/isc/log.c13
-rw-r--r--usr.sbin/bind/lib/isc/md5.c12
-rw-r--r--usr.sbin/bind/lib/isc/pk11.c4
-rw-r--r--usr.sbin/bind/lib/isc/print.c10
-rw-r--r--usr.sbin/bind/lib/isc/safe.c8
-rw-r--r--usr.sbin/bind/lib/isc/sha2.c83
-rw-r--r--usr.sbin/bind/lib/isc/task.c3
-rw-r--r--usr.sbin/bind/lib/isc/timer.c5
21 files changed, 13 insertions, 589 deletions
diff --git a/usr.sbin/bind/bin/dig/dig.c b/usr.sbin/bind/bin/dig/dig.c
index 04a93745496..a9a5dfbc2bb 100644
--- a/usr.sbin/bind/bin/dig/dig.c
+++ b/usr.sbin/bind/bin/dig/dig.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dig.c,v 1.29 2020/01/07 19:08:09 florian Exp $ */
+/* $Id: dig.c,v 1.30 2020/01/07 19:09:26 florian Exp $ */
/*! \file */
@@ -194,11 +194,7 @@ received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
isc_uint64_t diff;
time_t tnow;
struct tm tmnow;
-#ifdef WIN32
- wchar_t time_str[100];
-#else
char time_str[100];
-#endif
char fromtext[ISC_SOCKADDR_FORMATSIZE];
isc_sockaddr_format(from, fromtext, sizeof(fromtext));
@@ -213,19 +209,9 @@ received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
time(&tnow);
tmnow = *localtime(&tnow);
-#ifdef WIN32
- /*
- * On Windows, time zone name ("%Z") may be a localized
- * wide-character string, which strftime() handles incorrectly.
- */
- if (wcsftime(time_str, sizeof(time_str)/sizeof(time_str[0]),
- L"%a %b %d %H:%M:%S %Z %Y", &tmnow) > 0U)
- printf(";; WHEN: %ls\n", time_str);
-#else
if (strftime(time_str, sizeof(time_str),
"%a %b %d %H:%M:%S %Z %Y", &tmnow) > 0U)
printf(";; WHEN: %s\n", time_str);
-#endif
if (query->lookup->doing_xfr) {
printf(";; XFR size: %u records (messages %u, "
"bytes %" ISC_PRINT_QUADFORMAT "u)\n",
diff --git a/usr.sbin/bind/lib/dns/dst_api.c b/usr.sbin/bind/lib/dns/dst_api.c
index 41a5524c6b7..46e34e54b6f 100644
--- a/usr.sbin/bind/lib/dns/dst_api.c
+++ b/usr.sbin/bind/lib/dns/dst_api.c
@@ -33,7 +33,7 @@
/*
* Principal Author: Brian Wellington
- * $Id: dst_api.c,v 1.8 2020/01/07 19:08:09 florian Exp $
+ * $Id: dst_api.c,v 1.9 2020/01/07 19:09:26 florian Exp $
*/
/*! \file */
@@ -598,13 +598,8 @@ dst_key_fromnamedfile(const char *filename, const char *dirname,
REQUIRE(keyp != NULL && *keyp == NULL);
/* If an absolute path is specified, don't use the key directory */
-#ifndef WIN32
if (filename[0] == '/')
dirname = NULL;
-#else /* WIN32 */
- if (filename[0] == '/' || filename[0] == '\\')
- dirname = NULL;
-#endif
newfilenamelen = strlen(filename) + 5;
if (dirname != NULL)
diff --git a/usr.sbin/bind/lib/dns/dst_parse.c b/usr.sbin/bind/lib/dns/dst_parse.c
index 78d5f9e2750..6c2ac5844a5 100644
--- a/usr.sbin/bind/lib/dns/dst_parse.c
+++ b/usr.sbin/bind/lib/dns/dst_parse.c
@@ -33,7 +33,7 @@
/*%
* Principal Author: Brian Wellington
- * $Id: dst_parse.c,v 1.3 2019/12/17 01:46:31 sthen Exp $
+ * $Id: dst_parse.c,v 1.4 2020/01/07 19:09:26 florian Exp $
*/
#include <config.h>
@@ -708,13 +708,7 @@ dst__privstruct_writefile(const dst_key_t *key, const dst_private_t *priv,
/* File exists; warn that we are changing its permissions */
int level;
-#ifdef _WIN32
- /* Windows security model is pretty different,
- * e.g., there is no umask... */
- level = ISC_LOG_NOTICE;
-#else
level = ISC_LOG_WARNING;
-#endif
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_DNSSEC, level,
"Permissions on the file %s "
diff --git a/usr.sbin/bind/lib/dns/gen-win32.h b/usr.sbin/bind/lib/dns/gen-win32.h
deleted file mode 100644
index e0c3934400a..00000000000
--- a/usr.sbin/bind/lib/dns/gen-win32.h
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
- * Copyright (c) 1987, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $Id: gen-win32.h,v 1.6 2019/12/17 01:46:31 sthen Exp $ */
-
-/*! \file
- * \author Principal Authors: Computer Systems Research Group at UC Berkeley
- * \author Principal ISC caretaker: DCL
- */
-
-/*
- * \note This file was adapted from the NetBSD project's source tree, RCS ID:
- * NetBSD: getopt.c,v 1.15 1999/09/20 04:39:37 lukem Exp
- *
- * The primary change has been to rename items to the ISC namespace
- * and format in the ISC coding style.
- *
- * This file is responsible for defining two operations that are not
- * directly portable between Unix-like systems and Windows NT, option
- * parsing and directory scanning. It is here because it was decided
- * that the "gen" build utility was not to depend on libisc.a, so
- * the functions declared in isc/commandline.h and isc/dir.h could not
- * be used.
- *
- * The commandline stuff is pretty much a straight copy from the initial
- * isc/commandline.c. The dir stuff was shrunk to fit the needs of gen.c.
- */
-
-#ifndef DNS_GEN_WIN32_H
-#define DNS_GEN_WIN32_H 1
-
-#include <stdio.h>
-#include <string.h>
-#include <windows.h>
-
-#include <isc/boolean.h>
-#include <isc/lang.h>
-
-int isc_commandline_index = 1; /* Index into parent argv vector. */
-int isc_commandline_option; /* Character checked for validity. */
-
-char *isc_commandline_argument; /* Argument associated with option. */
-char *isc_commandline_progname; /* For printing error messages. */
-
-isc_boolean_t isc_commandline_errprint = ISC_TRUE; /* Print error messages. */
-isc_boolean_t isc_commandline_reset = ISC_TRUE; /* Reset processing. */
-
-#define BADOPT '?'
-#define BADARG ':'
-#define ENDOPT ""
-
-ISC_LANG_BEGINDECLS
-
-/*
- * getopt --
- * Parse argc/argv argument vector.
- */
-int
-isc_commandline_parse(int argc, char * const *argv, const char *options) {
- static char *place = ENDOPT;
- char *option; /* Index into *options of option. */
-
- /*
- * Update scanning pointer, either because a reset was requested or
- * the previous argv was finished.
- */
- if (isc_commandline_reset || *place == '\0') {
- isc_commandline_reset = ISC_FALSE;
-
- if (isc_commandline_progname == NULL)
- isc_commandline_progname = argv[0];
-
- if (isc_commandline_index >= argc ||
- *(place = argv[isc_commandline_index]) != '-') {
- /*
- * Index out of range or points to non-option.
- */
- place = ENDOPT;
- return (-1);
- }
-
- if (place[1] != '\0' && *++place == '-' && place[1] == '\0') {
- /*
- * Found '--' to signal end of options. Advance
- * index to next argv, the first non-option.
- */
- isc_commandline_index++;
- place = ENDOPT;
- return (-1);
- }
- }
-
- isc_commandline_option = *place++;
- option = strchr(options, isc_commandline_option);
-
- /*
- * Ensure valid option has been passed as specified by options string.
- * '-:' is never a valid command line option because it could not
- * distinguish ':' from the argument specifier in the options string.
- */
- if (isc_commandline_option == ':' || option == NULL) {
- if (*place == '\0')
- isc_commandline_index++;
-
- if (isc_commandline_errprint && *options != ':')
- fprintf(stderr, "%s: illegal option -- %c\n",
- isc_commandline_progname,
- isc_commandline_option);
-
- return (BADOPT);
- }
-
- if (*++option != ':') {
- /*
- * Option does not take an argument.
- */
- isc_commandline_argument = NULL;
-
- /*
- * Skip to next argv if at the end of the current argv.
- */
- if (*place == '\0')
- ++isc_commandline_index;
-
- } else {
- /*
- * Option needs an argument.
- */
- if (*place != '\0')
- /*
- * Option is in this argv, -D1 style.
- */
- isc_commandline_argument = place;
-
- else if (argc > ++isc_commandline_index)
- /*
- * Option is next argv, -D 1 style.
- */
- isc_commandline_argument = argv[isc_commandline_index];
-
- else {
- /*
- * Argument needed, but no more argv.
- */
- place = ENDOPT;
-
- /*
- * Silent failure with "missing argument" return
- * when ':' starts options string, per historical spec.
- */
- if (*options == ':')
- return (BADARG);
-
- if (isc_commandline_errprint)
- fprintf(stderr,
- "%s: option requires an argument -- %c\n",
- isc_commandline_progname,
- isc_commandline_option);
-
- return (BADOPT);
- }
-
- place = ENDOPT;
-
- /*
- * Point to argv that follows argument.
- */
- isc_commandline_index++;
- }
-
- return (isc_commandline_option);
-}
-
-typedef struct {
- HANDLE handle;
- WIN32_FIND_DATA find_data;
- isc_boolean_t first_file;
- char *filename;
-} isc_dir_t;
-
-isc_boolean_t
-start_directory(const char *path, isc_dir_t *dir) {
- char pattern[_MAX_PATH], *p;
-
- /*
- * Need space for slash-splat and final NUL.
- */
- if (strlen(path) + 3 > sizeof(pattern))
- return (ISC_FALSE);
-
- strcpy(pattern, path);
-
- /*
- * Append slash (if needed) and splat.
- */
- p = pattern + strlen(pattern);
- if (p != pattern && p[-1] != '\\' && p[-1] != ':')
- *p++ = '\\';
- *p++ = '*';
- *p++ = '\0';
-
- dir->first_file = ISC_TRUE;
-
- dir->handle = FindFirstFile(pattern, &dir->find_data);
-
- if (dir->handle == INVALID_HANDLE_VALUE) {
- dir->filename = NULL;
- return (ISC_FALSE);
- } else {
- dir->filename = dir->find_data.cFileName;
- return (ISC_TRUE);
- }
-}
-
-isc_boolean_t
-next_file(isc_dir_t *dir) {
- if (dir->first_file)
- dir->first_file = ISC_FALSE;
-
- else if (dir->handle != INVALID_HANDLE_VALUE) {
- if (FindNextFile(dir->handle, &dir->find_data) == TRUE)
- dir->filename = dir->find_data.cFileName;
- else
- dir->filename = NULL;
-
- } else
- dir->filename = NULL;
-
- if (dir->filename != NULL)
- return (ISC_TRUE);
- else
- return (ISC_FALSE);
-}
-
-void
-end_directory(isc_dir_t *dir) {
- if (dir->handle != INVALID_HANDLE_VALUE)
- FindClose(dir->handle);
-}
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_GEN_WIN32_H */
diff --git a/usr.sbin/bind/lib/dns/gen.c b/usr.sbin/bind/lib/dns/gen.c
index 6a20a6ad7c3..19fd92a50a0 100644
--- a/usr.sbin/bind/lib/dns/gen.c
+++ b/usr.sbin/bind/lib/dns/gen.c
@@ -16,19 +16,6 @@
/*! \file */
-#ifdef WIN32
-/*
- * Silence compiler warnings about using strcpy and friends.
- */
-#define _CRT_SECURE_NO_DEPRECATE 1
-/*
- * We use snprintf which was defined late in Windows even it is in C99.
- */
-#if _MSC_VER < 1900
-#define snprintf _snprintf
-#endif
-#endif
-
#include <sys/types.h>
#include <ctype.h>
@@ -38,11 +25,7 @@
#include <string.h>
#include <time.h>
-#ifdef WIN32
-#include "gen-win32.h"
-#else
#include "gen-unix.h"
-#endif
#define INSIST(cond) \
if (!(cond)) { \
diff --git a/usr.sbin/bind/lib/dns/gssapictx.c b/usr.sbin/bind/lib/dns/gssapictx.c
index ab4d7122f3a..88c947d3e86 100644
--- a/usr.sbin/bind/lib/dns/gssapictx.c
+++ b/usr.sbin/bind/lib/dns/gssapictx.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: gssapictx.c,v 1.3 2019/12/17 01:46:31 sthen Exp $ */
+/* $Id: gssapictx.c,v 1.4 2020/01/07 19:09:26 florian Exp $ */
#include <config.h>
@@ -68,11 +68,7 @@
* we include SPNEGO's OID.
*/
#ifdef GSSAPI
-#ifdef WIN32
-#include <krb5/krb5.h>
-#else
#include ISC_PLATFORM_KRB5HEADER
-#endif
static unsigned char krb5_mech_oid_bytes[] = {
0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x01, 0x02, 0x02
diff --git a/usr.sbin/bind/lib/dns/include/dst/gssapi.h b/usr.sbin/bind/lib/dns/include/dst/gssapi.h
index 84437813e17..41a2d4ae22c 100644
--- a/usr.sbin/bind/lib/dns/include/dst/gssapi.h
+++ b/usr.sbin/bind/lib/dns/include/dst/gssapi.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: gssapi.h,v 1.3 2019/12/17 01:46:33 sthen Exp $ */
+/* $Id: gssapi.h,v 1.4 2020/01/07 19:09:26 florian Exp $ */
#ifndef DST_GSSAPI_H
#define DST_GSSAPI_H 1
@@ -28,18 +28,10 @@
#include <dns/types.h>
#ifdef GSSAPI
-#ifdef WIN32
-/*
- * MSVC does not like macros in #include lines.
- */
-#include <gssapi/gssapi.h>
-#include <gssapi/gssapi_krb5.h>
-#else
#include ISC_PLATFORM_GSSAPIHEADER
#ifdef ISC_PLATFORM_GSSAPI_KRB5_HEADER
#include ISC_PLATFORM_GSSAPI_KRB5_HEADER
#endif
-#endif
#ifndef GSS_SPNEGO_MECHANISM
#define GSS_SPNEGO_MECHANISM ((void*)0)
#endif
diff --git a/usr.sbin/bind/lib/dns/opensslrsa_link.c b/usr.sbin/bind/lib/dns/opensslrsa_link.c
index 29de1079927..7612d6910ae 100644
--- a/usr.sbin/bind/lib/dns/opensslrsa_link.c
+++ b/usr.sbin/bind/lib/dns/opensslrsa_link.c
@@ -67,15 +67,6 @@
* We don't use configure for windows so enforce the OpenSSL version
* here. Unlike with configure we don't support overriding this test.
*/
-#ifdef WIN32
-#if !((OPENSSL_VERSION_NUMBER >= 0x009070cfL && \
- OPENSSL_VERSION_NUMBER < 0x00908000L) || \
- (OPENSSL_VERSION_NUMBER >= 0x0090804fL && \
- OPENSSL_VERSION_NUMBER < 0x10002000L) || \
- OPENSSL_VERSION_NUMBER >= 0x1000205fL)
-#error Please upgrade OpenSSL to 0.9.8d/0.9.7l or greater.
-#endif
-#endif
/*
diff --git a/usr.sbin/bind/lib/dns/rbtdb.c b/usr.sbin/bind/lib/dns/rbtdb.c
index c7d5d0fd48a..02a2995a472 100644
--- a/usr.sbin/bind/lib/dns/rbtdb.c
+++ b/usr.sbin/bind/lib/dns/rbtdb.c
@@ -75,14 +75,7 @@
#include <dns/zone.h>
#include <dns/zonekey.h>
-#ifndef WIN32
#include <sys/mman.h>
-#else
-#define PROT_READ 0x01
-#define PROT_WRITE 0x02
-#define MAP_PRIVATE 0x0002
-#define MAP_FAILED ((void *)-1)
-#endif
#ifdef DNS_RBTDB_VERSION64
#include "rbtdb64.h"
diff --git a/usr.sbin/bind/lib/dns/rdata/in_1/wks_11.c b/usr.sbin/bind/lib/dns/rdata/in_1/wks_11.c
index cd28f18ac31..871e17e0490 100644
--- a/usr.sbin/bind/lib/dns/rdata/in_1/wks_11.c
+++ b/usr.sbin/bind/lib/dns/rdata/in_1/wks_11.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: wks_11.c,v 1.7 2019/12/17 01:46:34 sthen Exp $ */
+/* $Id: wks_11.c,v 1.8 2020/01/07 19:09:26 florian Exp $ */
/* Reviewed: Fri Mar 17 15:01:49 PST 2000 by explorer */
@@ -70,12 +70,6 @@ mygetservbyname(const char *name, const char *proto, long *port) {
return (ISC_TF(se != NULL));
}
-#ifdef _WIN32
-#include <windows.h>
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#endif
-
static inline isc_result_t
fromtext_in_wks(ARGS_FROMTEXT) {
static isc_once_t once = ISC_ONCE_INIT;
@@ -103,20 +97,6 @@ fromtext_in_wks(ARGS_FROMTEXT) {
RUNTIME_CHECK(isc_once_do(&once, init_lock) == ISC_R_SUCCESS);
-#ifdef _WIN32
- {
- WORD wVersionRequested;
- WSADATA wsaData;
- int err;
-
- wVersionRequested = MAKEWORD(2, 0);
-
- err = WSAStartup(wVersionRequested, &wsaData );
- if (err != 0)
- return (ISC_R_FAILURE);
- }
-#endif
-
/*
* IPv4 dotted quad.
*/
@@ -192,9 +172,6 @@ fromtext_in_wks(ARGS_FROMTEXT) {
result = mem_tobuffer(target, bm, n);
cleanup:
-#ifdef _WIN32
- WSACleanup();
-#endif
return (result);
}
diff --git a/usr.sbin/bind/lib/isc/Makefile.in b/usr.sbin/bind/lib/isc/Makefile.in
index 9fc1df7f998..4ac3e23202d 100644
--- a/usr.sbin/bind/lib/isc/Makefile.in
+++ b/usr.sbin/bind/lib/isc/Makefile.in
@@ -46,11 +46,6 @@ THREADOPTOBJS = nothreads/condition.@O@ nothreads/mutex.@O@
THREADOBJS = nothreads/thread.@O@
-WIN32OBJS = win32/condition.@O@ win32/dir.@O@ win32/errno.@O@ \
- win32/file.@O@ win32/fsaccess.@O@ \
- win32/once.@O@ win32/stdtime.@O@ \
- win32/thread.@O@ win32/time.@O@
-
# Alphabetically
OBJS = @ISC_EXTRA_OBJS@ @ISC_PK11_O@ @ISC_PK11_RESULT_O@ \
aes.@O@ assertions.@O@ backtrace.@O@ base32.@O@ base64.@O@ \
diff --git a/usr.sbin/bind/lib/isc/hmacmd5.c b/usr.sbin/bind/lib/isc/hmacmd5.c
index 4700cf58f91..6cd9fc43aeb 100644
--- a/usr.sbin/bind/lib/isc/hmacmd5.c
+++ b/usr.sbin/bind/lib/isc/hmacmd5.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: hmacmd5.c,v 1.3 2019/12/17 01:46:34 sthen Exp $ */
+/* $Id: hmacmd5.c,v 1.4 2020/01/07 19:09:26 florian Exp $ */
/*! \file
* This code implements the HMAC-MD5 keyed hash algorithm
@@ -411,16 +411,4 @@ isc_hmacmd5_check(int testing) {
}
#else /* !PK11_MD5_DISABLE */
-#ifdef WIN32
-/* Make the Visual Studio linker happy */
-#include <isc/util.h>
-
-void isc_hmacmd5_init() { INSIST(0); }
-void isc_hmacmd5_invalidate() { INSIST(0); }
-void isc_hmacmd5_sign() { INSIST(0); }
-void isc_hmacmd5_update() { INSIST(0); }
-void isc_hmacmd5_verify() { INSIST(0); }
-void isc_hmacmd5_verify2() { INSIST(0); }
-void isc_hmacmd5_check() { INSIST(0); }
-#endif
#endif /* PK11_MD5_DISABLE */
diff --git a/usr.sbin/bind/lib/isc/include/isc/socket.h b/usr.sbin/bind/lib/isc/include/isc/socket.h
index 5cfc93b42b0..3e52735f08d 100644
--- a/usr.sbin/bind/lib/isc/include/isc/socket.h
+++ b/usr.sbin/bind/lib/isc/include/isc/socket.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: socket.h,v 1.7 2019/12/17 01:46:35 sthen Exp $ */
+/* $Id: socket.h,v 1.8 2020/01/07 19:09:26 florian Exp $ */
#ifndef ISC_SOCKET_H
#define ISC_SOCKET_H 1
@@ -66,55 +66,6 @@
#include <isc/types.h>
#include <isc/xml.h>
-#ifdef WIN32
-
-/* from the old namespace.h */
-
-#define isc_socket_create isc__socket_create
-#define isc_socket_dup isc__socket_dup
-#define isc_socket_attach isc__socket_attach
-#define isc_socket_detach isc__socket_detach
-#define isc_socketmgr_create isc__socketmgr_create
-#define isc_socketmgr_create2 isc__socketmgr_create2
-#define isc_socketmgr_destroy isc__socketmgr_destroy
-#define isc_socket_open isc__socket_open
-#define isc_socket_close isc__socket_close
-#define isc_socket_recvv isc__socket_recvv
-#define isc_socket_recv isc__socket_recv
-#define isc_socket_recv2 isc__socket_recv2
-#define isc_socket_send isc__socket_send
-#define isc_socket_sendto isc__socket_sendto
-#define isc_socket_sendv isc__socket_sendv
-#define isc_socket_sendtov isc__socket_sendtov
-#define isc_socket_sendtov2 isc__socket_sendtov2
-#define isc_socket_sendto2 isc__socket_sendto2
-#define isc_socket_cleanunix isc__socket_cleanunix
-#define isc_socket_permunix isc__socket_permunix
-#define isc_socket_bind isc__socket_bind
-#define isc_socket_filter isc__socket_filter
-#define isc_socket_listen isc__socket_listen
-#define isc_socket_accept isc__socket_accept
-#define isc_socket_connect isc__socket_connect
-#define isc_socket_getfd isc__socket_getfd
-#define isc_socket_getname isc__socket_getname
-#define isc_socket_gettag isc__socket_gettag
-#define isc_socket_getpeername isc__socket_getpeername
-#define isc_socket_getsockname isc__socket_getsockname
-#define isc_socket_cancel isc__socket_cancel
-#define isc_socket_gettype isc__socket_gettype
-#define isc_socket_isbound isc__socket_isbound
-#define isc_socket_ipv6only isc__socket_ipv6only
-#define isc_socket_setname isc__socket_setname
-#define isc_socketmgr_getmaxsockets isc__socketmgr_getmaxsockets
-#define isc_socketmgr_setstats isc__socketmgr_setstats
-#define isc_socketmgr_setreserved isc__socketmgr_setreserved
-#define isc__socketmgr_maxudp isc___socketmgr_maxudp
-#define isc_socket_fdwatchcreate isc__socket_fdwatchcreate
-#define isc_socket_fdwatchpoke isc__socket_fdwatchpoke
-#define isc_socket_dscp isc__socket_dscp
-
-#endif
-
ISC_LANG_BEGINDECLS
/***
@@ -390,13 +341,11 @@ typedef struct isc_socketmethods {
* the definition conflict with win32/socket.c, we enable this definition only
* for non-Win32 (i.e. Unix) platforms.
*/
-#ifndef WIN32
struct isc_socketmgr {
unsigned int impmagic;
unsigned int magic;
isc_socketmgrmethods_t *methods;
};
-#endif
#define ISCAPI_SOCKETMGR_MAGIC ISC_MAGIC('A','s','m','g')
#define ISCAPI_SOCKETMGR_VALID(m) ((m) != NULL && \
@@ -406,13 +355,11 @@ struct isc_socketmgr {
* This is the common prefix of a socket object. The same note as
* that for the socketmgr structure applies.
*/
-#ifndef WIN32
struct isc_socket {
unsigned int impmagic;
unsigned int magic;
isc_socketmethods_t *methods;
};
-#endif
#define ISCAPI_SOCKET_MAGIC ISC_MAGIC('A','s','c','t')
#define ISCAPI_SOCKET_VALID(s) ((s) != NULL && \
diff --git a/usr.sbin/bind/lib/isc/log.c b/usr.sbin/bind/lib/isc/log.c
index da8be20b293..060e436ba1f 100644
--- a/usr.sbin/bind/lib/isc/log.c
+++ b/usr.sbin/bind/lib/isc/log.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: log.c,v 1.11 2019/12/17 01:46:34 sthen Exp $ */
+/* $Id: log.c,v 1.12 2020/01/07 19:09:26 florian Exp $ */
/*! \file
* \author Principal Authors: DCL */
@@ -1150,9 +1150,6 @@ greatest_version(isc_logchannel_t *channel, int versions, int *greatestp) {
isc_dir_t dir;
isc_result_t result;
char sep = '/';
-#ifdef _WIN32
- char *bname2;
-#endif
REQUIRE(channel->type == ISC_LOG_TOFILE);
@@ -1161,14 +1158,6 @@ greatest_version(isc_logchannel_t *channel, int versions, int *greatestp) {
* with isc_mem_strdup in isc_log_createchannel.
*/
bname = strrchr(FILE_NAME(channel), sep);
-#ifdef _WIN32
- bname2 = strrchr(FILE_NAME(channel), '\\');
- if ((bname != NULL && bname2 != NULL && bname2 > bname) ||
- (bname == NULL && bname2 != NULL)) {
- bname = bname2;
- sep = '\\';
- }
-#endif
if (bname != NULL) {
*bname++ = '\0';
dirname = FILE_NAME(channel);
diff --git a/usr.sbin/bind/lib/isc/md5.c b/usr.sbin/bind/lib/isc/md5.c
index e5af8977661..531e6c15898 100644
--- a/usr.sbin/bind/lib/isc/md5.c
+++ b/usr.sbin/bind/lib/isc/md5.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: md5.c,v 1.3 2019/12/17 01:46:34 sthen Exp $ */
+/* $Id: md5.c,v 1.4 2020/01/07 19:09:26 florian Exp $ */
/*! \file
* This code implements the MD5 message-digest algorithm.
@@ -386,14 +386,4 @@ isc_md5_check(isc_boolean_t testing) {
}
#else /* !PK11_MD5_DISABLE */
-#ifdef WIN32
-/* Make the Visual Studio linker happy */
-#include <isc/util.h>
-
-void isc_md5_final() { INSIST(0); }
-void isc_md5_init() { INSIST(0); }
-void isc_md5_invalidate() { INSIST(0); }
-void isc_md5_update() { INSIST(0); }
-void isc_md5_check() { INSIST(0); }
-#endif
#endif /* PK11_MD5_DISABLE */
diff --git a/usr.sbin/bind/lib/isc/pk11.c b/usr.sbin/bind/lib/isc/pk11.c
index 85c8484a548..b7ebd961e67 100644
--- a/usr.sbin/bind/lib/isc/pk11.c
+++ b/usr.sbin/bind/lib/isc/pk11.c
@@ -124,11 +124,7 @@ static CK_C_INITIALIZE_ARGS pk11_init_args = {
#define PK11_LIB_LOCATION "unknown_provider"
#endif
-#ifndef WIN32
static const char *lib_name = PK11_LIB_LOCATION;
-#else
-static const char *lib_name = PK11_LIB_LOCATION ".dll";
-#endif
void
pk11_set_lib_name(const char *name) {
diff --git a/usr.sbin/bind/lib/isc/print.c b/usr.sbin/bind/lib/isc/print.c
index 85ca9c96631..e9f169c38d3 100644
--- a/usr.sbin/bind/lib/isc/print.c
+++ b/usr.sbin/bind/lib/isc/print.c
@@ -291,16 +291,6 @@ isc__print_printf(void (*emit)(char, void *), void *arg,
z = 1;
format++;
goto doint;
-#ifdef WIN32
- case 'I':
- /* Windows has I64 as a modifier for a quad. */
- if (format[1] == '6' && format[2] == '4') {
- q = 1;
- format += 3;
- goto doint;
- }
- continue;
-#endif
case 'n':
case 'i':
case 'd':
diff --git a/usr.sbin/bind/lib/isc/safe.c b/usr.sbin/bind/lib/isc/safe.c
index 92f41c29862..07d8eb9674b 100644
--- a/usr.sbin/bind/lib/isc/safe.c
+++ b/usr.sbin/bind/lib/isc/safe.c
@@ -22,10 +22,6 @@
#include <isc/string.h>
#include <isc/util.h>
-#ifdef WIN32
-#include <windows.h>
-#endif
-
#ifdef _MSC_VER
#pragma optimize("", off)
#endif
@@ -76,9 +72,7 @@ isc_safe_memwipe(void *ptr, size_t len) {
if (ISC_UNLIKELY(ptr == NULL || len == 0))
return;
-#ifdef WIN32
- SecureZeroMemory(ptr, len);
-#elif HAVE_EXPLICIT_BZERO
+#if HAVE_EXPLICIT_BZERO
explicit_bzero(ptr, len);
#else
memset(ptr, 0, len);
diff --git a/usr.sbin/bind/lib/isc/sha2.c b/usr.sbin/bind/lib/isc/sha2.c
index db74bf9432a..ea2932567b4 100644
--- a/usr.sbin/bind/lib/isc/sha2.c
+++ b/usr.sbin/bind/lib/isc/sha2.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sha2.c,v 1.4 2019/12/17 01:46:34 sthen Exp $ */
+/* $Id: sha2.c,v 1.5 2020/01/07 19:09:26 florian Exp $ */
/* $FreeBSD: src/sys/crypto/sha2/sha2.c,v 1.2.2.2 2002/03/05 08:36:47 ume Exp $ */
/* $KAME: sha2.c,v 1.8 2001/11/08 01:07:52 itojun Exp $ */
@@ -608,16 +608,6 @@ isc_sha384_final(isc_uint8_t digest[], isc_sha384_t *context) {
tmp = (tmp >> 16) | (tmp << 16); \
(x) = ((tmp & 0xff00ff00UL) >> 8) | ((tmp & 0x00ff00ffUL) << 8); \
}
-#ifdef WIN32
-#define REVERSE64(w,x) { \
- isc_uint64_t tmp = (w); \
- tmp = (tmp >> 32) | (tmp << 32); \
- tmp = ((tmp & 0xff00ff00ff00ff00UL) >> 8) | \
- ((tmp & 0x00ff00ff00ff00ffUL) << 8); \
- (x) = ((tmp & 0xffff0000ffff0000UL) >> 16) | \
- ((tmp & 0x0000ffff0000ffffUL) << 16); \
-}
-#else
#define REVERSE64(w,x) { \
isc_uint64_t tmp = (w); \
tmp = (tmp >> 32) | (tmp << 32); \
@@ -626,7 +616,6 @@ isc_sha384_final(isc_uint8_t digest[], isc_sha384_t *context) {
(x) = ((tmp & 0xffff0000ffff0000ULL) >> 16) | \
((tmp & 0x0000ffff0000ffffULL) << 16); \
}
-#endif
#endif /* BYTE_ORDER == LITTLE_ENDIAN */
/*
@@ -728,75 +717,6 @@ static const isc_uint32_t sha256_initial_hash_value[8] = {
0x5be0cd19UL
};
-#ifdef WIN32
-/* Hash constant words K for SHA-384 and SHA-512: */
-static const isc_uint64_t K512[80] = {
- 0x428a2f98d728ae22UL, 0x7137449123ef65cdUL,
- 0xb5c0fbcfec4d3b2fUL, 0xe9b5dba58189dbbcUL,
- 0x3956c25bf348b538UL, 0x59f111f1b605d019UL,
- 0x923f82a4af194f9bUL, 0xab1c5ed5da6d8118UL,
- 0xd807aa98a3030242UL, 0x12835b0145706fbeUL,
- 0x243185be4ee4b28cUL, 0x550c7dc3d5ffb4e2UL,
- 0x72be5d74f27b896fUL, 0x80deb1fe3b1696b1UL,
- 0x9bdc06a725c71235UL, 0xc19bf174cf692694UL,
- 0xe49b69c19ef14ad2UL, 0xefbe4786384f25e3UL,
- 0x0fc19dc68b8cd5b5UL, 0x240ca1cc77ac9c65UL,
- 0x2de92c6f592b0275UL, 0x4a7484aa6ea6e483UL,
- 0x5cb0a9dcbd41fbd4UL, 0x76f988da831153b5UL,
- 0x983e5152ee66dfabUL, 0xa831c66d2db43210UL,
- 0xb00327c898fb213fUL, 0xbf597fc7beef0ee4UL,
- 0xc6e00bf33da88fc2UL, 0xd5a79147930aa725UL,
- 0x06ca6351e003826fUL, 0x142929670a0e6e70UL,
- 0x27b70a8546d22ffcUL, 0x2e1b21385c26c926UL,
- 0x4d2c6dfc5ac42aedUL, 0x53380d139d95b3dfUL,
- 0x650a73548baf63deUL, 0x766a0abb3c77b2a8UL,
- 0x81c2c92e47edaee6UL, 0x92722c851482353bUL,
- 0xa2bfe8a14cf10364UL, 0xa81a664bbc423001UL,
- 0xc24b8b70d0f89791UL, 0xc76c51a30654be30UL,
- 0xd192e819d6ef5218UL, 0xd69906245565a910UL,
- 0xf40e35855771202aUL, 0x106aa07032bbd1b8UL,
- 0x19a4c116b8d2d0c8UL, 0x1e376c085141ab53UL,
- 0x2748774cdf8eeb99UL, 0x34b0bcb5e19b48a8UL,
- 0x391c0cb3c5c95a63UL, 0x4ed8aa4ae3418acbUL,
- 0x5b9cca4f7763e373UL, 0x682e6ff3d6b2b8a3UL,
- 0x748f82ee5defb2fcUL, 0x78a5636f43172f60UL,
- 0x84c87814a1f0ab72UL, 0x8cc702081a6439ecUL,
- 0x90befffa23631e28UL, 0xa4506cebde82bde9UL,
- 0xbef9a3f7b2c67915UL, 0xc67178f2e372532bUL,
- 0xca273eceea26619cUL, 0xd186b8c721c0c207UL,
- 0xeada7dd6cde0eb1eUL, 0xf57d4f7fee6ed178UL,
- 0x06f067aa72176fbaUL, 0x0a637dc5a2c898a6UL,
- 0x113f9804bef90daeUL, 0x1b710b35131c471bUL,
- 0x28db77f523047d84UL, 0x32caab7b40c72493UL,
- 0x3c9ebe0a15c9bebcUL, 0x431d67c49c100d4cUL,
- 0x4cc5d4becb3e42b6UL, 0x597f299cfc657e2aUL,
- 0x5fcb6fab3ad6faecUL, 0x6c44198c4a475817UL
-};
-
-/* Initial hash value H for SHA-384: */
-static const isc_uint64_t sha384_initial_hash_value[8] = {
- 0xcbbb9d5dc1059ed8UL,
- 0x629a292a367cd507UL,
- 0x9159015a3070dd17UL,
- 0x152fecd8f70e5939UL,
- 0x67332667ffc00b31UL,
- 0x8eb44a8768581511UL,
- 0xdb0c2e0d64f98fa7UL,
- 0x47b5481dbefa4fa4UL
-};
-
-/* Initial hash value H for SHA-512: */
-static const isc_uint64_t sha512_initial_hash_value[8] = {
- 0x6a09e667f3bcc908U,
- 0xbb67ae8584caa73bUL,
- 0x3c6ef372fe94f82bUL,
- 0xa54ff53a5f1d36f1UL,
- 0x510e527fade682d1UL,
- 0x9b05688c2b3e6c1fUL,
- 0x1f83d9abfb41bd6bUL,
- 0x5be0cd19137e2179UL
-};
-#else
/* Hash constant words K for SHA-384 and SHA-512: */
static const isc_uint64_t K512[80] = {
0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL,
@@ -864,7 +784,6 @@ static const isc_uint64_t sha512_initial_hash_value[8] = {
0x1f83d9abfb41bd6bULL,
0x5be0cd19137e2179ULL
};
-#endif
/*** SHA-224: *********************************************************/
diff --git a/usr.sbin/bind/lib/isc/task.c b/usr.sbin/bind/lib/isc/task.c
index c956155a018..b0559d1d2f8 100644
--- a/usr.sbin/bind/lib/isc/task.c
+++ b/usr.sbin/bind/lib/isc/task.c
@@ -1275,9 +1275,6 @@ dispatch(isc__taskmgr_t *manager) {
#ifdef USE_WORKER_THREADS
static isc_threadresult_t
-#ifdef _WIN32
-WINAPI
-#endif
run(void *uap) {
isc__taskmgr_t *manager = uap;
diff --git a/usr.sbin/bind/lib/isc/timer.c b/usr.sbin/bind/lib/isc/timer.c
index 56f389ff893..013557ed968 100644
--- a/usr.sbin/bind/lib/isc/timer.c
+++ b/usr.sbin/bind/lib/isc/timer.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: timer.c,v 1.5 2020/01/07 19:08:09 florian Exp $ */
+/* $Id: timer.c,v 1.6 2020/01/07 19:09:26 florian Exp $ */
/*! \file */
@@ -779,9 +779,6 @@ dispatch(isc__timermgr_t *manager, isc_time_t *now) {
#ifdef USE_TIMER_THREAD
static isc_threadresult_t
-#ifdef _WIN32 /* XXXDCL */
-WINAPI
-#endif
run(void *uap) {
isc__timermgr_t *manager = uap;
isc_time_t now;