X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/73ef93784354f893dc8b3a21ddc9538b64006ab3..fd0a407eb80151d554a057eca8965abcbfd9a7a1:/test/dnszones-src/db.test.ex?ds=sidebyside diff --git a/test/dnszones-src/db.test.ex b/test/dnszones-src/db.test.ex index 349fbd4d3..d6de7aa6c 100644 --- a/test/dnszones-src/db.test.ex +++ b/test/dnszones-src/db.test.ex @@ -20,10 +20,12 @@ ; and description. test.ex. NS exim.test.ex. -test.ex. SOA exim.test.ex. hostmaster.exim.test.ex 1430683638 1200 120 604800 3600 +test.ex. SOA exim.test.ex. hostmaster.exim.test.ex 1430683638 1200 120 604800 3000 test.ex. TXT "A TXT record for test.ex." s/lash TXT "A TXT record for s/lash.test.ex." +long TXT "This is a max-length chunk 789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234" "A short chunk" "A final chunk" +long TXT "Second RR" cname CNAME test.ex. @@ -172,7 +174,7 @@ cname4 CNAME thishost ; V4NET.11.12.13 is deliberately not reverse-registered -13.12.11.V4NET.rbl A 127.0.0.2 +TTL=3 13.12.11.V4NET.rbl A 127.0.0.2 TXT "This is a test blacklisting message" TTL=2 14.12.11.V4NET.rbl A 127.0.0.2 TXT "This is a test blacklisting message" @@ -201,6 +203,17 @@ TTL=2 14.12.11.V4NET.rbl A 127.0.0.2 2.13.13.V4NET.rbl A 127.0.0.1 A 127.0.0.2 +; Foolish return values outside 127.0/8 + +100.13.13.V4NET.rbl A 0.0.0.0 +101.13.13.V4NET.rbl A 126.255.255.255 +102.13.13.V4NET.rbl A 128.0.0.0 +103.13.13.V4NET.rbl A 255.255.255.255 +104.13.13.V4NET.rbl A 255.255.255.255 + A 127.0.0.0 +105.13.13.V4NET.rbl A 255.255.255.255 + A 255.255.255.254 + ; -------- Testing MX records -------- mxcased MX 5 ten-99.TEST.EX. @@ -419,36 +432,78 @@ DNSSEC l-sec A 127.0.0.1 AA a-aa A V4NET.0.0.100 ; ------- Testing DANE ------------ +; Since these refer to certs in the exim-ca tree, they must be regenerated any time that tree is. +; ; full suite dns chain, sha512 ; -; openssl x509 -in aux-fixed/cert1 -noout -pubkey \ +; TLSA_AUTOGEN +; openssl x509 -in aux-fixed/exim-ca/example.com/server1.example.com/server1.example.com.pem -noout -pubkey \ ; | openssl pkey -pubin -outform DER \ ; | openssl dgst -sha512 \ ; | awk '{print $2}' ; +DNSSEC mxnodane MX 1 nodane DNSSEC mxdane512ee MX 1 dane512ee +DNSSEC mxdane512ee1 MX 1 dane512ee +mxnondane512ee MX 1 dane512ee DNSSEC dane512ee A HOSTIPV4 -DNSSEC _1225._tcp.dane512ee TLSA 3 1 2 3d5eb81b1dfc3f93c1fa8819e3fb3fdb41bb590441d5f3811db17772f4bc6de29bdd7c4f4b723750dda871b99379192b3f979f03db1252c4f08b03ef7176528d +DNSSEC nodane A HOSTIPV4 + +DNSSEC _1225._tcp.dane512ee TLSA 3 1 2 e8173aaefffadc6c96700f7f396a17b8e590ebd15b081f1455abb152afecceb16a5534707ecd64611c8b6d8b9111f82e3fa954b98c6b230cda0e9be386747b71 + +# mx of mxdane owns a secure A and TLSA record +# used in 5802 +DNSSEC mxdane MX 1 dane512ee + +# mx of mxdanesecchain is a CNAME, with a secure target, that owns a secure A and TLSA record +DNSSEC mxdanesecchain MX 1 danesecchain +DNSSEC danesecchain CNAME dane512ee + +# mx of mxdaneinsecchain is CNAME, with an insecure target that own a secure A and TLSA record +# DANE should report a failure if the message is for ...@mxdaneinsecurechain +DNSSEC mxdaneinsecchain MX 1 daneinsecchain +daneinsecchain CNAME dane512ee ; A-only, sha256 ; -; openssl x509 -in aux-fixed/cert1 -noout -pubkey \ +; TLSA_AUTOGEN +; openssl x509 -in aux-fixed/exim-ca/example.com/server1.example.com/server1.example.com.pem -noout -pubkey \ ; | openssl pkey -pubin -outform DER \ ; | openssl dgst -sha256 \ ; | awk '{print $2}' ; DNSSEC dane256ee A HOSTIPV4 -DNSSEC _1225._tcp.dane256ee TLSA 3 1 1 2bb55f418bb03411a5007cecbfcd3ec1c94404312c0d53a44bb2166b32654db3 +DNSSEC _1225._tcp.dane256ee TLSA 3 1 1 e9f6e8fe73b130c720eb1fb5c94eaff522ec6f9759ed4c6815351d827b1226a7 ; full MX, sha256, TA-mode ; +; TLSA_AUTOGEN ; openssl x509 -in aux-fixed/exim-ca/example.com/CA/CA.pem -fingerprint -sha256 -noout \ -; | awk -F= '{print $2}' | tr -d : | tr '[A-F]' '[a-f]' +; | awk -F= '{print $2}' | tr -d : | tr '[A-F]' '[a-f]' ; DNSSEC mxdane256ta MX 1 dane256ta DNSSEC dane256ta A HOSTIPV4 -DNSSEC _1225._tcp.dane256ta TLSA 2 0 1 eec923139018c540a344c5191660ecba1ac3708525a98bfc338e17f31d3fa741 +DNSSEC _1225._tcp.dane256ta TLSA 2 0 1 0d643c1ebcdf2cb83634e0c2f5102c1e268983401c9f4d8711d60b44d7fb7a3e + + +; full MX, sha256, TA-mode, cert-key-only +; Indicates a trust-anchor for a chain involving an Authority Key ID extension +; linkage, as this excites a bug in OpenSSL 1.0.2 which the DANE code has to +; work around, while synthesizing a selfsigned parent for it. +; As it happens it is also an intermediate cert in the CA-rooted chain, as this +; was initially thought to be a factor. +; +; TLSA_AUTOGEN +; openssl x509 -in aux-fixed/exim-ca/example.com/CA/Signer.pem -noout -pubkey \ +; | openssl pkey -pubin -outform DER \ +; | openssl dgst -sha256 \ +; | awk '{print $2}' +; +DNSSEC mxdane256tak MX 1 dane256tak +DNSSEC dane256tak A HOSTIPV4 +DNSSEC _1225._tcp.dane256tak TLSA 2 1 1 beabbe636030e4c26d15a015e878c2a607ed5a87774443ffbc6991ec01d2b6b1 + ; A multiple-return MX where all TLSA lookups defer @@ -461,10 +516,80 @@ DNSSEC danelazy2 A 127.0.0.1 DNSSEC _1225._tcp.danelazy CNAME test.again.dns. DNSSEC _1225._tcp.danelazy2 CNAME test.again.dns. -; hosts with no TLSA +; hosts with no TLSA (just missing here, hence the TLSA NXDMAIN is _insecure_; a broken dane config) +; 1 for dane-required, 2 for merely requested DNSSEC dane.no.1 A HOSTIPV4 DNSSEC dane.no.2 A 127.0.0.1 +; a broken dane config (or under attack) where the TLSA lookup fails (as opposed to there not being one) +DNSSEC danebroken1 A 127.0.0.1 +_1225._tcp.danebroken1 CNAME test.fail.dns. + +; a broken dane config (or under attack) where the TLSA record is wrong +; (127.0.0.1 for merely dane-requested, but having gotten the TLSA it is supposedly definitive) +DNSSEC danebroken2 A 127.0.0.1 +DNSSEC _1225._tcp.danebroken2 TLSA 2 0 1 cb0fa60000000000000000000000000000000000000000000000000000000000 + +; a broken dane config (or under attack) where the TLSA record is correct but not DNSSEC-assured +; (record copied from dane256ee above) +; TLSA_AUTOGEN +; openssl x509 -in aux-fixed/exim-ca/example.com/server1.example.com/server1.example.com.pem -noout -pubkey \ +; | openssl pkey -pubin -outform DER \ +; | openssl dgst -sha256 \ +; | awk '{print $2}' +; 3 for dane-requested, 4 for dane-required +DNSSEC danebroken3 A 127.0.0.1 +_1225._tcp.danebroken3 TLSA 2 0 1 beabbe636030e4c26d15a015e878c2a607ed5a87774443ffbc6991ec01d2b6b1 +; TLSA_AUTOGEN +; openssl x509 -in aux-fixed/exim-ca/example.com/server1.example.com/server1.example.com.pem -noout -pubkey \ +; | openssl pkey -pubin -outform DER \ +; | openssl dgst -sha256 \ +; | awk '{print $2}' +DNSSEC danebroken4 A HOSTIPV4 +_1225._tcp.danebroken4 TLSA 2 0 1 beabbe636030e4c26d15a015e878c2a607ed5a87774443ffbc6991ec01d2b6b1 + +; a broken dane config (or under attack) where the address record is correct but not DNSSEC-assured +; (TLSA record copied from dane256ee above) +; 5 for dane-requested, 6 for dane-required +; TLSA_AUTOGEN +; openssl x509 -in aux-fixed/exim-ca/example.com/server1.example.com/server1.example.com.pem -noout -pubkey \ +; | openssl pkey -pubin -outform DER \ +; | openssl dgst -sha256 \ +; | awk '{print $2}' +danebroken5 A 127.0.0.1 +DNSSEC _1225._tcp.danebroken5 TLSA 2 0 1 beabbe636030e4c26d15a015e878c2a607ed5a87774443ffbc6991ec01d2b6b1 +; TLSA_AUTOGEN +; openssl x509 -in aux-fixed/exim-ca/example.com/server1.example.com/server1.example.com.pem -noout -pubkey \ +; | openssl pkey -pubin -outform DER \ +; | openssl dgst -sha256 \ +; | awk '{print $2}' +danebroken6 A HOSTIPV4 +DNSSEC _1225._tcp.danebroken6 TLSA 2 0 1 beabbe636030e4c26d15a015e878c2a607ed5a87774443ffbc6991ec01d2b6b1 + +; a good dns config saying there is no dane support, by securely returning NOXDOMAIN for TLSA lookups +; 3 for dane-required, 4 for merely requested +; the TLSA data here is dummy; ignored +DNSSEC dane.no.3 A HOSTIPV4 +DNSSEC dane.no.4 A 127.0.0.1 + +DNSSEC NXDOMAIN _1225._tcp.dane.no.3 TLSA 2 0 1 eec923139018c540a344c5191660ecba1ac3708525a98bfc338e17f31d3fa741 +DNSSEC NXDOMAIN _1225._tcp.dane.no.4 TLSA 2 0 1 eec923139018c540a344c5191660ecba1ac3708525a98bfc338e17f31d3fa741 + +; a mixed-usage set of TLSA records, EE one failing. TA one coped from dane256ta. +; +; TLSA_AUTOGEN +; openssl x509 -in aux-fixed/exim-ca/example.com/CA/CA.pem -fingerprint -sha256 -noout \ +; | awk -F= '{print $2}' | tr -d : | tr '[A-F]' '[a-f]' +; +DNSSEC danemixed A 127.0.0.1 +DNSSEC _1225._tcp.danemixed TLSA 2 0 1 0d643c1ebcdf2cb83634e0c2f5102c1e268983401c9f4d8711d60b44d7fb7a3e +DNSSEC TLSA 3 1 1 8276000000000000000000000000000000000000000000000000000000000000 + +; have the TLSA lookup, only, return SERVFAIL +; +DNSSEC daneservfail A 127.0.0.1 +DNSSEC _1225._tcp.daneservfail CNAME test.again.dns. + ; ------- Testing delays ------------ DELAY=500 delay500 A HOSTIPV4 @@ -477,13 +602,39 @@ DELAY=1500 delay1500 A HOSTIPV4 ; openssl rsa -in aux-fixed/dkim/dkim.private -out /dev/stdout -pubout -outform PEM ; ; Deliberate bad version, having extra backslashes +; sha256-hash-only version.... appears to be too long, gets truncated ; ; Another, 512-bit (with a Notes field) +; 512 requiring sha1 hash +; 512 requiring sha256 hash ; sel._domainkey TXT "v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXRFf+VhT+lCgFhhSkinZKcFNeRzjYdW8vT29Rbb3NadvTFwAd+cVLPFwZL8H5tUD/7JbUPqNTCPxmpgIL+V5T4tEZMorHatvvUM2qfcpQ45IfsZ+YdhbIiAslHCpy4xNxIR3zylgqRUF4+Dtsaqy3a5LhwMiKCLrnzhXk1F1hxwIDAQAB" sel_bad._domainkey TXT "v=DKIM1\; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXRFf+VhT+lCgFhhSkinZKcFNeRzjYdW8vT29Rbb3NadvTFwAd+cVLPFwZL8H5tUD/7JbUPqNTCPxmpgIL+V5T4tEZMorHatvvUM2qfcpQ45IfsZ+YdhbIiAslHCpy4xNxIR3zylgqRUF4+Dtsaqy3a5LhwMiKCLrnzhXk1F1hxwIDAQAB" +sel_sha256._domainkey TXT "v=DKIM1; h=sha256; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXRFf+VhT+lCgFhhSkinZKcFNeRzjYdW8vT29Rbb3NadvTFwAd+cVLPFwZL8H5tUD/7JbUPqNTCPxmpgIL+V5T4tEZMorHatvvUM2qfcpQ45IfsZ+YdhbIiAslHCpy4xNxIR3zylgqRUF4+Dtsaqy3a5LhwMiKCLrnzhXk1F1hxwIDAQAB" ses._domainkey TXT "v=DKIM1; n=halfkilo; p=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAL6eAQxd9didJ0/+05iDwJOqT6ly826Vi8aGPecsBiYK5/tAT97fxXk+dPWMZp9kQxtknEzYjYjAydzf+HQ2yJMCAwEAAQ==" +ses_sha1._domainkey TXT "v=DKIM1; h=sha1; p=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAL6eAQxd9didJ0/+05iDwJOqT6ly826Vi8aGPecsBiYK5/tAT97fxXk+dPWMZp9kQxtknEzYjYjAydzf+HQ2yJMCAwEAAQ==" +ses_sha256._domainkey TXT "v=DKIM1; h=sha256; p=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAL6eAQxd9didJ0/+05iDwJOqT6ly826Vi8aGPecsBiYK5/tAT97fxXk+dPWMZp9kQxtknEzYjYjAydzf+HQ2yJMCAwEAAQ==" + +sel2._domainkey TXT "v=spf1 mx a include:spf.nl2go.com -all" +sel2._domainkey TXT "v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXRFf+VhT+lCgFhhSkinZKcFNeRzjYdW8vT29Rbb3NadvTFwAd+cVLPFwZL8H5tUD/7JbUPqNTCPxmpgIL+V5T4tEZMorHatvvUM2qfcpQ45IfsZ+YdhbIiAslHCpy4xNxIR3zylgqRUF4+Dtsaqy3a5LhwMiKCLrnzhXk1F1hxwIDAQAB" + +; EC signing, using Ed25519 +; - needs GnuTLS 3.6.0 (fedora rawhide has that) +; certtool --generate-privkey --key-type=ed25519 --outfile=dkim_ed25519.private +; certtool --load_privkey=dkim_ed25519.private --pubkey_info --outder | tail -c +13 | base64 + +sed._domainkey TXT "v=DKIM1; k=ed25519; p=sPs07Vu29FpHT/80UXUcYHFOHifD4o2ZlP2+XUh9g6E=" + +; version of the above wrapped in SubjectPublicKeyInfo, in case the WG plumps in that direction +; certtool --load_privkey=aux-fixed/dkim/dkim_ed25519.private --pubkey_info +; (and grab the b64 content from between the pem headers) + +sedw._domainkey TXT "v=DKIM1; k=ed25519; p=MCowBQYDK2VwAyEAsPs07Vu29FpHT/80UXUcYHFOHifD4o2ZlP2+XUh9g6E=" + + +; ------- DMARC --------- +_dmarc TXT v=DMARC1; p=none ; End