From: Remi Gacogne Date: Fri, 22 Sep 2017 12:35:54 +0000 (+0200) Subject: auth: Fix a crash when getting a public GOST key if the private one is not set X-Git-Tag: rec-4.1.0-rc1~20^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=87557ae259973063177cb935bc6ef23044946218;p=pdns auth: Fix a crash when getting a public GOST key if the private one is not set --- diff --git a/pdns/botan110signers.cc b/pdns/botan110signers.cc index e99ceda4c..bd8865cda 100644 --- a/pdns/botan110signers.cc +++ b/pdns/botan110signers.cc @@ -181,8 +181,9 @@ std::string GOSTDNSCryptoKeyEngine::getPubKeyHash() const std::string GOSTDNSCryptoKeyEngine::getPublicKeyString() const { - const BigInt&x =d_key->public_point().get_affine_x(); - const BigInt&y =d_key->public_point().get_affine_y(); + std::shared_ptr pk = d_pubkey ? d_pubkey : d_key; + const BigInt&x =pk->public_point().get_affine_x(); + const BigInt&y =pk->public_point().get_affine_y(); size_t part_size = std::max(x.bytes(), y.bytes());