[perl-Crypt-DSA] CVE-2011-3599
Paul Howarth
pghmcfc at fedoraproject.org
Tue Sep 3 18:47:22 UTC 2013
commit aadaaacc0620568258e1311124accebc22be8c83
Author: Paul Howarth <paul at city-fan.org>
Date: Tue Sep 3 19:35:59 2013 +0100
CVE-2011-3599
As taught by the '09 Debian PGP disaster relating to DSA, the randomness
source is extremely important. On systems without /dev/random, Crypt::DSA
falls back to using Data::Random. Data::Random uses rand(), about which
the perldoc says "rand() is not cryptographically secure. You should not
rely on it in security-sensitive situations." In the case of DSA, this is
even worse. Using improperly secure randomness sources can compromise the
signing key upon signature of a message.
See: http://rdist.root.org/2010/11/19/dsa-requirements-for-random-k-value/
It might seem that this would not affect Fedora since /dev/random is always
available and so the fall back to Data::Random would never happen. However,
if an application is confined using a MAC system such as SELinux then
access to /dev/random could be denied by policy and the fall back would be
triggered.
perl-Crypt-DSA.spec | 13 +++++++++++--
remove-fallback.patch | 19 +++++++++++++++++++
2 files changed, 30 insertions(+), 2 deletions(-)
---
diff --git a/perl-Crypt-DSA.spec b/perl-Crypt-DSA.spec
index b94cec1..ebeee82 100644
--- a/perl-Crypt-DSA.spec
+++ b/perl-Crypt-DSA.spec
@@ -1,11 +1,12 @@
Summary: Perl module for DSA signatures and key generation
Name: perl-Crypt-DSA
Version: 1.17
-Release: 9%{?dist}
+Release: 10%{?dist}
License: GPL+ or Artistic
Group: Development/Libraries
Url: http://search.cpan.org/dist/Crypt-DSA/
Source0: http://search.cpan.org/CPAN/authors/id/A/AD/ADAMK/Crypt-DSA-%{version}.tar.gz
+Patch0: remove-fallback.patch
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
BuildArch: noarch
BuildRequires: perl(Carp)
@@ -38,6 +39,10 @@ verification, and key generation.
%prep
%setup -q -n Crypt-DSA-%{version}
+# Remove the ability to fall back to the cryptographically-insecure Data::Random
+# instead of using /dev/random (#743567, CPAN RT#71421, CVE-2011-3599)
+%patch0 -p1
+
%build
perl Makefile.PL INSTALLDIRS=vendor
make %{?_smp_mflags}
@@ -45,7 +50,6 @@ make %{?_smp_mflags}
%install
make pure_install DESTDIR=%{buildroot}
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
-find %{buildroot} -depth -type d -exec rmdir {} ';' 2>/dev/null
%{_fixperms} %{buildroot}
%check
@@ -64,6 +68,11 @@ make test AUTOMATED_TESTING=1 TEST_FILES="xt/*.t"
%{_mandir}/man3/Crypt::DSA::Util.3pm*
%changelog
+* Tue Sep 3 2013 Paul Howarth <paul at city-fan.org> - 1.17-10
+- Remove the ability to fall back to the cryptographically-insecure Data::Random
+ instead of using /dev/random (#743567, CPAN RT#71421, CVE-2011-3599)
+- Don't need to remove empty directories from the buildroot
+
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.17-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
diff --git a/remove-fallback.patch b/remove-fallback.patch
new file mode 100644
index 0000000..f39bb3c
--- /dev/null
+++ b/remove-fallback.patch
@@ -0,0 +1,19 @@
+Description: Remove the ability to fall back to Data::Random
+Forwarded: yes
+Bug: https://rt.cpan.org/Public/Bug/Display.html?id=71421
+Author: Harlan Lieberman-Berg <H.LiebermanBerg at gmail.com>
+--- a/lib/Crypt/DSA/Util.pm
++++ b/lib/Crypt/DSA/Util.pm
+@@ -64,11 +64,8 @@
+ }
+ close $fh;
+ }
+- elsif ( require Data::Random ) {
+- $r .= Data::Random::rand_chars( set=>'numeric' ) for 1..$bytes;
+- }
+ else {
+- croak "makerandom requires /dev/random or Data::Random";
++ croak "makerandom requires /dev/random";
+ }
+ my $down = $size - 1;
+ $r = unpack 'H*', pack 'B*', '0' x ( $size % 8 ? 8 - $size % 8 : 0 ) .
More information about the scm-commits
mailing list