"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "dnssec.go" between
dns-1.1.47.tar.gz and dns-1.1.48.tar.gz

About: GO DNS implements a DNS library in Go.

dnssec.go  (dns-1.1.47):dnssec.go  (dns-1.1.48)
skipping to change at line 143 skipping to change at line 143
} }
// KeyTag calculates the keytag (or key-id) of the DNSKEY. // KeyTag calculates the keytag (or key-id) of the DNSKEY.
func (k *DNSKEY) KeyTag() uint16 { func (k *DNSKEY) KeyTag() uint16 {
if k == nil { if k == nil {
return 0 return 0
} }
var keytag int var keytag int
switch k.Algorithm { switch k.Algorithm {
case RSAMD5: case RSAMD5:
// Look at the bottom two bytes of the modules, which the last
// item in the pubkey.
// This algorithm has been deprecated, but keep this key-tag calc ulation. // This algorithm has been deprecated, but keep this key-tag calc ulation.
// Look at the bottom two bytes of the modules, which the last it
em in the pubkey.
// See https://www.rfc-editor.org/errata/eid193 .
modulus, _ := fromBase64([]byte(k.PublicKey)) modulus, _ := fromBase64([]byte(k.PublicKey))
if len(modulus) > 1 { if len(modulus) > 1 {
x := binary.BigEndian.Uint16(modulus[len(modulus)-2:]) x := binary.BigEndian.Uint16(modulus[len(modulus)-3:])
keytag = int(x) keytag = int(x)
} }
default: default:
keywire := new(dnskeyWireFmt) keywire := new(dnskeyWireFmt)
keywire.Flags = k.Flags keywire.Flags = k.Flags
keywire.Protocol = k.Protocol keywire.Protocol = k.Protocol
keywire.Algorithm = k.Algorithm keywire.Algorithm = k.Algorithm
keywire.PublicKey = k.PublicKey keywire.PublicKey = k.PublicKey
wire := make([]byte, DefaultMsgSize) wire := make([]byte, DefaultMsgSize)
n, err := packKeyWire(keywire, wire) n, err := packKeyWire(keywire, wire)
 End of changes. 3 change blocks. 
3 lines changed or deleted 4 lines changed or added

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