rpms/perl-Razor-Agent/devel razor-agents-2.85-use-sha-not-sha1.patch, NONE, 1.1 perl-Razor-Agent.spec, 1.21, 1.22

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Author: wtogami

Update of /cvs/pkgs/rpms/perl-Razor-Agent/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv6068

Modified Files:
	perl-Razor-Agent.spec 
Added Files:
	razor-agents-2.85-use-sha-not-sha1.patch 
Log Message:
Use Digest::SHA instead of Digest::SHA1


razor-agents-2.85-use-sha-not-sha1.patch:
 Client/Engine.pm       |    1 -
 Signature/Ephemeral.pm |   14 +++++++-------
 Signature/Whiplash.pm  |   14 ++++++--------
 String.pm              |   17 +++++++----------
 4 files changed, 20 insertions(+), 26 deletions(-)

--- NEW FILE razor-agents-2.85-use-sha-not-sha1.patch ---
diff -urN razor-agents-2.85.orig/lib/Razor2/Client/Engine.pm razor-agents-2.85/lib/Razor2/Client/Engine.pm
--- razor-agents-2.85.orig/lib/Razor2/Client/Engine.pm	2005-06-13 19:42:25.000000000 -0400
+++ razor-agents-2.85/lib/Razor2/Client/Engine.pm	2009-11-01 13:45:08.125369192 -0500
@@ -1,7 +1,6 @@
 package Razor2::Client::Engine;
 
 use strict;
-use Digest::SHA1 qw(sha1_hex);
 use Data::Dumper;
 use Razor2::Signature::Ephemeral;
 use Razor2::Engine::VR8;
diff -urN razor-agents-2.85.orig/lib/Razor2/Signature/Ephemeral.pm razor-agents-2.85/lib/Razor2/Signature/Ephemeral.pm
--- razor-agents-2.85.orig/lib/Razor2/Signature/Ephemeral.pm	2003-03-03 18:09:50.000000000 -0500
+++ razor-agents-2.85/lib/Razor2/Signature/Ephemeral.pm	2009-11-01 13:45:08.125369192 -0500
@@ -2,9 +2,13 @@
 
 package Razor2::Signature::Ephemeral;
 use strict;
-use Digest::SHA1;
 use Data::Dumper;
 
+BEGIN {
+  eval  { require Digest::SHA;  import Digest::SHA  qw(sha1_hex); 1 }
+  or do { require Digest::SHA1; import Digest::SHA1 qw(sha1_hex) }
+}
+
 sub new {
 
     my ($class, %args) = @_;
@@ -86,16 +90,12 @@
     }
 
     my $digest;
-    my $ctx = Digest::SHA1->new;
 
     if ($seclength > 128) { 
-        $ctx->add($section1);
-        $ctx->add($section2);
-        $digest = $ctx->hexdigest;
+        $digest = sha1_hex($section1, $section2);
     } else { 
         debug("Sections too small... reverting back to orginal content.");
-        $ctx->add($content);
-        $digest = $ctx->hexdigest;
+        $digest = sha1_hex($content);
     }
 
     debug("Computed e-hash is $digest");
diff -urN razor-agents-2.85.orig/lib/Razor2/Signature/Whiplash.pm razor-agents-2.85/lib/Razor2/Signature/Whiplash.pm
--- razor-agents-2.85.orig/lib/Razor2/Signature/Whiplash.pm	2007-05-08 18:22:36.000000000 -0400
+++ razor-agents-2.85/lib/Razor2/Signature/Whiplash.pm	2009-11-01 13:45:08.124368017 -0500
@@ -7,7 +7,10 @@
 
 package Razor2::Signature::Whiplash; 
 
-use Digest::SHA1;
+BEGIN {
+  eval  { require Digest::SHA;  import Digest::SHA  qw(sha1_hex); 1 }
+  or do { require Digest::SHA1; import Digest::SHA1 qw(sha1_hex) }
+}
 
 sub new { 
 
@@ -683,13 +686,8 @@
         # the value of length to the nearest multiple of ``length_error''.
         # Take the first 20 hex chars from SHA1 and call it the signature.
 
-        my $sha1 = Digest::SHA1->new();
-
-        $sha1->add($host);
-        $sig = substr $sha1->hexdigest, 0, 12;
-
-        $sha1->add($corrected_length);
-        $sig .= substr $sha1->hexdigest, 0, 4;
+        $sig = substr sha1_hex($host), 0, 12;
+        $sig .= substr sha1_hex($corrected_length), 0, 4;
 
         push @sigs, $sig;
         $sig_meta{$sig} = [$host, $corrected_length];
diff -urN razor-agents-2.85.orig/lib/Razor2/String.pm razor-agents-2.85/lib/Razor2/String.pm
--- razor-agents-2.85.orig/lib/Razor2/String.pm	2005-06-13 17:09:59.000000000 -0400
+++ razor-agents-2.85/lib/Razor2/String.pm	2009-11-01 13:45:08.123368518 -0500
@@ -1,11 +1,15 @@
 # $Id: String.pm,v 1.48 2005/06/13 21:09:59 vipul Exp $
 package Razor2::String;
 
-use Digest::SHA1 qw(sha1_hex);
 use URI::Escape;
 use Razor2::Preproc::enBase64;
 use Data::Dumper;
 
+BEGIN {
+  eval  { require Digest::SHA;  import Digest::SHA  qw(sha1_hex); 1 }
+  or do { require Digest::SHA1; import Digest::SHA1 qw(sha1_hex) }
+}
+
 #use MIME::Parser;
 
 require Exporter;
@@ -69,15 +73,8 @@
     return unless $text && $iv1 && $iv2;
     die "no ref's allowed" if ref($text);
 
-    my $ctx = Digest::SHA1->new;
-    $ctx->add($iv2);
-    $ctx->add($text);
-    my $digest = $ctx->hexdigest;
-
-    $ctx = Digest::SHA1->new;
-    $ctx->add($iv1);
-    $ctx->add($digest);
-    $digest = $ctx->hexdigest;
+    my $digest = sha1_hex($iv2, $text);
+    $digest = sha1_hex($iv1, $digest);
 
     return (hextobase64($digest), $digest);
 }


Index: perl-Razor-Agent.spec
===================================================================
RCS file: /cvs/pkgs/rpms/perl-Razor-Agent/devel/perl-Razor-Agent.spec,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -p -r1.21 -r1.22
--- perl-Razor-Agent.spec	26 Jul 2009 16:20:15 -0000	1.21
+++ perl-Razor-Agent.spec	2 Nov 2009 03:37:20 -0000	1.22
@@ -1,11 +1,12 @@
 Summary:	Use a Razor catalogue server to filter spam messages
 Name:		perl-Razor-Agent
 Version:	2.85
-Release:	3%{?dist}
+Release:	4%{?dist}
 License:	Artistic 2.0
 Group:		Applications/Internet
 URL:		http://razor.sourceforge.net/
 Source:		http://dl.sourceforge.net/razor/razor-agents-%{version}.tar.bz2
+Patch0:         razor-agents-2.85-use-sha-not-sha1.patch
 Requires:	perl(Net::DNS), perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
 BuildRequires:	perl(Net::DNS), perl(Digest::SHA1), perl(Time::HiRes), perl(URI), perl(ExtUtils::MakeMaker)
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -28,6 +29,7 @@ Agents on the network.
 
 %prep
 %setup -q -n razor-agents-%{version}
+%patch0 -p1
 
 %build
 export CFLAGS="$RPM_OPT_FLAGS"
@@ -74,6 +76,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man*/*
 
 %changelog
+* Sun Nov 01 2009 Warren Togami <wtogami@xxxxxxxxxx> - 2.85-4
+- Use Digest::SHA instead of Digest::SHA1
+
 * Sun Jul 26 2009 Fedora Release Engineering <rel-eng@xxxxxxxxxxxxxxxxxxxxxxx> - 2.85-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
 

--
Fedora Extras Perl SIG
http://www.fedoraproject.org/wiki/Extras/SIGs/Perl
Fedora-perl-devel-list mailing list
Fedora-perl-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-perl-devel-list

[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Legacy Announce]     [Fedora PHP Devel]     [Kernel Devel]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Big List of Linux Books]     [Gimp]     [Yosemite Information]
  Powered by Linux