From da53d0fc75dcd9314f9bf9854a8a75b398008527 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 2 Feb 2022 17:58:48 +0100 Subject: util.dns: Minor updates of SVCB parser Now based on draft-ietf-dnsop-svcb-https-08 --- util/dns.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/dns.lua b/util/dns.lua index 851f480e..81e20971 100644 --- a/util/dns.lua +++ b/util/dns.lua @@ -198,7 +198,7 @@ function parsers.TLSA(packet) }, tlsa_mt); end -local svcb_params = {"alpn"; "no-default-alpn"; "port"; "ipv4hint"; "echconfig"; "ipv6hint"}; +local svcb_params = {"alpn"; "no-default-alpn"; "port"; "ipv4hint"; "ech"; "ipv6hint"}; setmetatable(svcb_params, {__index = function(_, n) return "key" .. tostring(n); end}); local svcb_mt = { @@ -206,6 +206,7 @@ local svcb_mt = { local kv = {}; for i = 1, #rr.fields do t_insert(kv, s_format("%s=%q", svcb_params[rr.fields[i].key], tostring(rr.fields[i].value))); + -- FIXME the =value part may be omitted when the value is "empty" end return s_format("%d %s %s", rr.prio, rr.name, t_concat(kv, " ")); end; -- cgit v1.2.3