From: Kees Monshouwer Date: Thu, 5 Dec 2013 16:32:18 +0000 (+0100) Subject: fix 64+ character TSIG keys X-Git-Tag: auth-3.3.1~4^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4e348b97a2b312d125637263193ec8a31c28c6e;p=thirdparty%2Fpdns.git fix 64+ character TSIG keys --- diff --git a/pdns/dnssecinfra.cc b/pdns/dnssecinfra.cc index c4cf85c809..7396ee8570 100644 --- a/pdns/dnssecinfra.cc +++ b/pdns/dnssecinfra.cc @@ -422,7 +422,11 @@ void decodeDERIntegerSequence(const std::string& input, vector& 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];