Skip to content

Commit

Permalink
Import of MIKEM/Net-SSLeay-1.61 from CPAN.
Browse files Browse the repository at this point in the history
gitpan-cpan-distribution: Net-SSLeay
gitpan-cpan-version:      1.61
gitpan-cpan-path:         MIKEM/Net-SSLeay-1.61.tar.gz
gitpan-cpan-author:       MIKEM
gitpan-cpan-maturity:     released
  • Loading branch information
mikemccauley authored and Gitpan committed Oct 26, 2014
1 parent 1f64513 commit c165304
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
7 changes: 7 additions & 0 deletions Changes
@@ -1,5 +1,12 @@
Revision history for Perl extension Net::SSLeay.

1.61 2014-05-12
Changes calloc to Newx and free to Safefree, otherwise there might be
problems because calloc is done from a different memory pool than free (depends
on the build options for perl, but seen on Windows). Patch from Steffen
Ullrich. Thanks.


1.60 2014-05-10
Fixed a typo in an error message. Patch from gregor herrmann. Thanks.
Fixed a problem with building with openssl that does not support
Expand Down
2 changes: 1 addition & 1 deletion META.yml
Expand Up @@ -28,4 +28,4 @@ requires:
resources:
bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=net-ssleay
repository: http://svn.debian.org/wsvn/net-ssleay
version: 1.60
version: 1.61
23 changes: 14 additions & 9 deletions SSLeay.xs
Expand Up @@ -2,13 +2,13 @@
*
* Copyright (c) 1996-2002 Sampo Kellomaki <sampo@iki.fi>
* Copyright (C) 2005 Florian Ragwitz <rafl@debian.org>
* Copyright (C) 2005 Mike McCauley <mikem@open.com.au>
* Copyright (C) 2005 Mike McCauley <mikem@airspayce.com>
*
* All Rights Reserved.
*
* Change data removed. See Changes
*
* $Id: SSLeay.xs 406 2014-05-10 21:39:46Z mikem-guest $
* $Id: SSLeay.xs 407 2014-05-12 07:31:36Z mikem-guest $
*
* The distribution and use of this module are subject to the conditions
* listed in LICENSE file at the root of OpenSSL-0.9.6b
Expand Down Expand Up @@ -5330,11 +5330,12 @@ i2d_OCSP_RESPONSE(r)
STRLEN len;
unsigned char *pc,*pi;
if (!(len = i2d_OCSP_RESPONSE(r,NULL))) croak("invalid OCSP response");
pi = pc = calloc(len,sizeof(char));
Newx(pc,len,char);
if (!pc) croak("out of memory");
pi = pc;
i2d_OCSP_RESPONSE(r,&pi);
XPUSHs(sv_2mortal(newSVpv((char*)pc,len)));
free(pc);
Safefree(pc);

void
OCSP_RESPONSE_free(r)
Expand Down Expand Up @@ -5362,11 +5363,12 @@ i2d_OCSP_REQUEST(r)
STRLEN len;
unsigned char *pc,*pi;
if (!(len = i2d_OCSP_REQUEST(r,NULL))) croak("invalid OCSP request");
pi = pc = calloc(len,sizeof(char));
pc = Newx(pc,len,char);
if (!pc) croak("out of memory");
pi = pc;
i2d_OCSP_REQUEST(r,&pi);
XPUSHs(sv_2mortal(newSVpv((char*)pc,len)));
free(pc);
Safefree(pc);


void
Expand Down Expand Up @@ -5409,11 +5411,12 @@ SSL_OCSP_cert2ids(ssl,...)
croak("out of memory for generating OCSO certid");
if (!(len = i2d_OCSP_CERTID(id,NULL)))
croak("OCSP certid has no length");
pi = pc = calloc(len+1,sizeof(char));
Newx(pc,len,char);
if (!pc) croak("out of memory");
pi = pc;
i2d_OCSP_CERTID(id,&pi);
XPUSHs(sv_2mortal(newSVpv((char*)pc,len)));
free(pc);
Safefree(pc);
}


Expand Down Expand Up @@ -5561,10 +5564,12 @@ OCSP_response_results(rsp,...)
unsigned char *pi,*pc;
int len = i2d_OCSP_CERTID(sir->certId,NULL);
if(!len) continue;
pi = pc = calloc(len+1,sizeof(char));
Newx(pc,len,char);
if (!pc) croak("out of memory");
pi = pc;
i2d_OCSP_CERTID(sir->certId,&pi);
idsv = newSVpv((char*)pc,len);
Safefree(pc);
} else {
/* reuse idsv from ST(..), but increment refcount */
idsv = SvREFCNT_inc(idsv);
Expand Down
2 changes: 1 addition & 1 deletion lib/Net/SSLeay.pm
Expand Up @@ -63,7 +63,7 @@ $Net::SSLeay::slowly = 0;
$Net::SSLeay::random_device = '/dev/urandom';
$Net::SSLeay::how_random = 512;

$VERSION = '1.60'; # Dont foget to set verison in META.yml too
$VERSION = '1.61'; # Dont foget to set version in META.yml too
@ISA = qw(Exporter);

#BEWARE:
Expand Down

0 comments on commit c165304

Please sign in to comment.