Как считается digest в DS Resource Record? DNSSEC.
От: neokoder  
Дата: 17.03.15 21:57
Оценка:
Привет
Столкнулся с такой проблемой не могу понять как считается хэш в DS Resource Record?
Вроде всё просто:

5.1.4. The Digest Field
The DS record refers to a DNSKEY RR by including a digest of that
DNSKEY RR.

The digest is calculated by concatenating the canonical form of the
fully qualified owner name of the DNSKEY RR with the DNSKEY RDATA,
and then applying the digest algorithm.

digest = digest_algorithm( DNSKEY owner name | DNSKEY RDATA);

"|" denotes concatenation

DNSKEY RDATA = Flags | Protocol | Algorithm | Public Key.

The size of the digest may vary depending on the digest algorithm and
DNSKEY RR size. As of the time of this writing, the only defined
digest algorithm is SHA-1, which produces a 20 octet digest.


Но когда пытаюсь проверить на примере:

5.4. DS RR Example


The following example shows a DNSKEY RR and its corresponding DS RR.

dskey.example.com. 86400 IN DNSKEY 256 3 5 ( AQOeiiR0GOMYkDshWoSKz9Xz
fwJr1AYtsmx3TGkJaNXVbfi/
2pHm822aJ5iI9BMzNXxeYCmZ
DRD99WYwYqUSdjMmmAphXdvx
egXd/M5+X7OrzKBaMbCVdFLU
Uh6DhweJBjEVv5f2wwjM9Xzc
nOf+EPbtG9DMBmADjFDc2w/r
ljwvFw==
) ; key id = 60485

dskey.example.com. 86400 IN DS 60485 5 1 ( 2BB183AF5F22588179A53B0A
98631FAD1A292118 )

The first four text fields specify the name, TTL, Class, and RR type
(DS). Value 60485 is the key tag for the corresponding
"dskey.example.com." DNSKEY RR, and value 5 denotes the algorithm
used by this "dskey.example.com." DNSKEY RR. The value 1 is the
algorithm used to construct the digest, and the rest of the RDATA
text is the digest in hexadecimal.


Ни фига не получается указанный там хеш. Чего только не пробовал изменять и owner name разными вариантами и Flags в little-endian/big-endian — ничё не помогает.
Подскажите где я ошибаюсь?
1) owner name=dskey.example.com.
2) Flags=0x0100 или 0x0001
3) Protocol=0x03
4) Algorithm=0x05
5) Public Key=бинарные данные после преобразования из base64
Итого: 152 байта для хеша SHA-1
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.