summaryrefslogtreecommitdiff
path: root/dev-perl/Crypt-OpenSSL-RSA
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-perl/Crypt-OpenSSL-RSA
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-perl/Crypt-OpenSSL-RSA')
-rw-r--r--dev-perl/Crypt-OpenSSL-RSA/Crypt-OpenSSL-RSA-0.280.0-r3.ebuild29
-rw-r--r--dev-perl/Crypt-OpenSSL-RSA/Manifest4
-rw-r--r--dev-perl/Crypt-OpenSSL-RSA/files/Crypt-OpenSSL-RSA-0.280.0-openssl-1.1.0.patch256
-rw-r--r--dev-perl/Crypt-OpenSSL-RSA/metadata.xml12
4 files changed, 301 insertions, 0 deletions
diff --git a/dev-perl/Crypt-OpenSSL-RSA/Crypt-OpenSSL-RSA-0.280.0-r3.ebuild b/dev-perl/Crypt-OpenSSL-RSA/Crypt-OpenSSL-RSA-0.280.0-r3.ebuild
new file mode 100644
index 000000000000..3446ba52fee3
--- /dev/null
+++ b/dev-perl/Crypt-OpenSSL-RSA/Crypt-OpenSSL-RSA-0.280.0-r3.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+MODULE_AUTHOR=PERLER
+MODULE_VERSION=0.28
+inherit perl-module
+
+DESCRIPTION="Crypt::OpenSSL::RSA module for perl"
+
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="libressl"
+
+RDEPEND="dev-perl/Crypt-OpenSSL-Bignum
+ dev-perl/Crypt-OpenSSL-Random
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:= )
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-openssl-1.1.0.patch"
+)
+
+SRC_TEST="do"
+
+mydoc="rfc*.txt"
diff --git a/dev-perl/Crypt-OpenSSL-RSA/Manifest b/dev-perl/Crypt-OpenSSL-RSA/Manifest
new file mode 100644
index 000000000000..767686123483
--- /dev/null
+++ b/dev-perl/Crypt-OpenSSL-RSA/Manifest
@@ -0,0 +1,4 @@
+AUX Crypt-OpenSSL-RSA-0.280.0-openssl-1.1.0.patch 7018 BLAKE2B 58b6adac6c8d7fa6e5b7aa5592fa395dbbfab006bf427a6da3a119d2b221946166133c64573c1fda32d9e806a92ab9ebe0e0430b25e2938a7e72c1a8fdd879b5 SHA512 8a56a800496a427448a82c5a3051dc85ace049f7e4c78859a44f62e30c218c28e31dd24bfc2a9ec9cb7f64e14933982f26181792771c54c3e684be738206a310
+DIST Crypt-OpenSSL-RSA-0.28.tar.gz 20035 BLAKE2B 9b98a22e68f2c16a38c0aee6ee9a509cd6c6b1d20b1c6533856b7682aa074c24a2e12e87ebdaf3deb7011cbe257737335646b52be74537533d836cbf6fb6ce6d SHA512 4a20c3f814e80ea15304b2a189001172e72237d703a0f9281e7e46d593c521508abfac3a259701994ec867f160821bec37e4e8234d04b792168db19b065ce324
+EBUILD Crypt-OpenSSL-RSA-0.280.0-r3.ebuild 650 BLAKE2B 420a285793de7567674a65c8ee0a5ba07cc0878aa46eb5ea7f8f112ebd452407f67ab08e93b99a15ae9c940aa0b3552c5b284f4c23e9597c766fe3a679148f51 SHA512 0ea9bce45893768902bca1a65a1e13c81b9a147a41fd44fa0010be5ba33fa579867f27125aedfc1cde5448f71bb4cae813c376924bb7be4187a99d53f20bd7ee
+MISC metadata.xml 407 BLAKE2B 0dfbb22c5bd94b1f49bf73aa69d6f6ac9272aa4631f93d890a10f8ce0f17df9c3760a79f82bbe4453b4ce7bb1c9dd4a05d838b11681aae42611b8bb9496d2ac1 SHA512 5cd69acf50b1ec86397e96b03d6aca318669f83b7a6276231572634622e889479330e741ac7a858a5c4fd633f40b5c4ca7cc0bc40e6cfc8eb02bee827eabb9a2
diff --git a/dev-perl/Crypt-OpenSSL-RSA/files/Crypt-OpenSSL-RSA-0.280.0-openssl-1.1.0.patch b/dev-perl/Crypt-OpenSSL-RSA/files/Crypt-OpenSSL-RSA-0.280.0-openssl-1.1.0.patch
new file mode 100644
index 000000000000..463bcdfc83ce
--- /dev/null
+++ b/dev-perl/Crypt-OpenSSL-RSA/files/Crypt-OpenSSL-RSA-0.280.0-openssl-1.1.0.patch
@@ -0,0 +1,256 @@
+From fdbda9585f5c99670912e5c0517dbc7a9d92c74b Mon Sep 17 00:00:00 2001
+From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
+Date: Sat, 1 Oct 2016 19:52:44 +0000
+Subject: [PATCH] libcrypt-openssl-rsa-perl: get it compiled with openssl 1.1.0
+
+Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
+
+Bug: https://rt.cpan.org/Public/Bug/Display.html?id=117481
+Bug-Debian: https://bugs.debian.org/828387
+
+---
+ RSA.xs | 173 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------
+ 1 file changed, 150 insertions(+), 23 deletions(-)
+
+diff --git a/RSA.xs b/RSA.xs
+index de512e7822d0..b384cb0e23a2 100644
+--- a/RSA.xs
++++ b/RSA.xs
+@@ -47,9 +47,119 @@ void croakSsl(char* p_file, int p_line)
+
+ #define THROW(p_result) if (!(p_result)) { error = 1; goto err; }
+
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || \
++ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL)
++static void RSA_get0_key(const RSA *r,
++ const BIGNUM **n, const BIGNUM **e, const BIGNUM **d)
++{
++ if (n != NULL)
++ *n = r->n;
++ if (e != NULL)
++ *e = r->e;
++ if (d != NULL)
++ *d = r->d;
++}
++
++static int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d)
++{
++ /* If the fields n and e in r are NULL, the corresponding input
++ * parameters MUST be non-NULL for n and e. d may be
++ * left NULL (in case only the public key is used).
++ */
++ if ((r->n == NULL && n == NULL)
++ || (r->e == NULL && e == NULL))
++ return 0;
++
++ if (n != NULL) {
++ BN_free(r->n);
++ r->n = n;
++ }
++ if (e != NULL) {
++ BN_free(r->e);
++ r->e = e;
++ }
++ if (d != NULL) {
++ BN_free(r->d);
++ r->d = d;
++ }
++
++ return 1;
++}
++
++static int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q)
++{
++ /* If the fields p and q in r are NULL, the corresponding input
++ * parameters MUST be non-NULL.
++ */
++ if ((r->p == NULL && p == NULL)
++ || (r->q == NULL && q == NULL))
++ return 0;
++
++ if (p != NULL) {
++ BN_free(r->p);
++ r->p = p;
++ }
++ if (q != NULL) {
++ BN_free(r->q);
++ r->q = q;
++ }
++
++ return 1;
++}
++
++static void RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q)
++{
++ if (p != NULL)
++ *p = r->p;
++ if (q != NULL)
++ *q = r->q;
++}
++
++static int RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp)
++{
++ /* If the fields dmp1, dmq1 and iqmp in r are NULL, the corresponding input
++ * parameters MUST be non-NULL.
++ */
++ if ((r->dmp1 == NULL && dmp1 == NULL)
++ || (r->dmq1 == NULL && dmq1 == NULL)
++ || (r->iqmp == NULL && iqmp == NULL))
++ return 0;
++
++ if (dmp1 != NULL) {
++ BN_free(r->dmp1);
++ r->dmp1 = dmp1;
++ }
++ if (dmq1 != NULL) {
++ BN_free(r->dmq1);
++ r->dmq1 = dmq1;
++ }
++ if (iqmp != NULL) {
++ BN_free(r->iqmp);
++ r->iqmp = iqmp;
++ }
++
++ return 1;
++}
++
++static void RSA_get0_crt_params(const RSA *r,
++ const BIGNUM **dmp1, const BIGNUM **dmq1,
++ const BIGNUM **iqmp)
++{
++ if (dmp1 != NULL)
++ *dmp1 = r->dmp1;
++ if (dmq1 != NULL)
++ *dmq1 = r->dmq1;
++ if (iqmp != NULL)
++ *iqmp = r->iqmp;
++}
++#endif
++
+ char _is_private(rsaData* p_rsa)
+ {
+- return(p_rsa->rsa->d != NULL);
++ const BIGNUM *d;
++
++ RSA_get0_key(p_rsa->rsa, NULL, NULL, &d);
++ return(d != NULL);
+ }
+
+ SV* make_rsa_obj(SV* p_proto, RSA* p_rsa)
+@@ -136,7 +246,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)))
+@@ -297,8 +407,15 @@ generate_key(proto, bitsSV, exponent = 65537)
+ unsigned long exponent;
+ PREINIT:
+ RSA* rsa;
++ BIGNUM *e;
+ CODE:
+- CHECK_OPEN_SSL(rsa = RSA_generate_key(SvIV(bitsSV), exponent, NULL, NULL));
++ e = BN_new();
++ CHECK_OPEN_SSL(e);
++ rsa = RSA_new();
++ CHECK_OPEN_SSL(rsa);
++ BN_set_word(e, exponent);
++ CHECK_OPEN_SSL(RSA_generate_key_ex(rsa, SvIV(bitsSV), e, NULL));
++ BN_free(e);
+ RETVAL = make_rsa_obj(proto, rsa);
+ OUTPUT:
+ RETVAL
+@@ -325,10 +442,11 @@ _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());
+- rsa->n = n;
+- rsa->e = e;
++ CHECK_OPEN_SSL(RSA_set0_key(rsa, n, e, NULL));
+ if (p || q)
+ {
++ BIGNUM *dmp1, *dmq1, *iqmp;
++
+ error = 0;
+ THROW(ctx = BN_CTX_new());
+ if (!p)
+@@ -341,8 +459,7 @@ _new_key_from_parameters(proto, n, e, d, p, q)
+ q = BN_new();
+ THROW(BN_div(q, NULL, n, p, ctx));
+ }
+- rsa->p = p;
+- rsa->q = q;
++ CHECK_OPEN_SSL(RSA_set0_factors(rsa, p, q));
+ THROW(p_minus_1 = BN_new());
+ THROW(BN_sub(p_minus_1, p, BN_value_one()));
+ THROW(q_minus_1 = BN_new());
+@@ -353,13 +470,17 @@ _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));
+ }
+- 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));
++ CHECK_OPEN_SSL(RSA_set0_key(rsa, NULL, NULL, d));
++
++ THROW(dmp1 = BN_new());
++ THROW(dmq1 = BN_new());
++ THROW(iqmp = BN_new());
++
++ THROW(BN_mod(dmp1, d, p_minus_1, ctx));
++ THROW(BN_mod(dmq1, d, q_minus_1, ctx));
++ THROW(BN_mod_inverse(iqmp, q, p, ctx));
++
++ CHECK_OPEN_SSL(RSA_set0_crt_params(rsa, dmp1, dmq1, iqmp));
+ THROW(RSA_check_key(rsa) == 1);
+ err:
+ if (p_minus_1) BN_clear_free(p_minus_1);
+@@ -373,7 +494,7 @@ _new_key_from_parameters(proto, n, e, d, p, q)
+ }
+ else
+ {
+- rsa->d = d;
++ CHECK_OPEN_SSL(RSA_set0_key(rsa, NULL, NULL, d));
+ }
+ RETVAL = make_rsa_obj(proto, rsa);
+ }
+@@ -386,15 +507,21 @@ _get_key_parameters(p_rsa)
+ PPCODE:
+ {
+ RSA* rsa;
++ const BIGNUM *n, *e, *d, *p, *q;
++ const BIGNUM *dmp1, *dmq1, *iqmp;
++
+ 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));
++ RSA_get0_key(rsa, &n, &e, &d);
++ RSA_get0_factors(rsa, &p, &q);
++ RSA_get0_crt_params(rsa, &dmp1, &dmq1, &iqmp);
++ 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*
+--
+2.1.4
+
diff --git a/dev-perl/Crypt-OpenSSL-RSA/metadata.xml b/dev-perl/Crypt-OpenSSL-RSA/metadata.xml
new file mode 100644
index 000000000000..1e425bb8a496
--- /dev/null
+++ b/dev-perl/Crypt-OpenSSL-RSA/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>perl@gentoo.org</email>
+ <name>Gentoo Perl Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="cpan">Crypt-OpenSSL-RSA</remote-id>
+ <remote-id type="cpan-module">Crypt::OpenSSL::RSA</remote-id>
+ </upstream>
+</pkgmetadata>