]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
fix 64+ character TSIG keys
authorKees Monshouwer <mind04@monshouwer.org>
Thu, 5 Dec 2013 16:32:18 +0000 (17:32 +0100)
committermind04 <mind04@monshouwer.org>
Thu, 5 Dec 2013 19:49:38 +0000 (20:49 +0100)
pdns/dnssecinfra.cc

index c4cf85c8090df2a8f10e6330aa662f9986dd7229..7396ee8570daec9579948e5659e74b614978f3f5 100644 (file)
@@ -422,7 +422,11 @@ void decodeDERIntegerSequence(const std::string& input, vector<string>& output)
 
 string calculateMD5HMAC(const std::string& key_, const std::string& text)
 {
-  const unsigned char* key=(const unsigned char*)key_.c_str();
+  string key__ = key_;
+  if (key__.size() > 64)
+    key__ = pdns_md5sum(key_);
+
+  const unsigned char* key=(const unsigned char*)key__.c_str();
   unsigned char keyIpad[64];
   unsigned char keyOpad[64];