]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
format decafsigners.cc 11426/head
authorKees Monshouwer <mind04@monshouwer.org>
Fri, 25 Mar 2022 10:10:00 +0000 (11:10 +0100)
committermind04 <mind04@monshouwer.org>
Fri, 25 Mar 2022 10:10:00 +0000 (11:10 +0100)
.not-formatted
pdns/decafsigners.cc

index 0dfb64d2544a28b2f6af2e3d0090bb5636cd6e6a..bd022488572d82e32ce99324e7830a9785ac2739 100644 (file)
@@ -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
index 0a2c99f7659e0e548afab7106307130406ac55c4..b5fb79057b1f3e31728fb82b698daf5a6252eb99 100644 (file)
@@ -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<std::string, std::string>& stormap )
+void DecafED25519DNSCryptoKeyEngine::fromISCMap(DNSKEYRecordContent& drc, std::map<std::string, std::string>& 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<std::string, std::string>& stormap )
+void DecafED448DNSCryptoKeyEngine::fromISCMap(DNSKEYRecordContent& drc, std::map<std::string, std::string>& 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()