keytag calc. for RSAMD5 keys
This commit is contained in:
parent
daf51db85d
commit
70efdaabea
10
dnssec.go
10
dnssec.go
|
@ -101,8 +101,14 @@ func (k *RR_DNSKEY) KeyTag() uint16 {
|
|||
var keytag int
|
||||
switch k.Algorithm {
|
||||
case RSAMD5:
|
||||
// TODO(mg): implement old style keytag calculation
|
||||
keytag = 0
|
||||
// Look at the bottom two bytes of the modules, which the last
|
||||
// item in the pubkey. We could do this faster by looking directly
|
||||
// at the base64 values. But I'm lazy.
|
||||
modulus, _ := packBase64([]byte(k.PublicKey))
|
||||
if (len(modulus) > 1) {
|
||||
x, _ := unpackUint16(modulus, len(modulus)-2)
|
||||
keytag = int(x)
|
||||
}
|
||||
default:
|
||||
keywire := new(dnskeyWireFmt)
|
||||
keywire.Flags = k.Flags
|
||||
|
|
Loading…
Reference in New Issue