From: Kees Monshouwer Date: Fri, 25 Mar 2022 10:10:00 +0000 (+0100) Subject: format decafsigners.cc X-Git-Tag: rec-4.7.0-beta1~32^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11426%2Fhead;p=thirdparty%2Fpdns.git format decafsigners.cc --- diff --git a/.not-formatted b/.not-formatted index 0dfb64d254..bd02248857 100644 --- a/.not-formatted +++ b/.not-formatted @@ -36,7 +36,6 @@ ./pdns/communicator.cc ./pdns/communicator.hh ./pdns/dbdnsseckeeper.cc -./pdns/decafsigners.cc ./pdns/delaypipe.cc ./pdns/delaypipe.hh ./pdns/digests.hh diff --git a/pdns/decafsigners.cc b/pdns/decafsigners.cc index 0a2c99f765..b5fb79057b 100644 --- a/pdns/decafsigners.cc +++ b/pdns/decafsigners.cc @@ -12,9 +12,9 @@ using namespace decaf; class DecafED25519DNSCryptoKeyEngine : public DNSCryptoKeyEngine { public: - explicit DecafED25519DNSCryptoKeyEngine(unsigned int algo) : DNSCryptoKeyEngine(algo) + explicit DecafED25519DNSCryptoKeyEngine(unsigned int algo) : + DNSCryptoKeyEngine(algo) { - } string getName() const override { return "Decaf ED25519"; } void create(unsigned int bits) override; @@ -39,8 +39,8 @@ private: void DecafED25519DNSCryptoKeyEngine::create(unsigned int bits) { - if(bits != (unsigned int)getBits()) { - throw runtime_error("Unsupported key length of "+std::to_string(bits)+" bits requested, DecafED25519 class"); + if (bits != (unsigned int)getBits()) { + throw runtime_error("Unsupported key length of " + std::to_string(bits) + " bits requested, DecafED25519 class"); } SpongeRng rng("/dev/urandom"); @@ -73,7 +73,7 @@ DNSCryptoKeyEngine::storvector_t DecafED25519DNSCryptoKeyEngine::convertToISCVec return storvector; } -void DecafED25519DNSCryptoKeyEngine::fromISCMap(DNSKEYRecordContent& drc, std::map& stormap ) +void DecafED25519DNSCryptoKeyEngine::fromISCMap(DNSKEYRecordContent& drc, std::map& stormap) { /* Private-key-format: v1.2 @@ -135,20 +135,20 @@ bool DecafED25519DNSCryptoKeyEngine::verify(const std::string& msg, const std::s try { pub.verify(sig, message); - } catch(const CryptoException& e) { + } + catch (const CryptoException& e) { return false; } return true; } - class DecafED448DNSCryptoKeyEngine : public DNSCryptoKeyEngine { public: - explicit DecafED448DNSCryptoKeyEngine(unsigned int algo) : DNSCryptoKeyEngine(algo) + explicit DecafED448DNSCryptoKeyEngine(unsigned int algo) : + DNSCryptoKeyEngine(algo) { - } string getName() const override { return "Decaf ED448"; } void create(unsigned int bits) override; @@ -173,8 +173,8 @@ private: void DecafED448DNSCryptoKeyEngine::create(unsigned int bits) { - if(bits != (unsigned int)getBits()) { - throw runtime_error("Unsupported key length of "+std::to_string(bits)+" bits requested, DecafED448 class"); + if (bits != (unsigned int)getBits()) { + throw runtime_error("Unsupported key length of " + std::to_string(bits) + " bits requested, DecafED448 class"); } SpongeRng rng("/dev/urandom"); @@ -207,7 +207,7 @@ DNSCryptoKeyEngine::storvector_t DecafED448DNSCryptoKeyEngine::convertToISCVecto return storvector; } -void DecafED448DNSCryptoKeyEngine::fromISCMap(DNSKEYRecordContent& drc, std::map& stormap ) +void DecafED448DNSCryptoKeyEngine::fromISCMap(DNSKEYRecordContent& drc, std::map& stormap) { /* Private-key-format: v1.2 @@ -269,15 +269,16 @@ bool DecafED448DNSCryptoKeyEngine::verify(const std::string& msg, const std::str try { pub.verify(sig, message); - } catch(const CryptoException& e) { + } + catch (const CryptoException& e) { return false; } return true; } - -namespace { +namespace +{ struct LoaderDecafStruct { LoaderDecafStruct()