Skip to content

Commit 65a5b6a

Browse files
committed
solving #2
1 parent 06432df commit 65a5b6a

File tree

6 files changed

+27
-12
lines changed

6 files changed

+27
-12
lines changed

-@

Whitespace-only changes.

create_configs.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
#!/bin/sh
22

3+
# Create output dir if it does not exist:
4+
mkdir -p output/servers
5+
36
rm -rf output/servers/*
47

58
PYTHONPATH=libs
69
export PYTHONPATH
710
./tools/config_builders/config_builder.py
11+
12+
echo "Done."
13+
echo "Please note: make sure you run this after create_zones.sh (if you have changed things there) and note before"

create_zones.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ if [[ ! -f ./ext/ldns-3597/ldns-3597 ]] ; then
1414
fi
1515

1616
# Create output dir if it does not exist:
17-
mkdir -p ./output
17+
mkdir -p output/final
18+
mkdir -p output/keys
19+
mkdir -p output/signed
20+
mkdir -p output/uncompleted
21+
mkdir -p output/unsigned
22+
mkdir -p output/zone_db
1823

1924
# Do or don't? You pick...
2025
rm -rf output/final/*
@@ -28,7 +33,7 @@ rm -rf output/zone_db/*
2833

2934
echo "Running static zones generator" &&\
3035
./tools/generators/static_zones.py &&\
31-
echo "Running bad-dnssec zones generator" &&\
36+
echo "Running bad-dnssec zones and types zones generator" &&\
3237
./tools/generators/bad_dnssec.py &&\
3338
echo "Running delegations zones generator" &&\
3439
./tools/generators/delegations.py &&\

input/templates/basic_zone.templ

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
IN AAAA 2a00:d78:0:712:94:198:159:39
1010
IN TXT "Automatically generated by DNS workbench from basic_zone template"
1111
IN TXT "v=spf1 -all"
12-
IN MX 0 .
13-
IN TXT "v=DMARC1; p=reject;"
12+
IN MX 0 .
13+
IN TXT "v=DMARC1; p=reject;"

libs/workbench/dnsutil.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def add_standard_sign_options(zd):
9595
zd.add("signer_keys", dname_u + ".ksk")
9696

9797
def execute(cmd, cwd=None):
98-
print("[DEBUG] run command: %s" % cmd)
98+
# print("[DEBUG] run command: %s" % cmd)
9999
cmdp = shlex.split(cmd)
100100
p = subprocess.Popen(cmdp, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd)
101101
(stdout, stderr) = p.communicate()
@@ -110,18 +110,19 @@ def get_keyfile(zone):
110110

111111
def check_create_key(zone, keyfile):
112112
base_keyfile = keyfile[:-8]
113-
if not base_keyfile.startswith("nods.") and not os.path.exists(keyfile):
113+
if not os.path.exists(keyfile):
114+
#print(" [dnsutil] zone found that might need key-material: " + zone)
114115
os.makedirs(os.path.dirname(keyfile), exist_ok=True)
115116
cmd = "ldns-keygen -k -r /dev/urandom -a RSASHA256 -b 1024 %s" % zone
116117
stdout = execute(cmd)
117118
basename = stdout.decode("utf-8").rstrip()
118-
119-
#if (base_keyfile.startswith("nods.")):
120-
# os.unlink(basename + ".ds")
121-
#else:
122119
os.rename(basename + ".ds", base_keyfile + ".ds")
123120
os.rename(basename + ".key", base_keyfile + ".key")
124121
os.rename(basename + ".private", base_keyfile + ".private")
122+
# we fix this in bad_dnssec.py
123+
#if os.path.basename(base_keyfile).startswith("nods."):
124+
# print("[DEBUG] removing " + base_keyfile + ".ds" )
125+
# os.unlink(base_keyfile + ".ds")
125126

126127
def get_all_db_files():
127128
# TODO: this needs improving

tools/generators/bad_dnssec.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ def create_bad_dnssec_tree_zonelist(name, depth):
109109

110110
def create_zone(zone, zonefile):
111111
zone = dnsutil.fqdn(zone)
112+
#print(" [create_zone] zone: %s - zonefile: %s" %(zone,zonefile))
112113
# create tempfile and write zone data to is
113114
with open(zonefile, "w") as out:
114115
# TODO: serial... (and other values)
@@ -119,9 +120,11 @@ def create_zone(zone, zonefile):
119120
for delegation in bad_dnssec_tree_delegations:
120121
delname = delegation + "." + zone
121122
dsfile = env.KEYS_DIR + "/" + delname + "ds"
122-
print("check for " + dsfile)
123-
if os.path.exists(dsfile) or delname.startswith("nods."):
123+
# print(" check for nods-delegation or " + dsfile)
124+
if os.path.exists(dsfile):
124125
dnsutil.add_template(out, "all_ns", delname, 3600)
126+
if delname.startswith("nods."):
127+
os.unlink(dsfile)
125128
# TODO: second check necessary?
126129
#if os.path.exists(dsfile):
127130
# with open(dsfile, "r") as infile:

0 commit comments

Comments
 (0)