Commit Diff
Diff:
95007404197bbdc5b80290d9859c1164d02b8043
116373da140fd13624502c6a475eea2ba8461147
Commit:
116373da140fd13624502c6a475eea2ba8461147
Tree:
02fcae2ec6f9c1fa2dbb19b685350cc3d766842d
Author:
pjp <pjp@delphinusdns.org>
Committer:
pjp <pjp@delphinusdns.org>
Date:
Tue Dec 1 13:56:11 2015 UTC
Message:
* try to make dd-convert.rb etc gem independent * we can now delegate with an NS record, but leave the DELEGATE record for backward compatibility, this will also require a version bump for configfiles
blob - 751022f8193bc4110e204ccf16c9668c0352499f
blob + 1477b7379d2937284d32f9058fa7c6a206008384
--- README
+++ README
@@ -1,4 +1,4 @@
-$Id: README,v 1.7 2015/11/21 07:36:18 pjp Exp $
+$Id: README,v 1.8 2015/12/01 13:56:11 pjp Exp $
1. README
2. WHY DELPHINUSDNS?
@@ -64,7 +64,8 @@ In Linux MINT you need to apt-get install build-essent
## configure the platform
$ ./configure
## this will install the development programs you'll need (as root)
-$ apt-get install bison cvs gcc libdb5.3-dev libssl-dev
+$ apt-get install bison cvs gcc libdb5.3-dev libssl-dev dnssec-tools
+$ apt-get install ruby-2.0
## add a privsep user with a chroot directory (option -m) (as root)
$ useradd -m _ddd
## create the db directory (as root)
blob - e6b365463ba5e596b44bf6a8d053b8ab18b6346c
blob + 501b9683ad715de939306581f53dda5424f929d5
--- dd-convert.rb
+++ dd-convert.rb
@@ -1,6 +1,6 @@
-#!/usr/local/bin/ruby
+#!/usr/bin/env ruby
#
-# $Id: dd-convert.rb,v 1.3 2015/11/28 19:07:19 pjp Exp $
+# $Id: dd-convert.rb,v 1.4 2015/12/01 13:56:11 pjp Exp $
#
# Copyright (c) 2015 Peter J. Philipp
# All rights reserved.
@@ -66,6 +66,7 @@ class ParseArguments < Hash
self[:salt] = ""
self[:ttl] = 3600
self[:iterations] = 10
+ self[:xsystem] = ""
opts = OptionParser.new do |opts|
opts.banner = "Usage: #$0 [options]"
@@ -131,6 +132,10 @@ class ParseArguments < Hash
self[:ttl] = filename
end
+ opts.on('-X', '--XSystem', 'specify an alternate system') do |system|
+ self[:xsystem] = system || ''
+ end
+
opts.on('-Z', '--ZSK', 'create ZSK keys') do |zsk|
self[:ZSK] = 1
end
@@ -520,13 +525,17 @@ class MyCreateKeys < Hash
"ecdsap384sha384" => 14
}
- def initialize(type, algorithm, bits, zonename, ttl)
+ def initialize(type, algorithm, bits, zonename, ttl, xsystem)
self[:zskname] = ''
self[:kskname] = ''
systemid = []
super()
- systemid = Etc.uname[:sysname]
+ if xsystem == "" then
+ systemid = Etc.uname[:sysname]
+ else
+ systemid = xsystem
+ end
if type == 1 then
createKSK(algorithm, bits, zonename, ttl, systemid)
@@ -538,7 +547,7 @@ class MyCreateKeys < Hash
def createKSK(algorithm, bits, zonename, ttl, systemid)
if systemid == "OpenBSD" then
keygen = "/usr/local/sbin/dnssec-keygen"
- elsif systemid == "FreeBSD" then
+ else
keygen = "/usr/sbin/dnssec-keygen"
end
@@ -555,7 +564,7 @@ class MyCreateKeys < Hash
def createZSK(algorithm, bits, zonename, ttl, systemid)
if systemid == "OpenBSD" then
keygen = "/usr/local/sbin/dnssec-keygen"
- elsif systemid == "FreeBSD" then
+ else
keygen = "/usr/sbin/dnssec-keygen"
end
@@ -583,10 +592,14 @@ end
#
systemid = []
-systemid = Etc.uname[:sysname]
-
arguments = ParseArguments.new(ARGV)
+if arguments[:xsystem] == "" then
+ systemid = Etc.uname[:sysname]
+else
+ systemid = arguments[:xsystem]
+end
+
if arguments[:input] != "" then
puts '################################################################'
inputfile = InputFile.new(arguments[:input], arguments[:zonename])
@@ -599,13 +612,19 @@ if arguments[:input] != "" then
end
if arguments[:KSK] == 1 then
- arguments[:kskname] = MyCreateKeys.new(1 , arguments[:algorithm], arguments[:numbits], arguments[:zonename], arguments[:ttl])[:kskname]
- puts 'created KSK key ' + arguments[:kskname]
+ arguments[:kskname] = MyCreateKeys.new(1 , \
+ arguments[:algorithm], arguments[:numbits], \
+ arguments[:zonename], arguments[:ttl], \
+ arguments[:xsystem])[:kskname]
+ puts 'created KSK key ' + arguments[:kskname]
end
if arguments[:ZSK] == 1 then
- arguments[:zskname] = MyCreateKeys.new(2 , arguments[:algorithm], arguments[:numbits], arguments[:zonename], arguments[:ttl])[:zskname]
- puts 'created ZSK key ' + arguments[:zskname]
+ arguments[:zskname] = MyCreateKeys.new(2 , \
+ arguments[:algorithm], arguments[:numbits], \
+ arguments[:zonename], arguments[:ttl], \
+ arguments[:xsystem])[:zskname]
+ puts 'created ZSK key ' + arguments[:zskname]
end
if arguments[:kskname] == '' then
@@ -626,6 +645,8 @@ if arguments[:input] != "" then
if systemid == "OpenBSD" then
signzonepath = "/usr/local/sbin/dnssec-signzone"
elsif systemid == "FreeBSD"
+ signzonepath = "/usr/sbin/dnssec-signzone"
+ else
signzonepath = "/usr/sbin/dnssec-signzone"
end
blob - 8a9f9805e11940836c50b6bd250219095c71f4c7
blob + 3521c049b2bb61586e46a07b2aa8c89400688b34
--- dnssec.c
+++ dnssec.c
@@ -757,7 +757,7 @@ base32hex_decode(u_char *input, u_char *output)
input[i] = tolower(input[i]);
for (p = character; *p && *p != input[i]; p++);
- if (*p == NULL)
+ if (*p == '\0')
return 0;
tmp = (p - start);
blob - 23a796598d8b21634db3be84041cf7876e871888
blob + 41067bdff4a821cfca2027103499daf359b6818c
--- parse.y
+++ parse.y
@@ -106,7 +106,7 @@ typedef struct {
#define YYSTYPE_IS_DECLARED 1
#endif
-static const char rcsid[] = "$Id: parse.y,v 1.31 2015/11/20 19:31:08 pjp Exp $";
+static const char rcsid[] = "$Id: parse.y,v 1.32 2015/12/01 13:56:11 pjp Exp $";
static int version = 0;
static int state = 0;
static uint8_t region = 0;
@@ -3597,7 +3597,7 @@ fill_ns(char *name, char *type, int myttl, char *names
nstype = NS_TYPE_HINT;
} else {
converted_name = check_rr(name, type, DNS_TYPE_DELEGATE, &converted_namelen);
- nstype = NS_TYPE_DELEGATE;
+ nstype = NS_TYPE_DELEGATE; /* XXX see below */
}
if (converted_name == NULL) {
@@ -3627,6 +3627,16 @@ fill_ns(char *name, char *type, int myttl, char *names
#endif
memcpy(ssd->zone, converted_name, converted_namelen);
ssd->zonelen = converted_namelen;
+
+ /*
+ * check if this is not the apex of a zone, if it was we're almost
+ * guaranteed to have come across a SOA already and it's not flagged
+ * then set the delegate type, this should make it possible to have * "NS" records instead of "delegate" records which are delphinusdnsd
+ * internal
+ */
+
+ if (!(ssd->flags & DOMAIN_HAVE_SOA))
+ nstype = NS_TYPE_DELEGATE;
ssd_ns = (struct domain_ns *) find_substruct(ssd, INTERNAL_TYPE_NS);
if (ssd_ns == NULL) {
repomaster@centroid.eu