Fix tsig 48 bits timer

This commit is contained in:
Miek Gieben 2012-03-02 23:12:23 +01:00
parent e1873c28bc
commit 9cbe439ce3
2 changed files with 7 additions and 11 deletions

View File

@ -329,3 +329,10 @@ func stripTsig(msg []byte) ([]byte, *RR_TSIG, error) {
}
return msg[:tsigoff], rr, nil
}
// Translate the TSIG time signed into a date. There is no
// need for RFC1982 calculations as this date is 48 bits.
func tsigTimeToDate(t uint64) string {
ti := time.Unix(int64(t), 0).UTC()
return ti.Format("20060102150405")
}

View File

@ -1055,17 +1055,6 @@ func dateToTime(s string) (uint32, error) {
return ti, nil
}
// Translate the TSIG time signed into a date. There is no
// need for RFC1982 calculations as this date is 48 bits
func tsigTimeToDate(t uint64) string {
// only use the lower 48 bits, TODO(mg), check for 48 bit size
return "TODO"
/*
ti := time.Unix(int64(t), 0).Unix()
return ti.Format("20060102150405")
*/
}
// saltString converts a NSECX salt to uppercase and
// returns "-" when it is empty
func saltString(s string) string {