From a683afa38cc20da20ad379ac9af280eae01433a2 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 25 Dec 2015 11:21:44 +0100 Subject: [PATCH 1/1] multi-NS secure delegation --- db.example.com.py | 2 +- zone.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/db.example.com.py b/db.example.com.py index 1087113..349d958 100644 --- a/db.example.com.py +++ b/db.example.com.py @@ -41,7 +41,7 @@ __zone__ = Zone('example.com.', serialfile = 'db.example.com.srl', 'orgstuff': CName('example.org.'), # CNAMEs cannot be combined with other records # 'sub1': Delegation('ns.example.org.', 'ns'), # this adds an NS record - 'sub2': SecureDelegation('ns.example.com.', 12345, Algorithm.RSA_SHA256, Digest.SHA256, '0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF'), # this adds an NS and a DS record + 'sub2': SecureDelegation(12345, Algorithm.RSA_SHA256, Digest.SHA256, '0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF', 'ns.example.com.'), # this adds an NS and a DS record # 'local': { 'one': Name(one4), diff --git a/zone.py b/zone.py index 5030e9c..7d692c1 100644 --- a/zone.py +++ b/zone.py @@ -296,12 +296,12 @@ def CName(name: str) -> Name: return Name(CNAME(name)) -def Delegation(name: str, *names) -> Name: - return Name(NS(name), list(map(NS, names))) +def Delegation(*names) -> Name: + return Name(list(map(NS, names))) -def SecureDelegation(name: str, tag: int, alg: int, digest: int, key: str) -> Name: - return Name(NS(name), DS(tag, alg, digest, key)) +def SecureDelegation(tag: int, alg: int, digest: int, key: str, *names) -> Name: + return Name(DS(tag, alg, digest, key), list(map(NS, names))) class Zone: -- 2.30.2