aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2017-02-03 13:01:00 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2017-02-03 13:01:00 +0000
commitc6342fe2e90510d8d2296423f2ca92818a7b3d18 (patch)
tree0cc9064980c804a7bf5cc6d96c9249950c7e56a9 /contrib
parent65be028f32ed37dce84f6328d4a7172132c8c224 (diff)
downloadsrc-vendor/ldns.tar.gz
src-vendor/ldns.zip
Notes
Notes: svn path=/vendor/ldns/dist/; revision=313156 svn path=/vendor/ldns/1.7.0/; revision=313157; tag=vendor/ldns/1.7.0
Diffstat (limited to 'contrib')
-rw-r--r--contrib/DNS-LDNS/Changes22
-rw-r--r--contrib/DNS-LDNS/LDNS.xs103
-rw-r--r--contrib/DNS-LDNS/META.yml26
-rwxr-xr-xcontrib/DNS-LDNS/Makefile.PL25
-rw-r--r--contrib/DNS-LDNS/README2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS.pm34
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecDataChain.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecName.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRSets.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRs.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecTrustTree.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecZone.pm8
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/GC.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/Key.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/KeyList.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/Packet.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/RBNode.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/RBTree.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/RData.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/RR.pm47
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/RRList.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/Resolver.pm2
-rw-r--r--contrib/DNS-LDNS/lib/DNS/LDNS/Zone.pm11
-rw-r--r--contrib/DNS-LDNS/t/dnssec_datachain.t50
-rw-r--r--contrib/DNS-LDNS/t/rr.t29
-rw-r--r--contrib/DNS-LDNS/typemap6
-rw-r--r--contrib/ldnsx/ldnsx.py4
-rw-r--r--contrib/python/Makefile2
-rw-r--r--contrib/python/ldns.i6
-rw-r--r--contrib/python/ldns_key.i2
-rw-r--r--contrib/python/ldns_rdf.i5
-rw-r--r--contrib/python/ldns_resolver.i12
32 files changed, 305 insertions, 117 deletions
diff --git a/contrib/DNS-LDNS/Changes b/contrib/DNS-LDNS/Changes
index b718c30222e6..b560eda9efc4 100644
--- a/contrib/DNS-LDNS/Changes
+++ b/contrib/DNS-LDNS/Changes
@@ -21,3 +21,25 @@ Revision history for Perl extension DNS::LDNS.
0.06 Tue Dec 31 12:17:00 2013
- Corrected pod syntax
+
+0.50 Sun Mar 30 11:05:23 2014
+ - Added prev parameter to the DNS::LDNS::RR::new(str) constructor.
+ - Corrected DNS::LDNS::RR::new(file/filename) constructor. Added prev
+ parameter, changed the default_ttl and origin parameters to
+ references so they can return data back to the caller as intended.
+ Using the 'built-in' default values for ttl and origin, rather than
+ my own values.
+ - Corrected the DNS::LDNS::Zone::new() constructor. Corrected file
+ option for reading zone from stream. Using the 'built-in' default
+ values for ttl and origin, rather than my own values.
+ - Removed the $DNS::LDNS::DEFAULT_* variables, they proved to be less
+ useful after modifying the Zone and RR constructors.
+ - More robust Makefile.PL. Check for existence of ldns library
+ and perl modules required for the test suite.
+
+0.51 Wed Apr 2 09:12:00 2014
+ - Added META.yml, and added some more package dependencies.
+ - Compatibility with ldns < 1.6.12.
+
+0.52 Tue May 5 09:13:00 2015
+ - Fixed typo in META.yml
diff --git a/contrib/DNS-LDNS/LDNS.xs b/contrib/DNS-LDNS/LDNS.xs
index 83f09ddee777..ad591448cf25 100644
--- a/contrib/DNS-LDNS/LDNS.xs
+++ b/contrib/DNS-LDNS/LDNS.xs
@@ -89,6 +89,22 @@ ldns_rr_list *ldns_validate_domain_dnskey_time(
ldns_rr_list *ldns_validate_domain_ds_time(
const ldns_resolver *res, const ldns_rdf *domain,
const ldns_rr_list * keys, time_t check_time);
+ldns_status ldns_verify_rrsig_keylist_time(
+ ldns_rr_list *rrset, ldns_rr *rrsig,
+ const ldns_rr_list *keys, time_t check_time,
+ ldns_rr_list *good_keys);
+ldns_status ldns_verify_trusted_time(
+ ldns_resolver *res, ldns_rr_list *rrset,
+ ldns_rr_list *rrsigs, time_t check_time,
+ ldns_rr_list *validating_keys);
+ldns_status ldns_verify_rrsig_time(
+ ldns_rr_list *rrset, ldns_rr *rrsig,
+ ldns_rr *key, time_t check_time);
+ldns_status ldns_verify_time(ldns_rr_list *rrset,
+ ldns_rr_list *rrsig,
+ const ldns_rr_list *keys,
+ time_t check_time,
+ ldns_rr_list *good_keys);
ldns_dnssec_trust_tree *ldns_dnssec_derive_trust_tree_time(
ldns_dnssec_data_chain *data_chain,
@@ -114,6 +130,33 @@ ldns_rr_list *ldns_validate_domain_ds_time(
Perl_croak(aTHX_ "function ldns_validate_domain_ds_time is not implemented in this version of ldns");
}
+ldns_status ldns_verify_rrsig_keylist_time(
+ ldns_rr_list *rrset, ldns_rr *rrsig,
+ const ldns_rr_list *keys, time_t check_time,
+ ldns_rr_list *good_keys) {
+ Perl_croak(aTHX_ "function ldns_verify_rrsig_keylist_time is not implemented in this version of ldns");
+}
+
+ldns_status ldns_verify_trusted_time(
+ ldns_resolver *res, ldns_rr_list *rrset,
+ ldns_rr_list *rrsigs, time_t check_time,
+ ldns_rr_list *validating_keys) {
+ Perl_croak(aTHX_ "function ldns_verify_trusted_time is not implemented in this version of ldns");
+}
+
+ldns_status ldns_verify_rrsig_time(
+ ldns_rr_list *rrset, ldns_rr *rrsig,
+ ldns_rr *key, time_t check_time) {
+ Perl_croak(aTHX_ "function ldns_verify_rrsig_time is not implemented in this version of ldns");
+}
+
+ldns_status ldns_verify_time(ldns_rr_list *rrset,
+ ldns_rr_list *rrsig,
+ const ldns_rr_list *keys,
+ time_t check_time,
+ ldns_rr_list *good_keys) {
+ Perl_croak(aTHX_ "function ldns_verify_time is not implemented in this version of ldns");
+}
#endif
@@ -709,45 +752,70 @@ ldns_rr_new_frm_type(t)
_new_from_type = 1
DNS__LDNS__RR
-_new_from_str(str, default_ttl, origin, s)
+_new_from_str(str, default_ttl, origin, prev, s)
const char* str;
uint32_t default_ttl;
DNS__LDNS__RData__Opt origin;
+ DNS__LDNS__RData__Opt prev;
LDNS_Status s;
PREINIT:
DNS__LDNS__RR rr = NULL;
+ ldns_rdf *pclone = NULL;
CODE:
- s = ldns_rr_new_frm_str(&rr, str, default_ttl, origin, NULL);
+
+ if (prev != NULL) {
+ pclone = ldns_rdf_clone(prev);
+ }
+
+ s = ldns_rr_new_frm_str(&rr, str, default_ttl, origin, &prev);
+ if (prev != NULL) {
+ prev = pclone;
+ }
+
if (s == LDNS_STATUS_OK) {
RETVAL = rr;
}
OUTPUT:
RETVAL
s
+ prev
DNS__LDNS__RR
-_new_from_file(fp, origin, default_ttl, s, line_nr)
+_new_from_file(fp, default_ttl, origin, prev, s, line_nr)
FILE* fp;
- DNS__LDNS__RData__Opt origin;
uint32_t default_ttl;
+ DNS__LDNS__RData__Opt origin;
+ DNS__LDNS__RData__Opt prev;
LDNS_Status s;
int line_nr;
PREINIT:
ldns_rr *rr;
ldns_rdf *oclone = NULL;
+ ldns_rdf *pclone = NULL;
CODE:
- RETVAL = NULL;
- /* Clone the origin object because the call may change/replace it and
- then it must be freed */
- if (origin) {
+
+ /* Must clone origin and prev because new_frm_fp_l may change
+ them and may not (we do not know for certain). The perl layer
+ will take care of freeing the old structs. */
+ if (origin != NULL) {
oclone = ldns_rdf_clone(origin);
}
- s = ldns_rr_new_frm_fp_l(&rr, fp, &default_ttl, &oclone, NULL,
+ if (prev != NULL) {
+ pclone = ldns_rdf_clone(prev);
+ }
+
+ RETVAL = NULL;
+ s = ldns_rr_new_frm_fp_l(&rr, fp, &default_ttl, &oclone, &pclone,
&line_nr);
- if (oclone) {
- ldns_rdf_deep_free(oclone);
- }
+ /* Replace the input origin with our new clone. The perl layer will
+ take care of freeing it later. */
+ if (origin != NULL) {
+ origin = oclone;
+ }
+ if (prev != NULL) {
+ prev = pclone;
+ }
if (s == LDNS_STATUS_OK) {
RETVAL = rr;
@@ -757,6 +825,9 @@ _new_from_file(fp, origin, default_ttl, s, line_nr)
RETVAL
s
line_nr
+ default_ttl
+ origin
+ prev
DNS__LDNS__RR
ldns_rr_clone(rr)
@@ -1223,7 +1294,7 @@ ldns_rdf_clone(rdf)
ALIAS:
clone = 1
-const char*
+Mortal_PV
ldns_rdf2str(rdf)
DNS__LDNS__RData rdf;
ALIAS:
@@ -2113,7 +2184,7 @@ ldns_resolver_nameservers_randomize(resolver)
ALIAS:
nameservers_randomize = 1
-char*
+const char*
ldns_resolver_tsig_keyname(resolver)
DNS__LDNS__Resolver resolver;
ALIAS:
@@ -2126,7 +2197,7 @@ ldns_resolver_set_tsig_keyname(resolver, tsig_keyname)
ALIAS:
set_tsig_keyname = 1
-char*
+const char*
ldns_resolver_tsig_algorithm(resolver)
DNS__LDNS__Resolver resolver;
ALIAS:
@@ -2139,7 +2210,7 @@ ldns_resolver_set_tsig_algorithm(resolver, tsig_algorithm)
ALIAS:
set_tsig_algorithm = 1
-char*
+const char*
ldns_resolver_tsig_keydata(resolver)
DNS__LDNS__Resolver resolver;
ALIAS:
diff --git a/contrib/DNS-LDNS/META.yml b/contrib/DNS-LDNS/META.yml
new file mode 100644
index 000000000000..b1f5ff10cc12
--- /dev/null
+++ b/contrib/DNS-LDNS/META.yml
@@ -0,0 +1,26 @@
+---
+abstract: 'Perl extension for the ldns library'
+author:
+ - 'Erik Pihl Ostlyngen <erik.ostlyngen@uninett.no>'
+build_requires:
+ FindBin: 0
+ Test::Exception: 0
+ Test::More: 0
+configure_requires:
+ Devel::CheckLib: 0
+ ExtUtils::MakeMaker: 0
+distribution_type: module
+dynamic_config: 0
+generated_by: 'ExtUtils::MakeMaker version 6.57_05'
+license: perl
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
+name: DNS-LDNS
+no_index:
+ directory:
+ - t
+ - inc
+requires:
+ XSLoader: 0
+version: 0.52
diff --git a/contrib/DNS-LDNS/Makefile.PL b/contrib/DNS-LDNS/Makefile.PL
index 2ee291ddb765..722e1b8b1e8c 100755
--- a/contrib/DNS-LDNS/Makefile.PL
+++ b/contrib/DNS-LDNS/Makefile.PL
@@ -1,14 +1,35 @@
use 5.014002;
use ExtUtils::MakeMaker;
+
+use Devel::CheckLib;
+
+check_lib_or_exit(
+ lib => 'ldns',
+ header => 'ldns/ldns.h',
+ function => 'if(atof(ldns_version()) >= 1.6) return 0; else return 1;'
+);
+
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
NAME => 'DNS::LDNS',
VERSION_FROM => 'lib/DNS/LDNS.pm', # finds $VERSION
- PREREQ_PM => {}, # e.g., Module::Name => 1.1
+ CONFIGURE_REQUIRES => {
+ 'Devel::CheckLib' => 0,
+ 'ExtUtils::MakeMaker' => 0,
+ },
+ BUILD_REQUIRES => { # Actually required only by the tests
+ 'FindBin' => 0,
+ 'Test::More' => 0,
+ 'Test::Exception' => 0,
+ },
+ PREREQ_PM => {
+ 'XSLoader' => 0,
+ },
($] >= 5.005 ? ## Add these new keywords supported since 5.005
(ABSTRACT_FROM => 'lib/DNS/LDNS.pm', # retrieve abstract from module
- AUTHOR => 'Erik Pihl Ostlyngen <erik.ostlyngen@uninett.no>') : ()),
+ AUTHOR => 'Erik Pihl Ostlyngen <erik.ostlyngen@uninett.no>',
+ LICENSE => 'perl') : ()),
LIBS => ['-lldns'],
DEFINE => '',
INC => '-I.',
diff --git a/contrib/DNS-LDNS/README b/contrib/DNS-LDNS/README
index 9f6830323655..d14929bf33d3 100644
--- a/contrib/DNS-LDNS/README
+++ b/contrib/DNS-LDNS/README
@@ -1,4 +1,4 @@
-DNS::LDNS version 0.06
+DNS::LDNS version 0.52
======================
DESCRIPTION
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS.pm b/contrib/DNS-LDNS/lib/DNS/LDNS.pm
index d2fe20e193b3..beeedbef9263 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS.pm
@@ -651,7 +651,7 @@ our @EXPORT = qw(
read_anchor_file
);
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub AUTOLOAD {
# This AUTOLOAD is used to 'autoload' constants from the constant()
@@ -706,15 +706,6 @@ require DNS::LDNS::KeyList;
require DNS::LDNS::DNSSecDataChain;
require DNS::LDNS::DNSSecTrustTree;
-# Some default values used by the constructors
-our $DEFAULT_CLASS = &LDNS_RR_CLASS_IN;
-our $DEFAULT_TTL = 86400; # 1d
-our $DEFAULT_ORIGIN = new DNS::LDNS::RData(&LDNS_RDF_TYPE_DNAME, '.');
-our $DEFAULT_SOA_REFRESH = 86400; # 1d
-our $DEFAULT_SOA_RETRY = 3600; # 1h
-our $DEFAULT_SOA_EXPIRE = 604800; # 1w
-our $DEFAULT_SOA_MINIMUM = 10800; # 3h
-
# Autoload methods go after =cut, and are processed by the autosplit program.
1;
@@ -778,7 +769,7 @@ Represents a parsed zonefile (maps to the ldns_zone struct)
=item B<DNS::LDNS::RRList>
Represents a list of RRs. This class is also used to represent an
-RRSet all the dnames and types are equal, (maps to the the
+RRSet if all the dnames and types are equal, (maps to the the
ldns_rr_list struct)
=item B<DNS::LDNS::RR>
@@ -909,15 +900,13 @@ freed.
The purpose for writing this wrapper class has been to be able to
process zone file data with good time performance. Data checking and
-error handling is a bit sparse. Calling a method with wrong argument
-types will some times kill the application with an intelligible error
-message, in other cases it may provoke a segmentation fault. Using
-out-of-range data values, e.g. in array indexes, may also cause
-unexpected results.
+error handling is a bit sparse.
-Most constructors and all methods returning a status will update the
-static DNS::LDNS::last_status variable. Most methods do not return a
-status and will not reset this variable even though they succeeds.
+Most constructors will update the DNS::LDNS::last_status variable if
+they fail (return undef). Wrapper methods to ldns functions which would
+return a status will update the static DNS::LDNS::last_status variable.
+Most methods do not return a status and will not reset this variable
+even though they succeeds.
=head2 EXPORT
@@ -1286,10 +1275,9 @@ None by default.
=head1 BUGS
-This package is currently in a very early stage of development. There
-are probably some bugs. You may also expect that method names and
-behaviour could still change without much considerations to backward
-compatibility.
+This package is still in the beta stage of development. There no known bugs,
+although parts of the code has not yet been very well tested. Bugreports will
+be greatly appreciated.
=head1 SEE ALSO
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecDataChain.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecDataChain.pm
index 42074dc153c8..28bebe044c0a 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecDataChain.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecDataChain.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS;
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub rrset {
my $self = shift;
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecName.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecName.pm
index bea6bb7c4931..0af91e2e4c32 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecName.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecName.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS ':all';
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub new {
my $class = shift;
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRSets.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRSets.pm
index fbd9bb735628..05471c7d1d6e 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRSets.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRSets.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS;
-our $VERSION = '0.06';
+our $VERSION = '0.52';
# Note: Since this class does not have a constructor, we can let its child
# objects be owned by the parent. This reduces the recursion depth on
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRs.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRs.pm
index b7b3dccf9543..78aa080c9c19 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRs.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecRRs.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS;
-our $VERSION = '0.06';
+our $VERSION = '0.52';
# Note: This class does not have a constructor. Thus, it can not be created
# as an individual object. The data structure of the node is owned
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecTrustTree.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecTrustTree.pm
index 1b9ca66e6102..cdd3ed846dd4 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecTrustTree.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecTrustTree.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS;
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub add_parent {
my ($self, $parent, $sig, $parent_status) = @_;
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecZone.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecZone.pm
index da809a6ace01..d273a00d2247 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecZone.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/DNSSecZone.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS ':all';
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub new {
my ($class, %args) = @_;
@@ -31,9 +31,9 @@ sub new {
if ($file) {
$zone = _new_from_file($file,
- $args{origin} || $LDNS::DEFAULT_ORIGIN,
- $args{ttl} || $LDNS::DEFAULT_TTL,
- $args{class} || $LDNS::DEFAULT_CLASS,
+ $args{origin},
+ $args{ttl} || 0,
+ $args{class} || 0,
$status, $line_nr);
}
else {
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/GC.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/GC.pm
index 014b7bee21af..e0d51e0d1ccd 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/GC.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/GC.pm
@@ -3,7 +3,7 @@ package DNS::LDNS::GC;
use strict;
use warnings;
-our $VERSION = '0.06';
+our $VERSION = '0.52';
my %ref_count;
my %owned_by;
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/Key.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/Key.pm
index bbce173dd8bb..f2fbb2e3e0ac 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/Key.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/Key.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS ':all';
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub new {
my ($class, %args) = @_;
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/KeyList.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/KeyList.pm
index c39e1c704e53..678225fd9a4c 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/KeyList.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/KeyList.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS ':all';
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub new {
my $class = shift;
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/Packet.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/Packet.pm
index f9875bf5abd0..c8d4ae2d4d9f 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/Packet.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/Packet.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS;
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub new {
my ($class, %args) = @_;
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/RBNode.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/RBNode.pm
index 31f617cddb1b..38adb385dfce 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/RBNode.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/RBNode.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS;
-our $VERSION = '0.06';
+our $VERSION = '0.52';
# Note: This class does not have a constructor. Thus, it can not be created
# as an individual object. The data structure of the object will always be
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/RBTree.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/RBTree.pm
index e86bfa8ddfa4..f64731a5b85c 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/RBTree.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/RBTree.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS;
-our $VERSION = '0.06';
+our $VERSION = '0.52';
# Note: Since this class does not have a constructor, we can let its child
# objects be owned by the parent. This reduces the recursion depth on
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/RData.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/RData.pm
index 76ef5ebac861..d495d3fbcf36 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/RData.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/RData.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS;
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub new {
my ($class, $type, $str) = @_;
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/RR.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/RR.pm
index 91f34afb4028..70c919cd295a 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/RR.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/RR.pm
@@ -5,9 +5,8 @@ use strict;
use warnings;
use DNS::LDNS ':all';
-use Carp 'croak';
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub new {
my $class = shift;
@@ -19,17 +18,19 @@ sub new {
$rr = _new;
}
elsif (scalar(@_) == 1) {
- $rr = _new_from_str($_[0], $DNS::LDNS::DEFAULT_TTL,
- $DNS::LDNS::DEFAULT_ORIGIN, $status);
+ $rr = _new_from_str($_[0], 0,
+ undef, undef,
+ $status);
}
else {
my %args = @_;
if ($args{str}) {
$rr = _new_from_str($args{str},
- $args{default_ttl} || $DNS::LDNS::DEFAULT_TTL,
- $args{origin} || $DNS::LDNS::DEFAULT_ORIGIN,
- $status);
+ $args{default_ttl} || 0,
+ $args{origin},
+ $args{prev} ? ${$args{prev}} : undef,
+ $status);
}
elsif ($args{filename} or $args{file}) {
my $line_nr = 0;
@@ -43,10 +44,13 @@ sub new {
$file = \*FILE;
}
+ my $ttl = 0;
$rr = _new_from_file($file,
- $args{default_ttl} || $DNS::LDNS::DEFAULT_TTL,
- $args{origin} || $DNS::LDNS::DEFAULT_ORIGIN,
- $status, $line_nr);
+ $args{default_ttl} ? ${$args{default_ttl}} : $ttl,
+ $args{origin} ? ${$args{origin}} : undef,
+ $args{prev} ? ${$args{prev}} : undef,
+ $status,
+ $line_nr);
if ($args{filename}) {
close $file;
}
@@ -56,11 +60,11 @@ sub new {
elsif ($args{type}) {
$rr = _new_from_type($args{type});
if ($args{owner}) {
- $rr->set_owner(new DNS::LDNS::RData(
- &LDNS_RDF_TYPE_DNAME, $args{owner}));
+ $rr->set_owner(ref $args{owner} ? $args{owner} :
+ new DNS::LDNS::RData(&LDNS_RDF_TYPE_DNAME, $args{owner}));
}
- $rr->set_ttl($args{ttl} || $DNS::LDNS::DEFAULT_TTL);
- $rr->set_class($args{class} || $DNS::LDNS::DEFAULT_CLASS);
+ $rr->set_ttl($args{ttl}) if ($args{ttl});
+ $rr->set_class($args{class}) if ($args{class});
if ($args{rdata}) {
if (!$rr->set_rdata(@{$args{rdata}})) {
@@ -369,21 +373,26 @@ DNS::LDNS::RR - Resource record
my rr = new DNS::LDNS::RR('mylabel 3600 IN A 168.10.10.10')
my rr = new DNS::LDNS::RR(
str => 'mylabel 3600 IN A 168.10.10.10',
- default_ttl => 3600, # optional,
- origin => new DNS::LDNS::RData(LDNS_RDF_TYPE_NAME, 'myzone.'), " # optional
+ default_ttl => 3600, # optional
+ origin => $origin_rdata, # optional
+ prev => \$prev_rdata, # optional
)
my rr = new DNS::LDNS::RR(
filename => '/path/to/rr',
- origin => ...)
+ default_ttl => \$ttl, # optional
+ origin => \$origin_rdata, # optional
+ prev => \$prev_rdata) # optional
my rr = new DNS::LDNS::RR(
file => \*FILE,
- origin => ...)
+ default_ttl => \$ttl, # optional
+ origin => \$origin_rdata, # optional
+ prev => \$prev_rdata) # optional
my rr = new DNS::LDNS::RR(
type => LDNS_RR_TYPE_A,
rdata => [new DNS::LDNS::RData(...), new DNS::LDNS::RData(...), ...],
class => LDNS_RR_CLASS_IN, # optional
ttl => 3600, # optional
- owner => new DNS::LDNS::RData(LDNS_RDF_TYPE_NAME, 'mylabel'), # optional)
+ owner => new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, 'mylabel'), # optional)
my rr = new DNS::LDNS::RR
rr2 = rr->clone
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/RRList.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/RRList.pm
index 11570acbcdde..7fdbd59db1dd 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/RRList.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/RRList.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS;
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub new {
my ($class, %args) = @_;
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/Resolver.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/Resolver.pm
index 111e64f0b7ec..fe4e10eff1cb 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/Resolver.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/Resolver.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS ':all';
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub new {
my ($class, %args) = @_;
diff --git a/contrib/DNS-LDNS/lib/DNS/LDNS/Zone.pm b/contrib/DNS-LDNS/lib/DNS/LDNS/Zone.pm
index a42beace7288..7f479275c418 100644
--- a/contrib/DNS-LDNS/lib/DNS/LDNS/Zone.pm
+++ b/contrib/DNS-LDNS/lib/DNS/LDNS/Zone.pm
@@ -6,7 +6,7 @@ use warnings;
use DNS::LDNS ':all';
-our $VERSION = '0.06';
+our $VERSION = '0.52';
sub new {
my ($class, %args) = @_;
@@ -25,12 +25,15 @@ sub new {
$file = \*FILE;
}
+ elsif ($args{file}) {
+ $file = $args{file};
+ }
if ($file) {
$zone = _new_from_file($file,
- $args{origin} || $DNS::LDNS::DEFAULT_ORIGIN,
- $args{default_ttl} || $DNS::LDNS::DEFAULT_TTL,
- $args{class} || $DNS::LDNS::DEFAULT_CLASS,
+ $args{origin},
+ $args{default_ttl} || 0,
+ $args{class} || 0,
$status, $line_nr);
}
else {
diff --git a/contrib/DNS-LDNS/t/dnssec_datachain.t b/contrib/DNS-LDNS/t/dnssec_datachain.t
index 3eff6f15760f..2a1e262c4072 100644
--- a/contrib/DNS-LDNS/t/dnssec_datachain.t
+++ b/contrib/DNS-LDNS/t/dnssec_datachain.t
@@ -18,39 +18,43 @@ my $p = $r->query(
new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, 'iis.se.'),
LDNS_RR_TYPE_SOA, LDNS_RR_CLASS_IN, LDNS_RD);
-isa_ok($p, 'DNS::LDNS::Packet');
+SKIP: {
+ skip "Resolver is not dnssec able. Skip this test.", 9 unless ($p->ad);
-my $rrset = $p->rr_list_by_type(LDNS_RR_TYPE_SOA, LDNS_SECTION_ANSWER);
+ isa_ok($p, 'DNS::LDNS::Packet');
-ok($rrset->rr_count > 0, 'Got an answer with some content');
+ my $rrset = $p->rr_list_by_type(LDNS_RR_TYPE_SOA, LDNS_SECTION_ANSWER);
-my $chain = $r->build_data_chain(LDNS_RD, $rrset, $p, undef);
+ ok($rrset->rr_count > 0, 'Got an answer with some content');
-isa_ok($chain, 'DNS::LDNS::DNSSecDataChain');
+ my $chain = $r->build_data_chain(LDNS_RD, $rrset, $p, undef);
-isa_ok($chain->parent, 'DNS::LDNS::DNSSecDataChain');
+ isa_ok($chain, 'DNS::LDNS::DNSSecDataChain');
-dies_ok {
- my $new_rr = new DNS::LDNS::RR(str => 'test.test. 1234 IN A 10.0.0.1');
- my $t = $chain->derive_trust_tree($new_rr);
-} 'Making a trust tree with foreign rr fails.';
+ isa_ok($chain->parent, 'DNS::LDNS::DNSSecDataChain');
-my $rr = $chain->rrset->rr(0);
+ dies_ok {
+ my $new_rr = new DNS::LDNS::RR(str => 'test.test. 1234 IN A 10.0.0.1');
+ my $t = $chain->derive_trust_tree($new_rr);
+ } 'Making a trust tree with foreign rr fails.';
-my $tree = $chain->derive_trust_tree($rr);
+ my $rr = $chain->rrset->rr(0);
-isa_ok($tree, 'DNS::LDNS::DNSSecTrustTree');
+ my $tree = $chain->derive_trust_tree($rr);
-# Get root keys.
-my $root_keys_pk = $r->query(
- new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, '.'),
- LDNS_RR_TYPE_DNSKEY, LDNS_RR_CLASS_IN, LDNS_RD);
-my $root_keys = $root_keys_pk->rr_list_by_type(
- LDNS_RR_TYPE_DNSKEY, LDNS_SECTION_ANSWER);
+ isa_ok($tree, 'DNS::LDNS::DNSSecTrustTree');
-is($tree->contains_keys($root_keys), LDNS_STATUS_OK,
- 'Root key found in trust chain');
+ # Get root keys.
+ my $root_keys_pk = $r->query(
+ new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, '.'),
+ LDNS_RR_TYPE_DNSKEY, LDNS_RR_CLASS_IN, LDNS_RD);
+ my $root_keys = $root_keys_pk->rr_list_by_type(
+ LDNS_RR_TYPE_DNSKEY, LDNS_SECTION_ANSWER);
-ok($tree->depth > 1, 'The trust tree is more than one node.');
+ is($tree->contains_keys($root_keys), LDNS_STATUS_OK,
+ 'Root key found in trust chain');
-isa_ok($tree->parent(0), 'DNS::LDNS::DNSSecTrustTree');
+ ok($tree->depth > 1, 'The trust tree is more than one node.');
+
+ isa_ok($tree->parent(0), 'DNS::LDNS::DNSSecTrustTree');
+}
diff --git a/contrib/DNS-LDNS/t/rr.t b/contrib/DNS-LDNS/t/rr.t
index 45b3d9f62f33..f3bae29e600f 100644
--- a/contrib/DNS-LDNS/t/rr.t
+++ b/contrib/DNS-LDNS/t/rr.t
@@ -1,4 +1,6 @@
-use Test::More tests => 14;
+use Test::More tests => 19;
+
+use FindBin qw/$Bin/;
use DNS::LDNS ':all';
@@ -22,6 +24,7 @@ $rr1 = new DNS::LDNS::RR(
new DNS::LDNS::RData(LDNS_RDF_TYPE_PERIOD, '87654')
],
);
+
isa_ok($rr1, 'DNS::LDNS::RR', 'Create SOA rr with rdata');
like($rr1->to_string, qr/^myzone\.org\.\s+1234\s+CH\s+SOA\s+hostmaster\.myzone\.org\.\s+master\.myzone\.org\.\s+2012113030\s+12345\s+1827\s+2345678\s+87654$/,
@@ -45,3 +48,27 @@ my $rr3 = new DNS::LDNS::RR(str => 'ozone.org. 1234 IN SOA hostmaster.ozone.org.
ok($rr3->compare_dname($rr1) > 0, 'Compare dname, greater than');
ok($rr1->compare_dname($rr3) < 0, 'Compare dname, less than');
is($rr1->compare_dname($rr2), 0, 'Compare dname, equal');
+
+# Read records from a zonefile
+my $origin = new DNS::LDNS::RData(LDNS_RDF_TYPE_DNAME, '.');
+my $prev = $origin->clone;
+my $ttl = 0;
+my $count = 0;
+open(ZONE, "$Bin/testdata/myzone.org");
+my $rr4 = new DNS::LDNS::RR(file => \*ZONE, default_ttl => \$ttl,
+ origin => \$origin, prev => \$prev);
+is($DNS::LDNS::last_status, LDNS_STATUS_SYNTAX_TTL, "Read ttl statement.");
+is($ttl, 4500, "TTL is 4500");
+
+$rr4 = new DNS::LDNS::RR(file => \*ZONE, default_ttl => \$ttl,
+ origin => \$origin, prev => \$prev);
+is($DNS::LDNS::last_status, LDNS_STATUS_SYNTAX_ORIGIN, "Read origin statement.");
+is($origin->to_string, "myzone.org.", "Origin is myzone.org.");
+
+while (!eof(\*ZONE)) {
+ $rr4 = new DNS::LDNS::RR(file => \*ZONE, default_ttl => \$ttl,
+ origin => \$origin, prev => \$prev);
+ last unless ($rr4);
+ $count++;
+}
+is($count, 6);
diff --git a/contrib/DNS-LDNS/typemap b/contrib/DNS-LDNS/typemap
index 568404bbb472..7bafc613e022 100644
--- a/contrib/DNS-LDNS/typemap
+++ b/contrib/DNS-LDNS/typemap
@@ -46,7 +46,7 @@ LDNS_GENERIC_STRUCT_OPT
$var = INT2PTR($type, tmp);
}
else
- croak(\"$var is not of type ${(my $ntt=$ntype)=~s/__/::/g;\$ntt}\")
+ croak(\"$var is not of type ${(my $ntt=$ntype)=~s/__/::/g;$ntt=~s/::Opt$//;\$ntt}\")
INPUT
LDNS_GENERIC_STRUCT
@@ -62,6 +62,10 @@ LDNS_GENERIC_STRUCT
sv_setref_pv($arg, \"${(my $ntt=$ntype)=~s/__/::/g;\$ntt}\", (void*)$var);
OUTPUT
+LDNS_GENERIC_STRUCT_OPT
+ sv_setref_pv($arg, \"${(my $ntt=$ntype)=~s/__/::/g;$ntt=~s/::Opt$//;\$ntt}\", (void*)$var);
+
+OUTPUT
Mortal_PV
sv_setsv($arg, sv_2mortal(newSVpv($var, 0)));
free((void *)$var);
diff --git a/contrib/ldnsx/ldnsx.py b/contrib/ldnsx/ldnsx.py
index 3ae9424f140c..9c28734b4953 100644
--- a/contrib/ldnsx/ldnsx.py
+++ b/contrib/ldnsx/ldnsx.py
@@ -855,6 +855,8 @@ _rr_types={
"APL" : ldns.LDNS_RR_TYPE_APL,
"ATMA" : ldns.LDNS_RR_TYPE_ATMA,
"AXFR" : ldns.LDNS_RR_TYPE_AXFR,
+ "CDNSKEY" : ldns.LDNS_RR_TYPE_CDNSKEY,
+ "CDS" : ldns.LDNS_RR_TYPE_CDS,
"CERT" : ldns.LDNS_RR_TYPE_CERT,
"CNAME": ldns.LDNS_RR_TYPE_CNAME,
"COUNT": ldns.LDNS_RR_TYPE_COUNT,
@@ -895,6 +897,7 @@ _rr_types={
"NSEC3PARAMS" : ldns.LDNS_RR_TYPE_NSEC3PARAMS,
"NULL" : ldns.LDNS_RR_TYPE_NULL,
"NXT" : ldns.LDNS_RR_TYPE_NXT,
+ "OPENPGPKEY" : ldns.LDNS_RR_TYPE_OPENPGPKEY,
"OPT" : ldns.LDNS_RR_TYPE_OPT,
"PTR" : ldns.LDNS_RR_TYPE_PTR,
"PX" : ldns.LDNS_RR_TYPE_PX,
@@ -906,6 +909,7 @@ _rr_types={
"SOA" : ldns.LDNS_RR_TYPE_SOA,
"SRV" : ldns.LDNS_RR_TYPE_SRV,
"SSHFP": ldns.LDNS_RR_TYPE_SSHFP,
+ "TLSA" : ldns.LDNS_RR_TYPE_TLSA,
"TSIG" : ldns.LDNS_RR_TYPE_TSIG,
"TXT" : ldns.LDNS_RR_TYPE_TXT,
"UID" : ldns.LDNS_RR_TYPE_UID,
diff --git a/contrib/python/Makefile b/contrib/python/Makefile
index debc7d0486d2..172ab20c1a4e 100644
--- a/contrib/python/Makefile
+++ b/contrib/python/Makefile
@@ -34,7 +34,7 @@
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " testenv to make test environment and run bash "
- @echo " usefull in case you don't want to install ldns but want to test examples"
+ @echo " useful in case you don't want to install ldns but want to test examples"
@echo " doc to make documentation"
@echo " clean clean all"
diff --git a/contrib/python/ldns.i b/contrib/python/ldns.i
index 35e076f8b7cc..0635c0bac83b 100644
--- a/contrib/python/ldns.i
+++ b/contrib/python/ldns.i
@@ -126,6 +126,9 @@ uint32_t ldns_read_timeval_usec(struct timeval* t) {
%immutable ldns_struct_rr_descriptor::_name;
%immutable ldns_error_str;
%immutable ldns_signing_algorithms;
+%immutable ldns_tsig_credentials_struct::algorithm;
+%immutable ldns_tsig_credentials_struct::keyname;
+%immutable ldns_tsig_credentials_struct::keydata;
//*_new_frm_fp_l
%apply int *OUTPUT { (int *line_nr) };
@@ -139,6 +142,8 @@ uint32_t ldns_read_timeval_usec(struct timeval* t) {
%include "ldns_resolver.i"
%include "ldns_rr.i"
+%include <ldns/rr.h>
+
%inline %{
int Python_str_Check(PyObject *o) {
#if PY_VERSION_HEX>=0x03000000
@@ -168,7 +173,6 @@ int Python_str_Check(PyObject *o) {
%include <ldns/packet.h>
%include <ldns/rdata.h>
%include <ldns/resolver.h>
- %include <ldns/rr.h>
%include <ldns/str2host.h>
%include <ldns/tsig.h>
%include <ldns/update.h>
diff --git a/contrib/python/ldns_key.i b/contrib/python/ldns_key.i
index 26a9b0f57fa4..93f09c65f64f 100644
--- a/contrib/python/ldns_key.i
+++ b/contrib/python/ldns_key.i
@@ -116,7 +116,7 @@ This class can contains all types of keys that are used in DNSSEC. Mostly used t
#retvals: ldns_rr *
def print_to_file(self, file):
- """print a private key to the file ouput
+ """print a private key to the file output
:param file: output file pointer
"""
diff --git a/contrib/python/ldns_rdf.i b/contrib/python/ldns_rdf.i
index 7b69d8b21768..22e1c36697ce 100644
--- a/contrib/python/ldns_rdf.i
+++ b/contrib/python/ldns_rdf.i
@@ -221,6 +221,11 @@
case LDNS_RDF_TYPE_EUI64: return "EUI64";
case LDNS_RDF_TYPE_TAG: return "TAG";
case LDNS_RDF_TYPE_LONG_STR: return "LONG_STR";
+ case LDNS_RDF_TYPE_CERTIFICATE_USAGE:
+ return "CERTIFICATE_USAGE";
+ case LDNS_RDF_TYPE_SELECTOR: return "SELECTOR";
+ case LDNS_RDF_TYPE_MATCHING_TYPE:
+ return "MATCHING_TYPE";
}
}
return 0;
diff --git a/contrib/python/ldns_resolver.i b/contrib/python/ldns_resolver.i
index b926e65a81e7..7081ec36ace0 100644
--- a/contrib/python/ldns_resolver.i
+++ b/contrib/python/ldns_resolver.i
@@ -113,9 +113,9 @@
%rename(__ldns_resolver_tsig_algorithm) ldns_resolver_tsig_algorithm;
%inline
%{
- char * _ldns_resolver_tsig_algorithm(const ldns_resolver *res)
+ const char * _ldns_resolver_tsig_algorithm(const ldns_resolver *res)
{
- char *str;
+ const char *str;
str = ldns_resolver_tsig_algorithm(res);
if (str != NULL) {
str = strdup(str);
@@ -128,9 +128,9 @@
%rename(__ldns_resolver_tsig_keydata) ldns_resolver_tsig_keydata;
%inline
%{
- char * _ldns_resolver_tsig_keydata(const ldns_resolver *res)
+ const char * _ldns_resolver_tsig_keydata(const ldns_resolver *res)
{
- char *str;
+ const char *str;
str = ldns_resolver_tsig_keydata(res);
if (str != NULL) {
str = strdup(str);
@@ -143,9 +143,9 @@
%rename(__ldns_resolver_tsig_keyname) ldns_resolver_tsig_keyname;
%inline
%{
- char * _ldns_resolver_tsig_keyname(const ldns_resolver *res)
+ const char * _ldns_resolver_tsig_keyname(const ldns_resolver *res)
{
- char *str;
+ const char *str;
str = ldns_resolver_tsig_keyname(res);
if (str != NULL) {
str = strdup(str);