string hashQNameWithSalt(const NSEC3PARAMRecordContent& ns3prc, const DNSName& qname)
{
- unsigned int times = ns3prc.d_iterations;
+ return hashQNameWithSalt(ns3prc.d_salt, ns3prc.d_iterations, qname);
+}
+
+string hashQNameWithSalt(const std::string& salt, unsigned int iterations, const DNSName& qname)
+{
+ unsigned int times = iterations;
unsigned char hash[20];
string toHash(qname.toDNSStringLC());
for(;;) {
- toHash.append(ns3prc.d_salt);
+ toHash.append(salt);
SHA1((unsigned char*)toHash.c_str(), toHash.length(), hash);
toHash.assign((char*)hash, sizeof(hash));
if(!times--)
vector<shared_ptr<DNSRecordContent> >& toSign, vector<RRSIGRecordContent> &rrc);
string hashQNameWithSalt(const NSEC3PARAMRecordContent& ns3prc, const DNSName& qname);
+string hashQNameWithSalt(const std::string& salt, unsigned int iterations, const DNSName& qname);
void decodeDERIntegerSequence(const std::string& input, vector<string>& output);
class DNSPacket;
void addRRSigs(DNSSECKeeper& dk, UeberBackend& db, const std::set<DNSName>& authMap, vector<DNSResourceRecord>& rrs);