toddr / Crypt-OpenSSL-RSA

Release history of Crypt-OpenSSL-RSA
https://metacpan.org/pod/Crypt::OpenSSL::RSA
Other
8 stars 25 forks source link

Add static compatibiltiy between COR and Net::SSLeay [rt.cpan.org #123936] #18

Closed toddr closed 5 years ago

toddr commented 5 years ago

Migrated from rt.cpan.org#123936 (status was 'new')

Requestors:

Attachments:

From privi@cpan.org on 2017-12-23 20:58:51:

The Net::SSLeay module is already using in XS the function name "bn2sv", resulting in compiling error, at least if you try to compile statically. (See attached linkerror.txt)

The following short patch fixes this issue:

--- failing/Crypt-OpenSSL-RSA-0.28/RSA.xs   2011-08-24 22:57:35.000000000 +0000
+++ working/Crypt-OpenSSL-RSA-0.28/RSA.xs   2017-12-23 20:44:17.182419988 +0000
@@ -136,7 +136,7 @@
     }
 }

-SV* bn2sv(BIGNUM* p_bn)
+SV* cor_bn2sv(BIGNUM* p_bn)
 {
     return p_bn != NULL
         ? sv_2mortal(newSViv((IV) BN_dup(p_bn)))
@@ -387,14 +387,14 @@
 {
     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));
+    XPUSHs(cor_bn2sv(rsa->n));
+    XPUSHs(cor_bn2sv(rsa->e));
+    XPUSHs(cor_bn2sv(rsa->d));
+    XPUSHs(cor_bn2sv(rsa->p));
+    XPUSHs(cor_bn2sv(rsa->q));
+    XPUSHs(cor_bn2sv(rsa->dmp1));
+    XPUSHs(cor_bn2sv(rsa->dmq1));
+    XPUSHs(cor_bn2sv(rsa->iqmp));
 }

 SV*