From 49b8142262247dcf6e0308e26cdb2d7f1bbafcb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulf=20M=C3=B6ller?= Date: Thu, 22 Jul 1999 16:10:31 +0000 Subject: Make the perl module compile and eliminate some of the warnings. Still doesn't work (the destructor on BIO and SSL is called immediately after creating the object. Why that??) --- perl/MANIFEST | 1 - perl/Makefile.PL | 7 +++++-- perl/OpenSSL.pm | 2 +- perl/OpenSSL.xs | 2 ++ perl/openssl.h | 2 +- perl/openssl_bio.xs | 3 ++- perl/openssl_bn.xs | 1 + perl/openssl_cipher.xs | 3 ++- perl/openssl_digest.xs | 2 +- perl/openssl_ssl.xs | 18 +++++++++++++----- 10 files changed, 28 insertions(+), 13 deletions(-) (limited to 'perl') diff --git a/perl/MANIFEST b/perl/MANIFEST index a7046cf28c..80c900769d 100644 --- a/perl/MANIFEST +++ b/perl/MANIFEST @@ -12,7 +12,6 @@ openssl_digest.xs openssl_err.xs openssl_ssl.xs openssl_x509.xs -openssl_cb.c t/01-use.t t/02-version.t t/03-bio.t diff --git a/perl/Makefile.PL b/perl/Makefile.PL index 09eb93653b..2a67ad061d 100644 --- a/perl/Makefile.PL +++ b/perl/Makefile.PL @@ -2,7 +2,11 @@ ## Makefile.PL -- Perl MakeMaker specification ## -$V = '0.9.2b'; +open(IN,"<../Makefile.ssl") || die "unable to open Makefile.ssl!\n"; +while() { + $V=$1 if (/^VERSION=(.*)$/); +} +close(IN); print "Configuring companion Perl module for OpenSSL $V\n"; use ExtUtils::MakeMaker; @@ -18,7 +22,6 @@ WriteMakefile( 'DEFINE' => '', 'INC' => '-I../include', 'H' => ['openssl.h'], - 'C' => ['openssl_cb.c'], 'OBJECT' => 'OpenSSL.o ' . 'openssl_bio.o ' . diff --git a/perl/OpenSSL.pm b/perl/OpenSSL.pm index 7711c332ca..ae7265a21d 100644 --- a/perl/OpenSSL.pm +++ b/perl/OpenSSL.pm @@ -11,7 +11,7 @@ use DynaLoader; @ISA = qw(Exporter DynaLoader); @EXPORT = qw(); -$VERSION = '0.922'; +$VERSION = '0.94'; bootstrap OpenSSL; @OpenSSL::BN::ISA = qw(OpenSSL::ERR); diff --git a/perl/OpenSSL.xs b/perl/OpenSSL.xs index 9af3113f76..2267168b79 100644 --- a/perl/OpenSSL.xs +++ b/perl/OpenSSL.xs @@ -64,6 +64,8 @@ ex_cleanup(obj, data, ad, idx, argl, argp) MODULE = OpenSSL PACKAGE = OpenSSL +PROTOTYPES: ENABLE + BOOT: boot_bio(); boot_cipher(); diff --git a/perl/openssl.h b/perl/openssl.h index 52e6cfc89a..2712324a30 100644 --- a/perl/openssl.h +++ b/perl/openssl.h @@ -60,7 +60,7 @@ extern "C" { #endif #include "EXTERN.h" -#include +#include "perl.h" #include "XSUB.h" #ifdef __cplusplus diff --git a/perl/openssl_bio.xs b/perl/openssl_bio.xs index 346ead441f..06d61af130 100644 --- a/perl/openssl_bio.xs +++ b/perl/openssl_bio.xs @@ -66,6 +66,7 @@ boot_bio(void) MODULE = OpenSSL::BIO PACKAGE = OpenSSL::BIO PREFIX = p5_BIO_ +PROTOTYPES: ENABLE VERSIONCHECK: DISABLE void @@ -216,7 +217,7 @@ p5_BIO_pop(b) * perl library, in which case it will have a perl * SV, otherwise it will have been created internally, * inside OpenSSL. For the 'pushed in', it needs - * the reference count decememted. */ + * the reference count decremented. */ arg = (SV *)BIO_get_ex_data(bio, p5_bio_ex_bio_ptr); if (arg == NULL) { arg = new_ref("OpenSSL::BIO",(char *)bio,0); diff --git a/perl/openssl_bn.xs b/perl/openssl_bn.xs index 359e906651..f79bf879e8 100644 --- a/perl/openssl_bn.xs +++ b/perl/openssl_bn.xs @@ -72,6 +72,7 @@ char *arg; MODULE = OpenSSL::BN PACKAGE = OpenSSL::BN PREFIX = p5_BN_ +PROTOTYPES: ENABLE VERSIONCHECK: DISABLE void diff --git a/perl/openssl_cipher.xs b/perl/openssl_cipher.xs index fb4c632995..e9ff2a8f79 100644 --- a/perl/openssl_cipher.xs +++ b/perl/openssl_cipher.xs @@ -9,13 +9,14 @@ int boot_cipher() MODULE = OpenSSL::Cipher PACKAGE = OpenSSL::Cipher PREFIX = p5_EVP_C_ +PROTOTYPES: ENABLE VERSIONCHECK: DISABLE void p5_EVP_C_new(...) PREINIT: EVP_CIPHER_CTX *ctx; - EVP_CIPHER *c; + const EVP_CIPHER *c; char *name; PPCODE: if ((items == 1) && SvPOK(ST(0))) diff --git a/perl/openssl_digest.xs b/perl/openssl_digest.xs index e4bc29ea89..6cd3018e9f 100644 --- a/perl/openssl_digest.xs +++ b/perl/openssl_digest.xs @@ -23,7 +23,7 @@ void p5_EVP_MD_new(...) PREINIT: EVP_MD_CTX *ctx; - EVP_MD *md; + const EVP_MD *md; char *name; PPCODE: if ((items == 1) && SvPOK(ST(0))) diff --git a/perl/openssl_ssl.xs b/perl/openssl_ssl.xs index 7022c468f2..c7d1b171ab 100644 --- a/perl/openssl_ssl.xs +++ b/perl/openssl_ssl.xs @@ -60,6 +60,7 @@ int boot_ssl() MODULE = OpenSSL::SSL PACKAGE = OpenSSL::SSL::CTX PREFIX = p5_SSL_CTX_ +PROTOTYPES: ENABLE VERSIONCHECK: DISABLE void @@ -75,7 +76,7 @@ p5_SSL_CTX_new(...) else if ((items == 2) && SvPOK(ST(1))) method=SvPV(ST(1),na); else - croak("Usage: OpenSSL::SSL_CTX::new(type)"); + croak("Usage: OpenSSL::SSL::CTX::new(type)"); if (strcmp(method,"SSLv3") == 0) meth=SSLv3_method(); @@ -95,9 +96,15 @@ p5_SSL_CTX_new(...) meth=SSLv2_client_method(); else if (strcmp(method,"SSLv2_server") == 0) meth=SSLv2_server_method(); + else if (strcmp(method,"TLSv1") == 0) + meth=TLSv1_method(); + else if (strcmp(method,"TLSv1_client") == 0) + meth=TLSv1_client_method(); + else if (strcmp(method,"TLSv1_server") == 0) + meth=TLSv1_server_method(); else { - croak("Not passed a valid SSL method name, should be 'SSLv[23] [client|server]'"); + croak("Not a valid SSL method name, should be 'SSLv[23] [client|server]'"); } EXTEND(sp,1); PUSHs(sv_newmortal()); @@ -176,7 +183,6 @@ p5_SSL_new(...) SV *sv_ctx; SSL_CTX *ctx; SSL *ssl; - int i; SV *arg; PPCODE: pr_name("p5_SSL_new"); @@ -198,8 +204,8 @@ p5_SSL_new(...) /* Now this is being a little hairy, we keep a pointer to * our perl reference. We need to do a different one - * to the one we return because it will have it's reference - * count droped to 0 apon return and if we up its reference + * to the one we return because it will have its reference + * count dropped to 0 upon return and if we up its reference * count, it will never be DESTROYED */ arg=newSVsv(ST(0)); SSL_set_ex_data(ssl,p5_ssl_ex_ssl_ptr,(char *)arg); @@ -363,7 +369,9 @@ p5_SSL_DESTROY(ssl) SSL *ssl; CODE: pr_name_dd("p5_SSL_DESTROY",ssl->references,ssl->ctx->references); +#ifdef DEBUG fprintf(stderr,"SSL_DESTROY %d\n",ssl->references); +#endif SSL_free(ssl); int -- cgit v1.2.3