From: Miod Vallat Date: Wed, 4 Feb 2026 06:00:16 +0000 (+0100) Subject: Correctly compute public key exponent length when larger than 255. X-Git-Tag: rec-5.5.0-alpha0~38^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F16810%2Fhead;p=thirdparty%2Fpdns.git Correctly compute public key exponent length when larger than 255. Signed-off-by: Miod Vallat --- diff --git a/pdns/opensslsigners.cc b/pdns/opensslsigners.cc index 3a8df543b1..fb4daf6aec 100644 --- a/pdns/opensslsigners.cc +++ b/pdns/opensslsigners.cc @@ -941,7 +941,7 @@ void OpenSSLRSADNSCryptoKeyEngine::fromPublicKeyString(const std::string& conten if (contentLen < 3) { throw runtime_error(getName() + " invalid input size for the public key"); } - const size_t exponentSize = raw[1] * 0xff + raw[2]; + const size_t exponentSize = (static_cast(raw[1])) * 0x100 + raw[2]; if (contentLen < (exponentSize + 4)) { throw runtime_error(getName() + " invalid input size for the public key"); }