8
0

Accepting request 640384 from devel:languages:perl:autoupdate

- Fix autogenerated changes to build again
  * Drop openssl110.patch (upstream)
- updated to 0.31
   see /usr/share/doc/packages/perl-Crypt-OpenSSL-RSA/Changes
  0.31 
      - Remove default of SHA256 for RSA keys. This has caused significant
        problems with downstream modules and it has always been possible to
        do $key->use_sha256_hash()
- updated to 0.30
   see /usr/share/doc/packages/perl-Crypt-OpenSSL-RSA/Changes
  0.30 
          - Working windows library detection
          - Actively testing on appveyor for windows now.
          - work correctly on LibreSSL
  
  0.29_03  
          - Add whirlpool hash support.
          - Crypt::OpenSSL::Random is now required at comnpile-time.
          - Use the new interface to RSA_generate_key if available
          - Add library paths to LIBS from Crypt::OpenSSL::Guess
  
  0.29_02  
          - Add missing require of Config::OpenSSL::Guess
  
  0.29_01  
          - Adapt to OpenSSL 1.1.0 (dur-randir)
          - Move issue tracker to github.
          - Modernization as in Crypt::OpenSSL::Random.
          - better MSWin32 hints, fixes MSVC libraries,
          - more meta tests,
          - prefer hash mode NID_sha256 over NID_sha1 for sign

OBS-URL: https://build.opensuse.org/request/show/640384
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Crypt-OpenSSL-RSA?expand=0&rev=24
This commit is contained in:
2018-10-07 09:23:16 +00:00
committed by Git OBS Bridge
parent 29e5403c7b
commit 616033b9a5
6 changed files with 100 additions and 190 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5357f977464bb3a8184cf2d3341851a10d5515b4b2b0dfb88bf78995c0ded7be
size 20035

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4173403ad4cf76732192099f833fbfbf3cd8104e0246b3844187ae384d2c5436
size 25856

28
cpanspec.yml Normal file
View File

@@ -0,0 +1,28 @@
---
#description_paragraphs: 3
#description: |-
# override description from CPAN
#summary: override summary from CPAN
#no_testing: broken upstream
#sources:
# - source1
# - source2
#patches:
# foo.patch: -p1
# bar.patch:
#preamble: |-
# BuildRequires: gcc-c++
#post_prep: |-
# hunspell=`pkg-config --libs hunspell | sed -e 's,-l,,; s, *,,g'`
# sed -i -e "s,hunspell-X,$hunspell," t/00-prereq.t Makefile.PL
#post_build: |-
# rm unused.files
#post_install: |-
# sed on %{name}.files
#license: SUSE-NonFree
#skip_noarch: 1
#custom_build: |-
#./Build build flags=%{?_smp_mflags} --myflag
#custom_test: |-
#startserver && make test
#ignore_requires: Bizarre::Module

View File

@@ -1,172 +0,0 @@
From 5e7842169fe47f4cd63b2b4acca39d5f34febf8f Mon Sep 17 00:00:00 2001
From: Petr Pisar <ppisar@redhat.com>
Date: Thu, 29 Jun 2017 23:20:06 +0300
Subject: [PATCH] Adapt to OpenSSL 1.1.0
---
RSA.xs | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 73 insertions(+), 16 deletions(-)
diff --git a/RSA.xs b/RSA.xs
index de512e7..9bf6f01 100644
--- a/RSA.xs
+++ b/RSA.xs
@@ -49,7 +49,13 @@ void croakSsl(char* p_file, int p_line)
char _is_private(rsaData* p_rsa)
{
- return(p_rsa->rsa->d != NULL);
+ const BIGNUM *d;
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ d = p_rsa->rsa->d;
+#else
+ RSA_get0_key(p_rsa->rsa, NULL, NULL, &d);
+#endif
+ return(d != NULL);
}
SV* make_rsa_obj(SV* p_proto, RSA* p_rsa)
@@ -136,7 +142,7 @@ unsigned char* get_message_digest(SV* text_SV, int hash_method)
}
}
-SV* bn2sv(BIGNUM* p_bn)
+SV* bn2sv(const BIGNUM* p_bn)
{
return p_bn != NULL
? sv_2mortal(newSViv((IV) BN_dup(p_bn)))
@@ -317,6 +323,9 @@ _new_key_from_parameters(proto, n, e, d, p, q)
BN_CTX* ctx;
BIGNUM* p_minus_1 = NULL;
BIGNUM* q_minus_1 = NULL;
+ BIGNUM* dmp1 = NULL;
+ BIGNUM* dmq1 = NULL;
+ BIGNUM* iqmp = NULL;
int error;
CODE:
{
@@ -325,8 +334,10 @@ _new_key_from_parameters(proto, n, e, d, p, q)
croak("At least a modulous and public key must be provided");
}
CHECK_OPEN_SSL(rsa = RSA_new());
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
rsa->n = n;
rsa->e = e;
+#endif
if (p || q)
{
error = 0;
@@ -341,8 +352,12 @@ _new_key_from_parameters(proto, n, e, d, p, q)
q = BN_new();
THROW(BN_div(q, NULL, n, p, ctx));
}
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
rsa->p = p;
rsa->q = q;
+#else
+ THROW(RSA_set0_factors(rsa, p, q));
+#endif
THROW(p_minus_1 = BN_new());
THROW(BN_sub(p_minus_1, p, BN_value_one()));
THROW(q_minus_1 = BN_new());
@@ -353,17 +368,32 @@ _new_key_from_parameters(proto, n, e, d, p, q)
THROW(BN_mul(d, p_minus_1, q_minus_1, ctx));
THROW(BN_mod_inverse(d, e, d, ctx));
}
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
rsa->d = d;
- THROW(rsa->dmp1 = BN_new());
- THROW(BN_mod(rsa->dmp1, d, p_minus_1, ctx));
- THROW(rsa->dmq1 = BN_new());
- THROW(BN_mod(rsa->dmq1, d, q_minus_1, ctx));
- THROW(rsa->iqmp = BN_new());
- THROW(BN_mod_inverse(rsa->iqmp, q, p, ctx));
+#else
+ THROW(RSA_set0_key(rsa, n, e, d));
+#endif
+ THROW(dmp1 = BN_new());
+ THROW(BN_mod(dmp1, d, p_minus_1, ctx));
+ THROW(dmq1 = BN_new());
+ THROW(BN_mod(dmq1, d, q_minus_1, ctx));
+ THROW(iqmp = BN_new());
+ THROW(BN_mod_inverse(iqmp, q, p, ctx));
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ rsa->dmp1 = dmp1;
+ rsa->dmq1 = dmq1;
+ rsa->iqmp = iqmp;
+#else
+ THROW(RSA_set0_crt_params(rsa, dmp1, dmq1, iqmp));
+#endif
+ dmp1 = dmq1 = iqmp = NULL;
THROW(RSA_check_key(rsa) == 1);
err:
if (p_minus_1) BN_clear_free(p_minus_1);
if (q_minus_1) BN_clear_free(q_minus_1);
+ if (dmp1) BN_clear_free(dmp1);
+ if (dmq1) BN_clear_free(dmq1);
+ if (iqmp) BN_clear_free(iqmp);
if (ctx) BN_CTX_free(ctx);
if (error)
{
@@ -373,7 +403,11 @@ _new_key_from_parameters(proto, n, e, d, p, q)
}
else
{
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
rsa->d = d;
+#else
+ CHECK_OPEN_SSL(RSA_set0_key(rsa, n, e, d));
+#endif
}
RETVAL = make_rsa_obj(proto, rsa);
}
@@ -383,18 +417,41 @@ _new_key_from_parameters(proto, n, e, d, p, q)
void
_get_key_parameters(p_rsa)
rsaData* p_rsa;
+PREINIT:
+ const BIGNUM* n;
+ const BIGNUM* e;
+ const BIGNUM* d;
+ const BIGNUM* p;
+ const BIGNUM* q;
+ const BIGNUM* dmp1;
+ const BIGNUM* dmq1;
+ const BIGNUM* iqmp;
PPCODE:
{
RSA* rsa;
rsa = p_rsa->rsa;
- XPUSHs(bn2sv(rsa->n));
- XPUSHs(bn2sv(rsa->e));
- XPUSHs(bn2sv(rsa->d));
- XPUSHs(bn2sv(rsa->p));
- XPUSHs(bn2sv(rsa->q));
- XPUSHs(bn2sv(rsa->dmp1));
- XPUSHs(bn2sv(rsa->dmq1));
- XPUSHs(bn2sv(rsa->iqmp));
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ n = rsa->n;
+ e = rsa->e;
+ d = rsa->d;
+ p = rsa->p;
+ q = rsa->q;
+ dmp1 = rsa->dmp1;
+ dmq1 = rsa->dmq1;
+ iqmp = rsa->iqmp;
+#else
+ RSA_get0_key(rsa, &n, &e, &d);
+ RSA_get0_factors(rsa, &p, &q);
+ RSA_get0_crt_params(rsa, &dmp1, &dmq1, &iqmp);
+#endif
+ XPUSHs(bn2sv(n));
+ XPUSHs(bn2sv(e));
+ XPUSHs(bn2sv(d));
+ XPUSHs(bn2sv(p));
+ XPUSHs(bn2sv(q));
+ XPUSHs(bn2sv(dmp1));
+ XPUSHs(bn2sv(dmq1));
+ XPUSHs(bn2sv(iqmp));
}
SV*

View File

@@ -1,3 +1,48 @@
-------------------------------------------------------------------
Sun Oct 7 09:01:37 UTC 2018 - Dirk Stoecker <opensuse@dstoecker.de>
- Fix autogenerated changes to build again
* Drop openssl110.patch (upstream)
-------------------------------------------------------------------
Tue Sep 25 05:09:43 UTC 2018 - Stephan Kulow <coolo@suse.com>
- updated to 0.31
see /usr/share/doc/packages/perl-Crypt-OpenSSL-RSA/Changes
0.31 Mon Sep 24 2018
- Remove default of SHA256 for RSA keys. This has caused significant
problems with downstream modules and it has always been possible to
do $key->use_sha256_hash()
-------------------------------------------------------------------
Wed May 2 05:08:37 UTC 2018 - coolo@suse.com
- updated to 0.30
see /usr/share/doc/packages/perl-Crypt-OpenSSL-RSA/Changes
0.30 Tue May 1 2018
- Working windows library detection
- Actively testing on appveyor for windows now.
- work correctly on LibreSSL
0.29_03 Mon Apr 16 2018
- Add whirlpool hash support.
- Crypt::OpenSSL::Random is now required at comnpile-time.
- Use the new interface to RSA_generate_key if available
- Add library paths to LIBS from Crypt::OpenSSL::Guess
0.29_02 Sun Apr 15 2018
- Add missing require of Config::OpenSSL::Guess
0.29_01 Fri Apr 13 2018
- Adapt to OpenSSL 1.1.0 (dur-randir)
- Move issue tracker to github.
- Modernization as in Crypt::OpenSSL::Random.
- better MSWin32 hints, fixes MSVC libraries,
- more meta tests,
- prefer hash mode NID_sha256 over NID_sha1 for sign
-------------------------------------------------------------------
Mon Aug 21 10:28:25 UTC 2017 - tchvatal@suse.com

View File

@@ -1,7 +1,7 @@
#
# spec file for package perl-Crypt-OpenSSL-RSA
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,44 +12,51 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define cpan_name Crypt-OpenSSL-RSA
Name: perl-Crypt-OpenSSL-RSA
Version: 0.28
Version: 0.31
Release: 0
%define cpan_name Crypt-OpenSSL-RSA
Summary: RSA encoding and decoding, using the openSSL libraries
License: GPL-1.0+ OR Artistic-1.0
License: Artistic-1.0 OR GPL-1.0-or-later
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/Crypt-OpenSSL-RSA
Source: http://search.cpan.org/CPAN/authors/id/P/PE/PERLER/Crypt-OpenSSL-RSA-%{version}.tar.gz
Url: http://search.cpan.org/dist/Crypt-OpenSSL-RSA/
Source0: https://cpan.metacpan.org/authors/id/T/TO/TODDR/%{cpan_name}-%{version}.tar.gz
Source1: cpanspec.yml
Patch0: %{cpan_name}.patch
Patch1: openssl110.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: openssl-devel
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Crypt::OpenSSL::Guess) >= 0.11
BuildRequires: perl(Crypt::OpenSSL::Random)
Requires: perl(Crypt::OpenSSL::Random)
Recommends: perl(Crypt::OpenSSL::Bignum)
%{perl_requires}
%description
Crypt::OpenSSL::RSA is an XS perl module designed to provide basic RSA
functionality. It does this by providing a glue to the RSA functions
in the OpenSSL library.
'Crypt::OpenSSL::RSA' provides the ability to RSA encrypt strings which are
somewhat shorter than the block size of a key. It also allows for
decryption, signatures and signature verification.
_NOTE_: Many of the methods in this package can croak, so use 'eval', or
Error.pm's try/catch mechanism to capture errors. Also, while some methods
from earlier versions of this package return true on success, this (never
documented) behavior is no longer the case.
%prep
%setup -q -n %{cpan_name}-%{version}
%patch0
%patch1 -p1
%build
perl Makefile.PL OPTIMIZE="%{optflags} -Wall"
perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
make %{?_smp_mflags}
%check
make %{?_smp_mflags} test
make test
%install
%perl_make_install
@@ -57,6 +64,8 @@ make %{?_smp_mflags} test
%perl_gen_filelist
%files -f %{name}.files
%doc Changes LICENSE README
%defattr(-,root,root,755)
%doc Changes README README.md
%license LICENSE
%changelog