diff options
-rw-r--r-- | CHANGES | 9 | ||||
-rw-r--r-- | perl/.cvsignore | 12 | ||||
-rw-r--r-- | perl/MANIFEST | 25 | ||||
-rw-r--r-- | perl/Makefile.PL | 58 | ||||
-rw-r--r-- | perl/OpenSSL.pm (renamed from perl/SSLeay.pm) | 58 | ||||
-rw-r--r-- | perl/OpenSSL.xs | 22 | ||||
-rw-r--r-- | perl/SSLeay.xs | 65 | ||||
-rw-r--r-- | perl/b.pl | 21 | ||||
-rw-r--r-- | perl/bio.pl | 30 | ||||
-rw-r--r-- | perl/bio.txt | 36 | ||||
-rw-r--r-- | perl/bio.xs | 450 | ||||
-rw-r--r-- | perl/bn.pl | 23 | ||||
-rw-r--r-- | perl/bn.txt | 38 | ||||
-rw-r--r-- | perl/bn.xs | 589 | ||||
-rw-r--r-- | perl/callback.c | 103 | ||||
-rw-r--r-- | perl/cipher.pl | 39 | ||||
-rw-r--r-- | perl/cipher.txt | 10 | ||||
-rw-r--r-- | perl/cipher.xs | 152 | ||||
-rw-r--r-- | perl/dh.pl | 40 | ||||
-rw-r--r-- | perl/digest.txt | 7 | ||||
-rw-r--r-- | perl/digest.xs | 83 | ||||
-rw-r--r-- | perl/err.txt | 2 | ||||
-rw-r--r-- | perl/err.xs | 46 | ||||
-rw-r--r-- | perl/f.pl | 11 | ||||
-rw-r--r-- | perl/g.pl | 18 | ||||
-rw-r--r-- | perl/gen_rsa.pl | 49 | ||||
-rw-r--r-- | perl/mul.pl | 56 | ||||
-rw-r--r-- | perl/openssl.h | 2 | ||||
-rw-r--r-- | perl/openssl_bio.xs | 27 | ||||
-rw-r--r-- | perl/openssl_bn.xs | 75 | ||||
-rw-r--r-- | perl/openssl_cb.c | 1 | ||||
-rw-r--r-- | perl/openssl_cipher.xs | 9 | ||||
-rw-r--r-- | perl/openssl_digest.xs | 11 | ||||
-rw-r--r-- | perl/openssl_err.xs | 5 | ||||
-rw-r--r-- | perl/openssl_ssl.xs | 35 | ||||
-rw-r--r-- | perl/openssl_x509.xs | 7 | ||||
-rw-r--r-- | perl/p5SSLeay.h | 96 | ||||
-rw-r--r-- | perl/r.pl | 56 | ||||
-rw-r--r-- | perl/s.pl | 72 | ||||
-rw-r--r-- | perl/s2.pl | 49 | ||||
-rw-r--r-- | perl/server.pem | 369 | ||||
-rw-r--r-- | perl/ss.pl | 64 | ||||
-rw-r--r-- | perl/ssl.pl | 71 | ||||
-rw-r--r-- | perl/ssl.txt | 43 | ||||
-rw-r--r-- | perl/ssl.xs | 474 | ||||
-rw-r--r-- | perl/ssl_srvr.pl | 35 | ||||
-rw-r--r-- | perl/sslbio.pl | 40 | ||||
-rw-r--r-- | perl/t.pl | 12 | ||||
-rw-r--r-- | perl/test | 32 | ||||
-rw-r--r-- | perl/test.pl | 30 | ||||
-rw-r--r-- | perl/test.txt | 36 | ||||
-rw-r--r-- | perl/test2.pl | 28 | ||||
-rw-r--r-- | perl/test3.pl | 19 | ||||
-rw-r--r-- | perl/test8.pl | 19 | ||||
-rw-r--r-- | perl/test9.pl | 38 | ||||
-rw-r--r-- | perl/testbn.pl | 23 | ||||
-rw-r--r-- | perl/testdec.pl | 14 | ||||
-rw-r--r-- | perl/testmd.pl | 26 | ||||
-rw-r--r-- | perl/tt.pl | 15 | ||||
-rw-r--r-- | perl/typemap | 52 | ||||
-rw-r--r-- | perl/x509.txt | 6 | ||||
-rw-r--r-- | perl/x509.xs | 74 | ||||
-rw-r--r-- | perl/xstmp.c | 102 | ||||
-rw-r--r-- | perl/y.pl | 7 | ||||
-rw-r--r-- | perl/yy.pl | 19 | ||||
-rw-r--r-- | perl/z.pl | 32 | ||||
-rw-r--r-- | perl/zz.pl | 22 |
67 files changed, 226 insertions, 3973 deletions
@@ -5,6 +5,15 @@ Changes between 0.9.1c and 0.9.2 + *) Overhauled the Perl interface (perl/*): + - ported BN stuff to OpenSSL's different BN library + - made the perl/ source tree CVS-aware + - renamed the package from SSLeay to OpenSSL (the files still contain + their history because I've copied them in the repository) + - removed obsolete files (the test scripts will be replaced + by better Test::Harness variants in the future) + [Ralf S. Engelschall] + *) First cut for a very conservative source tree cleanup: 1. merge various obsolete readme texts into doc/ssleay.txt where we collect the old documents and readme texts. diff --git a/perl/.cvsignore b/perl/.cvsignore new file mode 100644 index 0000000000..e3f4b2ec4e --- /dev/null +++ b/perl/.cvsignore @@ -0,0 +1,12 @@ +Makefile +blib +pm_to_blib +OpenSSL.c +openssl_bio.c +openssl_bn.c +openssl_cipher.c +openssl_digest.c +openssl_err.c +openssl_ssl.c +openssl_x509.c +OpenSSL.bs diff --git a/perl/MANIFEST b/perl/MANIFEST index 992db5ed4c..6acbc10af4 100644 --- a/perl/MANIFEST +++ b/perl/MANIFEST @@ -1,17 +1,14 @@ MANIFEST Makefile.PL -SSLeay.pm -bio.xs -bn.xs -cipher.xs -digest.xs -err.xs -ssl.xs -x509.xs -test.pl -test2.pl -test3.pl -test9.pl -testbn.pl -testmd.pl typemap +OpenSSL.pm +OpenSSL.xs +openssl.h +openssl_bio.xs +openssl_bn.xs +openssl_cipher.xs +openssl_digest.xs +openssl_err.xs +openssl_ssl.xs +openssl_x509.xs +openssl_cb.c diff --git a/perl/Makefile.PL b/perl/Makefile.PL index f9998e0a61..77d5af5f21 100644 --- a/perl/Makefile.PL +++ b/perl/Makefile.PL @@ -1,25 +1,37 @@ +## +## Makefile.PL -- Perl MakeMaker specification +## + use ExtUtils::MakeMaker; -# See lib/ExtUtils/MakeMaker.pm for details of how to influence -# the contents of the Makefile that is written. + WriteMakefile( - 'OPTIMIZE' => '-g', - 'DISTNAME' => 'SSLeay-perl5-0.8.5', - 'NAME' => 'SSLeay', - 'VERSION_FROM' => 'SSLeay.pm', - 'LIBS' => ['-L.. -lssl -lcrypto'], - 'DEFINE' => '', - 'INC' => '-I../include', - 'C' => ['callback.c'], - 'H' => ['p5SSLeay.h'], - 'OBJECT' => " SSLeay.o bio.o bn.o cipher.o digest.o err.o - ssl.o x509.o", - 'XS' => { 'SSLeay.xs' => 'SSLeay.c', - 'bio.xs' => 'bio.c', - 'bn.xs' => 'bn.c', - 'cipher.xs' => 'cipher.c', - 'digest.xs' => 'digest.c', - 'err.xs' => 'err.c', - 'ssl.xs' => 'ssl.c', - 'x509.xs' => 'x509.c', - } - ); + 'OPTIMIZE' => '', + 'DISTNAME' => 'OpenSSL-0.9.2', + 'NAME' => 'OpenSSL', + 'VERSION_FROM' => 'OpenSSL.pm', + 'LIBS' => ['-L.. -lssl -lcrypto'], + 'DEFINE' => '', + 'INC' => '-I../include', + 'H' => ['openssl.h'], + 'C' => ['openssl_cb.c'], + 'OBJECT' => + 'OpenSSL.o ' . + 'openssl_bio.o ' . + 'openssl_bn.o ' . + 'openssl_cipher.o ' . + 'openssl_digest.o ' . + 'openssl_err.o ' . + 'openssl_ssl.o ' . + 'openssl_x509.o ', + 'XS' => { + 'OpenSSL.xs' => 'OpenSSL.c', + 'openssl_bio.xs' => 'openssl_bio.c', + 'openssl_bn.xs' => 'openssl_bn.c', + 'openssl_cipher.xs' => 'openssl_cipher.c', + 'openssl_digest.xs' => 'openssl_digest.c', + 'openssl_err.xs' => 'openssl_err.c', + 'openssl_ssl.xs' => 'openssl_ssl.c', + 'openssl_x509.xs' => 'openssl_x509.c', + }, +); + diff --git a/perl/SSLeay.pm b/perl/OpenSSL.pm index f7710039d2..21c05a44cf 100644 --- a/perl/SSLeay.pm +++ b/perl/OpenSSL.pm @@ -1,4 +1,8 @@ -package SSLeay; +## +## OpenSSL.pm +## + +package OpenSSL; use Exporter; use DynaLoader; @@ -6,28 +10,26 @@ use DynaLoader; @ISA = qw(Exporter DynaLoader); @EXPORT = qw(); -$VERSION='0.82'; -$VERSION='0.82'; -bootstrap SSLeay; - -@SSLeay::BN::ISA= qw(SSLeay::ERR); -@SSLeay::MD::ISA= qw(SSLeay::ERR); -@SSLeay::Cipher::ISA= qw(SSLeay::ERR); -@SSLeay::SSL::CTX::ISA= qw(SSLeay::ERR); -@SSLeay::BIO::ISA= qw(SSLeay::ERR); -@SSLeay::SSL::ISA= qw(SSLeay::ERR); +$VERSION='0.92'; +bootstrap penSSL; -@BN::ISA= qw(SSLeay::BN); -@MD::ISA= qw(SSLeay::MD); -@Cipher::ISA= qw(SSLeay::Cipher); -@SSL::ISA= qw(SSLeay::SSL); -@SSL::CTX::ISA= qw(SSLeay::SSL::CTX); -@BIO::ISA= qw(SSLeay::BIO); +@OpenSSL::BN::ISA= qw(OpenSSL::ERR); +@OpenSSL::MD::ISA= qw(OpenSSL::ERR); +@OpenSSL::Cipher::ISA= qw(OpenSSL::ERR); +@OpenSSL::SSL::CTX::ISA= qw(OpenSSL::ERR); +@OpenSSL::BIO::ISA= qw(OpenSSL::ERR); +@OpenSSL::SSL::ISA= qw(OpenSSL::ERR); +@BN::ISA= qw(OpenSSL::BN); +@MD::ISA= qw(OpenSSL::MD); +@Cipher::ISA= qw(OpenSSL::Cipher); +@SSL::ISA= qw(OpenSSL::SSL); +@SSL::CTX::ISA= qw(OpenSSL::SSL::CTX); +@BIO::ISA= qw(OpenSSL::BIO); -@SSLeay::MD::names=qw(md2 md5 sha sha1 ripemd160 mdc2); +@OpenSSL::MD::names=qw(md2 md5 sha sha1 ripemd160 mdc2); -@SSLeay::Cipher::names=qw( +@OpenSSL::Cipher::names=qw( des-ecb des-cfb des-ofb des-cbc des-ede des-ede-cfb des-ede-ofb des-ede-cbc des-ede3 des-ede3-cfb des-ede3-ofb des-ede3-cbc @@ -39,9 +41,9 @@ bootstrap SSLeay; rc5-ecb rc5-cfb rc5-ofb rc5-cbc ); -sub SSLeay::SSL::CTX::new_ssl { SSLeay::SSL::new($_[0]); } +sub OpenSSL::SSL::CTX::new_ssl { OpenSSL::SSL::new($_[0]); } -sub SSLeay::ERR::error +sub OpenSSL::ERR::error { my($o)=@_; my($s,$ret); @@ -53,26 +55,26 @@ sub SSLeay::ERR::error return($ret); } -@SSLeay::Cipher::aliases=qw(des desx des3 idea rc2 bf cast); +@OpenSSL::Cipher::aliases=qw(des desx des3 idea rc2 bf cast); -package SSLeay::BN; +package OpenSSL::BN; -sub bnfix { (ref($_[0]) ne "SSLeay::BN")?SSLeay::BN::dec2bn($_[0]):$_[0]; } +sub bnfix { (ref($_[0]) ne "OpenSSL::BN")?OpenSSL::BN::dec2bn($_[0]):$_[0]; } use overload "=" => sub { dup($_[0]); }, "+" => sub { add($_[0],$_[1]); }, "-" => sub { ($_[1],$_[0])=($_[0],$_[1]) if $_[2]; - SSLeay::BN::sub($_[0],$_[1]); }, + OpenSSL::BN::sub($_[0],$_[1]); }, "*" => sub { mul($_[0],$_[1]); }, "/" => sub { ($_[1],$_[0])=($_[0],$_[1]) if $_[2]; (div($_[0],$_[1]))[0]; }, "%" => sub { ($_[1],$_[0])=($_[0],$_[1]) if $_[2]; mod($_[0],$_[1]); }, "**" => sub { ($_[1],$_[0])=($_[0],$_[1]) if $_[2]; exp($_[0],$_[1]); }, "<<" => sub { lshift($_[0],$_[1]); }, ">>" => sub { rshift($_[0],$_[1]); }, -"<=>" => sub { SSLeay::BN::cmp($_[0],$_[1]); }, +"<=>" => sub { OpenSSL::BN::cmp($_[0],$_[1]); }, '""' => sub { bn2dec($_[0]); }, '0+' => sub { dec2bn($_[0]); }, -"bool" => sub { ref($_[0]) eq "SSLeay::BN"; }; +"bool" => sub { ref($_[0]) eq "OpenSSL::BN"; }; -sub SSLeay::BIO::do_accept { SSLeay::BIO::do_handshake(@_); } +sub OpenSSL::BIO::do_accept { OpenSSL::BIO::do_handshake(@_); } 1; diff --git a/perl/OpenSSL.xs b/perl/OpenSSL.xs index 3e3d1debeb..6a975be515 100644 --- a/perl/OpenSSL.xs +++ b/perl/OpenSSL.xs @@ -1,4 +1,8 @@ -#include "p5SSLeay.h" +/* +** OpenSSL.xs +*/ + +#include "openssl.h" SV *new_ref(type,obj,mort) char *type; @@ -47,7 +51,7 @@ fprintf(stderr,"ex_cleanup %08X %s\n",obj,argp); SvREFCNT_dec((SV *)data); } -MODULE = SSLeay PACKAGE = SSLeay +MODULE = OpenSSL PACKAGE = OpenSSL BOOT: boot_bio(); @@ -55,11 +59,11 @@ BOOT: boot_digest(); boot_err(); boot_ssl(); - boot_SSLeay__BN(); - boot_SSLeay__BIO(); - boot_SSLeay__Cipher(); - boot_SSLeay__MD(); - boot_SSLeay__ERR(); - boot_SSLeay__SSL(); - boot_SSLeay__X509(); + boot_OpenSSL__BN(); + boot_OpenSSL__BIO(); + boot_OpenSSL__Cipher(); + boot_OpenSSL__MD(); + boot_OpenSSL__ERR(); + boot_OpenSSL__SSL(); + boot_OpenSSL__X509(); diff --git a/perl/SSLeay.xs b/perl/SSLeay.xs deleted file mode 100644 index 3e3d1debeb..0000000000 --- a/perl/SSLeay.xs +++ /dev/null @@ -1,65 +0,0 @@ -#include "p5SSLeay.h" - -SV *new_ref(type,obj,mort) -char *type; -char *obj; - { - SV *ret; - - if (mort) - ret=sv_newmortal(); - else - ret=newSViv(0); -printf(">new_ref %d\n",type); - sv_setref_pv(ret,type,(void *)obj); - return(ret); - } - -int ex_new(obj,data,ad,idx,argl,argp) -char *obj; -SV *data; -CRYPTO_EX_DATA *ad; -int idx; -long argl; -char *argp; - { - SV *sv; - -fprintf(stderr,"ex_new %08X %s\n",obj,argp); - sv=sv_newmortal(); - sv_setref_pv(sv,argp,(void *)obj); -printf("%d>new_ref '%s'\n",sv,argp); - CRYPTO_set_ex_data(ad,idx,(char *)sv); - return(1); - } - -void ex_cleanup(obj,data,ad,idx,argl,argp) -char *obj; -SV *data; -CRYPTO_EX_DATA *ad; -int idx; -long argl; -char *argp; - { - pr_name("ex_cleanup"); -fprintf(stderr,"ex_cleanup %08X %s\n",obj,argp); - if (data != NULL) - SvREFCNT_dec((SV *)data); - } - -MODULE = SSLeay PACKAGE = SSLeay - -BOOT: - boot_bio(); - boot_cipher(); - boot_digest(); - boot_err(); - boot_ssl(); - boot_SSLeay__BN(); - boot_SSLeay__BIO(); - boot_SSLeay__Cipher(); - boot_SSLeay__MD(); - boot_SSLeay__ERR(); - boot_SSLeay__SSL(); - boot_SSLeay__X509(); - diff --git a/perl/b.pl b/perl/b.pl deleted file mode 100644 index ac1e52de79..0000000000 --- a/perl/b.pl +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/local/bin/perl - -use ExtUtils::testlib; - -use SSLeay; - -$cmd=<<"EOF"; - -EOF - -$conn="localhost:4433"; -$conn=$ARGV[0] if $#ARGV >= 0; -print "X\n"; -$bio=BIO->new("connect"); -print "XX\n"; -$bio->set_callback(sub {print STDERR $_[0]->number_read."\n"; $_[$#_] }); -print "XXX\n"; -$bio->hostname($conn) || die $ssl->error(); -print "XXXX\n"; - -#$ssl=BIO->new("ssl"); diff --git a/perl/bio.pl b/perl/bio.pl deleted file mode 100644 index 70a97e7925..0000000000 --- a/perl/bio.pl +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/local/bin/perl - -use ExtUtils::testlib; - -use SSLeay; - -$cmd=<<"EOF"; -GET / HTTP/1.0 - -EOF - -$conn="localhost:4433"; -$conn=$ARGV[0] if $#ARGV >= 0; -$bio=SSLeay::BIO::new("connect"); -#$bio->set_callback(sub {print STDERR SSLeay::BIO::number_read($_[0])."\n"; $_[$#_] }); -#$bio->set_callback(sub {print STDERR "$#_:".$_[0].":$_[1]:$_[2]:$_[3]:$_[4]:\n"; $_[$#_] }); -$bio->hostname($conn) || die $ssl->error(); - - -(($ret=$bio->do_handshake()) > 0) || die $bio->error(); - -(($ret=$bio->syswrite($cmd)) > 0) || die $bio->error(); - -while (1) - { - $ret=$bio->sysread($buf,10240); - last if ($ret <= 0); - print $buf; - } - diff --git a/perl/bio.txt b/perl/bio.txt deleted file mode 100644 index 5b46c9f5ee..0000000000 --- a/perl/bio.txt +++ /dev/null @@ -1,36 +0,0 @@ -BIO::new(type) - "connect" - "accept" - "ssl" - "buffer" - -"connect" - BIO::hostname(name) host:port to connect to - -"accept" - BIO::set_accept_port(port) port to connect too. - -"connect", "accept", "ssl" - BIO::do_andshake do protocol - -"ssl" - BIO::set_ssl(ssl) - BIO::get_ssl() - -BIO::push(bio) -BIO::pop; return BIO -BIO::number_read() -BIO::number_written() -BIO::references() - -BIO::sysread(buf,len[,offset]) -BIO::syswrite(in[,len][,offset]) -BIO::getline() -BIO::puts(in) -BIO::flush() -BIO::type() -BIO::next_bio(); -BIO::set_callback(callback[, args]) - -BIO::new_buffer_ssl_connect(SSL_CTX) -BIO::new_ssl_connect(SSL_CTX) diff --git a/perl/bio.xs b/perl/bio.xs deleted file mode 100644 index a9d32d8408..0000000000 --- a/perl/bio.xs +++ /dev/null @@ -1,450 +0,0 @@ -#include "p5SSLeay.h" - -static int p5_bio_ex_bio_ptr=0; -static int p5_bio_ex_bio_callback=0; -static int p5_bio_ex_bio_callback_data=0; - -static long p5_bio_callback(bio,state,parg,cmd,larg,ret) -BIO *bio; -int state; -char *parg; -int cmd; -long larg; -int ret; - { - int i; - SV *me,*cb; - - me=(SV *)BIO_get_ex_data(bio,p5_bio_ex_bio_ptr); - cb=(SV *)BIO_get_ex_data(bio,p5_bio_ex_bio_callback); - if (cb != NULL) - { - dSP; - - ENTER ; - SAVETMPS; - - PUSHMARK(sp); - XPUSHs(sv_2mortal(newSViv(me))); - XPUSHs(sv_2mortal(newSViv(state))); - XPUSHs(sv_2mortal(newSViv(cmd))); - if ((state == BIO_CB_READ) || (state == BIO_CB_WRITE)) - { - XPUSHs(sv_2mortal(newSVpv(parg,larg))); - } - else - XPUSHs(&sv_undef); - /* ptr one */ - XPUSHs(sv_2mortal(newSViv(larg))); - XPUSHs(sv_2mortal(newSViv(ret))); - PUTBACK; - - i=perl_call_sv(cb,G_SCALAR); - - SPAGAIN; - if (i == 1) - ret=POPi; - else - ret=1; - PUTBACK; - FREETMPS; - LEAVE; - } - else - { - croak("Internal error in SSL p5_ssl_info_callback"); - } - return(ret); - } - -int boot_bio() - { - p5_bio_ex_bio_ptr= - BIO_get_ex_new_index(0,"SSLeay::BIO",ex_new,NULL, - ex_cleanup); - p5_bio_ex_bio_callback= - BIO_get_ex_new_index(0,"bio_callback",NULL,NULL, - ex_cleanup); - p5_bio_ex_bio_callback_data= - BIO_get_ex_new_index(0,"bio_callback_data",NULL,NULL, - ex_cleanup); - return(1); - } - -MODULE = SSLeay::BIO PACKAGE = SSLeay::BIO PREFIX = p5_BIO_ - -VERSIONCHECK: DISABLE - -void -p5_BIO_new_buffer_ssl_connect(...) - PREINIT: - SSL_CTX *ctx; - BIO *bio; - SV *arg; - PPCODE: - if (items == 1) - arg=ST(0); - else if (items == 2) - arg=ST(1); - else - arg=NULL; - - if ((arg == NULL) || !(sv_derived_from(arg,"SSLeay::SSL::CTX"))) - croak("Usage: SSLeay::BIO::new_buffer_ssl_connect(SSL_CTX)"); - else - { - IV tmp=SvIV((SV *)SvRV(arg)); - ctx=(SSL_CTX *)tmp; - } - EXTEND(sp,1); - bio=BIO_new_buffer_ssl_connect(ctx); - arg=(SV *)BIO_get_ex_data(bio,p5_bio_ex_bio_ptr); - PUSHs(arg); - -void -p5_BIO_new_ssl_connect(...) - PREINIT: - SSL_CTX *ctx; - BIO *bio; - SV *arg; - PPCODE: - if (items == 1) - arg=ST(0); - else if (items == 2) - arg=ST(1); - else - arg=NULL; - - if ((arg == NULL) || !(sv_derived_from(arg,"SSLeay::SSL::CTX"))) - croak("Usage: SSLeay::BIO::new_ssl_connect(SSL_CTX)"); - else - { - IV tmp=SvIV((SV *)SvRV(arg)); - ctx=(SSL_CTX *)tmp; - } - EXTEND(sp,1); - bio=BIO_new_ssl_connect(ctx); - arg=(SV *)BIO_get_ex_data(bio,p5_bio_ex_bio_ptr); - PUSHs(arg); - -void -p5_BIO_new(...) - PREINIT: - BIO *bio; - char *type; - SV *arg; - PPCODE: - pr_name("p5_BIO_new"); - if ((items == 1) && SvPOK(ST(0))) - type=SvPV(ST(0),na); - else if ((items == 2) && SvPOK(ST(1))) - type=SvPV(ST(1),na); - else - croak("Usage: SSLeay::BIO::new(type)"); - - EXTEND(sp,1); - if (strcmp(type,"connect") == 0) - bio=BIO_new(BIO_s_connect()); - else if (strcmp(type,"accept") == 0) - bio=BIO_new(BIO_s_accept()); - else if (strcmp(type,"ssl") == 0) - bio=BIO_new(BIO_f_ssl()); - else if (strcmp(type,"buffer") == 0) - bio=BIO_new(BIO_f_buffer()); - else - croak("unknown BIO type"); - arg=(SV *)BIO_get_ex_data(bio,p5_bio_ex_bio_ptr); - PUSHs(arg); - -int -p5_BIO_hostname(bio,name) - BIO *bio; - char *name; - CODE: - RETVAL=BIO_set_conn_hostname(bio,name); - OUTPUT: - RETVAL - -int -p5_BIO_set_accept_port(bio,str) - BIO *bio; - char *str; - CODE: - RETVAL=BIO_set_accept_port(bio,str); - OUTPUT: - RETVAL - -int -p5_BIO_do_handshake(bio) - BIO *bio; - CODE: - RETVAL=BIO_do_handshake(bio); - OUTPUT: - RETVAL - -BIO * -p5_BIO_push(b,bio) - BIO *b; - BIO *bio; - CODE: - /* This reference will be reduced when the reference is - * let go, and then when the BIO_free_all() is called - * inside the SSLeay library by the BIO with this - * pushed into */ - bio->references++; - RETVAL=BIO_push(b,bio); - OUTPUT: - RETVAL - -void -p5_BIO_pop(b) - BIO *b - PREINIT: - BIO *bio; - char *type; - SV *arg; - PPCODE: - bio=BIO_pop(b); - if (bio != NULL) - { - /* This BIO will either be one created in the - * perl library, in which case it will have a perl - * SV, otherwise it will have been created internally, - * inside SSLeay. For the 'pushed in', it needs - * the reference count decememted. */ - arg=(SV *)BIO_get_ex_data(bio,p5_bio_ex_bio_ptr); - if (arg == NULL) - { - arg=new_ref("SSLeay::BIO",(char *)bio,0); - BIO_set_ex_data(bio,p5_bio_ex_bio_ptr,(char *)arg); - PUSHs(arg); - } - else - { |