From 8b719c4bd71e7a912320cda1074cf3e650216d24 Mon Sep 17 00:00:00 2001 From: Timothy Legge Date: Wed, 3 Jul 2024 19:51:41 -0300 Subject: [PATCH 1/2] Fixes #50 - Correct openssl version may not be found --- Makefile.PL | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile.PL b/Makefile.PL index 3b72fdd..485cb7d 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,5 +1,6 @@ use strict; use warnings; +use Config; use 5.006; use ExtUtils::MakeMaker 6.48; @@ -23,6 +24,7 @@ WriteMakefile( }, 'OBJECT' => 'RSA.o', 'LIBS' => [openssl_lib_paths() . ' -lssl -lcrypto'], + 'LDDLFLAGS' => openssl_lib_paths() . ' ' . $Config{lddlflags}, 'DEFINE' => '-DPERL5 -DOPENSSL_NO_KRB5', # perl-5.8/gcc-3.2 needs -DPERL5, and redhat9 likes -DOPENSSL_NO_KRB5 From 2d041e9935c81694ab87ad4ce2c2ccfd2d72977c Mon Sep 17 00:00:00 2001 From: Timothy Legge Date: Thu, 4 Jul 2024 17:47:52 -0300 Subject: [PATCH 2/2] Fixes #52 - Out of memory on openssl 1.1.1w hpux --- RSA.xs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/RSA.xs b/RSA.xs index 5f5cfae..b6c0509 100644 --- a/RSA.xs +++ b/RSA.xs @@ -165,11 +165,13 @@ SV* cor_bn2sv(const BIGNUM* p_bn) SV* extractBioString(BIO* p_stringBio) { SV* sv; - BUF_MEM* bptr; + char *datap; + long datasize = 0; CHECK_OPEN_SSL(BIO_flush(p_stringBio) == 1); - BIO_get_mem_ptr(p_stringBio, &bptr); - sv = newSVpv(bptr->data, bptr->length); + + datasize = BIO_get_mem_data(p_stringBio, &datap); + sv = newSVpv(datap, datasize); CHECK_OPEN_SSL(BIO_set_close(p_stringBio, BIO_CLOSE) == 1); BIO_free(p_stringBio);