Permalink
Browse files

fix 64+ character TSIG keys

  • Loading branch information...
1 parent 00a7b25 commit c4e348b97a2b312d125637263193ec8a31c28c6e @mind04 mind04 committed with mind04 Dec 5, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 pdns/dnssecinfra.cc
View
@@ -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];

0 comments on commit c4e348b

Please sign in to comment.