]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Remove separate string_compare source
authorPieter Lexis <pieter.lexis@powerdns.com>
Mon, 20 Sep 2021 09:12:34 +0000 (11:12 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Mon, 20 Sep 2021 09:12:34 +0000 (11:12 +0200)
pdns/Makefile.am
pdns/dnsdistdist/Makefile.am
pdns/dnsdistdist/string_compare.hh [deleted symlink]
pdns/dnssecinfra.cc
pdns/ednscookies.cc
pdns/recursordist/Makefile.am
pdns/recursordist/string_compare.hh [deleted symlink]
pdns/string_compare.hh [deleted file]

index 867d3c04cbc60440f43c81780ee237995e6aebdf..a916faba099263730ea432a1b87423b957def6a3 100644 (file)
@@ -53,7 +53,6 @@ EXTRA_DIST = \
        lua-record.cc \
        minicurl.cc \
        minicurl.hh \
-       string_compare.hh \
        api-swagger.yaml \
        api-swagger.json \
        requirements.txt \
index 26371f6bf362deb1b3c77adfd8f25e6abb94409e..a9f4433f205a57aaca5075e7d5d03410ea9fae85 100644 (file)
@@ -103,7 +103,6 @@ EXTRA_DIST=COPYING \
           kqueuemplexer.cc \
           portsmplexer.cc \
           cdb.cc cdb.hh \
-          string_compare.hh \
           ext/lmdb-safe/lmdb-safe.cc ext/lmdb-safe/lmdb-safe.hh \
           ext/protozero/include/* \
           builder-support/gen-version
diff --git a/pdns/dnsdistdist/string_compare.hh b/pdns/dnsdistdist/string_compare.hh
deleted file mode 120000 (symlink)
index 7c3ecf5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../string_compare.hh
\ No newline at end of file
index f89acb68e176c94d57196f181cfde1496f22fb1b..e4f77e795f2278e3805f168708498fb7de7b222e 100644 (file)
@@ -45,7 +45,6 @@
 #include "pkcs11signers.hh"
 #endif
 #include "misc.hh"
-#include "string_compare.hh"
 
 using namespace boost::assign;
 
index 204f4eed06db7f6bc8e86a553fff10f9b5ba783f..5992b13f86dbad7219781c2c55ecb6fa1bd1b8f7 100644 (file)
@@ -24,7 +24,6 @@
 #endif
 #include "ednscookies.hh"
 #include "misc.hh"
-#include "string_compare.hh"
 
 #ifdef HAVE_CRYPTO_SHORTHASH
 #include <sodium.h>
index 6ceec199793f0d0c69b0e37910a6e2ea8ff36370..b80d554f50eaf6c560bfe192eb63156b89c6a156 100644 (file)
@@ -63,7 +63,6 @@ EXTRA_DIST = \
        mtasker_fcontext.cc mtasker_ucontext.cc \
        NOTICE \
        opensslsigners.hh opensslsigners.cc \
-       string_compare.hh \
        portsmplexer.cc \
        dnstap.proto dnstap.cc dnstap.hh fstrm_logger.cc fstrm_logger.hh \
        ext/protozero/include/* \
diff --git a/pdns/recursordist/string_compare.hh b/pdns/recursordist/string_compare.hh
deleted file mode 120000 (symlink)
index 7c3ecf5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../string_compare.hh
\ No newline at end of file
diff --git a/pdns/string_compare.hh b/pdns/string_compare.hh
deleted file mode 100644 (file)
index 65d51c6..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * This file is part of PowerDNS or dnsdist.
- * Copyright -- PowerDNS.COM B.V. and its contributors
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * In addition, for the avoidance of any doubt, permission is granted to
- * link this program with OpenSSL and to (re)distribute the binaries
- * produced as the result of such linking.
- *
- * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <string>
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef HAVE_CRYPTO_MEMCMP
-#include <openssl/crypto.h>
-#endif
-
-static bool constantTimeStringEquals(const std::string& a, const std::string& b)
-{
-  if (a.size() != b.size()) {
-    return false;
-  }
-  const size_t size = a.size();
-#ifdef HAVE_CRYPTO_MEMCMP
-  return CRYPTO_memcmp(a.c_str(), b.c_str(), size) == 0;
-#else
-  const volatile unsigned char* _a = (const volatile unsigned char*)a.c_str();
-  const volatile unsigned char* _b = (const volatile unsigned char*)b.c_str();
-  unsigned char res = 0;
-
-  for (size_t idx = 0; idx < size; idx++) {
-    res |= _a[idx] ^ _b[idx];
-  }
-
-  return res == 0;
-#endif
-}