From 87557ae259973063177cb935bc6ef23044946218 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 22 Sep 2017 14:35:54 +0200 Subject: [PATCH] auth: Fix a crash when getting a public GOST key if the private one is not set --- pdns/botan110signers.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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()); -- 2.40.0