r62246 - in /branches/upstream/libcrypt-openssl-x509-perl/current: Changes README X509.pm X509.xs t/x509.t
carnil-guest at users.alioth.debian.org
carnil-guest at users.alioth.debian.org
Tue Aug 31 15:28:05 UTC 2010
Author: carnil-guest
Date: Tue Aug 31 15:27:45 2010
New Revision: 62246
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=62246
Log:
[svn-upgrade] new version libcrypt-openssl-x509-perl (1.4)
Modified:
branches/upstream/libcrypt-openssl-x509-perl/current/Changes
branches/upstream/libcrypt-openssl-x509-perl/current/README
branches/upstream/libcrypt-openssl-x509-perl/current/X509.pm
branches/upstream/libcrypt-openssl-x509-perl/current/X509.xs
branches/upstream/libcrypt-openssl-x509-perl/current/t/x509.t
Modified: branches/upstream/libcrypt-openssl-x509-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcrypt-openssl-x509-perl/current/Changes?rev=62246&op=diff
==============================================================================
--- branches/upstream/libcrypt-openssl-x509-perl/current/Changes (original)
+++ branches/upstream/libcrypt-openssl-x509-perl/current/Changes Tue Aug 31 15:27:45 2010
@@ -1,7 +1,10 @@
Revision history for Perl extension Crypt::OpenSSL::X509.
+1.4 Tue Aug 31 07:13:20 PDT 2010
+ - Fix new_from_string().
+
1.3 Fri Aug 6 09:18:30 PDT 2010
- - Fix fingerprint_sha1.
+ - Fix fingerprint_sha1().
1.2 Mon May 31 05:59:03 PDT 2010
- Compatible with OpenSSL v1.0.0
Modified: branches/upstream/libcrypt-openssl-x509-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcrypt-openssl-x509-perl/current/README?rev=62246&op=diff
==============================================================================
--- branches/upstream/libcrypt-openssl-x509-perl/current/README (original)
+++ branches/upstream/libcrypt-openssl-x509-perl/current/README Tue Aug 31 15:27:45 2010
@@ -1,4 +1,4 @@
-Crypt/OpenSSL/X509 version 1.2
+Crypt/OpenSSL/X509 version 1.4
===============================
The README is used to introduce the module and provide instructions on
Modified: branches/upstream/libcrypt-openssl-x509-perl/current/X509.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcrypt-openssl-x509-perl/current/X509.pm?rev=62246&op=diff
==============================================================================
--- branches/upstream/libcrypt-openssl-x509-perl/current/X509.pm (original)
+++ branches/upstream/libcrypt-openssl-x509-perl/current/X509.pm Tue Aug 31 15:27:45 2010
@@ -5,7 +5,7 @@
use Exporter;
use base qw(Exporter);
-$VERSION = '1.3';
+$VERSION = '1.4';
@EXPORT_OK = qw(
FORMAT_UNDEF FORMAT_ASN1 FORMAT_TEXT FORMAT_PEM FORMAT_NETSCAPE
Modified: branches/upstream/libcrypt-openssl-x509-perl/current/X509.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcrypt-openssl-x509-perl/current/X509.xs?rev=62246&op=diff
==============================================================================
--- branches/upstream/libcrypt-openssl-x509-perl/current/X509.xs (original)
+++ branches/upstream/libcrypt-openssl-x509-perl/current/X509.xs Tue Aug 31 15:27:45 2010
@@ -291,7 +291,7 @@
Crypt::OpenSSL::X509
new_from_string(class, string, format = FORMAT_PEM)
SV *class
- char *string
+ SV *string
int format
ALIAS:
@@ -299,13 +299,17 @@
PREINIT:
BIO *bio;
-
- CODE:
+ STRLEN len;
+ char *cert;
+
+ CODE:
+
+ cert = SvPV(string, len);
if (ix == 1) {
- bio = BIO_new_file(string, "r");
+ bio = BIO_new_file(cert, "r");
} else {
- bio = BIO_new_mem_buf(string, strlen(string));
+ bio = BIO_new_mem_buf(cert, len);
}
if (!bio) croak("%s: Failed to create BIO", SvPV_nolen(class));
@@ -320,9 +324,9 @@
RETVAL = (X509*)PEM_read_bio_X509(bio, NULL, NULL, NULL);
}
+ BIO_free_all(bio);
+
if (!RETVAL) croak("%s: failed to read X509 certificate.", SvPV_nolen(class));
-
- BIO_free_all(bio);
OUTPUT:
RETVAL
Modified: branches/upstream/libcrypt-openssl-x509-perl/current/t/x509.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcrypt-openssl-x509-perl/current/t/x509.t?rev=62246&op=diff
==============================================================================
--- branches/upstream/libcrypt-openssl-x509-perl/current/t/x509.t (original)
+++ branches/upstream/libcrypt-openssl-x509-perl/current/t/x509.t Tue Aug 31 15:27:45 2010
@@ -1,5 +1,5 @@
-use Test::More tests => 44;
+use Test::More tests => 46;
BEGIN { use_ok('Crypt::OpenSSL::X509') };
@@ -72,3 +72,13 @@
isa_ok($x509->subject_name()->get_entry_by_type("ST"),"Crypt::OpenSSL::X509::Name_Entry",'Name->get_entry_by_type');
ok($x509->subject_name()->get_entry_by_type("ST")->is_printableString(),'Name_Entry->is_printableString');
ok(not($x509->subject_name()->get_entry_by_type("ST")->is_asn1_type(Crypt::OpenSSL::X509::V_ASN1_UTF8STRING)),'Name_Entry->is_asn1_type');
+
+# Check new_from_string / as_string round trip.
+{
+ my $x509 = Crypt::OpenSSL::X509->new_from_string(
+ Crypt::OpenSSL::X509->new_from_file('certs/balt.pem')->as_string(1),
+ 1);
+
+ ok($x509);
+ ok($x509->serial() eq '020000B9', 'serial()');
+}
More information about the Pkg-perl-cvs-commits
mailing list