"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tsig.go" between
dns-1.1.45.tar.gz and dns-1.1.46.tar.gz

About: GO DNS implements a DNS library in Go.

tsig.go  (dns-1.1.45):tsig.go  (dns-1.1.46)
skipping to change at line 77 skipping to change at line 77
mac, err := hex.DecodeString(t.MAC) mac, err := hex.DecodeString(t.MAC)
if err != nil { if err != nil {
return err return err
} }
if !hmac.Equal(b, mac) { if !hmac.Equal(b, mac) {
return ErrSig return ErrSig
} }
return nil return nil
} }
type tsigSecretProvider map[string]string
func (ts tsigSecretProvider) Generate(msg []byte, t *TSIG) ([]byte, error) {
key, ok := ts[t.Hdr.Name]
if !ok {
return nil, ErrSecret
}
return tsigHMACProvider(key).Generate(msg, t)
}
func (ts tsigSecretProvider) Verify(msg []byte, t *TSIG) error {
key, ok := ts[t.Hdr.Name]
if !ok {
return ErrSecret
}
return tsigHMACProvider(key).Verify(msg, t)
}
// TSIG is the RR the holds the transaction signature of a message. // TSIG is the RR the holds the transaction signature of a message.
// See RFC 2845 and RFC 4635. // See RFC 2845 and RFC 4635.
type TSIG struct { type TSIG struct {
Hdr RR_Header Hdr RR_Header
Algorithm string `dns:"domain-name"` Algorithm string `dns:"domain-name"`
TimeSigned uint64 `dns:"uint48"` TimeSigned uint64 `dns:"uint48"`
Fudge uint16 Fudge uint16
MACSize uint16 MACSize uint16
MAC string `dns:"size-hex:MACSize"` MAC string `dns:"size-hex:MACSize"`
OrigId uint16 OrigId uint16
 End of changes. 1 change blocks. 
0 lines changed or deleted 18 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)