Skip to content

Commit d90efbf

Browse files
committed
at midnight UTC we would switch to new signatures, that became valid as of 'now', with no safety margin. Add one hour overlap.
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2857 d19b8d6e-7fed-0310-83ef-9ca221ded41b
1 parent a2f3b9e commit d90efbf

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

pdns/dnssecinfra.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,9 @@ int countLabels(const std::string& signQName)
318318
return count;
319319
}
320320

321-
uint32_t getCurrentInception()
321+
uint32_t getCurrentInception(unsigned int safety)
322322
{
323-
uint32_t now = time(0);
323+
uint32_t now = time(0) - safety; // if we sign 'now' all clocks have to be correct at UTC midnight
324324
now -= (now % (7*86400));
325325
return now;
326326
}

pdns/dnssecinfra.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class DNSSECKeeper;
117117
struct DNSSECPrivateKey;
118118

119119
void fillOutRRSIG(DNSSECPrivateKey& dpk, const std::string& signQName, RRSIGRecordContent& rrc, vector<shared_ptr<DNSRecordContent> >& toSign);
120-
uint32_t getCurrentInception();
120+
uint32_t getCurrentInception(unsigned int safety=0);
121121
void addSignature(DNSSECKeeper& dk, DNSBackend& db, const std::string signQName, const std::string& wildcardname, uint16_t signQType, uint32_t signTTL, DNSPacketWriter::Place signPlace,
122122
vector<shared_ptr<DNSRecordContent> >& toSign, vector<DNSResourceRecord>& outsigned, uint32_t origTTL);
123123
int getRRSIGsForRRSET(DNSSECKeeper& dk, const std::string& signer, const std::string signQName, uint16_t signQType, uint32_t signTTL,

pdns/dnssecsigner.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ int getRRSIGsForRRSET(DNSSECKeeper& dk, const std::string& signer, const std::st
3535

3636
rrc.d_labels=countLabels(signQName);
3737
rrc.d_originalttl=signTTL;
38-
rrc.d_siginception=getCurrentInception();
38+
rrc.d_siginception=getCurrentInception(3600); // 1 hour safety margin, we start dishing out new week after an hour
3939
rrc.d_sigexpire = rrc.d_siginception + 14*86400; // XXX should come from zone metadata
4040
rrc.d_signer = toLower(signer);
4141
rrc.d_tag = 0;

0 commit comments

Comments
 (0)