]> granicus.if.org Git - pdns/commitdiff
fix up the ECDSA from the crypto++ too for the new BIND field ordering
authorBert Hubert <bert.hubert@netherlabs.nl>
Sun, 27 Feb 2011 09:33:39 +0000 (09:33 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Sun, 27 Feb 2011 09:33:39 +0000 (09:33 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2055 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/cryptoppsigners.cc

index de72402fe5a701e436bc4f8c2c9e05b303548d14..d44255cb17260f43becb47a6789afb6ce2eb70ee 100644 (file)
@@ -16,7 +16,7 @@ public:
   {}
   void create(unsigned int bits);
   string getName() const { return "CryptoPP ECDSA"; }
-  stormap_t convertToISCMap() const;
+  storvector_t convertToISCVector() const;
   std::string getPubKeyHash() const;
   std::string sign(const std::string& msg) const; 
   std::string hash(const std::string& hash) const; 
@@ -61,7 +61,7 @@ int CryptoPPECDSADNSCryptoKeyEngine<HASHER,CURVE,BITS>::getBits() const
 }
 
 template<class HASHER, class CURVE, int BITS>
-std::map<std::string, std::string> CryptoPPECDSADNSCryptoKeyEngine<HASHER,CURVE,BITS>::convertToISCMap() const
+DNSCryptoKeyEngine::storvector_t CryptoPPECDSADNSCryptoKeyEngine<HASHER,CURVE,BITS>::convertToISCVector() const
 {
    /* Algorithm: 13 (ECDSAP256SHA256)
    PrivateKey: GU6SnQ/Ou+xC5RumuIUIuJZteXT2z0O/ok1s38Et6mQ= */
@@ -73,14 +73,14 @@ std::map<std::string, std::string> CryptoPPECDSADNSCryptoKeyEngine<HASHER,CURVE,
   else
     algostr+=" (?)";
   
-  map<string,string> stormap;
-  stormap["Algorithm"]=algostr;
+  storvector_t storvect;
+  storvect.push_back(make_pair("Algorithm", algostr));
   
   const CryptoPP::Integer& pe=d_key->GetPrivateExponent();
   unsigned char buffer[pe.MinEncodedSize()];
   pe.Encode(buffer, pe.MinEncodedSize());
-  stormap["PrivateKey"] = string((char*)buffer, sizeof(buffer));
-  return stormap;
+  storvect.push_back(make_pair("PrivateKey", string((char*)buffer, sizeof(buffer))));
+  return storvect;
 }
 template<class HASHER, class CURVE, int BITS>
 void CryptoPPECDSADNSCryptoKeyEngine<HASHER,CURVE,BITS>::fromISCMap(DNSKEYRecordContent& drc, std::map<std::string, std::string>& stormap )