Skip to content

Commit

Permalink
Add WALLET rdatatype support. (rthalley#1098)
Browse files Browse the repository at this point in the history
  • Loading branch information
rthalley authored Jul 3, 2024
1 parent 84de5d6 commit e5e9f5e
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 8 deletions.
2 changes: 2 additions & 0 deletions dns/rdatatype.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class RdataType(dns.enum.IntEnum):
AVC = 258
AMTRELAY = 260
RESINFO = 261
WALLET = 262
TA = 32768
DLV = 32769

Expand Down Expand Up @@ -328,6 +329,7 @@ def register_type(
AVC = RdataType.AVC
AMTRELAY = RdataType.AMTRELAY
RESINFO = RdataType.RESINFO
WALLET = RdataType.WALLET
TA = RdataType.TA
DLV = RdataType.DLV

Expand Down
8 changes: 8 additions & 0 deletions dns/rdtypes/ANY/WALLET.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license

import dns.immutable
import dns.rdtypes.txtbase

@dns.immutable.immutable
class WALLET(dns.rdtypes.txtbase.TXTBase):
"""WALLET record"""
1 change: 1 addition & 0 deletions dns/rdtypes/ANY/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"TSIG",
"TXT",
"URI",
"WALLET",
"X25",
"ZONEMD",
]
17 changes: 9 additions & 8 deletions tests/example
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

$ORIGIN .
$TTL 300 ; 5 minutes
example IN SOA ns1.example. hostmaster.example. 1 2 3 4 5
example IN SOA ns1.example. hostmaster.example. 1 2 3 4 5
example. NS ns1.example.
ns1.example. A 10.53.0.1
example. NS ns2.example.
Expand Down Expand Up @@ -45,7 +45,7 @@ $TTL 300 ; 5 minutes
b CNAME foo.net.
c A 73.80.65.49
$TTL 3600 ; 1 hour
cert01 CERT 65534 65535 PRIVATEOID MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgi WCn/GxHhai6VAuHAoNUz4YoU1tVfSCSqQYn6//11U6Nl d80jEeC8aTrO+KKmCaY=
cert01 CERT 65534 65535 PRIVATEOID MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgi WCn/GxHhai6VAuHAoNUz4YoU1tVfSCSqQYn6//11U6Nl d80jEeC8aTrO+KKmCaY=
cname01 CNAME cname-target.
cname02 CNAME cname-target
cname03 CNAME .
Expand Down Expand Up @@ -73,16 +73,16 @@ gpos01 GPOS "-22.6882" "116.8652" "250.0"
;;
;; XXXRTH I have commented out the following line because I don't think
;; it is a valid GPOS record.
;;
;;
;;gpos02 GPOS "" "" ""
hinfo01 HINFO "Generic PC clone" "NetBSD-1.4"
hinfo02 HINFO "PC" "NetBSD"
isdn01 ISDN "isdn-address"
isdn02 ISDN "isdn-address" "subaddress"
isdn03 ISDN isdn-address
isdn04 ISDN isdn-address subaddress
;key01 KEY 512 255 1 AQMFD5raczCJHViKtLYhWGz8hMY9UGRuniJDBzC7w0aR yzWZriO6i2odGWWQVucZqKVsENW91IOW4vqudngPZsY3 GvQ/xVA8/7pyFj6b7Esga60zyGW6LFe9r8n6paHrlG5o jqf0BaqHT+8=
;key02 KEY HOST|FLAG4 DNSSEC RSAMD5 AQMFD5raczCJHViKtLYhWGz8hMY9UGRuniJDBzC7w0aR yzWZriO6i2odGWWQVucZqKVsENW91IOW4vqudngPZsY3 GvQ/xVA8/7pyFj6b7Esga60zyGW6LFe9r8n6paHrlG5o jqf0BaqHT+8=
;key01 KEY 512 255 1 AQMFD5raczCJHViKtLYhWGz8hMY9UGRuniJDBzC7w0aR yzWZriO6i2odGWWQVucZqKVsENW91IOW4vqudngPZsY3 GvQ/xVA8/7pyFj6b7Esga60zyGW6LFe9r8n6paHrlG5o jqf0BaqHT+8=
;key02 KEY HOST|FLAG4 DNSSEC RSAMD5 AQMFD5raczCJHViKtLYhWGz8hMY9UGRuniJDBzC7w0aR yzWZriO6i2odGWWQVucZqKVsENW91IOW4vqudngPZsY3 GvQ/xVA8/7pyFj6b7Esga60zyGW6LFe9r8n6paHrlG5o jqf0BaqHT+8=
kx01 KX 10 kdc
kx02 KX 10 .
loc01 LOC 60 9 N 24 39 E 10 20 2000 20
Expand Down Expand Up @@ -129,7 +129,7 @@ $ORIGIN s.example.
ns A 73.80.65.49
$ORIGIN example.
$TTL 3600 ; 1 hour
;sig01 SIG NXT 1 3 3600 20200101000000 20030101000000 2143 foo MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgi WCn/GxHhai6VAuHAoNUz4YoU1tVfSCSqQYn6//11U6Nl d80jEeC8aTrO+KKmCaY=
;sig01 SIG NXT 1 3 3600 20200101000000 20030101000000 2143 foo MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgi WCn/GxHhai6VAuHAoNUz4YoU1tVfSCSqQYn6//11U6Nl d80jEeC8aTrO+KKmCaY=
srv01 SRV 0 0 0 .
srv02 SRV 65535 65535 65535 old-slow-box.example.com.
$TTL 301 ; 5 minutes 1 second
Expand Down Expand Up @@ -173,15 +173,15 @@ apl01 APL 1:192.168.32.0/21 !1:192.168.38.0/28
apl02 APL 1:224.0.0.0/4 2:FF00:0:0:0:0:0:0:0/8
unknown2 TYPE999 \# 8 0a0000010a000001
unknown3 A \# 4 7f000002
rrsig01 RRSIG NSEC 1 3 3600 20200101000000 20030101000000 2143 foo MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgi WCn/GxHhai6VAuHAoNUz4YoU1tVfSCSqQYn6//11U6Nl d80jEeC8aTrO+KKmCaY=
rrsig01 RRSIG NSEC 1 3 3600 20200101000000 20030101000000 2143 foo MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgi WCn/GxHhai6VAuHAoNUz4YoU1tVfSCSqQYn6//11U6Nl d80jEeC8aTrO+KKmCaY=
rrsig02 RRSIG NSEC 1 3 3600 1577836800 1041379200 2143 foo MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgi WCn/GxHhai6VAuHAoNUz4YoU1tVfSCSqQYn6//11U6Nl d80jEeC8aTrO+KKmCaY=
nsec01 NSEC a.secure A MX RRSIG NSEC TYPE1234
nsec02 NSEC . ( NSAP-PTR NSEC )
nsec03 NSEC . ( NSEC TYPE65535 )
nsec301 NSEC3 1 1 12 aabbccdd 2t7b4g4vsa5smi47k61mv5bv1a22bojr MX DNSKEY NS SOA NSEC3PARAM RRSIG
nsec302 NSEC3 1 1 12 - 2t7b4g4vsa5smi47k61mv5bv1a22bojr MX DNSKEY NS SOA NSEC3PARAM RRSIG
nsec303 NSEC3 1 1 1 abcd alkmaao A
dnskey01 DNSKEY 512 255 1 AQMFD5raczCJHViKtLYhWGz8hMY9UGRuniJDBzC7w0aR yzWZriO6i2odGWWQVucZqKVsENW91IOW4vqudngPZsY3 GvQ/xVA8/7pyFj6b7Esga60zyGW6LFe9r8n6paHrlG5o jqf0BaqHT+8=
dnskey01 DNSKEY 512 255 1 AQMFD5raczCJHViKtLYhWGz8hMY9UGRuniJDBzC7w0aR yzWZriO6i2odGWWQVucZqKVsENW91IOW4vqudngPZsY3 GvQ/xVA8/7pyFj6b7Esga60zyGW6LFe9r8n6paHrlG5o jqf0BaqHT+8=
dnskey02 DNSKEY 257 3 RSAMD5 ( AQMFD5raczCJHViKtLYhWGz8hMY9UGRuniJDBzC7w0aR yzWZriO6i2odGWWQVucZqKVsENW91IOW4vqudngPZsY3 GvQ/xVA8/7pyFj6b7Esga60zyGW6LFe9r8n6paHrlG5o jqf0BaqHT+8= )
sshfp1 SSHFP 1 1 aa549bfe898489c02d1715d97d79c57ba2fa76ab
spf SPF "v=spf1 mx -all"
Expand Down Expand Up @@ -266,3 +266,4 @@ svcb05 SVCB 16 foo.example.org. ohttp
https01 HTTPS 0 svc
https02 HTTPS 1 . port=8002 ech="abcd"
resinfo RESINFO qnamemin exterr=15,16,17 infourl=https://resolver.example.com/guide
wallet WALLET EXAMPLE 01234567890abcdef
1 change: 1 addition & 0 deletions tests/example1.good
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ unknown2 3600 IN TYPE999 \# 8 0a0000010a000001
unknown3 3600 IN A 127.0.0.2
uri01 3600 IN URI 10 1 "ftp://ftp1.example.com/public"
uri02 3600 IN URI 10 1 "http://www.example.com/path"
wallet 3600 IN WALLET "EXAMPLE" "01234567890abcdef"
wks01 3600 IN WKS 10.0.0.1 6 0 1 2 21 23
wks02 3600 IN WKS 10.0.0.1 17 0 1 2 53
wks03 3600 IN WKS 10.0.0.2 6 65535
Expand Down
1 change: 1 addition & 0 deletions tests/example2.good
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ unknown2.example. 3600 IN TYPE999 \# 8 0a0000010a000001
unknown3.example. 3600 IN A 127.0.0.2
uri01.example. 3600 IN URI 10 1 "ftp://ftp1.example.com/public"
uri02.example. 3600 IN URI 10 1 "http://www.example.com/path"
wallet.example. 3600 IN WALLET "EXAMPLE" "01234567890abcdef"
wks01.example. 3600 IN WKS 10.0.0.1 6 0 1 2 21 23
wks02.example. 3600 IN WKS 10.0.0.1 17 0 1 2 53
wks03.example. 3600 IN WKS 10.0.0.2 6 65535
Expand Down
1 change: 1 addition & 0 deletions tests/example3.good
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ unknown2 3600 IN TYPE999 \# 8 0a0000010a000001
unknown3 3600 IN A 127.0.0.2
uri01 3600 IN URI 10 1 "ftp://ftp1.example.com/public"
uri02 3600 IN URI 10 1 "http://www.example.com/path"
wallet 3600 IN WALLET "EXAMPLE" "01234567890abcdef"
wks01 3600 IN WKS 10.0.0.1 6 0 1 2 21 23
wks02 3600 IN WKS 10.0.0.1 17 0 1 2 53
wks03 3600 IN WKS 10.0.0.2 6 65535
Expand Down
1 change: 1 addition & 0 deletions tests/example4.good
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ unknown2 3600 IN TYPE999 \# 8 0a0000010a000001
unknown3 3600 IN A 127.0.0.2
uri01 3600 IN URI 10 1 "ftp://ftp1.example.com/public"
uri02 3600 IN URI 10 1 "http://www.example.com/path"
wallet 3600 IN WALLET "EXAMPLE" "01234567890abcdef"
wks01 3600 IN WKS 10.0.0.1 6 0 1 2 21 23
wks02 3600 IN WKS 10.0.0.1 17 0 1 2 53
wks03 3600 IN WKS 10.0.0.2 6 65535
Expand Down

0 comments on commit e5e9f5e

Please sign in to comment.