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??)
This commit is contained in:
Ulf Möller 1999-07-22 16:10:31 +00:00
parent f0e8ae723c
commit 49b8142262
13 changed files with 32 additions and 17 deletions

View file

@ -180,6 +180,7 @@ all: Makefile.ssl
(cd $$i && echo "making all in $$i..." && \
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' SDIRS='${SDIRS}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' all ) || exit 1; \
done;
cd perl; $(PERL) Makefile.PL; make
sub_all:
@for i in $(DIRS) ;\
@ -207,8 +208,7 @@ linux-shared:
Makefile.ssl: Makefile.org
@echo "Makefile.ssl is older than Makefile.org."
@echo "Reconfigure the source tree (via 'perl Configure' or 'sh config')"
@echo "and update the error lists (via 'make errors'), please."
@echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
@false
libclean:

View file

@ -1,4 +1,4 @@
lib
date.h
buildinf.h
opensslconf.h
Makefile.save

View file

@ -141,7 +141,7 @@ char *CRYPTO_get_ex_data(CRYPTO_EX_DATA *ad, int idx)
return(sk_value(ad->sk,idx));
}
/* The callback is called with the 'object', which is the origional data object
/* The callback is called with the 'object', which is the original data object
* being duplicated, a pointer to the
* 'new' object to be inserted, the index, and the argi/argp
*/

View file

@ -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

View file

@ -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(<IN>) {
$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 ' .

View file

@ -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);

View file

@ -64,6 +64,8 @@ ex_cleanup(obj, data, ad, idx, argl, argp)
MODULE = OpenSSL PACKAGE = OpenSSL
PROTOTYPES: ENABLE
BOOT:
boot_bio();
boot_cipher();

View file

@ -60,7 +60,7 @@ extern "C" {
#endif
#include "EXTERN.h"
#include <openssl/perl.h>
#include "perl.h"
#include "XSUB.h"
#ifdef __cplusplus

View file

@ -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);

View file

@ -72,6 +72,7 @@ char *arg;
MODULE = OpenSSL::BN PACKAGE = OpenSSL::BN PREFIX = p5_BN_
PROTOTYPES: ENABLE
VERSIONCHECK: DISABLE
void

View file

@ -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)))

View file

@ -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)))

View file

@ -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