]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
trust anchors: add KeyTag into comments
authorVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 14 Mar 2017 17:21:50 +0000 (18:21 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 15 Mar 2017 14:33:45 +0000 (15:33 +0100)
Fixes #167.

daemon/lua/trust_anchors.lua.in

index 6c8e0a3b59a0c2c55f667d53144383bbce045d6d..3a8d2fdd34d0cc3f0e9f0091453bc59ea9de5518 100644 (file)
@@ -219,6 +219,7 @@ local function keyset_write(keyset, path)
        for i = 1, #keyset do
                local ta = keyset[i]
                ta.comment = ' ' .. ta.state .. ':' .. (ta.timer or '')
+                                       .. ' ; KeyTag:' .. ta.key_tag -- the tag is just for humans
                local rr_str = kres.rr2str(ta) .. '\n'
                if ta.state ~= key_state.Valid and ta.state ~= key_state.Missing then
                        rr_str = '; '..rr_str -- Invalidate key string (for older kresd versions)
@@ -280,6 +281,11 @@ local function keyset_read(path)
                        end
                end
        end
+
+       local _k, ta
+       for _k, ta in pairs(tas) do
+               ta.key_tag = C.kr_dnssec_key_tag(ta.type, ta.rdata, #ta.rdata)
+       end
        return tas
 end