]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Read DNSKEY TTL from kasp.Key.dnskey
authorNicki Křížek <nicki@isc.org>
Tue, 16 Jun 2026 13:57:48 +0000 (15:57 +0200)
committerNicki Křížek <nicki@isc.org>
Thu, 2 Jul 2026 12:51:41 +0000 (14:51 +0200)
Remove the redundant ttl() method. The DNSKEY RR already provides the
TTL.

bin/tests/system/isctest/kasp.py

index 5987de2c773521a5409f264272e877b0dce34d47..b919753dd7ec67bcc5525c1d569134634f44694b 100644 (file)
@@ -506,14 +506,6 @@ class Key:
             return isctest.vars.algorithms.RSASHA512OID.number
         return alg
 
-    def ttl(self) -> int:
-        with open(self.keyfile, "r", encoding="utf-8") as file:
-            for line in file:
-                if line.startswith(";"):
-                    continue
-                return int(line.split()[1])
-        return 0
-
     @property
     def dnskey(self) -> dns.rrset.RRset:
         with open(self.keyfile, "r", encoding="utf-8") as file:
@@ -588,7 +580,7 @@ class Key:
         dsfromkey_command = [
             os.environ.get("DSFROMKEY"),
             "-T",
-            str(self.ttl()),
+            str(self.dnskey.ttl),
             "-a",
             alg,
             "-C",