From: Fred Morcos Date: Thu, 7 Apr 2022 12:59:49 +0000 (+0200) Subject: Guard libsodium PEM methods with libcrypto X-Git-Tag: auth-4.8.0-alpha0~124^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e640d42b84f562afbd04335f190c8ab3bfeb5f09;p=thirdparty%2Fpdns.git Guard libsodium PEM methods with libcrypto These methods depend on OpenSSL for PEM import and export. --- diff --git a/pdns/sodiumsigners.cc b/pdns/sodiumsigners.cc index c4d68e29e2..cbb18c6c96 100644 --- a/pdns/sodiumsigners.cc +++ b/pdns/sodiumsigners.cc @@ -16,6 +16,7 @@ public: string getName() const override { return "Sodium ED25519"; } void create(unsigned int bits) override; +#if defined(HAVE_LIBCRYPTO_ED25519) /** * \brief Creates an ED25519 key engine from a PEM file. * @@ -46,6 +47,7 @@ public: * \exception std::runtime_error In case of OpenSSL errors. */ void convertToPEM(std::FILE& fp) const override; +#endif storvector_t convertToISCVector() const override; std::string getPubKeyHash() const override; @@ -74,6 +76,7 @@ void SodiumED25519DNSCryptoKeyEngine::create(unsigned int bits) crypto_sign_ed25519_keypair(d_pubkey, d_seckey); } +#if defined(HAVE_LIBCRYPTO_ED25519) void SodiumED25519DNSCryptoKeyEngine::createFromPEMFile(DNSKEYRecordContent& drc, const string& filename, std::FILE& fp) { drc.d_algorithm = d_algorithm; @@ -107,6 +110,7 @@ void SodiumED25519DNSCryptoKeyEngine::convertToPEM(std::FILE& fp) const throw runtime_error(getName() + ": Could not convert private key to PEM"); } } +#endif int SodiumED25519DNSCryptoKeyEngine::getBits() const {