hardaker pushed to perl-Net-DNS-SEC (epel7). "A patch to support bind's new private key file format"

notifications at fedoraproject.org notifications at fedoraproject.org
Tue Apr 28 18:17:47 UTC 2015


>From b8d08891a4ac5b7fcf8b7c97c8695297c8f7125d Mon Sep 17 00:00:00 2001
From: Wes Hardaker <opensource at hardakers.net>
Date: Thu, 6 Jan 2011 08:14:10 -0800
Subject: A patch to support bind's new private key file format


diff --git a/perl-Net-DNS-SEC.spec b/perl-Net-DNS-SEC.spec
index 3264f36..2d7f576 100644
--- a/perl-Net-DNS-SEC.spec
+++ b/perl-Net-DNS-SEC.spec
@@ -1,6 +1,6 @@
 Name:           perl-Net-DNS-SEC
 Version:        0.16
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        DNSSEC modules for Perl
 License:        GPL+ or Artistic 
 Group:          Development/Libraries
@@ -22,6 +22,7 @@ BuildRequires:  perl(Time::Local)
 BuildRequires:  perl(Digest::BubbleBabble)
 BuildRequires:  perl(Digest::SHA)
 BuildRequires:  perl(MIME::Base32)
+Patch1:         v0.16-v1.3-private-key-format.patch
 
 # neither are picked up automagically.
 Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
@@ -38,6 +39,8 @@ RSA and DSA crypto routines are supported.
 %prep
 %setup -q -n Net-DNS-SEC-%{version}
 
+%patch1 -p1 -b .v1-3
+
 %build
 %{__perl} Makefile.PL INSTALLDIRS=vendor
 make %{?_smp_mflags}
@@ -66,6 +69,9 @@ rm -rf %{buildroot}
 %{_mandir}/man3/*
 
 %changelog
+* Thu Jan  6 2011 Wes Hardaker <wjhns174 at hardakers.net> - 0.16-4
+- added support for the v1.3 private key format
+
 * Thu Sep 23 2010 Wes Hardaker <wjhns174 at hardakers.net> - 0.16-3
 - rebuild after prereq now properly in the system
 
diff --git a/v0.16-v1.3-private-key-format.patch b/v0.16-v1.3-private-key-format.patch
new file mode 100644
index 0000000..1a8b47c
--- /dev/null
+++ b/v0.16-v1.3-private-key-format.patch
@@ -0,0 +1,101 @@
+diff --git a/SEC/Private.pm b/SEC/Private.pm
+index 52dd298..bcdc5b8 100644
+--- a/SEC/Private.pm
++++ b/SEC/Private.pm
+@@ -26,7 +26,8 @@ sub new {
+     my $self={};
+     my    ($Modulus,$PublicExponent,$PrivateExponent,$Prime1,
+ 	   $Prime2,$Exponent1,$Exponent2,$Coefficient,
+-	   $prime_p,$subprime_q,$base_g,$private_val_x,$public_val_y);
++	   $prime_p,$subprime_q,$base_g,$private_val_x,$public_val_y,
++	   $Created, $Publish, $Activate);
+     
+ 
+     bless ($self,$class);
+@@ -51,7 +52,7 @@ sub new {
+     
+     while (<KEYFH>) {
+ 	if (/Private-key-format: (v\d*\.\d*)/) {
+-	    if ($1 ne "v1.2") {
++	    if ($1 ne "v1.2" && $1 ne "v1.3") {
+ 		croak "Private Key Format not regognized";
+ 	    }
+ 	}elsif	    (/^Algorithm:\s*(\d*)/) {
+@@ -87,7 +88,14 @@ sub new {
+ 	    $private_val_x=decode_base64($1);
+ 	} elsif (/^Public_value\(y\):\s*(\S+)/) { 
+ 	    $public_val_y=decode_base64($1);
+-	}
++	} elsif (/^Created\(y\):\s*(\S+)/) { 
++	    $Created=$1;
++	} elsif (/^Publish\(y\):\s*(\S+)/) { 
++	    $Publish=$1;
++	} elsif (/^Activate\(y\):\s*(\S+)/) { 
++	    $Activate=$1;
++	} 
++	
+     }
+     close(KEYFH);
+ 
+@@ -130,6 +138,14 @@ sub new {
+ 	$private_dsa->set_pub_key($public_val_y);
+ 	$self->{"privatekey"}=$private_dsa;
+     }
++
++    if (defined($Created)) {
++	# new fields in v1.3
++	$self->{'created'} = $Created;
++	$self->{'publish'} = $Publish;
++	$self->{'activate'} = $Activate;
++    }
++
+     return $self;
+ 
+ }
+@@ -162,6 +178,24 @@ sub signame {
+ }
+ 
+ 
++sub created {
++    my $self=shift;
++    return $self->{'created'} if (exists($self->{'created'}));
++}
++
++
++sub publish {
++    my $self=shift;
++    return $self->{'publish'} if (exists($self->{'publish'}));
++}
++
++
++sub activate {
++    my $self=shift;
++    return $self->{'activate'} if (exists($self->{'activate'}));
++}
++
++
+ # Little helper function to put a BigInt into a binary (unsigned,
+ #network order )
+ 
+@@ -356,14 +390,19 @@ or Crypt::OpenSSL::DSA object. This is really only relevant to the
+ Net::DNS::RR::SIG class.
+ 
+ 
+-=head2  algorithm, keytag, signame
++=head2  algorithm, keytag, signame, created, publish, activate
+  
+  $private->algorithm
+  $private->keytag
+  $private->signame
++ $private->created
++ $private->publish
++ $private->activate
+ 
+ Returns components as determined from the filename and needed by
+-Net::DNS::RR::RRSIG.
++Net::DNS::RR::RRSIG.  The 'created', 'publish' and 'activate'
++components are only available in version 1.3 or higher formatted
++files.
+ 
+ 
+ =head1 RSASHA1 specific helper functions
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/perl-Net-DNS-SEC.git/commit/?h=epel7&id=b8d08891a4ac5b7fcf8b7c97c8695297c8f7125d


More information about the scm-commits mailing list