Skip Menu |

This queue is for tickets about the Net-SSLeay CPAN distribution.

Report information
The Basics
Id: 106545
Status: resolved
Priority: 0/
Queue: Net-SSLeay

People
Owner: MIKEM [...] cpan.org
Requestors: AGRUNDMA [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 1.69
  • 1.70
Fixed in: 1.71



Subject: [PATCH] 4 functions need PREINIT blocks to compile on MSVC, etc
Some of the new functions that were added recently don't compile on some non-gcc compilers due to variable declarations after statements. I ran into this with both MSVC and AIX cc. The attached patch fixes X509_check_host, X509_check_ip, SSL_CTX_set_alpn_protos, and SSL_set_alpn_protos. Thanks, -- Andy Grundman Lead Perl Language Developer, ActiveState andyg@activestate.com
Subject: Net-SSLeay-1.70-xs-preinit.patch
From f81a73dc2a3e077858d92e5d900b0fe91ddce64c Mon Sep 17 00:00:00 2001 From: Andy Grundman <andyg@activestate.com> Date: Wed, 19 Aug 2015 13:41:46 -0700 Subject: [PATCH] Generated C code is not compatible with MSVC, AIX cc, probably others. Added some PREINIT blocks and replaced 2 cases of INIT with PREINIT. --- SSLeay.xs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/SSLeay.xs b/SSLeay.xs index 1bf09fa..7e42f47 100644 --- a/SSLeay.xs +++ b/SSLeay.xs @@ -2336,7 +2336,7 @@ RAND_write_file(file_name) int X509_check_host(X509 *cert, const char *name, unsigned int flags = 0, SV *peername = &PL_sv_undef) - INIT: + PREINIT: char *c_peername = NULL; CODE: RETVAL = X509_check_host(cert, name, 0, flags, (items == 4) ? &c_peername : NULL); @@ -2357,7 +2357,7 @@ X509_check_email(X509 *cert, const char *address, unsigned int flags = 0) int X509_check_ip(X509 *cert, SV *address, unsigned int flags = 0) - INIT: + PREINIT: unsigned char *c_address; size_t addresslen; CODE: @@ -5852,10 +5852,11 @@ int SSL_CTX_set_alpn_protos(ctx,data=&PL_sv_undef) SSL_CTX * ctx SV * data - CODE: + PREINIT: unsigned char *alpn_data; unsigned char alpn_len; + CODE: RETVAL = -1; if (!SvROK(data) || (SvTYPE(SvRV(data)) != SVt_PVAV)) @@ -5875,10 +5876,11 @@ int SSL_set_alpn_protos(ssl,data=&PL_sv_undef) SSL * ssl SV * data - CODE: + PREINIT: unsigned char *alpn_data; unsigned char alpn_len; + CODE: RETVAL = -1; if (!SvROK(data) || (SvTYPE(SvRV(data)) != SVt_PVAV)) -- 2.3.2 (Apple Git-55)
Subject: Re: [rt.cpan.org #106545] [PATCH] 4 functions need PREINIT blocks to compile on MSVC, etc
Date: Thu, 20 Aug 2015 13:49:06 +1000
To: bug-Net-SSLeay [...] rt.cpan.org
From: Mike McCauley <mikem [...] airspayce.com>
Thanks. Your patch is now in SVN 452 Cheers. On Wednesday, August 19, 2015 06:03:35 PM Andy Grundman via RT wrote: Show quoted text
> Wed Aug 19 18:03:34 2015: Request 106545 was acted upon. > Transaction: Ticket created by AGRUNDMA > Queue: Net-SSLeay > Subject: [PATCH] 4 functions need PREINIT blocks to compile on MSVC, > etc Broken in: 1.69, 1.70 > Severity: (no value) > Owner: Nobody > Requestors: AGRUNDMA@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=106545 > > > > Some of the new functions that were added recently don't compile on some > non-gcc compilers due to variable declarations after statements. I ran into > this with both MSVC and AIX cc. The attached patch fixes X509_check_host, > X509_check_ip, SSL_CTX_set_alpn_protos, and SSL_set_alpn_protos. > > Thanks, > -- > Andy Grundman > Lead Perl Language Developer, ActiveState > andyg@activestate.com
-- Mike McCauley VK4AMM mikem@airspayce.com Airspayce Pty Ltd 9 Bulbul Place Currumbin Waters QLD 4223 Australia http://www.airspayce.com Phone +61 7 5598-7474