]> granicus.if.org Git - pdns/commitdiff
auth: Fix a crash when getting a public GOST key if the private one is not set
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 22 Sep 2017 12:35:54 +0000 (14:35 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 22 Sep 2017 12:35:54 +0000 (14:35 +0200)
pdns/botan110signers.cc

index e99ceda4c010c3c2d64592bfb7685ea6f6818037..bd8865cdabec5f301aa09f1608d2faf66997d31d 100644 (file)
@@ -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<GOST_3410_PublicKey> 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());