dnsruby 1.2 → 1.23
Sign up to get free protection for your applications and to get access to all the features.
- data/demo/axfr.rb +176 -0
- data/demo/check_soa.rb +141 -0
- data/demo/check_zone.rb +157 -0
- data/demo/example_recurse.rb +11 -0
- data/demo/mresolv.rb +67 -0
- data/demo/mx.rb +33 -0
- data/demo/rubydig.rb +58 -0
- data/demo/to_resolve.txt +3088 -0
- data/demo/trace_dns.rb +15 -0
- data/doc/classes/Dnsruby.html +463 -0
- data/doc/classes/Dnsruby/Algorithms.html +171 -0
- data/doc/classes/Dnsruby/Classes.html +197 -0
- data/doc/classes/Dnsruby/Classes.src/M000209.html +23 -0
- data/doc/classes/Dnsruby/Classes.src/M000210.html +19 -0
- data/doc/classes/Dnsruby/CodeMapper.html +375 -0
- data/doc/classes/Dnsruby/CodeMapper.src/M000186.html +18 -0
- data/doc/classes/Dnsruby/CodeMapper.src/M000187.html +33 -0
- data/doc/classes/Dnsruby/CodeMapper.src/M000188.html +21 -0
- data/doc/classes/Dnsruby/CodeMapper.src/M000189.html +19 -0
- data/doc/classes/Dnsruby/CodeMapper.src/M000190.html +19 -0
- data/doc/classes/Dnsruby/CodeMapper.src/M000191.html +18 -0
- data/doc/classes/Dnsruby/CodeMapper.src/M000192.html +22 -0
- data/doc/classes/Dnsruby/CodeMapper.src/M000193.html +22 -0
- data/doc/classes/Dnsruby/CodeMapper.src/M000194.html +22 -0
- data/doc/classes/Dnsruby/CodeMapper.src/M000195.html +31 -0
- data/doc/classes/Dnsruby/CodeMapper.src/M000196.html +19 -0
- data/doc/classes/Dnsruby/Config.html +413 -0
- data/doc/classes/Dnsruby/Config.src/M000148.html +18 -0
- data/doc/classes/Dnsruby/Config.src/M000149.html +19 -0
- data/doc/classes/Dnsruby/Config.src/M000150.html +19 -0
- data/doc/classes/Dnsruby/Config.src/M000151.html +25 -0
- data/doc/classes/Dnsruby/Config.src/M000152.html +21 -0
- data/doc/classes/Dnsruby/Config.src/M000153.html +38 -0
- data/doc/classes/Dnsruby/Config.src/M000154.html +26 -0
- data/doc/classes/Dnsruby/Config.src/M000155.html +22 -0
- data/doc/classes/Dnsruby/Config.src/M000156.html +27 -0
- data/doc/classes/Dnsruby/Config.src/M000157.html +22 -0
- data/doc/classes/Dnsruby/Config.src/M000158.html +21 -0
- data/doc/classes/Dnsruby/DNS.html +571 -0
- data/doc/classes/Dnsruby/DNS.src/M000258.html +24 -0
- data/doc/classes/Dnsruby/DNS.src/M000259.html +18 -0
- data/doc/classes/Dnsruby/DNS.src/M000260.html +18 -0
- data/doc/classes/Dnsruby/DNS.src/M000261.html +20 -0
- data/doc/classes/Dnsruby/DNS.src/M000262.html +19 -0
- data/doc/classes/Dnsruby/DNS.src/M000263.html +20 -0
- data/doc/classes/Dnsruby/DNS.src/M000264.html +18 -0
- data/doc/classes/Dnsruby/DNS.src/M000265.html +19 -0
- data/doc/classes/Dnsruby/DNS.src/M000266.html +20 -0
- data/doc/classes/Dnsruby/DNS.src/M000267.html +28 -0
- data/doc/classes/Dnsruby/DNS.src/M000268.html +19 -0
- data/doc/classes/Dnsruby/DNS.src/M000269.html +20 -0
- data/doc/classes/Dnsruby/DNS.src/M000270.html +31 -0
- data/doc/classes/Dnsruby/DecodeError.html +120 -0
- data/doc/classes/Dnsruby/Dnssec.html +287 -0
- data/doc/classes/Dnsruby/Dnssec.src/M000249.html +23 -0
- data/doc/classes/Dnsruby/Dnssec.src/M000250.html +19 -0
- data/doc/classes/Dnsruby/Dnssec.src/M000251.html +90 -0
- data/doc/classes/Dnsruby/Dnssec.src/M000252.html +76 -0
- data/doc/classes/Dnsruby/EncodeError.html +120 -0
- data/doc/classes/Dnsruby/FormErr.html +119 -0
- data/doc/classes/Dnsruby/Header.html +501 -0
- data/doc/classes/Dnsruby/Header.src/M000231.html +35 -0
- data/doc/classes/Dnsruby/Header.src/M000232.html +18 -0
- data/doc/classes/Dnsruby/Header.src/M000233.html +18 -0
- data/doc/classes/Dnsruby/Header.src/M000234.html +21 -0
- data/doc/classes/Dnsruby/Header.src/M000235.html +20 -0
- data/doc/classes/Dnsruby/Header.src/M000236.html +32 -0
- data/doc/classes/Dnsruby/Header.src/M000237.html +27 -0
- data/doc/classes/Dnsruby/Header.src/M000238.html +26 -0
- data/doc/classes/Dnsruby/Header.src/M000239.html +47 -0
- data/doc/classes/Dnsruby/Header.src/M000240.html +28 -0
- data/doc/classes/Dnsruby/Header.src/M000241.html +30 -0
- data/doc/classes/Dnsruby/Hosts.html +316 -0
- data/doc/classes/Dnsruby/Hosts.src/M000197.html +20 -0
- data/doc/classes/Dnsruby/Hosts.src/M000198.html +19 -0
- data/doc/classes/Dnsruby/Hosts.src/M000199.html +20 -0
- data/doc/classes/Dnsruby/Hosts.src/M000200.html +21 -0
- data/doc/classes/Dnsruby/Hosts.src/M000201.html +19 -0
- data/doc/classes/Dnsruby/Hosts.src/M000202.html +20 -0
- data/doc/classes/Dnsruby/Hosts.src/M000203.html +21 -0
- data/doc/classes/Dnsruby/IPv4.html +233 -0
- data/doc/classes/Dnsruby/IPv4.src/M000204.html +32 -0
- data/doc/classes/Dnsruby/IPv4.src/M000205.html +19 -0
- data/doc/classes/Dnsruby/IPv4.src/M000206.html +18 -0
- data/doc/classes/Dnsruby/IPv4.src/M000207.html +18 -0
- data/doc/classes/Dnsruby/IPv4.src/M000208.html +18 -0
- data/doc/classes/Dnsruby/IPv6.html +281 -0
- data/doc/classes/Dnsruby/IPv6.src/M000242.html +60 -0
- data/doc/classes/Dnsruby/IPv6.src/M000243.html +22 -0
- data/doc/classes/Dnsruby/IPv6.src/M000244.html +20 -0
- data/doc/classes/Dnsruby/IPv6.src/M000245.html +18 -0
- data/doc/classes/Dnsruby/Message.html +803 -0
- data/doc/classes/Dnsruby/Message.src/M000119.html +38 -0
- data/doc/classes/Dnsruby/Message.src/M000120.html +26 -0
- data/doc/classes/Dnsruby/Message.src/M000121.html +22 -0
- data/doc/classes/Dnsruby/Message.src/M000122.html +22 -0
- data/doc/classes/Dnsruby/Message.src/M000123.html +20 -0
- data/doc/classes/Dnsruby/Message.src/M000124.html +20 -0
- data/doc/classes/Dnsruby/Message.src/M000125.html +20 -0
- data/doc/classes/Dnsruby/Message.src/M000126.html +20 -0
- data/doc/classes/Dnsruby/Message.src/M000127.html +18 -0
- data/doc/classes/Dnsruby/Message.src/M000128.html +20 -0
- data/doc/classes/Dnsruby/Message.src/M000129.html +23 -0
- data/doc/classes/Dnsruby/Message.src/M000130.html +30 -0
- data/doc/classes/Dnsruby/Message.src/M000131.html +20 -0
- data/doc/classes/Dnsruby/Message.src/M000132.html +18 -0
- data/doc/classes/Dnsruby/Message.src/M000133.html +56 -0
- data/doc/classes/Dnsruby/Message.src/M000134.html +35 -0
- data/doc/classes/Dnsruby/Message.src/M000135.html +46 -0
- data/doc/classes/Dnsruby/Message/Section.html +160 -0
- data/doc/classes/Dnsruby/Message/Section.src/M000141.html +29 -0
- data/doc/classes/Dnsruby/Message/Section.src/M000142.html +30 -0
- data/doc/classes/Dnsruby/MetaTypes.html +136 -0
- data/doc/classes/Dnsruby/Modes.html +171 -0
- data/doc/classes/Dnsruby/NXDomain.html +119 -0
- data/doc/classes/Dnsruby/Name.html +330 -0
- data/doc/classes/Dnsruby/Name.src/M000104.html +28 -0
- data/doc/classes/Dnsruby/Name.src/M000105.html +20 -0
- data/doc/classes/Dnsruby/Name.src/M000106.html +18 -0
- data/doc/classes/Dnsruby/Name.src/M000107.html +21 -0
- data/doc/classes/Dnsruby/Name.src/M000108.html +22 -0
- data/doc/classes/Dnsruby/Name.src/M000109.html +18 -0
- data/doc/classes/Dnsruby/Name/Label.html +300 -0
- data/doc/classes/Dnsruby/Name/Label.src/M000110.html +21 -0
- data/doc/classes/Dnsruby/Name/Label.src/M000111.html +18 -0
- data/doc/classes/Dnsruby/Name/Label.src/M000112.html +22 -0
- data/doc/classes/Dnsruby/Name/Label.src/M000113.html +18 -0
- data/doc/classes/Dnsruby/Name/Label.src/M000114.html +18 -0
- data/doc/classes/Dnsruby/Name/Label.src/M000115.html +18 -0
- data/doc/classes/Dnsruby/Name/Label.src/M000116.html +18 -0
- data/doc/classes/Dnsruby/Name/Label.src/M000117.html +18 -0
- data/doc/classes/Dnsruby/Name/Label.src/M000118.html +18 -0
- data/doc/classes/Dnsruby/NotImp.html +119 -0
- data/doc/classes/Dnsruby/OpCode.html +146 -0
- data/doc/classes/Dnsruby/OtherResolvError.html +119 -0
- data/doc/classes/Dnsruby/QTypes.html +146 -0
- data/doc/classes/Dnsruby/Question.html +301 -0
- data/doc/classes/Dnsruby/Question.src/M000226.html +47 -0
- data/doc/classes/Dnsruby/Question.src/M000227.html +18 -0
- data/doc/classes/Dnsruby/Question.src/M000228.html +18 -0
- data/doc/classes/Dnsruby/Question.src/M000229.html +32 -0
- data/doc/classes/Dnsruby/Question.src/M000230.html +18 -0
- data/doc/classes/Dnsruby/RCode.html +211 -0
- data/doc/classes/Dnsruby/RR.html +648 -0
- data/doc/classes/Dnsruby/RR.src/M000001.html +18 -0
- data/doc/classes/Dnsruby/RR.src/M000002.html +22 -0
- data/doc/classes/Dnsruby/RR.src/M000003.html +18 -0
- data/doc/classes/Dnsruby/RR.src/M000004.html +18 -0
- data/doc/classes/Dnsruby/RR.src/M000005.html +26 -0
- data/doc/classes/Dnsruby/RR.src/M000006.html +18 -0
- data/doc/classes/Dnsruby/RR.src/M000007.html +36 -0
- data/doc/classes/Dnsruby/RR.src/M000008.html +100 -0
- data/doc/classes/Dnsruby/RR.src/M000009.html +18 -0
- data/doc/classes/Dnsruby/RR.src/M000010.html +18 -0
- data/doc/classes/Dnsruby/RR.src/M000011.html +22 -0
- data/doc/classes/Dnsruby/RR.src/M000012.html +29 -0
- data/doc/classes/Dnsruby/RR.src/M000013.html +24 -0
- data/doc/classes/Dnsruby/RR/ANY.html +133 -0
- data/doc/classes/Dnsruby/RR/CERT.html +180 -0
- data/doc/classes/Dnsruby/RR/CERT/CertificateTypes.html +169 -0
- data/doc/classes/Dnsruby/RR/CNAME.html +151 -0
- data/doc/classes/Dnsruby/RR/DNAME.html +150 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.html +422 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000044.html +20 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000045.html +21 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000046.html +28 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000047.html +22 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000048.html +18 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000049.html +22 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000050.html +18 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000051.html +26 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000052.html +38 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000053.html +45 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000054.html +21 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000055.html +24 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000056.html +32 -0
- data/doc/classes/Dnsruby/RR/DNSKEY.src/M000057.html +24 -0
- data/doc/classes/Dnsruby/RR/DS.html +286 -0
- data/doc/classes/Dnsruby/RR/DS.src/M000039.html +22 -0
- data/doc/classes/Dnsruby/RR/DS.src/M000040.html +28 -0
- data/doc/classes/Dnsruby/RR/DS.src/M000041.html +24 -0
- data/doc/classes/Dnsruby/RR/DS.src/M000042.html +28 -0
- data/doc/classes/Dnsruby/RR/DS.src/M000043.html +36 -0
- data/doc/classes/Dnsruby/RR/DomainName.html +175 -0
- data/doc/classes/Dnsruby/RR/DomainName.src/M000083.html +18 -0
- data/doc/classes/Dnsruby/RR/Generic.html +133 -0
- data/doc/classes/Dnsruby/RR/HINFO.html +155 -0
- data/doc/classes/Dnsruby/RR/IN.html +155 -0
- data/doc/classes/Dnsruby/RR/IN/A.html +200 -0
- data/doc/classes/Dnsruby/RR/IN/A.src/M000017.html +18 -0
- data/doc/classes/Dnsruby/RR/IN/A.src/M000018.html +18 -0
- data/doc/classes/Dnsruby/RR/IN/A.src/M000019.html +18 -0
- data/doc/classes/Dnsruby/RR/IN/AAAA.html +139 -0
- data/doc/classes/Dnsruby/RR/IN/AFSDB.html +145 -0
- data/doc/classes/Dnsruby/RR/IN/PX.html +143 -0
- data/doc/classes/Dnsruby/RR/IN/SRV.html +238 -0
- data/doc/classes/Dnsruby/RR/IN/SRV.src/M000014.html +29 -0
- data/doc/classes/Dnsruby/RR/IN/SRV.src/M000015.html +26 -0
- data/doc/classes/Dnsruby/RR/IN/SRV.src/M000016.html +22 -0
- data/doc/classes/Dnsruby/RR/IN/WKS.html +166 -0
- data/doc/classes/Dnsruby/RR/IN/WKS.src/M000020.html +20 -0
- data/doc/classes/Dnsruby/RR/ISDN.html +155 -0
- data/doc/classes/Dnsruby/RR/LOC.html +395 -0
- data/doc/classes/Dnsruby/RR/LOC.src/M000025.html +32 -0
- data/doc/classes/Dnsruby/RR/LOC.src/M000026.html +23 -0
- data/doc/classes/Dnsruby/RR/LOC.src/M000027.html +25 -0
- data/doc/classes/Dnsruby/RR/LOC.src/M000028.html +21 -0
- data/doc/classes/Dnsruby/RR/LOC.src/M000029.html +20 -0
- data/doc/classes/Dnsruby/RR/LOC.src/M000030.html +23 -0
- data/doc/classes/Dnsruby/RR/MB.html +150 -0
- data/doc/classes/Dnsruby/RR/MG.html +150 -0
- data/doc/classes/Dnsruby/RR/MINFO.html +156 -0
- data/doc/classes/Dnsruby/RR/MR.html +150 -0
- data/doc/classes/Dnsruby/RR/MX.html +155 -0
- data/doc/classes/Dnsruby/RR/NAPTR.html +190 -0
- data/doc/classes/Dnsruby/RR/NS.html +151 -0
- data/doc/classes/Dnsruby/RR/NSAP.html +293 -0
- data/doc/classes/Dnsruby/RR/NSAP.src/M000093.html +19 -0
- data/doc/classes/Dnsruby/RR/NSAP.src/M000094.html +19 -0
- data/doc/classes/Dnsruby/RR/NSAP.src/M000095.html +22 -0
- data/doc/classes/Dnsruby/RR/NSAP.src/M000096.html +31 -0
- data/doc/classes/Dnsruby/RR/NSEC.html +301 -0
- data/doc/classes/Dnsruby/RR/NSEC.src/M000031.html +19 -0
- data/doc/classes/Dnsruby/RR/NSEC.src/M000032.html +18 -0
- data/doc/classes/Dnsruby/RR/NSEC.src/M000033.html +34 -0
- data/doc/classes/Dnsruby/RR/NSEC.src/M000034.html +18 -0
- data/doc/classes/Dnsruby/RR/NSEC.src/M000035.html +71 -0
- data/doc/classes/Dnsruby/RR/NSEC.src/M000036.html +18 -0
- data/doc/classes/Dnsruby/RR/NSEC.src/M000037.html +80 -0
- data/doc/classes/Dnsruby/RR/NSEC.src/M000038.html +23 -0
- data/doc/classes/Dnsruby/RR/NSEC3.html +366 -0
- data/doc/classes/Dnsruby/RR/NSEC3.src/M000085.html +28 -0
- data/doc/classes/Dnsruby/RR/NSEC3.src/M000086.html +18 -0
- data/doc/classes/Dnsruby/RR/NSEC3.src/M000087.html +18 -0
- data/doc/classes/Dnsruby/RR/NSEC3.src/M000088.html +22 -0
- data/doc/classes/Dnsruby/RR/NSEC3.src/M000089.html +18 -0
- data/doc/classes/Dnsruby/RR/NSEC3.src/M000090.html +21 -0
- data/doc/classes/Dnsruby/RR/NSEC3.src/M000091.html +21 -0
- data/doc/classes/Dnsruby/RR/NSEC3.src/M000092.html +29 -0
- data/doc/classes/Dnsruby/RR/NSEC3PARAM.html +279 -0
- data/doc/classes/Dnsruby/RR/NSEC3PARAM.src/M000077.html +28 -0
- data/doc/classes/Dnsruby/RR/NSEC3PARAM.src/M000078.html +18 -0
- data/doc/classes/Dnsruby/RR/NSEC3PARAM.src/M000079.html +22 -0
- data/doc/classes/Dnsruby/RR/NSEC3PARAM.src/M000080.html +21 -0
- data/doc/classes/Dnsruby/RR/NSEC3PARAM.src/M000081.html +25 -0
- data/doc/classes/Dnsruby/RR/PTR.html +132 -0
- data/doc/classes/Dnsruby/RR/RP.html +183 -0
- data/doc/classes/Dnsruby/RR/RP.src/M000082.html +19 -0
- data/doc/classes/Dnsruby/RR/RRSIG.html +357 -0
- data/doc/classes/Dnsruby/RR/RRSIG.src/M000097.html +26 -0
- data/doc/classes/Dnsruby/RR/RRSIG.src/M000098.html +28 -0
- data/doc/classes/Dnsruby/RR/RRSIG.src/M000099.html +23 -0
- data/doc/classes/Dnsruby/RR/RRSIG.src/M000100.html +23 -0
- data/doc/classes/Dnsruby/RR/RRSIG.src/M000101.html +46 -0
- data/doc/classes/Dnsruby/RR/RRSIG.src/M000102.html +50 -0
- data/doc/classes/Dnsruby/RR/RRSIG.src/M000103.html +27 -0
- data/doc/classes/Dnsruby/RR/RT.html +155 -0
- data/doc/classes/Dnsruby/RR/SOA.html +233 -0
- data/doc/classes/Dnsruby/RR/SOA.src/M000066.html +24 -0
- data/doc/classes/Dnsruby/RR/SOA.src/M000067.html +27 -0
- data/doc/classes/Dnsruby/RR/SPF.html +138 -0
- data/doc/classes/Dnsruby/RR/TKEY.html +313 -0
- data/doc/classes/Dnsruby/RR/TKEY.src/M000021.html +19 -0
- data/doc/classes/Dnsruby/RR/TKEY.src/M000022.html +29 -0
- data/doc/classes/Dnsruby/RR/TKEY.src/M000023.html +21 -0
- data/doc/classes/Dnsruby/RR/TKEY.src/M000024.html +29 -0
- data/doc/classes/Dnsruby/RR/TSIG.html +524 -0
- data/doc/classes/Dnsruby/RR/TSIG.src/M000068.html +24 -0
- data/doc/classes/Dnsruby/RR/TSIG.src/M000069.html +32 -0
- data/doc/classes/Dnsruby/RR/TSIG.src/M000070.html +54 -0
- data/doc/classes/Dnsruby/RR/TSIG.src/M000071.html +121 -0
- data/doc/classes/Dnsruby/RR/TSIG.src/M000072.html +33 -0
- data/doc/classes/Dnsruby/RR/TSIG.src/M000073.html +25 -0
- data/doc/classes/Dnsruby/RR/TSIG.src/M000074.html +36 -0
- data/doc/classes/Dnsruby/RR/TSIG.src/M000075.html +22 -0
- data/doc/classes/Dnsruby/RR/TSIG.src/M000076.html +29 -0
- data/doc/classes/Dnsruby/RR/TXT.html +233 -0
- data/doc/classes/Dnsruby/RR/TXT.src/M000061.html +18 -0
- data/doc/classes/Dnsruby/RR/TXT.src/M000062.html +18 -0
- data/doc/classes/Dnsruby/RR/TXT.src/M000063.html +20 -0
- data/doc/classes/Dnsruby/RR/TXT.src/M000064.html +27 -0
- data/doc/classes/Dnsruby/RR/TXT.src/M000065.html +25 -0
- data/doc/classes/Dnsruby/RR/X25.html +203 -0
- data/doc/classes/Dnsruby/RR/X25.src/M000058.html +18 -0
- data/doc/classes/Dnsruby/RR/X25.src/M000059.html +18 -0
- data/doc/classes/Dnsruby/RR/X25.src/M000060.html +22 -0
- data/doc/classes/Dnsruby/RRSet.html +404 -0
- data/doc/classes/Dnsruby/RRSet.src/M000211.html +23 -0
- data/doc/classes/Dnsruby/RRSet.src/M000212.html +18 -0
- data/doc/classes/Dnsruby/RRSet.src/M000213.html +18 -0
- data/doc/classes/Dnsruby/RRSet.src/M000214.html +47 -0
- data/doc/classes/Dnsruby/RRSet.src/M000215.html +42 -0
- data/doc/classes/Dnsruby/RRSet.src/M000216.html +18 -0
- data/doc/classes/Dnsruby/RRSet.src/M000217.html +20 -0
- data/doc/classes/Dnsruby/RRSet.src/M000218.html +18 -0
- data/doc/classes/Dnsruby/RRSet.src/M000219.html +18 -0
- data/doc/classes/Dnsruby/RRSet.src/M000220.html +18 -0
- data/doc/classes/Dnsruby/RRSet.src/M000221.html +18 -0
- data/doc/classes/Dnsruby/RRSet.src/M000222.html +22 -0
- data/doc/classes/Dnsruby/RRSet.src/M000223.html +18 -0
- data/doc/classes/Dnsruby/RRSet.src/M000224.html +22 -0
- data/doc/classes/Dnsruby/RRSet.src/M000225.html +18 -0
- data/doc/classes/Dnsruby/Refused.html +119 -0
- data/doc/classes/Dnsruby/Resolv.html +401 -0
- data/doc/classes/Dnsruby/Resolv.src/M000159.html +18 -0
- data/doc/classes/Dnsruby/Resolv.src/M000160.html +18 -0
- data/doc/classes/Dnsruby/Resolv.src/M000161.html +18 -0
- data/doc/classes/Dnsruby/Resolv.src/M000162.html +18 -0
- data/doc/classes/Dnsruby/Resolv.src/M000163.html +18 -0
- data/doc/classes/Dnsruby/Resolv.src/M000164.html +18 -0
- data/doc/classes/Dnsruby/Resolv.src/M000165.html +18 -0
- data/doc/classes/Dnsruby/Resolv.src/M000166.html +19 -0
- data/doc/classes/Dnsruby/Resolv.src/M000167.html +20 -0
- data/doc/classes/Dnsruby/Resolv.src/M000168.html +29 -0
- data/doc/classes/Dnsruby/Resolv.src/M000169.html +19 -0
- data/doc/classes/Dnsruby/Resolv.src/M000170.html +20 -0
- data/doc/classes/Dnsruby/Resolv.src/M000171.html +25 -0
- data/doc/classes/Dnsruby/ResolvError.html +117 -0
- data/doc/classes/Dnsruby/ResolvTimeout.html +117 -0
- data/doc/classes/Dnsruby/Resolver.html +1055 -0
- data/doc/classes/Dnsruby/Resolver.src/M000271.html +21 -0
- data/doc/classes/Dnsruby/Resolver.src/M000272.html +27 -0
- data/doc/classes/Dnsruby/Resolver.src/M000273.html +28 -0
- data/doc/classes/Dnsruby/Resolver.src/M000274.html +18 -0
- data/doc/classes/Dnsruby/Resolver.src/M000275.html +51 -0
- data/doc/classes/Dnsruby/Resolver.src/M000276.html +21 -0
- data/doc/classes/Dnsruby/Resolver.src/M000277.html +22 -0
- data/doc/classes/Dnsruby/Resolver.src/M000278.html +18 -0
- data/doc/classes/Dnsruby/Resolver.src/M000279.html +20 -0
- data/doc/classes/Dnsruby/Resolver.src/M000280.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000281.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000282.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000283.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000284.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000285.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000286.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000287.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000288.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000289.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000290.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000291.html +19 -0
- data/doc/classes/Dnsruby/Resolver.src/M000292.html +26 -0
- data/doc/classes/Dnsruby/Resolver.src/M000293.html +18 -0
- data/doc/classes/Dnsruby/Resolver.src/M000294.html +23 -0
- data/doc/classes/Dnsruby/Resolver.src/M000295.html +18 -0
- data/doc/classes/Dnsruby/ServFail.html +119 -0
- data/doc/classes/Dnsruby/SingleResolver.html +674 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000172.html +18 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000173.html +24 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000174.html +36 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000175.html +18 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000176.html +19 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000177.html +50 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000178.html +19 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000179.html +21 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000180.html +25 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000181.html +54 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000182.html +27 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000183.html +27 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000184.html +35 -0
- data/doc/classes/Dnsruby/SingleResolver.src/M000185.html +21 -0
- data/doc/classes/Dnsruby/TheLog.html +196 -0
- data/doc/classes/Dnsruby/TheLog.src/M000246.html +20 -0
- data/doc/classes/Dnsruby/TheLog.src/M000247.html +20 -0
- data/doc/classes/Dnsruby/TheLog.src/M000248.html +20 -0
- data/doc/classes/Dnsruby/Types.html +436 -0
- data/doc/classes/Dnsruby/Update.html +368 -0
- data/doc/classes/Dnsruby/Update.src/M000253.html +32 -0
- data/doc/classes/Dnsruby/Update.src/M000254.html +36 -0
- data/doc/classes/Dnsruby/Update.src/M000255.html +32 -0
- data/doc/classes/Dnsruby/Update.src/M000256.html +41 -0
- data/doc/classes/Dnsruby/Update.src/M000257.html +34 -0
- data/doc/classes/Dnsruby/VerifyError.html +119 -0
- data/doc/classes/Dnsruby/ZoneTransfer.html +300 -0
- data/doc/classes/Dnsruby/ZoneTransfer.src/M000143.html +18 -0
- data/doc/classes/Dnsruby/ZoneTransfer.src/M000144.html +24 -0
- data/doc/classes/Dnsruby/ZoneTransfer.src/M000145.html +35 -0
- data/doc/classes/Dnsruby/ZoneTransfer/Delta.html +200 -0
- data/doc/classes/Dnsruby/ZoneTransfer/Delta.src/M000146.html +19 -0
- data/doc/classes/Dnsruby/ZoneTransfer/Delta.src/M000147.html +19 -0
- data/doc/created.rid +1 -0
- data/doc/files/lib/Dnsruby/Config_rb.html +101 -0
- data/doc/files/lib/Dnsruby/DNS_rb.html +110 -0
- data/doc/files/lib/Dnsruby/Hosts_rb.html +108 -0
- data/doc/files/lib/Dnsruby/Resolver_rb.html +109 -0
- data/doc/files/lib/Dnsruby/SingleResolver_rb.html +108 -0
- data/doc/files/lib/Dnsruby/TheLog_rb.html +110 -0
- data/doc/files/lib/Dnsruby/code_mapper_rb.html +101 -0
- data/doc/files/lib/Dnsruby/dnssec_rb.html +107 -0
- data/doc/files/lib/Dnsruby/event_machine_interface_rb.html +108 -0
- data/doc/files/lib/Dnsruby/ipv4_rb.html +101 -0
- data/doc/files/lib/Dnsruby/ipv6_rb.html +101 -0
- data/doc/files/lib/Dnsruby/message_rb.html +109 -0
- data/doc/files/lib/Dnsruby/name_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/AAAA_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/AFSDB_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/A_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/CERT_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/DNSKEY_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/DS_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/HINFO_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/IN_rb.html +112 -0
- data/doc/files/lib/Dnsruby/resource/ISDN_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/LOC_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/MINFO_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/MX_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/NAPTR_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/NSAP_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/NSEC3PARAM_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/NSEC3_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/NSEC_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/OPT_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/PX_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/RP_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/RRSIG_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/RT_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/SOA_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/SPF_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/SRV_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/TKEY_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/TSIG_rb.html +114 -0
- data/doc/files/lib/Dnsruby/resource/TXT_rb.html +108 -0
- data/doc/files/lib/Dnsruby/resource/X25_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/domain_name_rb.html +101 -0
- data/doc/files/lib/Dnsruby/resource/generic_rb.html +131 -0
- data/doc/files/lib/Dnsruby/resource/resource_rb.html +110 -0
- data/doc/files/lib/Dnsruby/select_thread_rb.html +111 -0
- data/doc/files/lib/Dnsruby/update_rb.html +101 -0
- data/doc/files/lib/Dnsruby/zone_transfer_rb.html +101 -0
- data/doc/files/lib/dnsruby_rb.html +118 -0
- data/doc/fr_class_index.html +108 -0
- data/doc/fr_file_index.html +75 -0
- data/doc/fr_method_index.html +321 -0
- data/doc/index.html +24 -0
- data/lib/Dnsruby/DNS.rb +3 -3
- data/lib/Dnsruby/Resolver.rb +11 -2
- data/lib/Dnsruby/SingleResolver.rb +28 -20
- data/lib/Dnsruby/code_mapper.rb +9 -4
- data/lib/Dnsruby/dnssec.rb +6 -3
- data/lib/Dnsruby/message.rb +108 -32
- data/lib/Dnsruby/resource/DLV.rb +27 -0
- data/lib/Dnsruby/resource/DNSKEY.rb +29 -7
- data/lib/Dnsruby/resource/DS.rb +97 -18
- data/lib/Dnsruby/resource/DS.rb.new +202 -0
- data/lib/Dnsruby/resource/DS.rb.orig +162 -0
- data/lib/Dnsruby/resource/NSEC.rb +22 -6
- data/lib/Dnsruby/resource/OPT.rb +14 -13
- data/lib/Dnsruby/resource/PX.rb +1 -1
- data/lib/Dnsruby/resource/RRSIG.rb +17 -9
- data/lib/Dnsruby/resource/RT.rb +1 -1
- data/lib/Dnsruby/resource/TSIG.rb +4 -0
- data/lib/Dnsruby/resource/generic.rb +2 -1
- data/lib/Dnsruby/resource/resource.rb +23 -8
- data/lib/Dnsruby/select_thread.rb +15 -7
- data/lib/Dnsruby/update.rb +3 -3
- data/lib/Dnsruby/zone_transfer.rb +1 -1
- data/lib/dnsruby.rb +4 -2
- data/test/tc_dns.rb +1 -1
- data/test/tc_ds.rb +47 -4
- data/test/tc_em_deferrable.rb +38 -0
- data/test/tc_event_machine_res.rb +1 -1
- data/test/tc_header.rb +2 -2
- data/test/tc_inet6.rb +170 -0
- data/test/tc_nsec3.rb +6 -5
- data/test/tc_packet.rb +18 -4
- data/test/tc_queue.rb +17 -0
- data/test/tc_resolver.rb +14 -14
- data/test/tc_rr-opt.rb +21 -2
- data/test/tc_rr.rb +4 -0
- data/test/tc_rrset.rb +2 -2
- data/test/tc_rrsig.rb +2 -2
- data/test/tc_tcp.rb +1 -1
- data/test/tc_tsig.rb +6 -6
- data/test/ts_offline.rb +17 -2
- data/test/ts_online.rb +4 -0
- metadata +496 -3
@@ -0,0 +1,202 @@
|
|
1
|
+
#--
|
2
|
+
#Copyright 2007 Nominet UK
|
3
|
+
#
|
4
|
+
#Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
#you may not use this file except in compliance with the License.
|
6
|
+
#You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
#Unless required by applicable law or agreed to in writing, software
|
11
|
+
#distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
#See the License for the specific language governing permissions and
|
14
|
+
#limitations under the License.
|
15
|
+
#++
|
16
|
+
module Dnsruby
|
17
|
+
class RR
|
18
|
+
#RFC4034, section 4
|
19
|
+
#The DS Resource Record refers to a DNSKEY RR and is used in the DNS
|
20
|
+
#DNSKEY authentication process. A DS RR refers to a DNSKEY RR by
|
21
|
+
#storing the key tag, algorithm number, and a digest of the DNSKEY RR.
|
22
|
+
#Note that while the digest should be sufficient to identify the
|
23
|
+
#public key, storing the key tag and key algorithm helps make the
|
24
|
+
#identification process more efficient. By authenticating the DS
|
25
|
+
#record, a resolver can authenticate the DNSKEY RR to which the DS
|
26
|
+
#record points. The key authentication process is described in
|
27
|
+
#[RFC4035].
|
28
|
+
|
29
|
+
class DS < RR
|
30
|
+
class DigestTypes < CodeMapper
|
31
|
+
update()
|
32
|
+
add_pair("SHA-1", 1)
|
33
|
+
add_pair("SHA-2", 2 )
|
34
|
+
end
|
35
|
+
|
36
|
+
ClassValue = nil #:nodoc: all
|
37
|
+
TypeValue = Types::DS #:nodoc: all
|
38
|
+
|
39
|
+
#The RDATA for a DS RR consists of a 2 octet Key Tag field, a 1 octet
|
40
|
+
#Algorithm field, a 1 octet Digest Type field, and a Digest field.
|
41
|
+
#
|
42
|
+
# 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
|
43
|
+
# 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
44
|
+
#+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
45
|
+
#| Key Tag | Algorithm | Digest Type |
|
46
|
+
#+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
47
|
+
#/ /
|
48
|
+
#/ Digest /
|
49
|
+
#/ /
|
50
|
+
#+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
51
|
+
|
52
|
+
|
53
|
+
#The Key Tag field lists the key tag of the DNSKEY RR referred to by
|
54
|
+
#the DS record, in network byte order.
|
55
|
+
attr_accessor :key_tag
|
56
|
+
#The algorithm used for this key
|
57
|
+
#See Dnsruby::Algorithms for permitted values
|
58
|
+
attr_reader :algorithm
|
59
|
+
#The DS RR refers to a DNSKEY RR by including a digest of that DNSKEY
|
60
|
+
#RR. The Digest Type field identifies the algorithm used to construct
|
61
|
+
#the digest.
|
62
|
+
attr_reader :digest_type
|
63
|
+
#The DS record refers to a DNSKEY RR by including a digest of that
|
64
|
+
#DNSKEY RR.
|
65
|
+
attr_accessor :digest
|
66
|
+
|
67
|
+
def digest_type=(d)
|
68
|
+
dig = DS.get_digest_type(d)
|
69
|
+
@digest_type = dig
|
70
|
+
end
|
71
|
+
|
72
|
+
def DS.get_digest_type(d)
|
73
|
+
if (d.instance_of?String)
|
74
|
+
if (d.length == 1)
|
75
|
+
d = d.to_i
|
76
|
+
end
|
77
|
+
end
|
78
|
+
begin
|
79
|
+
digest = DigestTypes.new(d)
|
80
|
+
return digest
|
81
|
+
rescue ArgumentError => e
|
82
|
+
raise DecodeError.new(e)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def algorithm=(a)
|
87
|
+
if (a.instance_of?String)
|
88
|
+
if (a.length == 1)
|
89
|
+
a = a.to_i
|
90
|
+
end
|
91
|
+
end
|
92
|
+
begin
|
93
|
+
alg = Algorithms.new(a)
|
94
|
+
@algorithm = alg
|
95
|
+
rescue ArgumentError => e
|
96
|
+
raise DecodeError.new(e)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
# Return the digest of the specified DNSKEY RR
|
101
|
+
def digest_key(key)
|
102
|
+
return DS.digest_key(key, @digest_type)
|
103
|
+
end
|
104
|
+
|
105
|
+
def DS.digest_key(key, digest_type)
|
106
|
+
data = MessageEncoder.new {|msg|
|
107
|
+
msg.put_rr(key, true)
|
108
|
+
}.to_s
|
109
|
+
|
110
|
+
if (digest_type.code == 1)
|
111
|
+
digest = OpenSSL::Digest::SHA1.digest(data)
|
112
|
+
print digest.to_s + "\n"
|
113
|
+
return digest
|
114
|
+
elsif (digest_type.code == 2)
|
115
|
+
digest = OpenSSL::Digest::SHA256.digest(data)
|
116
|
+
print digest.to_s + "\n"
|
117
|
+
return digest
|
118
|
+
end
|
119
|
+
|
120
|
+
end
|
121
|
+
|
122
|
+
# Check if the key's digest is the same as that stored in the DS record
|
123
|
+
def check_key(key)
|
124
|
+
if (key.key_tag == @key_tag)
|
125
|
+
digest = digest_key(key)
|
126
|
+
if (@digest == digest)
|
127
|
+
if (!key.zone_key?)
|
128
|
+
else
|
129
|
+
return true
|
130
|
+
end
|
131
|
+
else
|
132
|
+
end
|
133
|
+
end
|
134
|
+
return false
|
135
|
+
end
|
136
|
+
|
137
|
+
def DS.from_key(key, digest_type)
|
138
|
+
digest_type = get_digest_type(digest_type)
|
139
|
+
# Create a new DS record from the specified key
|
140
|
+
ds = RR.create(:name => key.name, :type => "DS", :ttl => key.ttl,
|
141
|
+
:key_tag => key.key_tag,
|
142
|
+
:digest_type => digest_type, :algorithm => key.algorithm,
|
143
|
+
:digest => digest_key(key, digest_type))
|
144
|
+
return ds
|
145
|
+
end
|
146
|
+
|
147
|
+
|
148
|
+
def from_data(data) #:nodoc: all
|
149
|
+
key_tag, algorithm, digest_type, digest = data
|
150
|
+
self.key_tag=(key_tag)
|
151
|
+
self.algorithm=(algorithm)
|
152
|
+
self.digest_type=(digest_type)
|
153
|
+
self.digest=(digest)
|
154
|
+
end
|
155
|
+
|
156
|
+
def from_string(input)
|
157
|
+
if (input.length > 0)
|
158
|
+
data = input.split(" ")
|
159
|
+
self.key_tag=(data[0].to_i)
|
160
|
+
self.algorithm=(data[1])
|
161
|
+
self.digest_type=(data[2])
|
162
|
+
|
163
|
+
buf = ""
|
164
|
+
index = 3
|
165
|
+
end_index = data.length - 1
|
166
|
+
if (data[index]=="(")
|
167
|
+
end_index = data.length - 2
|
168
|
+
index = 4
|
169
|
+
end
|
170
|
+
(index..end_index).each {|i|
|
171
|
+
buf += data[i]
|
172
|
+
}
|
173
|
+
## self.digest=Base64.decode64(buf)
|
174
|
+
# buf.gsub!(/\n/, "")
|
175
|
+
# buf.gsub!(/ /, "")
|
176
|
+
self.digest=buf.unpack("m*")[0]
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
def rdata_to_string #:nodoc: all
|
181
|
+
if (@key_tag != nil)
|
182
|
+
# return "#{@key_tag.to_i} #{@algorithm.string} #{@digest_type} ( #{Base64.encode64(@digest)} )"
|
183
|
+
return "#{@key_tag.to_i} #{@algorithm.string} #{@digest_type.code} ( #{[@digest].pack("m*").gsub("\n", "")} )"
|
184
|
+
else
|
185
|
+
return ""
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
def encode_rdata(msg, canonical=false) #:nodoc: all
|
190
|
+
msg.put_pack("ncc", @key_tag, @algorithm.code, @digest_type.code)
|
191
|
+
msg.put_bytes(@digest)
|
192
|
+
end
|
193
|
+
|
194
|
+
def self.decode_rdata(msg) #:nodoc: all
|
195
|
+
key_tag, algorithm, digest_type = msg.get_unpack("ncc")
|
196
|
+
digest = msg.get_bytes
|
197
|
+
return self.new(
|
198
|
+
[key_tag, algorithm, digest_type, digest])
|
199
|
+
end
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
@@ -0,0 +1,162 @@
|
|
1
|
+
#--
|
2
|
+
#Copyright 2007 Nominet UK
|
3
|
+
#
|
4
|
+
#Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
#you may not use this file except in compliance with the License.
|
6
|
+
#You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
#Unless required by applicable law or agreed to in writing, software
|
11
|
+
#distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
#See the License for the specific language governing permissions and
|
14
|
+
#limitations under the License.
|
15
|
+
#++
|
16
|
+
module Dnsruby
|
17
|
+
class RR
|
18
|
+
#RFC4034, section 4
|
19
|
+
#The DS Resource Record refers to a DNSKEY RR and is used in the DNS
|
20
|
+
#DNSKEY authentication process. A DS RR refers to a DNSKEY RR by
|
21
|
+
#storing the key tag, algorithm number, and a digest of the DNSKEY RR.
|
22
|
+
#Note that while the digest should be sufficient to identify the
|
23
|
+
#public key, storing the key tag and key algorithm helps make the
|
24
|
+
#identification process more efficient. By authenticating the DS
|
25
|
+
#record, a resolver can authenticate the DNSKEY RR to which the DS
|
26
|
+
#record points. The key authentication process is described in
|
27
|
+
#[RFC4035].
|
28
|
+
|
29
|
+
class DS < RR
|
30
|
+
ClassValue = nil #:nodoc: all
|
31
|
+
TypeValue = Types::DS #:nodoc: all
|
32
|
+
|
33
|
+
#The RDATA for a DS RR consists of a 2 octet Key Tag field, a 1 octet
|
34
|
+
#Algorithm field, a 1 octet Digest Type field, and a Digest field.
|
35
|
+
#
|
36
|
+
# 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
|
37
|
+
# 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
38
|
+
#+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
39
|
+
#| Key Tag | Algorithm | Digest Type |
|
40
|
+
#+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
41
|
+
#/ /
|
42
|
+
#/ Digest /
|
43
|
+
#/ /
|
44
|
+
#+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
45
|
+
|
46
|
+
|
47
|
+
#The Key Tag field lists the key tag of the DNSKEY RR referred to by
|
48
|
+
#the DS record, in network byte order.
|
49
|
+
attr_accessor :key_tag
|
50
|
+
#The algorithm used for this key
|
51
|
+
#See Dnsruby::Algorithms for permitted values
|
52
|
+
attr_reader :algorithm
|
53
|
+
#The DS RR refers to a DNSKEY RR by including a digest of that DNSKEY
|
54
|
+
#RR. The Digest Type field identifies the algorithm used to construct
|
55
|
+
#the digest.
|
56
|
+
attr_reader :digest_type
|
57
|
+
#The DS record refers to a DNSKEY RR by including a digest of that
|
58
|
+
#DNSKEY RR.
|
59
|
+
attr_accessor :digest
|
60
|
+
|
61
|
+
def digest_type=(d)
|
62
|
+
if ((d == 1) || (d == "SHA-1") || (d == "1"))
|
63
|
+
@digest_type = 1
|
64
|
+
else
|
65
|
+
raise DecodeError.new("Unsupported DS digest type (#{d})")
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def algorithm=(a)
|
70
|
+
if (a.instance_of?String)
|
71
|
+
if (a.length == 1)
|
72
|
+
a = a.to_i
|
73
|
+
end
|
74
|
+
end
|
75
|
+
begin
|
76
|
+
alg = Algorithms.new(a)
|
77
|
+
@algorithm = alg
|
78
|
+
rescue ArgumentError => e
|
79
|
+
raise DecodeError.new(e)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
# Return the digest of the specified DNSKEY RR
|
84
|
+
def digest_key(key)
|
85
|
+
data = MessageEncoder.new {|msg|
|
86
|
+
msg.put_rr(key, true)
|
87
|
+
}.to_s
|
88
|
+
|
89
|
+
OpenSSL::Digest::SHA1.new(data)
|
90
|
+
return digest
|
91
|
+
|
92
|
+
end
|
93
|
+
|
94
|
+
# Check if the key's digest is the same as that stored in the DS record
|
95
|
+
def check_key(key)
|
96
|
+
if (key.key_tag == @key_tag)
|
97
|
+
digest = digest_key(key)
|
98
|
+
if (@digest == digest)
|
99
|
+
if (!key.zone_key?)
|
100
|
+
else
|
101
|
+
return true
|
102
|
+
end
|
103
|
+
else
|
104
|
+
end
|
105
|
+
end
|
106
|
+
return false
|
107
|
+
end
|
108
|
+
|
109
|
+
|
110
|
+
def from_data(data) #:nodoc: all
|
111
|
+
key_tag, algorithm, digest_type, digest = data
|
112
|
+
self.key_tag=(key_tag)
|
113
|
+
self.algorithm=(algorithm)
|
114
|
+
self.digest_type=(digest_type)
|
115
|
+
self.digest=(digest)
|
116
|
+
end
|
117
|
+
|
118
|
+
def from_string(input)
|
119
|
+
if (input.length > 0)
|
120
|
+
data = input.split(" ")
|
121
|
+
self.key_tag=(data[0].to_i)
|
122
|
+
self.algorithm=(data[1])
|
123
|
+
self.digest_type=(data[2])
|
124
|
+
|
125
|
+
buf = ""
|
126
|
+
index = 3
|
127
|
+
end_index = data.length - 1
|
128
|
+
if (data[index]=="(")
|
129
|
+
end_index = data.length - 2
|
130
|
+
index = 4
|
131
|
+
end
|
132
|
+
(index..end_index).each {|i|
|
133
|
+
buf += data[i]
|
134
|
+
}
|
135
|
+
# self.digest=Base64.decode64(buf)
|
136
|
+
self.digest=buf.unpack("m*")[0]
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
def rdata_to_string #:nodoc: all
|
141
|
+
if (@key_tag != nil)
|
142
|
+
# return "#{@key_tag.to_i} #{@algorithm.string} #{@digest_type} ( #{Base64.encode64(@digest)} )"
|
143
|
+
return "#{@key_tag.to_i} #{@algorithm.string} #{@digest_type} ( #{[@digest].pack("m*")} )"
|
144
|
+
else
|
145
|
+
return ""
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
def encode_rdata(msg, canonical=false) #:nodoc: all
|
150
|
+
msg.put_pack("ncc", @key_tag, @algorithm.code, @digest_type)
|
151
|
+
msg.put_bytes(@digest)
|
152
|
+
end
|
153
|
+
|
154
|
+
def self.decode_rdata(msg) #:nodoc: all
|
155
|
+
key_tag, algorithm, digest_type = msg.get_unpack("ncc")
|
156
|
+
digest = msg.get_bytes
|
157
|
+
return self.new(
|
158
|
+
[key_tag, algorithm, digest_type, digest])
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
@@ -95,6 +95,10 @@ module Dnsruby
|
|
95
95
|
end
|
96
96
|
window_number = bytes[pos]
|
97
97
|
bitmap_length = bytes[pos+1]
|
98
|
+
if (window_number.class == String) # Ruby 1.9
|
99
|
+
window_number = window_number.getbyte(0)
|
100
|
+
bitmap_length = bitmap_length.getbyte(0)
|
101
|
+
end
|
98
102
|
pos += 2
|
99
103
|
bitmap = bytes[pos,bitmap_length]
|
100
104
|
pos += bitmap_length
|
@@ -170,7 +174,11 @@ module Dnsruby
|
|
170
174
|
break if (types_to_go.empty?)
|
171
175
|
end
|
172
176
|
bitmap += " "
|
173
|
-
bitmap[bitmap_pos]
|
177
|
+
if (bitmap[bitmap_pos].class == String)
|
178
|
+
bitmap.setbyte(bitmap_pos, byte) # Ruby 1.9
|
179
|
+
else
|
180
|
+
bitmap[bitmap_pos]=byte
|
181
|
+
end
|
174
182
|
bitmap_pos+=1
|
175
183
|
end
|
176
184
|
|
@@ -180,11 +188,19 @@ module Dnsruby
|
|
180
188
|
output += " "
|
181
189
|
end
|
182
190
|
|
183
|
-
output[start]
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
191
|
+
if (output[start].class == String)
|
192
|
+
output.setbyte(start, window)
|
193
|
+
output.setbyte(start+1, bitmap.length)
|
194
|
+
bitmap.length.times do |i|
|
195
|
+
output.setbyte(start+2+i, bitmap[i].getbyte(0))
|
196
|
+
end
|
197
|
+
else
|
198
|
+
output[start] = window
|
199
|
+
output[start+1] = bitmap.length
|
200
|
+
bitmap.length.times do |i|
|
201
|
+
output[start+2+i] = bitmap[i]
|
202
|
+
end
|
203
|
+
end
|
188
204
|
end
|
189
205
|
window += 1
|
190
206
|
|
data/lib/Dnsruby/resource/OPT.rb
CHANGED
@@ -130,7 +130,7 @@ module Dnsruby
|
|
130
130
|
end
|
131
131
|
|
132
132
|
def payloadsize
|
133
|
-
return @klass
|
133
|
+
return @klass.code
|
134
134
|
end
|
135
135
|
|
136
136
|
def payloadsize=(size)
|
@@ -161,28 +161,25 @@ module Dnsruby
|
|
161
161
|
end
|
162
162
|
|
163
163
|
def from_string(input)
|
164
|
-
|
165
|
-
@options = input.split(" ")
|
166
|
-
end
|
164
|
+
raise NotImplementedError
|
167
165
|
end
|
168
166
|
|
169
167
|
def to_s
|
170
|
-
ret = "OPT pseudo-record : #{
|
171
|
-
ret = ""
|
168
|
+
ret = "OPT pseudo-record : payloadsize #{payloadsize}, xrcode #{xrcode}, version #{version}, flags #{flags}"
|
172
169
|
if @options
|
173
170
|
@options.each do |opt|
|
174
|
-
ret = ret + opt.to_s
|
171
|
+
ret = ret + " " + opt.to_s
|
175
172
|
end
|
176
|
-
ret.chomp!
|
177
173
|
end
|
174
|
+
ret = ret + "\n"
|
178
175
|
return ret
|
179
176
|
end
|
180
177
|
|
181
178
|
def encode_rdata(msg, canonical=false)
|
182
179
|
if (@options)
|
183
180
|
@options.each do |opt|
|
184
|
-
msg.
|
185
|
-
msg.
|
181
|
+
msg.put_pack('n', opt.code)
|
182
|
+
msg.put_pack('n', opt.data.length)
|
186
183
|
msg.put_bytes(opt.data)
|
187
184
|
end
|
188
185
|
msg.put_array(@options)
|
@@ -193,10 +190,10 @@ module Dnsruby
|
|
193
190
|
if (msg.has_remaining)
|
194
191
|
options = []
|
195
192
|
while (msg.has_remaining) do
|
196
|
-
code
|
197
|
-
len = msg.
|
193
|
+
code = msg.get_unpack('n')[0]
|
194
|
+
len = msg.get_unpack('n')[0]
|
198
195
|
data = msg.get_bytes(len)
|
199
|
-
options.
|
196
|
+
options.push(Option.new(code, data))
|
200
197
|
end
|
201
198
|
end
|
202
199
|
return self.new([options])
|
@@ -204,6 +201,10 @@ module Dnsruby
|
|
204
201
|
|
205
202
|
class Option
|
206
203
|
attr_accessor :code, :data
|
204
|
+
def initialize(code, data)
|
205
|
+
@code = code
|
206
|
+
@data = data
|
207
|
+
end
|
207
208
|
end
|
208
209
|
end
|
209
210
|
end
|