Small api change to check RRSIG validity
This commit is contained in:
parent
9c0ff1489b
commit
39a8e2b8af
12
dnssec.go
12
dnssec.go
|
@ -426,9 +426,15 @@ func (rr *RRSIG) Verify(k *DNSKEY, rrset []RR) error {
|
|||
}
|
||||
|
||||
// ValidityPeriod uses RFC1982 serial arithmetic to calculate
|
||||
// if a signature period is valid.
|
||||
func (rr *RRSIG) ValidityPeriod() bool {
|
||||
utc := time.Now().UTC().Unix()
|
||||
// if a signature period is valid. If t is the zero time, the
|
||||
// current time is taken other t is.
|
||||
func (rr *RRSIG) ValidityPeriod(t time.Tim) bool {
|
||||
var utc int64
|
||||
if t == time.Zero {
|
||||
utc = time.Now().UTC().Unix()
|
||||
} else {
|
||||
utc = t.Now().UTC().Unix()
|
||||
}
|
||||
modi := (int64(rr.Inception) - utc) / year68
|
||||
mode := (int64(rr.Expiration) - utc) / year68
|
||||
ti := int64(rr.Inception) + (modi * year68)
|
||||
|
|
Loading…
Reference in New Issue