#include "pkcs11signers.hh"
#endif
#include "gss_context.hh"
+#include "misc.hh"
using namespace boost::assign;
return message;
}
-
-bool getTSIGHashEnum(const string &algoName, TSIGHashEnum& algoEnum)
-{
- string normalizedName = toLowerCanonic(algoName);
-
- if (normalizedName == "hmac-md5.sig-alg.reg.int")
- algoEnum = TSIG_MD5;
- else if (normalizedName == "hmac-sha1")
- algoEnum = TSIG_SHA1;
- else if (normalizedName == "hmac-sha224")
- algoEnum = TSIG_SHA224;
- else if (normalizedName == "hmac-sha256")
- algoEnum = TSIG_SHA256;
- else if (normalizedName == "hmac-sha384")
- algoEnum = TSIG_SHA384;
- else if (normalizedName == "hmac-sha512")
- algoEnum = TSIG_SHA512;
- else {
- return false;
- }
- return true;
-}
-
-
void addTSIG(DNSPacketWriter& pw, TSIGRecordContent* trc, const string& tsigkeyname, const string& tsigsecret, const string& tsigprevious, bool timersonly)
{
TSIGHashEnum algo;
class DNSPacket;
void addRRSigs(DNSSECKeeper& dk, UeberBackend& db, const std::set<string, CIStringCompare>& authMap, vector<DNSResourceRecord>& rrs);
-typedef enum { TSIG_MD5, TSIG_SHA1, TSIG_SHA224, TSIG_SHA256, TSIG_SHA384, TSIG_SHA512 } TSIGHashEnum;
string calculateMD5HMAC(const std::string& key, const std::string& text);
string calculateSHAHMAC(const std::string& key, const std::string& text, TSIGHashEnum hash);
string calculateHMAC(const std::string& key, const std::string& text, TSIGHashEnum hash);
string makeTSIGMessageFromTSIGPacket(const string& opacket, unsigned int tsigoffset, const string& keyname, const TSIGRecordContent& trc, const string& previous, bool timersonly, unsigned int dnsHeaderOffset=0);
-bool getTSIGHashEnum(const string &algoName, TSIGHashEnum& algoEnum);
void addTSIG(DNSPacketWriter& pw, TSIGRecordContent* trc, const string& tsigkeyname, const string& tsigsecret, const string& tsigprevious, bool timersonly);
uint64_t signatureCacheSize(const std::string& str);
#endif
return true;
}
-// please feel free to add other operating systems here. What we need are stats on dropped UDP packets
uint64_t udpErrorStats(const std::string& str)
{
#ifdef __linux__
#endif
return 0;
}
+
+bool getTSIGHashEnum(const string &algoName, TSIGHashEnum& algoEnum)
+{
+ string normalizedName = toLowerCanonic(algoName);
+
+ if (normalizedName == "hmac-md5.sig-alg.reg.int")
+ algoEnum = TSIG_MD5;
+ else if (normalizedName == "hmac-sha1")
+ algoEnum = TSIG_SHA1;
+ else if (normalizedName == "hmac-sha224")
+ algoEnum = TSIG_SHA224;
+ else if (normalizedName == "hmac-sha256")
+ algoEnum = TSIG_SHA256;
+ else if (normalizedName == "hmac-sha384")
+ algoEnum = TSIG_SHA384;
+ else if (normalizedName == "hmac-sha512")
+ algoEnum = TSIG_SHA512;
+ else {
+ return false;
+ }
+ return true;
+}
#include <vector>
#include "namespaces.hh"
+typedef enum { TSIG_MD5, TSIG_SHA1, TSIG_SHA224, TSIG_SHA256, TSIG_SHA384, TSIG_SHA512 } TSIGHashEnum;
+
bool chopOff(string &domain);
bool chopOffDotted(string &domain);
uint32_t getLong(const unsigned char *p);
uint32_t getLong(const char *p);
uint32_t pdns_strtoui(const char *nptr, char **endptr, int base);
+bool getTSIGHashEnum(const string &algoName, TSIGHashEnum& algoEnum);
int logFacilityToLOG(unsigned int facility);