Hello community, here is the log from the commit of package perl-Crypt-OpenSSL-RSA for openSUSE:Factory checked in at 2017-09-05 15:13:51 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Crypt-OpenSSL-RSA (Old) and /work/SRC/openSUSE:Factory/.perl-Crypt-OpenSSL-RSA.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Crypt-OpenSSL-RSA" Tue Sep 5 15:13:51 2017 rev:20 rq:520466 version:0.28 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Crypt-OpenSSL-RSA/perl-Crypt-OpenSSL-RSA.changes 2011-12-02 13:22:12.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Crypt-OpenSSL-RSA.new/perl-Crypt-OpenSSL-RSA.changes 2017-09-05 15:13:52.312608602 +0200 @@ -1,0 +2,6 @@ +Mon Aug 21 10:28:25 UTC 2017 - tchva...@suse.com + +- Sort with spec-cleaner +- Add patch openssl110.patch fixing compatibility with openssl-1.1.0 + +------------------------------------------------------------------- New: ---- openssl110.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Crypt-OpenSSL-RSA.spec ++++++ --- /var/tmp/diff_new_pack.fsmK27/_old 2017-09-05 15:13:53.520438824 +0200 +++ /var/tmp/diff_new_pack.fsmK27/_new 2017-09-05 15:13:53.520438824 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-Crypt-OpenSSL-RSA # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2017 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 @@ -15,26 +15,24 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # -# norootforbuild - -Name: perl-Crypt-OpenSSL-RSA %define cpan_name Crypt-OpenSSL-RSA -Summary: RSA encoding and decoding, using the openSSL libraries +Name: perl-Crypt-OpenSSL-RSA Version: 0.28 Release: 0 -License: GPL-1.0+ or Artistic-1.0 +Summary: RSA encoding and decoding, using the openSSL libraries +License: GPL-1.0+ OR Artistic-1.0 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 -Patch: %{cpan_name}.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%{perl_requires} +Patch0: %{cpan_name}.patch +Patch1: openssl110.patch BuildRequires: openssl-devel BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(Crypt::OpenSSL::Random) Requires: perl(Crypt::OpenSSL::Random) +%{perl_requires} %description Crypt::OpenSSL::RSA is an XS perl module designed to provide basic RSA @@ -42,26 +40,23 @@ in the OpenSSL library. %prep -%setup -n %{cpan_name}-%{version} -%patch +%setup -q -n %{cpan_name}-%{version} +%patch0 +%patch1 -p1 %build -%{__perl} Makefile.PL OPTIMIZE="$RPM_OPT_FLAGS -Wall" -%{__make} %{?_smp_mflags} +perl Makefile.PL OPTIMIZE="%{optflags} -Wall" +make %{?_smp_mflags} %check -%{__make} test +make %{?_smp_mflags} test %install %perl_make_install %perl_process_packlist %perl_gen_filelist -%clean -%{__rm} -rf $RPM_BUILD_ROOT - %files -f %{name}.files -%defattr(-, root, root) %doc Changes LICENSE README %changelog ++++++ openssl110.patch ++++++ >From 5e7842169fe47f4cd63b2b4acca39d5f34febf8f Mon Sep 17 00:00:00 2001 From: Petr Pisar <ppi...@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*