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)
This commit is contained in:
Ralf S. Engelschall 1999-02-10 09:38:31 +00:00
parent 0517335e3c
commit 8073036dd6
67 changed files with 226 additions and 3973 deletions

View file

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

12
perl/.cvsignore Normal file
View file

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

View file

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

View file

@ -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',
},
);

View file

@ -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;
$VERSION='0.92';
bootstrap penSSL;
@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);
@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(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);
@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);
@OpenSSL::MD::names=qw(md2 md5 sha sha1 ripemd160 mdc2);
@SSLeay::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;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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
{
/* it was pushed in */
SvREFCNT_inc(arg);
PUSHs(arg);
#if 0 /* This does not need to be done. */
if (bio->references < 1)
abort();
/* decrement the reference count */
BIO_free(bio);
#endif
}
}
int
p5_BIO_sysread(bio,in,num, ...)
BIO *bio;
SV *in;
int num;
PREINIT:
int i,n,olen;
int offset;
char *p;
CODE:
offset=0;
if (!SvPOK(in))
sv_setpvn(in,"",0);
SvPV(in,olen);
if (items > 3)
{
offset=SvIV(ST(3));
if (offset < 0)
{
if (-offset > olen)
croak("Offset outside string");
offset+=olen;
}
}
if ((num+offset) > olen)
{
SvGROW(in,num+offset+1);
p=SvPV(in,i);
memset(&(p[olen]),0,(num+offset)-olen+1);
}
p=SvPV(in,n);
i=BIO_read(bio,p+offset,num);
RETVAL=i;
if (i <= 0) i=0;
SvCUR_set(in,offset+i);
OUTPUT:
RETVAL
int
p5_BIO_syswrite(bio,in, ...)
BIO *bio;
SV *in;
PREINIT:
char *ptr;
int len,in_len;
int offset=0;
int n;
CODE:
ptr=SvPV(in,in_len);
if (items > 2)
{
len=SvOK(ST(2))?SvIV(ST(2)):in_len;
if (items > 3)
{
offset=SvIV(ST(3));
if (offset < 0)
{
if (-offset > in_len)
croak("Offset outside string");
offset+=in_len;
}
else if ((offset >= in_len) && (in_len > 0))
croak("Offset outside string");
}
if (len >= (in_len-offset))
len=in_len-offset;
}
else
len=in_len;
RETVAL=BIO_write(bio,ptr+offset,len);
OUTPUT:
RETVAL
void
p5_BIO_getline(bio)
BIO *bio;
PREINIT:
int i;
char *p;
PPCODE:
pr_name("p5_BIO_gets");
EXTEND(sp,1);
PUSHs(sv_newmortal());
sv_setpvn(ST(0),"",0);
SvGROW(ST(0),1024);
p=SvPV(ST(0),na);
i=BIO_gets(bio,p,1024);
if (i < 0) i=0;
SvCUR_set(ST(0),i);
int
p5_BIO_flush(bio)
BIO *bio;
CODE:
RETVAL=BIO_flush(bio);
OUTPUT:
RETVAL
char *
p5_BIO_type(bio)
BIO *bio;
CODE:
RETVAL=bio->method->name;
OUTPUT:
RETVAL
void
p5_BIO_next_bio(b)
BIO *b
PREINIT:
BIO *bio;
char *type;
SV *arg;
PPCODE:
bio=b->next_bio;
if (bio != NULL)
{
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);
bio->references++;
PUSHs(arg);
}
else
{
SvREFCNT_inc(arg);
PUSHs(arg);
}
}
int
p5_BIO_puts(bio,in)
BIO *bio;
SV *in;
PREINIT:
char *ptr;
CODE:
ptr=SvPV(in,na);
RETVAL=BIO_puts(bio,ptr);
OUTPUT:
RETVAL
void
p5_BIO_set_callback(bio,cb,...)
BIO *bio;
SV *cb;
PREINIT:
SV *arg=NULL;
SV *arg2=NULL;
CODE:
if (items > 3)
croak("Usage: SSLeay::BIO::set_callback(bio,callback[,arg]");
if (items == 3)
{
arg2=sv_mortalcopy(ST(2));
SvREFCNT_inc(arg2);
BIO_set_ex_data(bio,p5_bio_ex_bio_callback_data,
(char *)arg2);
}
arg=sv_mortalcopy(ST(1));
SvREFCNT_inc(arg);
BIO_set_ex_data(bio,p5_bio_ex_bio_callback,(char *)arg);
printf("%08lx < bio_ptr\n",BIO_get_ex_data(bio,p5_bio_ex_bio_ptr));
BIO_set_callback(bio,p5_bio_callback);
void
p5_BIO_DESTROY(bio)
BIO *bio
PREINIT:
SV *sv;
PPCODE:
pr_name_d("p5_BIO_DESTROY",bio->references);
printf("p5_BIO_DESTROY <%s> %d\n",bio->method->name,bio->references);
BIO_set_ex_data(bio,p5_bio_ex_bio_ptr,NULL);
BIO_free_all(bio);
int
p5_BIO_set_ssl(bio,ssl)
BIO *bio;
SSL *ssl;
CODE:
pr_name("p5_BIO_set_ssl");
ssl->references++;
RETVAL=BIO_set_ssl(bio,ssl,BIO_CLOSE);
OUTPUT:
RETVAL
int
p5_BIO_number_read(bio)
BIO *bio;
CODE:
RETVAL=BIO_number_read(bio);
OUTPUT:
RETVAL
int
p5_BIO_number_written(bio)
BIO *bio;
CODE:
RETVAL=BIO_number_written(bio);
OUTPUT:
RETVAL
int
p5_BIO_references(bio)
BIO *bio;
CODE:
RETVAL=bio->references;
OUTPUT:
RETVAL

View file

@ -1,23 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
$message=SSLeay::BN::new();
$e=SSLeay::BN::new();
$mod=SSLeay::BN::new();
$mod=SSLeay::BN::dec2bn("114381625757888867669235779976146612010218296721242362562561842935706935245733897830597123563958705058989075147599290026879543541");
$e=5;
$d=SSLeay::BN::dec2bn("45752650303155547067694311990458644804087318688496945025024737159778909096647814932594914301288138204957467016445183857236173773");
$message=SSLeay::BN::bin2bn("The magic words are squeamish ossifrage");
$cipher_text= $message->mod_exp($e,$mod);
print $mod."\n";
print $mod->num_bits()."\n";
for (1 .. 1000)
{
$clear= $cipher_text->mod_exp($d,$mod);
}
print $clear->bn2bin()."\n";

View file

@ -1,38 +0,0 @@
BN->new()
BN->dup(a)
BN->rand(bits[,top][,bottom])
BN->hex2bn(a)
BN->bn2hex(a)
BN->dec2bn(a)
BN->bn2dec(a)
BN->bin2bn(a)
BN->bn2bin(a)
BN->mpi2bn(a)
BN->bn2mpi(a)
BN->add(a,b)
BN->sub(a,b)
BN->mul(a,b)
(div,mod)=BN->div(a,b)
BN->mod(a,b)
BN->exp(a,p)
BN->mod_mul(a,b,c)
BN->mod_exp(a,b,c)
BN->is_prime(p,num)
BN->generate_prime(bits,strong,callback)
BN->num_bits(a)
BN->cmp(a,b)
BN->ucmp(a,b)
BN->is_bit_set(a,pos)
BN->set_bit(a,pos)
BN->clear_bit(a,pos)
BN->lshift(a,num)
BN->rshift(a,num)
BN->mask_bits(a,pos)
BN->clear(a)
BN->gcd(a,b)
BN->mod_inverse(a,mod)

View file

@ -1,589 +0,0 @@
#include "p5SSLeay.h"
int sv_to_BIGNUM(var,arg,name)
BIGNUM **var;
SV *arg;
char *name;
{
int ret=1;
if (sv_derived_from(arg,"SSLeay::BN"))
{
IV tmp = SvIV((SV*)SvRV(arg));
*var = (BIGNUM *) tmp;
}
else if (SvIOK(arg)) {
SV *tmp=sv_newmortal();
*var=BN_new();
BN_set_word(*var,SvIV(arg));
sv_setref_pv(tmp,"SSLeay::BN",(void*)*var);
}
else if (SvPOK(arg)) {
char *ptr;
STRLEN len;
SV *tmp=sv_newmortal();
*var=BN_new();
sv_setref_pv(tmp,"SSLeay::BN", (void*)*var);
ptr=SvPV(arg,len);
SvGROW(arg,len+1);
ptr[len]='\0';
BN_dec2bn(var,ptr);
}
else
{
croak(name);
ret=0;
}
return(ret);
}
typedef struct gpc_args_st {
SV *cb;
SV *arg;
} GPC_ARGS;
static void generate_prime_callback(pos,num,arg)
int pos;
int num;
char *arg;
{
dSP ;
int i;
GPC_ARGS *a=(GPC_ARGS *)arg;
ENTER ;
SAVETMPS ;
PUSHMARK(sp);
XPUSHs(sv_2mortal(newSViv(pos)));
XPUSHs(sv_2mortal(newSViv(num)));
XPUSHs(sv_2mortal(newSVsv(a->arg)));
PUTBACK;
i=perl_call_sv(a->cb,G_DISCARD);
SPAGAIN;
PUTBACK;
FREETMPS;
LEAVE;
}
MODULE = SSLeay::BN PACKAGE = SSLeay::BN PREFIX = p5_BN_
VERSIONCHECK: DISABLE
void
p5_BN_new(...)
PREINIT:
BIGNUM *bn;
SV *arg;
PPCODE:
pr_name("p5_BN_new");
EXTEND(sp,1);
PUSHs(sv_newmortal());
bn=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)bn);
void
p5_BN_dup(a)
BIGNUM *a;
PREINIT:
BIGNUM *bn;
PPCODE:
pr_name("p5_BN_dup");
EXTEND(sp,1);
PUSHs(sv_newmortal());
bn=BN_dup(a);
sv_setref_pv(ST(0), "SSLeay::BN", (void*)bn);
void
p5_BN_rand(bits,...)
int bits;
PREINIT:
int top=1;
int bottom=0;
BIGNUM *ret;
PPCODE:
pr_name("p5_BN_rand");
if ((items < 1) || (items > 3))
croak("Usage: SSLeay::BN::rand(bits[,top_bit][,bottombit]");
if (items >= 2) top=(int)SvIV(ST(0));
if (items >= 3) bottom=(int)SvIV(ST(1));
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
BN_rand(ret,bits,top,bottom);
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
void
p5_BN_bin2bn(a)
datum a;
PREINIT:
BIGNUM *ret;
PPCODE:
pr_name("p5_BN_bin2bn");
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_bin2bn(a.dptr,a.dsize,NULL);
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
void
p5_BN_bn2bin(a)
BIGNUM *a;
PREINIT:
int i;
PPCODE:
pr_name("p5_BN_bn2bin");
EXTEND(sp,1);
PUSHs(sv_newmortal());
i=BN_num_bytes(a)+2;
sv_setpvn(ST(0),"",1);
SvGROW(ST(0),i+1);
SvCUR_set(ST(0),BN_bn2bin(a,SvPV(ST(0),na)));
void
p5_BN_mpi2bn(a)
datum a;
PREINIT:
BIGNUM *ret;
PPCODE:
pr_name("p5_BN_mpi2bn");
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_mpi2bn(a.dptr,a.dsize,NULL);
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
void
p5_BN_bn2mpi(a)
BIGNUM *a;
PREINIT:
int i;
PPCODE:
pr_name("p5_BN_bn2mpi");
EXTEND(sp,1);
PUSHs(sv_newmortal());
i=BN_bn2mpi(a,NULL);
sv_setpvn(ST(0),"",1);
SvGROW(ST(0),i+1);
SvCUR_set(ST(0),BN_bn2mpi(a,SvPV(ST(0),na)));
void
p5_BN_hex2bn(a)
datum a;
PREINIT:
BIGNUM *ret;
PPCODE:
pr_name("p5_BN_hex2bn");
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
BN_hex2bn(&ret,a.dptr);
void
p5_BN_dec2bn(a)
datum a;
PREINIT:
BIGNUM *ret;
PPCODE:
pr_name("p5_BN_dec2bn");
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
BN_dec2bn(&ret,a.dptr);
SV *
p5_BN_bn2hex(a)
BIGNUM *a;
PREINIT:
char *ptr;
int i;
CODE:
pr_name("p5_BN_bn2hex");
ptr=BN_bn2hex(a);
RETVAL=newSVpv("",0);
i=strlen(ptr);
SvGROW(RETVAL,i+1);
memcpy(SvPV(RETVAL,na),ptr,i+1);
SvCUR_set(RETVAL,i);
Free(ptr);
OUTPUT:
RETVAL
SV *
p5_BN_bn2dec(a)
BIGNUM *a;
PREINIT:
char *ptr;
int i;
CODE:
pr_name("p5_BN_bn2dec");
ptr=BN_bn2dec(a);
RETVAL=newSVpv("",0);
i=strlen(ptr);
SvGROW(RETVAL,i+1);
memcpy(SvPV(RETVAL,na),ptr,i+1);
SvCUR_set(RETVAL,i);
Free(ptr);
OUTPUT:
RETVAL
void
p5_BN_add(a,b)
BIGNUM *a;
BIGNUM *b;
PREINIT:
BIGNUM *ret;
PPCODE:
pr_name("p5_BN_add");
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
BN_add(ret,a,b);
void
p5_BN_sub(a,b)
BIGNUM *a;
BIGNUM *b;
PREINIT:
BIGNUM *ret;
PPCODE:
pr_name("p5_BN_sub");
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
BN_sub(ret,a,b);
void
p5_BN_mul(a,b)
BIGNUM *a;
BIGNUM *b;
PREINIT:
BIGNUM *ret;
PPCODE:
pr_name("p5_BN_mul");
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
BN_mul(ret,a,b);
void
p5_BN_div(a,b)
BIGNUM *a;
BIGNUM *b;
PREINIT:
static BN_CTX *ctx=NULL;
BIGNUM *div,*mod;
PPCODE:
pr_name("p5_BN_div");
if (ctx == NULL) ctx=BN_CTX_new();
EXTEND(sp,2);
PUSHs(sv_newmortal());
PUSHs(sv_newmortal());
div=BN_new();
mod=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)div);
sv_setref_pv(ST(1), "SSLeay::BN", (void*)mod);
BN_div(div,mod,a,b,ctx);
void
p5_BN_mod(a,b)
BIGNUM *a;
BIGNUM *b;
PREINIT:
static BN_CTX *ctx=NULL;
BIGNUM *rem;
PPCODE:
pr_name("p5_BN_mod");
if (ctx == NULL) ctx=BN_CTX_new();
EXTEND(sp,1);
PUSHs(sv_newmortal());
rem=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)rem);
BN_mod(rem,a,b,ctx);
void
p5_BN_exp(a,p)
BIGNUM *a;
BIGNUM *p;
PREINIT:
BIGNUM *ret;
static BN_CTX *ctx=NULL;
PPCODE:
pr_name("p5_BN_exp");
if (ctx == NULL) ctx=BN_CTX_new();
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
BN_exp(ret,a,p,ctx);
void
p5_BN_mod_mul(a,b,c)
BIGNUM *a;
BIGNUM *b;
BIGNUM *c;
PREINIT:
static BN_CTX *ctx=NULL;
BIGNUM *ret;
PPCODE:
pr_name("p5_BN_mod_mul");
if (ctx == NULL) ctx=BN_CTX_new();
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
BN_mod_mul(ret,a,b,c,ctx);
void
p5_BN_mod_exp(a,b,c)
BIGNUM *a;
BIGNUM *b;
BIGNUM *c;
PREINIT:
static BN_CTX *ctx=NULL;
BIGNUM *ret;
PPCODE:
pr_name("p5_BN_mod_exp");
if (ctx == NULL) ctx=BN_CTX_new();
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
BN_mod_exp(ret,a,b,c,ctx);
void
p5_BN_generate_prime(...)
PREINIT:
int bits=512;
int strong=0;
BIGNUM *ret=NULL;
SV *callback=NULL;
SV *cb_arg=NULL;
GPC_ARGS arg;
dSP;
PPCODE:
pr_name("p5_BN_generate_prime");
if ((items < 0) || (items > 4))
croak("Usage: SSLeay::BN::generate_prime(a[,strong][,callback][,cb_arg]");
if (items >= 1) bits=(int)SvIV(ST(0));
if (items >= 2) strong=(int)SvIV(ST(1));
if (items >= 3) callback=ST(2);
if (items == 4) cb_arg=ST(3);
if (callback == NULL)
ret=BN_generate_prime(bits,strong,NULL,NULL,NULL,NULL);
else
{
arg.cb=callback;
arg.arg=cb_arg;
ret=BN_generate_prime(bits,strong,NULL,NULL,
generate_prime_callback,(char *)&arg);
}
SPAGAIN;
sp-=items; /* a bit evil that I do this */
EXTEND(sp,1);
PUSHs(sv_newmortal());
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
void
p5_BN_is_prime(p,...)
BIGNUM *p;
PREINIT:
int nchecks=5,ret;
SV *callback=NULL;
SV *cb_arg=NULL;
GPC_ARGS arg;
dSP;
static BN_CTX *ctx=NULL;
PPCODE:
pr_name("p5_BN_is_prime");
if ((items < 1) || (items > 4))
croak("Usage: SSLeay::BN::is_prime(a[,ncheck][,callback][,callback_arg]");
if (ctx == NULL) ctx=BN_CTX_new();
if (items >= 2) nchecks=(int)SvIV(ST(1));
if (items >= 3) callback=ST(2);
if (items >= 4) cb_arg=ST(3);
arg.arg=cb_arg;
if (callback == NULL)
ret=BN_is_prime(p,nchecks,NULL,ctx,NULL);
else
{
arg.cb=callback;
arg.arg=cb_arg;
ret=BN_is_prime(p,nchecks,generate_prime_callback,
ctx,(char *)&arg);
}
SPAGAIN;
sp-=items; /* a bit evil */
PUSHs(sv_2mortal(newSViv(ret)));
int
p5_BN_num_bits(a)
BIGNUM *a;
CODE:
pr_name("p5_BN_num_bits");
RETVAL=BN_num_bits(a);
OUTPUT:
RETVAL
int
p5_BN_cmp(a,b)
BIGNUM *a;
BIGNUM *b;
CODE:
pr_name("p5_BN_cmp");
RETVAL=BN_cmp(a,b);
OUTPUT:
RETVAL
int
p5_BN_ucmp(a,b)
BIGNUM *a;
BIGNUM *b;
CODE:
pr_name("p5_BN_ucmp");
RETVAL=BN_ucmp(a,b);
OUTPUT:
RETVAL
int
p5_BN_is_bit_set(a,b)
BIGNUM *a;
int b;
CODE:
pr_name("p5_BN_is_bit_set");
RETVAL=BN_is_bit_set(a,b);
OUTPUT:
RETVAL
void
p5_BN_set_bit(a,b)
BIGNUM *a;
int b;
PREINIT:
BIGNUM *ret;
PPCODE:
pr_name("p5_BN_set_bit");
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_dup(a);
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
BN_set_bit(ret,b);
void
p5_BN_clear_bit(a,b)
BIGNUM *a;
int b;
PREINIT:
BIGNUM *ret;
PPCODE:
pr_name("p5_BN_clear_bit");
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_dup(a);
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
BN_clear_bit(ret,b);
void
p5_BN_lshift(a,b)
BIGNUM *a;
int b;
PREINIT:
BIGNUM *ret;
PPCODE:
pr_name("p5_BN_lshift");
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
if (b == 1)
BN_lshift1(ret,a);
else
BN_lshift(ret,a,b);
void
p5_BN_rshift(a,b)
BIGNUM *a;
int b;
PREINIT:
BIGNUM *ret;
PPCODE:
pr_name("p5_BN_rshift");
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
if (b == 1)
BN_rshift1(ret,a);
else
BN_rshift(ret,a,b);
void
p5_BN_mask_bits(a,b)
BIGNUM *a;
int b;
PREINIT:
BIGNUM *ret;
PPCODE:
pr_name("p5_BN_mask_bits");
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_dup(a);
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
BN_mask_bits(ret,b);
void
p5_BN_clear(a)
BIGNUM *a;
PPCODE:
pr_name("p5_BN_clear");
BN_clear(a);
void
p5_BN_gcd(a,b)
BIGNUM *a;
BIGNUM *b;
PREINIT:
static BN_CTX *ctx=NULL;
BIGNUM *ret;
PPCODE:
pr_name("p5_BN_gcd");
if (ctx == NULL) ctx=BN_CTX_new();
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
BN_gcd(ret,a,b,ctx);
void
p5_BN_mod_inverse(a,mod)
BIGNUM *a;
BIGNUM *mod;
PREINIT:
static BN_CTX *ctx=NULL;
BIGNUM *ret;
PPCODE:
pr_name("p5_BN_mod_inverse");
if (ctx == NULL) ctx=BN_CTX_new();
ret=BN_mod_inverse(a,mod,ctx);
EXTEND(sp,1);
PUSHs(sv_newmortal());
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
void
p5_BN_DESTROY(bn)
BIGNUM *bn
CODE:
pr_name("p5_BN_DESTROY");
BN_free(bn);

View file

@ -1,103 +0,0 @@
/* perl/callback.c */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
SV *new_ref(type,obj,mort)
char *type;
char *obj;
{
SV *ret;
if (mort)
ret=sv_newmortal();
else
ret=newSViv(0);
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 idx=%d %08X %s\n",idx,obj,argp);
sv=sv_newmortal();
sv_setref_pv(sv,argp,(void *)obj);
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);
}

View file

@ -1,39 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
$md=SSLeay::MD::new("md5");
foreach (@SSLeay::Cipher::names)
{
($c=SSLeay::Cipher::new($_)) ||
die "'$_' is an unknown cipher algorithm\n";
$data="012345678abcdefghijklmnopqrstuvwxyz";
$c->init("01234567abcdefghABCDEFGH","zyxwvut",1);
$in =$c->update(substr($data, 0, 5));
$in.=$c->update(substr($data, 5,10));
$in.=$c->update(substr($data,15,1));
$in.=$c->update(substr($data,16));
$in.=$c->final();
$c->init("01234567abcdefghABCDEFGH","zyxwvut",0);
$out=$c->update($in);
$out.=$c->final();
($out eq $data) || die "decrypt for $_ failed:$!\n";
$md->init();
$md->update($in);
$digest=$md->final();
print unpack("H*",$digest);
printf " %2d %2d %2d %s\n", $c->key_length(), $c->iv_length(),
$c->block_size(), $c->name();
}

View file

@ -1,10 +0,0 @@
Cipher::new(name) "des-cbc" etc
Cipher::name()
Cipher::key_length()
Cipher::iv_length()
Cipher::block_size()
Cipher::init(key,iv,enc)
Cipher::update(in)
Cipher::final()
Cipher::cipher(in)

View file

@ -1,152 +0,0 @@
#include "p5SSLeay.h"
int boot_cipher()
{
SSLeay_add_all_ciphers();
return(1);
}
MODULE = SSLeay::Cipher PACKAGE = SSLeay::Cipher PREFIX = p5_EVP_C_
VERSIONCHECK: DISABLE
void
p5_EVP_C_new(...)
PREINIT:
EVP_CIPHER_CTX *ctx;
EVP_CIPHER *c;
char *name;
PPCODE:
if ((items == 1) && SvPOK(ST(0)))
name=SvPV(ST(0),na);
else if ((items == 2) && SvPOK(ST(1)))
name=SvPV(ST(1),na);
else
croak("Usage: SSLeay::Cipher::new(type)");
PUSHs(sv_newmortal());
c=EVP_get_cipherbyname(name);
if (c != NULL)
{
ctx=malloc(sizeof(EVP_CIPHER_CTX));
EVP_EncryptInit(ctx,c,NULL,NULL);
sv_setref_pv(ST(0), "SSLeay::Cipher", (void*)ctx);
}
datum
p5_EVP_C_name(ctx)
EVP_CIPHER_CTX *ctx
CODE:
RETVAL.dptr=OBJ_nid2ln(EVP_CIPHER_CTX_nid(ctx));
RETVAL.dsize=strlen(RETVAL.dptr);
OUTPUT:
RETVAL
int
p5_EVP_C_key_length(ctx)
EVP_CIPHER_CTX *ctx
CODE:
RETVAL=EVP_CIPHER_CTX_key_length(ctx);
OUTPUT:
RETVAL
int
p5_EVP_C_iv_length(ctx)
EVP_CIPHER_CTX *ctx
CODE:
RETVAL=EVP_CIPHER_CTX_iv_length(ctx);
OUTPUT:
RETVAL
int
p5_EVP_C_block_size(ctx)
EVP_CIPHER_CTX *ctx
CODE:
RETVAL=EVP_CIPHER_CTX_block_size(ctx);
OUTPUT:
RETVAL
void
p5_EVP_C_init(ctx,key,iv,enc)
EVP_CIPHER_CTX *ctx
datum key
datum iv
int enc
PREINIT:
char loc_iv[EVP_MAX_IV_LENGTH];
char loc_key[EVP_MAX_KEY_LENGTH];
char *ip=loc_iv,*kp=loc_key;
int i;
memset(loc_iv,0,EVP_MAX_IV_LENGTH);
memset(loc_key,0,EVP_MAX_KEY_LENGTH);
CODE:
i=key.dsize;
if (key.dsize > EVP_CIPHER_CTX_key_length(ctx))
i=EVP_CIPHER_CTX_key_length(ctx);
if (i > 0)
{
memset(kp,0,EVP_MAX_KEY_LENGTH);
memcpy(kp,key.dptr,i);
}
else
kp=NULL;
i=iv.dsize;
if (iv.dsize > EVP_CIPHER_CTX_iv_length(ctx))
i=EVP_CIPHER_CTX_iv_length(ctx);
if (i > 0)
{
memcpy(ip,iv.dptr,i);
memset(ip,0,EVP_MAX_IV_LENGTH);
}
else
ip=NULL;
EVP_CipherInit(ctx,EVP_CIPHER_CTX_cipher(ctx),kp,ip,enc);
memset(loc_key,0,sizeof(loc_key));
memset(loc_iv,0,sizeof(loc_iv));
SV *
p5_EVP_C_cipher(ctx,in)
EVP_CIPHER_CTX *ctx;
datum in;
CODE:
RETVAL=newSVpv("",0);
SvGROW(RETVAL,in.dsize+EVP_CIPHER_CTX_block_size(ctx)+1);
EVP_Cipher(ctx,SvPV(RETVAL,na),in.dptr,in.dsize);
SvCUR_set(RETVAL,in.dsize);
OUTPUT:
RETVAL
SV *
p5_EVP_C_update(ctx, in)
EVP_CIPHER_CTX *ctx
datum in
PREINIT:
int i;
CODE:
RETVAL=newSVpv("",0);
SvGROW(RETVAL,in.dsize+EVP_CIPHER_CTX_block_size(ctx)+1);
EVP_CipherUpdate(ctx,SvPV(RETVAL,na),&i,in.dptr,in.dsize);
SvCUR_set(RETVAL,i);
OUTPUT:
RETVAL
SV *
p5_EVP_C_final(ctx)
EVP_CIPHER_CTX *ctx
PREINIT:
int i;
CODE:
RETVAL=newSVpv("",0);
SvGROW(RETVAL,EVP_CIPHER_CTX_block_size(ctx)+1);
if (!EVP_CipherFinal(ctx,SvPV(RETVAL,na),&i))
sv_setpv(RETVAL,"BAD DECODE");
else
SvCUR_set(RETVAL,i);
OUTPUT:
RETVAL
void
p5_EVP_C_DESTROY(ctx)
EVP_CIPHER_CTX *ctx
CODE:
free((char *)ctx);

View file

@ -1,40 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
$g=SSLeay::BN::hex2bn("000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002");
$p=SSLeay::BN::hex2bn("ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff");
$pub=SSLeay::BN::hex2bn("521b5b72d0a23f5f908eff62741b9c43ac65c47ad264a4f8d62d73dfab4938a6e019f81c28d64efd9b47c1b8188566c6184b6064cc42fac2778bd732678148c6cc7601bfe0ed18da76dd7bb976cd2ff0afc7b20f3f81171e2ea6534de061f929");
$priv=SSLeay::BN::hex2bn("6e15c752af3f4cf6d7425164c451eeba760ec0651d12dc3b0ee5002a95af6191268ca47c0fbb3d836136eee795ae4af3a1adad5e04d0dbb04378cae0406ece23ca3b86839c0fd60064c1019c7d18be4dc0ec4be6c1e9ff6b0f5bd76373585503");
$his=SSLeay::BN::hex2bn("d0fb51cd44a8578f55eb0822ede90f07504f4720d7367ff4bf76c27fedbce79d9204421ff7e86bd1dd02031bce4ceccd1d3e7c62679b6eb5fda8238fd4fe07bff573d552795f0d46f25753c688300fb9ed396792b59a49fdf89c8429124b668e");
$sh=SSLeay::BN::hex2bn("66ec34b09bddf86147f6c6efd5ee4e6691e690eb0e90aceda16a742cad0abe531cb61d057aff362001ca19013215140ca2a1dd8966c78105bacbf2161f9cfbd58d351ff87923de77f9c56851037223d48272565416ee769e65a621cefb90b403");
$g2=SSLeay::BN::hex2bn("000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002");
$p2=SSLeay::BN::hex2bn("ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff");
$pub2=SSLeay::BN::hex2bn("d0fb51cd44a8578f55eb0822ede90f07504f4720d7367ff4bf76c27fedbce79d9204421ff7e86bd1dd02031bce4ceccd1d3e7c62679b6eb5fda8238fd4fe07bff573d552795f0d46f25753c688300fb9ed396792b59a49fdf89c8429124b668e");
$priv2=SSLeay::BN::hex2bn("b81d54f52b687669fc8bd8087ac319accc2f94a2feafe09779f4a81e8e01f77290f5bbe84a08003afc4448145be427fad0b9d047889cf361c9dd378b15c1ebd5bda33e051fbd9eba8bf063e2bd836467cddb61f1db5c4b06bea5c9a77fb87b24");
$his2=SSLeay::BN::hex2bn("521b5b72d0a23f5f908eff62741b9c43ac65c47ad264a4f8d62d73dfab4938a6e019f81c28d64efd9b47c1b8188566c6184b6064cc42fac2778bd732678148c6cc7601bfe0ed18da76dd7bb976cd2ff0afc7b20f3f81171e2ea6534de061f929");
$sh2=SSLeay::BN::hex2bn("791faba7a6b592cb68a963945229483dc30f80f5cb295b2b5a59ef618a262d22de0845948a34db83d8bde260b940967ff85593a609e53ee6510aea09b776b4704d5e916917f384458d4790b6e0befcb1cb2f112b850e9ed410a091db80e1db2e");
print "g=".$g->bn2hex."\n";
print "p=".$p->bn2hex."\n";
print "pub=".$pub->bn2hex."\n";
print "priv=".$priv->bn2hex."\n";
print "sh=".$sh->bn2hex."\n";
print "new p - p2 = ".($p-$p2)."\n";
$tmp=$g->mod_exp($priv,$p);
print "XXXXXXXXXXXXXXXX\n";
print "new pub - pub = ".($tmp-$pub)."\n";
$tmp2=$g2->mod_exp($priv2,$p2);
print "XXXXXXXXXXXXXXXX\n";
print $p." pub\n";
print $tmp2." calc pub\n";
print $pub2." txt pub\n";

View file

@ -1,7 +0,0 @@
MD::new(name) "md2", "md5" etc
MD::name()
MD::init()
MD::update(in)
MD::final()

View file

@ -1,83 +0,0 @@
#include "p5SSLeay.h"
int boot_digest()
{
SSLeay_add_all_digests();
return(1);
}
MODULE = SSLeay::MD PACKAGE = SSLeay::MD PREFIX = p5_EVP_MD_
PROTOTYPES: ENABLE
VERSIONCHECK: DISABLE
# SSLeay::MD::new(name) name= md2, md5, sha, sha1, or mdc2
# md->name() - returns the name
# md->init() - reinitalises the digest
# md->update(data) - adds more data to digest
# digest=md->final() - returns digest
#
void
p5_EVP_MD_new(...)
PREINIT:
EVP_MD_CTX *ctx;
EVP_MD *md;
char *name;
PPCODE:
if ((items == 1) && SvPOK(ST(0)))
name=SvPV(ST(0),na);
else if ((items == 2) && SvPOK(ST(1)))
name=SvPV(ST(1),na);
else
croak("Usage: SSLeay::MD::new(type)");
PUSHs(sv_newmortal());
md=EVP_get_digestbyname(name);
if (md != NULL)
{
ctx=malloc(sizeof(EVP_MD_CTX));
EVP_DigestInit(ctx,md);
sv_setref_pv(ST(0), "SSLeay::MD", (void*)ctx);
}
datum
p5_EVP_MD_name(ctx)
EVP_MD_CTX *ctx
CODE:
RETVAL.dptr=OBJ_nid2ln(EVP_MD_type(EVP_MD_CTX_type(ctx)));
RETVAL.dsize=strlen(RETVAL.dptr);
OUTPUT:
RETVAL
void
p5_EVP_MD_init(ctx)
EVP_MD_CTX *ctx
CODE:
EVP_DigestInit(ctx,EVP_MD_CTX_type(ctx));
void
p5_EVP_MD_update(ctx, in)
EVP_MD_CTX *ctx
datum in
CODE:
EVP_DigestUpdate(ctx,in.dptr,in.dsize);
datum
p5_EVP_MD_final(ctx)
EVP_MD_CTX *ctx
PREINIT:
char md[EVP_MAX_MD_SIZE];
int len;
CODE:
EVP_DigestFinal(ctx,md,&len);
RETVAL.dptr=md;
RETVAL.dsize=len;
OUTPUT:
RETVAL
void
p5_EVP_MD_DESTROY(ctx)
EVP_MD_CTX *ctx
CODE:
free((char *)ctx);

View file

@ -1,2 +0,0 @@
ERR::get_error()
ERR::peek_error()

View file

@ -1,46 +0,0 @@
#include "p5SSLeay.h"
int boot_err()
{
SSL_load_error_strings();
return(1);
}
MODULE = SSLeay::ERR PACKAGE = SSLeay::ERR PREFIX = p5_ERR_
PROTOTYPES: ENABLE
VERSIONCHECK: DISABLE
# md->error() - returns the last error in text or numeric context
void
p5_ERR_get_error(...)
PPCODE:
char buf[512];
unsigned long l;
pr_name("p5_ERR_get_code");
EXTEND(sp,1);
PUSHs(sv_newmortal());
l=ERR_get_error();
ERR_error_string(l,buf);
sv_setiv(ST(0),l);
sv_setpv(ST(0),buf);
SvIOK_on(ST(0));
void
p5_ERR_peek_error(...)
PPCODE:
char buf[512];
unsigned long l;
pr_name("p5_ERR_get_code");
EXTEND(sp,1);
PUSHs(sv_newmortal());
l=ERR_peek_error();
ERR_error_string(l,buf);
sv_setiv(ST(0),l);
sv_setpv(ST(0),buf);
SvIOK_on(ST(0));

View file

@ -1,11 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
for (7 .. 7926)
{
my $num = SSLeay::BN::dec2bn($_);
print "$_ is ".($num->is_prime ? 'prime' : 'composite'), "\n";
}

View file

@ -1,18 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
$num=SSLeay::BN::new();
$shift=SSLeay::BN::new();
print "0\n";
$num=SSLeay::BN::hex2bn("1234329378209857309429670349760347603497603496398");
print "1\n";
$s=SSLeay::BN::hex2bn("59");
print "a\n";
$r=$num->lshift(59);
print "b";
print $num->bn2hex."\n";
print $s->bn2hex."\n";
print $r->bn2hex."\n";

View file

@ -1,49 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
$bits=512;
$bits=$ARGV[0] if $#ARGV >= 0;
$p=SSLeay::BN::generate_prime($bits/2,0,sub {print STDERR $_[0]?"+":"."});
print "\n";
$q=SSLeay::BN::generate_prime($bits/2,0,sub {print STDERR $_[0]?"+":"."});
print "\n";
$e=SSLeay::BN::hex2bn("10001");
$t1=$p-1;
$t2=$q-1;
($t1->gcd($e) == 1) || die "p failed the gcd test\n";
($t2->gcd($e) == 1) || die "q failed the gcd test\n";
($q,$p)=($p,$q) if ($p < $q);
$n=$p*$q;
$t=($p-1)*($q-1);
($t->gcd($e) == 1) || die "t failed the gcd test\n";
$d=$e->mod_inverse($t);
$dmp1=$d%($p-1);
$dmq1=$d%($q-1);
$iqmp=$q->mod_inverse($p);
print "n =$n\n";
print "e =$e\n";
print "d =$d\n";
print "dmp1=$dmp1\n";
print "dmq1=$dmq1\n";
print "iqmp=$iqmp\n";
$a=SSLeay::BN::bin2bn("This is an RSA test");
print "Test with\n'".$a->bn2bin."' or\n$a\n";
$t1=$a->mod_exp($e,$n);
print "$t1\n";
$t2=$t1->mod_exp($d,$n);
print "'".$t2->bn2bin."'\n";

View file

@ -1,56 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
sub mul
{
my($ab,$cd,$num)=@_;
if ($num <= 4096)
{
return($ab*$cd);
}
else
{
my($a,$b,$c,$d,$n,$ac,$bd,$m,$t1,$t2);
$n=$num/2;
$a=$ab->mask_bits($n);
$b=$ab->rshift($n);
$c=$cd->mask_bits($n);
$d=$cd->rshift($n);
$t1=($b-$a);
$t2=($c-$d);
$m= &mul($t1,$t2,$n);
$ac=&mul($a,$c,$n);
$bd=&mul($b,$d,$n);
$m=$m+$ac+$bd;
$m=$m->lshift($n);
$bd=$bd->lshift($num);
$r=$ac+$m+$bd;
return($r);
}
}
$num=4096*32;
$a=SSLeay::BN::rand($num);
$b=SSLeay::BN::rand($num);
#for (1 .. 10)
{
$r=&mul($a,$b,$num);
}
#for (1 .. 10)
{
$rr=$a*$b;
}
$res=$rr-$r;
print $res->bn2hex()."\n";

View file

@ -1,4 +1,3 @@
/* perl/p5SSLeay.h */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -55,6 +54,7 @@
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#ifdef __cplusplus
extern "C" {
#endif

View file

@ -1,4 +1,5 @@
#include "p5SSLeay.h"
#include "openssl.h"
static int p5_bio_ex_bio_ptr=0;
static int p5_bio_ex_bio_callback=0;
@ -60,7 +61,7 @@ int ret;
int boot_bio()
{
p5_bio_ex_bio_ptr=
BIO_get_ex_new_index(0,"SSLeay::BIO",ex_new,NULL,
BIO_get_ex_new_index(0,"OpenSSL::BIO",ex_new,NULL,
ex_cleanup);
p5_bio_ex_bio_callback=
BIO_get_ex_new_index(0,"bio_callback",NULL,NULL,
@ -71,7 +72,7 @@ int boot_bio()
return(1);
}
MODULE = SSLeay::BIO PACKAGE = SSLeay::BIO PREFIX = p5_BIO_
MODULE = OpenSSL::BIO PACKAGE = OpenSSL::BIO PREFIX = p5_BIO_
VERSIONCHECK: DISABLE
@ -89,8 +90,8 @@ p5_BIO_new_buffer_ssl_connect(...)
else
arg=NULL;
if ((arg == NULL) || !(sv_derived_from(arg,"SSLeay::SSL::CTX")))
croak("Usage: SSLeay::BIO::new_buffer_ssl_connect(SSL_CTX)");
if ((arg == NULL) || !(sv_derived_from(arg,"OpenSSL::SSL::CTX")))
croak("Usage: OpenSSL::BIO::new_buffer_ssl_connect(SSL_CTX)");
else
{
IV tmp=SvIV((SV *)SvRV(arg));
@ -115,8 +116,8 @@ p5_BIO_new_ssl_connect(...)
else
arg=NULL;
if ((arg == NULL) || !(sv_derived_from(arg,"SSLeay::SSL::CTX")))
croak("Usage: SSLeay::BIO::new_ssl_connect(SSL_CTX)");
if ((arg == NULL) || !(sv_derived_from(arg,"OpenSSL::SSL::CTX")))
croak("Usage: OpenSSL::BIO::new_ssl_connect(SSL_CTX)");
else
{
IV tmp=SvIV((SV *)SvRV(arg));
@ -140,7 +141,7 @@ p5_BIO_new(...)
else if ((items == 2) && SvPOK(ST(1)))
type=SvPV(ST(1),na);
else
croak("Usage: SSLeay::BIO::new(type)");
croak("Usage: OpenSSL::BIO::new(type)");
EXTEND(sp,1);
if (strcmp(type,"connect") == 0)
@ -189,7 +190,7 @@ p5_BIO_push(b,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
* inside the OpenSSL library by the BIO with this
* pushed into */
bio->references++;
RETVAL=BIO_push(b,bio);
@ -210,12 +211,12 @@ p5_BIO_pop(b)
/* 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
* inside OpenSSL. 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);
arg=new_ref("OpenSSL::BIO",(char *)bio,0);
BIO_set_ex_data(bio,p5_bio_ex_bio_ptr,(char *)arg);
PUSHs(arg);
}
@ -355,7 +356,7 @@ p5_BIO_next_bio(b)
arg=(SV *)BIO_get_ex_data(bio,p5_bio_ex_bio_ptr);
if (arg == NULL)
{
arg=new_ref("SSLeay::BIO",(char *)bio,0);
arg=new_ref("OpenSSL::BIO",(char *)bio,0);
BIO_set_ex_data(bio,p5_bio_ex_bio_ptr,(char *)arg);
bio->references++;
PUSHs(arg);
@ -388,7 +389,7 @@ p5_BIO_set_callback(bio,cb,...)
SV *arg2=NULL;
CODE:
if (items > 3)
croak("Usage: SSLeay::BIO::set_callback(bio,callback[,arg]");
croak("Usage: OpenSSL::BIO::set_callback(bio,callback[,arg]");
if (items == 3)
{
arg2=sv_mortalcopy(ST(2));

View file

@ -1,4 +1,5 @@
#include "p5SSLeay.h"
#include "openssl.h"
int sv_to_BIGNUM(var,arg,name)
BIGNUM **var;
@ -7,7 +8,7 @@ char *name;
{
int ret=1;
if (sv_derived_from(arg,"SSLeay::BN"))
if (sv_derived_from(arg,"OpenSSL::BN"))
{
IV tmp = SvIV((SV*)SvRV(arg));
*var = (BIGNUM *) tmp;
@ -16,14 +17,14 @@ char *name;
SV *tmp=sv_newmortal();
*var=BN_new();
BN_set_word(*var,SvIV(arg));
sv_setref_pv(tmp,"SSLeay::BN",(void*)*var);
sv_setref_pv(tmp,"OpenSSL::BN",(void*)*var);
}
else if (SvPOK(arg)) {
char *ptr;
STRLEN len;
SV *tmp=sv_newmortal();
*var=BN_new();
sv_setref_pv(tmp,"SSLeay::BN", (void*)*var);
sv_setref_pv(tmp,"OpenSSL::BN", (void*)*var);
ptr=SvPV(arg,len);
SvGROW(arg,len+1);
ptr[len]='\0';
@ -69,7 +70,7 @@ char *arg;
LEAVE;
}
MODULE = SSLeay::BN PACKAGE = SSLeay::BN PREFIX = p5_BN_
MODULE = OpenSSL::BN PACKAGE = OpenSSL::BN PREFIX = p5_BN_
VERSIONCHECK: DISABLE
@ -83,7 +84,7 @@ p5_BN_new(...)
EXTEND(sp,1);
PUSHs(sv_newmortal());
bn=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)bn);
sv_setref_pv(ST(0), "OpenSSL::BN", (void*)bn);
void
p5_BN_dup(a)
@ -95,7 +96,7 @@ p5_BN_dup(a)
EXTEND(sp,1);
PUSHs(sv_newmortal());
bn=BN_dup(a);
sv_setref_pv(ST(0), "SSLeay::BN", (void*)bn);
sv_setref_pv(ST(0), "OpenSSL::BN", (void*)bn);
void
p5_BN_rand(bits,...)
@ -107,14 +108,14 @@ p5_BN_rand(bits,...)
PPCODE:
pr_name("p5_BN_rand");
if ((items < 1) || (items > 3))
croak("Usage: SSLeay::BN::rand(bits[,top_bit][,bottombit]");
croak("Usage: OpenSSL::BN::rand(bits[,top_bit][,bottombit]");
if (items >= 2) top=(int)SvIV(ST(0));
if (items >= 3) bottom=(int)SvIV(ST(1));
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
BN_rand(ret,bits,top,bottom);
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret);
void
p5_BN_bin2bn(a)
@ -126,7 +127,7 @@ p5_BN_bin2bn(a)
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_bin2bn(a.dptr,a.dsize,NULL);
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret);
void
p5_BN_bn2bin(a)
@ -152,7 +153,7 @@ p5_BN_mpi2bn(a)
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_mpi2bn(a.dptr,a.dsize,NULL);
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret);
void
p5_BN_bn2mpi(a)
@ -178,7 +179,7 @@ p5_BN_hex2bn(a)
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret);
BN_hex2bn(&ret,a.dptr);
void
@ -191,7 +192,7 @@ p5_BN_dec2bn(a)
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret);
BN_dec2bn(&ret,a.dptr);
SV *
@ -241,7 +242,7 @@ p5_BN_add(a,b)
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret);
BN_add(ret,a,b);
void
@ -255,7 +256,7 @@ p5_BN_sub(a,b)
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret);
BN_sub(ret,a,b);
void
@ -263,14 +264,16 @@ p5_BN_mul(a,b)
BIGNUM *a;
BIGNUM *b;
PREINIT:
static BN_CTX *ctx=NULL;
BIGNUM *ret;
PPCODE:
pr_name("p5_BN_mul");
if (ctx == NULL) ctx=BN_CTX_new();
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
BN_mul(ret,a,b);
sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret);
BN_mul(ret,a,b,ctx);
void
p5_BN_div(a,b)
@ -287,8 +290,8 @@ p5_BN_div(a,b)
PUSHs(sv_newmortal());
div=BN_new();
mod=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)div);
sv_setref_pv(ST(1), "SSLeay::BN", (void*)mod);
sv_setref_pv(ST(0), "OpenSSL::BN", (void*)div);
sv_setref_pv(ST(1), "OpenSSL::BN", (void*)mod);
BN_div(div,mod,a,b,ctx);
void
@ -304,7 +307,7 @@ p5_BN_mod(a,b)
EXTEND(sp,1);
PUSHs(sv_newmortal());
rem=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)rem);
sv_setref_pv(ST(0), "OpenSSL::BN", (void*)rem);
BN_mod(rem,a,b,ctx);
void
@ -320,7 +323,7 @@ p5_BN_exp(a,p)
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret);
BN_exp(ret,a,p,ctx);
void
@ -337,7 +340,7 @@ p5_BN_mod_mul(a,b,c)
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret);
BN_mod_mul(ret,a,b,c,ctx);
void
@ -354,7 +357,7 @@ p5_BN_mod_exp(a,b,c)
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret);
BN_mod_exp(ret,a,b,c,ctx);
void
@ -371,20 +374,20 @@ p5_BN_generate_prime(...)
PPCODE:
pr_name("p5_BN_generate_prime");
if ((items < 0) || (items > 4))
croak("Usage: SSLeay::BN::generate_prime(a[,strong][,callback][,cb_arg]");
croak("Usage: OpenSSL::BN::generate_prime(a[,strong][,callback][,cb_arg]");
if (items >= 1) bits=(int)SvIV(ST(0));
if (items >= 2) strong=(int)SvIV(ST(1));
if (items >= 3) callback=ST(2);
if (items == 4) cb_arg=ST(3);
if (callback == NULL)
ret=BN_generate_prime(bits,strong,NULL,NULL,NULL,NULL);
ret=BN_generate_prime(ret,bits,strong,NULL,NULL,NULL,NULL);
else
{
arg.cb=callback;
arg.arg=cb_arg;
ret=BN_generate_prime(bits,strong,NULL,NULL,
ret=BN_generate_prime(ret,bits,strong,NULL,NULL,
generate_prime_callback,(char *)&arg);
}
@ -393,7 +396,7 @@ p5_BN_generate_prime(...)
EXTEND(sp,1);
PUSHs(sv_newmortal());
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret);
void
p5_BN_is_prime(p,...)
@ -408,7 +411,7 @@ p5_BN_is_prime(p,...)
PPCODE:
pr_name("p5_BN_is_prime");
if ((items < 1) || (items > 4))
croak("Usage: SSLeay::BN::is_prime(a[,ncheck][,callback][,callback_arg]");
croak("Usage: OpenSSL::BN::is_prime(a[,ncheck][,callback][,callback_arg]");
if (ctx == NULL) ctx=BN_CTX_new();
if (items >= 2) nchecks=(int)SvIV(ST(1));
if (items >= 3) callback=ST(2);
@ -477,7 +480,7 @@ p5_BN_set_bit(a,b)
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_dup(a);
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret);
BN_set_bit(ret,b);
void
@ -491,7 +494,7 @@ p5_BN_clear_bit(a,b)
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_dup(a);
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret);
BN_clear_bit(ret,b);
void
@ -505,7 +508,7 @@ p5_BN_lshift(a,b)
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret);
if (b == 1)
BN_lshift1(ret,a);
else
@ -522,7 +525,7 @@ p5_BN_rshift(a,b)
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret);
if (b == 1)
BN_rshift1(ret,a);
else
@ -539,7 +542,7 @@ p5_BN_mask_bits(a,b)
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_dup(a);
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret);
BN_mask_bits(ret,b);
void
@ -562,7 +565,7 @@ p5_BN_gcd(a,b)
EXTEND(sp,1);
PUSHs(sv_newmortal());
ret=BN_new();
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret);
BN_gcd(ret,a,b,ctx);
void
@ -575,10 +578,10 @@ p5_BN_mod_inverse(a,mod)
PPCODE:
pr_name("p5_BN_mod_inverse");
if (ctx == NULL) ctx=BN_CTX_new();
ret=BN_mod_inverse(a,mod,ctx);
ret=BN_mod_inverse(ret,a,mod,ctx);
EXTEND(sp,1);
PUSHs(sv_newmortal());
sv_setref_pv(ST(0), "SSLeay::BN", (void*)ret);
sv_setref_pv(ST(0), "OpenSSL::BN", (void*)ret);
void
p5_BN_DESTROY(bn)

View file

@ -1,4 +1,3 @@
/* perl/callback.c */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*

View file

@ -1,4 +1,5 @@
#include "p5SSLeay.h"
#include "openssl.h"
int boot_cipher()
{
@ -6,7 +7,7 @@ int boot_cipher()
return(1);
}
MODULE = SSLeay::Cipher PACKAGE = SSLeay::Cipher PREFIX = p5_EVP_C_
MODULE = OpenSSL::Cipher PACKAGE = OpenSSL::Cipher PREFIX = p5_EVP_C_
VERSIONCHECK: DISABLE
@ -22,14 +23,14 @@ p5_EVP_C_new(...)
else if ((items == 2) && SvPOK(ST(1)))
name=SvPV(ST(1),na);
else
croak("Usage: SSLeay::Cipher::new(type)");
croak("Usage: OpenSSL::Cipher::new(type)");
PUSHs(sv_newmortal());
c=EVP_get_cipherbyname(name);
if (c != NULL)
{
ctx=malloc(sizeof(EVP_CIPHER_CTX));
EVP_EncryptInit(ctx,c,NULL,NULL);
sv_setref_pv(ST(0), "SSLeay::Cipher", (void*)ctx);
sv_setref_pv(ST(0), "OpenSSL::Cipher", (void*)ctx);
}
datum

View file

@ -1,4 +1,5 @@
#include "p5SSLeay.h"
#include "openssl.h"
int boot_digest()
{
@ -6,12 +7,12 @@ int boot_digest()
return(1);
}
MODULE = SSLeay::MD PACKAGE = SSLeay::MD PREFIX = p5_EVP_MD_
MODULE = OpenSSL::MD PACKAGE = OpenSSL::MD PREFIX = p5_EVP_MD_
PROTOTYPES: ENABLE
VERSIONCHECK: DISABLE
# SSLeay::MD::new(name) name= md2, md5, sha, sha1, or mdc2
# OpenSSL::MD::new(name) name= md2, md5, sha, sha1, or mdc2
# md->name() - returns the name
# md->init() - reinitalises the digest
# md->update(data) - adds more data to digest
@ -30,14 +31,14 @@ p5_EVP_MD_new(...)
else if ((items == 2) && SvPOK(ST(1)))
name=SvPV(ST(1),na);
else
croak("Usage: SSLeay::MD::new(type)");
croak("Usage: OpenSSL::MD::new(type)");
PUSHs(sv_newmortal());
md=EVP_get_digestbyname(name);
if (md != NULL)
{
ctx=malloc(sizeof(EVP_MD_CTX));
EVP_DigestInit(ctx,md);
sv_setref_pv(ST(0), "SSLeay::MD", (void*)ctx);
sv_setref_pv(ST(0), "OpenSSL::MD", (void*)ctx);
}
datum

View file

@ -1,4 +1,5 @@
#include "p5SSLeay.h"
#include "openssl.h"
int boot_err()
{
@ -6,7 +7,7 @@ int boot_err()
return(1);
}
MODULE = SSLeay::ERR PACKAGE = SSLeay::ERR PREFIX = p5_ERR_
MODULE = OpenSSL::ERR PACKAGE = OpenSSL::ERR PREFIX = p5_ERR_
PROTOTYPES: ENABLE
VERSIONCHECK: DISABLE

View file

@ -1,4 +1,5 @@
#include "p5SSLeay.h"
#include "openssl.h"
static int p5_ssl_ex_ssl_ptr=0;
static int p5_ssl_ex_ssl_info_callback=0;
@ -44,7 +45,7 @@ int ret;
int boot_ssl()
{
p5_ssl_ex_ssl_ptr=
SSL_get_ex_new_index(0,"SSLeay::SSL",ex_new,NULL,ex_cleanup);
SSL_get_ex_new_index(0,"OpenSSL::SSL",ex_new,NULL,ex_cleanup);
p5_ssl_ex_ssl_info_callback=
SSL_get_ex_new_index(0,"ssl_info_callback",NULL,NULL,
ex_cleanup);
@ -57,7 +58,7 @@ int boot_ssl()
return(1);
}
MODULE = SSLeay::SSL PACKAGE = SSLeay::SSL::CTX PREFIX = p5_SSL_CTX_
MODULE = OpenSSL::SSL PACKAGE = OpenSSL::SSL::CTX PREFIX = p5_SSL_CTX_
VERSIONCHECK: DISABLE
@ -74,7 +75,7 @@ p5_SSL_CTX_new(...)
else if ((items == 2) && SvPOK(ST(1)))
method=SvPV(ST(1),na);
else
croak("Usage: SSLeay::SSL_CTX::new(type)");
croak("Usage: OpenSSL::SSL_CTX::new(type)");
if (strcmp(method,"SSLv3") == 0)
meth=SSLv3_method();
@ -101,7 +102,7 @@ p5_SSL_CTX_new(...)
EXTEND(sp,1);
PUSHs(sv_newmortal());
ctx=SSL_CTX_new(meth);
sv_setref_pv(ST(0), "SSLeay::SSL::CTX", (void*)ctx);
sv_setref_pv(ST(0), "OpenSSL::SSL::CTX", (void*)ctx);
int
p5_SSL_CTX_use_PrivateKey_file(ctx,file,...)
@ -113,7 +114,7 @@ p5_SSL_CTX_use_PrivateKey_file(ctx,file,...)
CODE:
pr_name("p5_SSL_CTX_use_PrivateKey_file");
if (items > 3)
croak("SSLeay::SSL::CTX::use_PrivateKey_file(ssl_ctx,file[,type])");
croak("OpenSSL::SSL::CTX::use_PrivateKey_file(ssl_ctx,file[,type])");
if (items == 3)
{
ptr=SvPV(ST(2),na);
@ -139,7 +140,7 @@ p5_SSL_CTX_set_options(ctx,...)
for (i=1; i<items; i++)
{
if (!SvPOK(ST(i)))
croak("Usage: SSLeay::SSL_CTX::set_options(ssl_ctx[,option,value]+)");
croak("Usage: OpenSSL::SSL_CTX::set_options(ssl_ctx[,option,value]+)");
ptr=SvPV(ST(i),na);
if (strcmp(ptr,"-info_callback") == 0)
{
@ -154,7 +155,7 @@ p5_SSL_CTX_set_options(ctx,...)
}
else
{
croak("SSLeay::SSL_CTX::set_options(): unknown option");
croak("OpenSSL::SSL_CTX::set_options(): unknown option");
}
}
@ -167,7 +168,7 @@ p5_SSL_CTX_DESTROY(ctx)
pr_name_d("p5_SSL_CTX_DESTROY",ctx->references);
SSL_CTX_free(ctx);
MODULE = SSLeay::SSL PACKAGE = SSLeay::SSL PREFIX = p5_SSL_
MODULE = OpenSSL::SSL PACKAGE = OpenSSL::SSL PREFIX = p5_SSL_
void
p5_SSL_new(...)
@ -180,20 +181,20 @@ p5_SSL_new(...)
PPCODE:
pr_name("p5_SSL_new");
if ((items != 1) && (items != 2))
croak("Usage: SSLeay::SSL::new(ssl_ctx)");
if (sv_derived_from(ST(items-1),"SSLeay::SSL::CTX"))
croak("Usage: OpenSSL::SSL::new(ssl_ctx)");
if (sv_derived_from(ST(items-1),"OpenSSL::SSL::CTX"))
{
IV tmp = SvIV((SV*)SvRV(ST(items-1)));
ctx=(SSL_CTX *)tmp;
sv_ctx=ST(items-1);
}
else
croak("ssl_ctx is not of type SSLeay::SSL::CTX");
croak("ssl_ctx is not of type OpenSSL::SSL::CTX");
EXTEND(sp,1);
PUSHs(sv_newmortal());
ssl=SSL_new(ctx);
sv_setref_pv(ST(0), "SSLeay::SSL", (void*)ssl);
sv_setref_pv(ST(0), "OpenSSL::SSL", (void*)ssl);
/* Now this is being a little hairy, we keep a pointer to
* our perl reference. We need to do a different one
@ -317,7 +318,7 @@ p5_SSL_set_options(ssl,...)
for (i=1; i<items; i++)
{
if (!SvPOK(ST(i)))
croak("Usage: SSLeay::SSL::set_options(ssl[,option,value]+)");
croak("Usage: OpenSSL::SSL::set_options(ssl[,option,value]+)");
ptr=SvPV(ST(i),na);
if (strcmp(ptr,"-info_callback") == 0)
{
@ -339,7 +340,7 @@ p5_SSL_set_options(ssl,...)
}
else
{
croak("SSLeay::SSL::set_options(): unknown option");
croak("OpenSSL::SSL::set_options(): unknown option");
}
}
@ -421,7 +422,7 @@ p5_SSL_get_peer_certificate(ssl)
OUTPUT:
RETVAL
MODULE = SSLeay::SSL PACKAGE = SSLeay::SSL::CIPHER PREFIX = p5_SSL_CIPHER_
MODULE = OpenSSL::SSL PACKAGE = OpenSSL::SSL::CIPHER PREFIX = p5_SSL_CIPHER_
int
p5_SSL_CIPHER_get_bits(sc)
@ -452,7 +453,7 @@ p5_SSL_CIPHER_get_name(sc)
OUTPUT:
RETVAL
MODULE = SSLeay::SSL PACKAGE = SSLeay::BIO PREFIX = p5_BIO_
MODULE = OpenSSL::SSL PACKAGE = OpenSSL::BIO PREFIX = p5_BIO_
void
p5_BIO_get_ssl(bio)

View file

@ -1,6 +1,7 @@
#include "p5SSLeay.h"
MODULE = SSLeay::X509 PACKAGE = SSLeay::X509 PREFIX = p5_X509_
#include "openssl.h"
MODULE = OpenSSL::X509 PACKAGE = OpenSSL::X509 PREFIX = p5_X509_
PROTOTYPES: ENABLE
VERSIONCHECK: DISABLE
@ -15,7 +16,7 @@ p5_X509_new(void )
EXTEND(sp,1);
PUSHs(sv_newmortal());
x509=X509_new();
sv_setref_pv(ST(0),"SSLeay::X509",(void *)x509);
sv_setref_pv(ST(0),"OpenSSL::X509",(void *)x509);
char *
p5_X509_get_subject_name(x509)

View file

@ -1,96 +0,0 @@
/* perl/p5SSLeay.h */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#ifdef __cplusplus
extern "C" {
#endif
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#ifdef __cplusplus
}
#endif
typedef struct datum_st
{
char *dptr;
int dsize;
} datum;
#include "crypto.h"
#include "buffer.h"
#include "bio.h"
#include "evp.h"
#include "err.h"
#include "x509.h"
#include "ssl.h"
#if 0
#define pr_name(name) printf("%s\n",name)
#define pr_name_d(name,p2) printf("%s %d\n",name,p2)
#define pr_name_dd(name,p2,p3) printf("%s %d %d\n",name,p2,p3)
#else
#define pr_name(name)
#define pr_name_d(name,p2)
#define pr_name_dd(name,p2,p3)
#endif
SV *new_ref(char *type, char *obj, int mort);
int ex_new(char *obj,SV *data,CRYPTO_EX_DATA *ad,int idx,long argl,char *argp);
void ex_cleanup(char *obj,SV *data,CRYPTO_EX_DATA *ad,int idx,
long argl,char *argp);

View file

@ -1,56 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
$bits=512;
$bits=$ARGV[0] if $#ARGV >= 0;
$q=SSLeay::BN::dec2bn("334533373942443239443435463034324139443635374634423531423146313742443038394230324138363038393539303745363034393946353346323345374537463935433635374238353245344341444241344138413244373443323338334431414134363244443532423243423133433537");
$p=SSLeay::BN::dec2bn("3338413942343132463534373734353742343636444439363131313131353843334536434330363934313646414132453044434138413630434631334134443046313735313632344131433437443642434436423642453234383046393732383538444139393131314339303743393939363744443235443332393332394543384630304634323646333735");
$pp=SSLeay::BN::generate_prime($bits/2,0,sub {print STDERR $_[0]?"+":"."});
printf $pp->is_prime."\n";
printf $p->is_prime."\n";
printf $q->is_prime."\n";
printf "p->length=%d\n",$p->num_bits;
printf "q->length=%d\n",$q->num_bits;
$bits=$p->num_bits+$q->num_bits;
$e=SSLeay::BN::hex2bn("10001");
$t1=$p-1;
$t2=$q-1;
($t1->gcd($e) == 1) || die "p failed the gcd test\n";
($t2->gcd($e) == 1) || die "q failed the gcd test\n";
($q,$p)=($p,$q) if ($p < $q);
$n=$p*$q;
$t=($p-1)*($q-1);
($t->gcd($e) == 1) || die "t failed the gcd test\n";
$d=$e->mod_inverse($t);
$dmp1=$d%($p-1);
$dmq1=$d%($q-1);
$iqmp=$q->mod_inverse($p);
print "n =$n\n";
print "e =$e\n";
print "d =$d\n";
print "dmp1=$dmp1\n";
print "dmq1=$dmq1\n";
print "iqmp=$iqmp\n";
$a=SSLeay::BN::bin2bn("This is an RSA test");
print "Test with\n'".$a->bn2bin."' or\n$a\n";
print "<$a>\n";
$t1=$a->mod_exp($e,$n);
print ">$t1>\n";
$t2=$t1->mod_exp($d,$n);
print "<$t2>\n";

View file

@ -1,72 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
$ssl_ctx=SSL::CTX->new("SSLv3_client");
$ssl_ctx->set_options("-info_callback" =>
sub {
print STDERR $_[0]->state()."\n";
}
);
$conn="localhost:4433";
$conn=$ARGV[0] if $#ARGV >= 0;
$cbio=BIO->new("connect");
$cbio->hostname($conn) || die $ssl->error();
$bbio=BIO->new("buffer");
$sbio=BIO->new("ssl");
$ssl=$ssl_ctx->new_ssl;
$ssl->set_options(-connect_state);
$sbio->set_ssl($ssl);
$sbio->push($cbio);
$bbio->push($sbio);
$bio=$bbio;
#$bio->set_callback(
# sub {
# my($bio,$state,$cmd,$buf,$lart,$ret)=@_;
# print STDERR "$state:$cmd\n";
# return($ret);
# }
# );
$b=$bio;
do {
print STDERR $b->type."\n";
} while ($b=$b->next_bio);
(($ret=$bio->syswrite("GET / HTTP/1.0\r\n\r\n")) > 0) || die $bio->error();
$bio->flush;
$data="";
while (1)
{
$ret=$bio->getline;
$ret =~ s/[\r\n]//g;
print STDERR "$ret\n";
last if $ret eq "";
$server=$1 if $ret=~ /^Server: (.*)/;
}
print "server is $server\n";
$x509=$ssl->get_peer_certificate();
print "version :".$x509->get_version()."\n";
print "serialNumber:".$x509->get_serialNumber()->bn2hex."\n";
print "subject :".$x509->get_subject_name()."\n";
print "issuer :". $x509->get_issuer_name()."\n";
$c=$ssl->get_current_cipher;
($i,$a)=$c->get_bits;
$v=$c->get_version;
$n=$c->get_name;
print "protocol=".$ssl->get_version."\n";
print "bits=$i($a) cipher type=$v cipher=$n\n";

View file

@ -1,49 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
$ssl_ctx=SSL::CTX->new("SSLv3");
$ssl_ctx->set_options("-info_callback" =>
sub {
print STDERR $_[0]->state()."\n";
}
);
$conn="localhost:4433";
$conn=$ARGV[0] if $#ARGV >= 0;
$cbio=BIO->new("connect");
$cbio->hostname($conn) || die $ssl->error();
$ssl=$ssl_ctx->new_ssl;
$sbio=BIO->new("ssl");
$sbio->set_ssl($ssl);
$ssl->set_options("-connect_state");
$bio=BIO->new("buffer");
$sbio->push($cbio);
$bio->push($sbio);
($bio->do_handshake() > 0) || die $bio->error();
(($ret=$bio->syswrite("GET / HTTP/1.0\r\n\r\n")) > 0) || die $ssl->error();
$bio->flush() || die $bio->error();
$data="";
while ($_=$bio->getline())
{
if (/^Server:/)
{
print;
last;
}
}
if ($bio->peek_error())
{
print "There was an error:".$ssl->error();
}
print "exit\n";

View file

@ -1,369 +0,0 @@
issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit)
subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Server test cert (512 bit)
-----BEGIN CERTIFICATE-----
MIIB6TCCAVICAQAwDQYJKoZIhvcNAQEEBQAwWzELMAkGA1UEBhMCQVUxEzARBgNV
BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYD
VQQDExJUZXN0IENBICgxMDI0IGJpdCkwHhcNOTcwNjA5MTM1NzQ2WhcNOTgwNjA5
MTM1NzQ2WjBjMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFuZDEaMBgG
A1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxIzAhBgNVBAMTGlNlcnZlciB0ZXN0IGNl
cnQgKDUxMiBiaXQpMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJ+zw4Qnlf8SMVIP
Fe9GEcStgOY2Ww/dgNdhjeD8ckUJNP5VZkVDTGiXav6ooKXfX3j/7tdkuD8Ey2//
Kv7+ue0CAwEAATANBgkqhkiG9w0BAQQFAAOBgQB4TMR2CvacKE9wAsu9jyCX8YiW
mgCM+YoP6kt4Zkj2z5IRfm7WrycKsnpnOR+tGeqAjkCeZ6/36o9l91RvPnN1VJ/i
xQv2df0KFeMr00IkDdTNAdIWqFkSsZTAY2QAdgenb7MB1joejquYzO2DQIO7+wpH
irObpESxAZLySCmPPg==
-----END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY-----
MIIBPAIBAAJBAJ+zw4Qnlf8SMVIPFe9GEcStgOY2Ww/dgNdhjeD8ckUJNP5VZkVD
TGiXav6ooKXfX3j/7tdkuD8Ey2//Kv7+ue0CAwEAAQJAN6W31vDEP2DjdqhzCDDu
OA4NACqoiFqyblo7yc2tM4h4xMbC3Yx5UKMN9ZkCtX0gzrz6DyF47bdKcWBzNWCj
gQIhANEoojVt7hq+SQ6MCN6FTAysGgQf56Q3TYoJMoWvdiXVAiEAw3e3rc+VJpOz
rHuDo6bgpjUAAXM+v3fcpsfZSNO6V7kCIQCtbVjanpUwvZkMI9by02oUk9taki3b
PzPfAfNPYAbCJQIhAJXNQDWyqwn/lGmR11cqY2y9nZ1+5w3yHGatLrcDnQHxAiEA
vnlEGo8K85u+KwIOimM48ZG8oTk7iFdkqLJR1utT3aU=
-----END RSA PRIVATE KEY-----
subject=/C=US/O=AT&T Bell Laboratories/OU=Prototype Research CA
issuer= /C=US/O=AT&T Bell Laboratories/OU=Prototype Research CA
notBefore=950413210656Z
notAfter =970412210656Z
-----BEGIN X509 CERTIFICATE-----
MIICCDCCAXECAQAwDQYJKoZIhvcNAQEEBQAwTjELMAkGA1UEBhMCVVMxHzAdBgNV
BAoUFkFUJlQgQmVsbCBMYWJvcmF0b3JpZXMxHjAcBgNVBAsUFVByb3RvdHlwZSBS
ZXNlYXJjaCBDQTAeFw05NTA0MTMyMTA2NTZaFw05NzA0MTIyMTA2NTZaME4xCzAJ
BgNVBAYTAlVTMR8wHQYDVQQKFBZBVCZUIEJlbGwgTGFib3JhdG9yaWVzMR4wHAYD
VQQLFBVQcm90b3R5cGUgUmVzZWFyY2ggQ0EwgZwwDQYJKoZIhvcNAQEBBQADgYoA
MIGGAoGAebOmgtSCl+wCYZc86UGYeTLY8cjmW2P0FN8ToT/u2pECCoFdrlycX0OR
3wt0ZhpFXLVNeDnHwEE9veNUih7pCL2ZBFqoIoQkB1lZmXRiVtjGonz8BLm/qrFM
YHb0lme/Ol+s118mwKVxnn6bSAeI/OXKhLaVdYZWk+aEaxEDkVkCAQ8wDQYJKoZI
hvcNAQEEBQADgYEAAZMG14lZmZ8bahkaHaTV9dQf4p2FZiQTFwHP9ZyGsXPC+LT5
dG5iTaRmyjNIJdPWohZDl97kAci79aBndvuEvRKOjLHs3WRGBIwERnAcnY9Mz8u/
zIHK23PjYVxGGaZd669OJwD0CYyqH22HH9nFUGaoJdsv39ChW0NRdLE9+y8=
-----END X509 CERTIFICATE-----
issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit)
subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit)
-----BEGIN CERTIFICATE-----
MIICJjCCAY8CAQAwDQYJKoZIhvcNAQEEBQAwXDELMAkGA1UEBhMCQVUxEzARBgNV
BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYD
VQQDExNUZXN0IFBDQSAoMTAyNCBiaXQpMB4XDTk3MDYwOTEzNTc0M1oXDTAxMDYw
OTEzNTc0M1owWzELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQxGjAY
BgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYDVQQDExJUZXN0IENBICgxMDI0
IGJpdCkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKO7o8t116VP6cgybTsZ
DCZhr95nYlZuya3aCi1IKoztqwWnjbmDFIriOqGFPrZQ+moMETC9D59iRW/dFXSv
1F65ka/XY2hLh9exCCo7XuUcDs53Qp3bI3AmMqHjgzE8oO3ajyJAzJkTTOUecQU2
mw/gI4tMM0LqWMQS7luTy4+xAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAM7achv3v
hLQJcv/65eGEpBXM40ZDVoFQFFJWaY5p883HTqLB1x4FdzsXHH0QKBTcKpWwqyu4
YDm3fb8oDugw72bCzfyZK/zVZPR/hVlqI/fvU109Qoc+7oPvIXWky71HfcK6ZBCA
q30KIqGM/uoM60INq97qjDmCJapagcNBGQs=
-----END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQCju6PLddelT+nIMm07GQwmYa/eZ2JWbsmt2gotSCqM7asFp425
gxSK4jqhhT62UPpqDBEwvQ+fYkVv3RV0r9ReuZGv12NoS4fXsQgqO17lHA7Od0Kd
2yNwJjKh44MxPKDt2o8i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ExZGb3IgRGVtbyBQdXJwb3NlcyBPbmx5MRww
GgYDVQQDExNFbnRydXN0IERlbW8gV2ViIENBMIGdMA0GCSqGSIb3DQEBAQUAA4GL
ADCBhwKBgQCaroS7O1DA0hm4IefNYU1cx/nqOmzEnk291d1XqznDeF4wEgakbkCc
zTKxK791yNpXG5RmngqH7cygDRTHZJ6mfCRn0wGC+AI00F2vYTGqPGRQL1N3lZT0
YDKFC0SQeMMjFIZ1aeQigroFQnHo0VB3zWIMpNkka8PY9lxHZAmWwQIBAzANBgkq
hkiG9w0BAQQFAAOBgQBAx0UMVA1s54lMQyXjMX5kj99FJN5itb8bK1Rk+cegPQPF
cWO9SEWyEjjBjIkjjzAwBkaEszFsNGxemxtXvwjIm1xEUMTVlPEWTs2qnDvAUA9W
YqhWbhH0toGT36236QAsqCZ76rbTRVSSX2BHyJwJMG2tCRv7kRJ//NIgxj3H4w==
-----END CERTIFICATE-----
issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit)
subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit)
-----BEGIN CERTIFICATE-----
MIICJzCCAZACAQAwDQYJKoZIhvcNAQEEBQAwXDELMAkGA1UEBhMCQVUxEzARBgNV
BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYD
VQQDExNUZXN0IFBDQSAoMTAyNCBiaXQpMB4XDTk3MDYwOTEzNTczN1oXDTAxMDYw
OTEzNTczN1owXDELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQxGjAY
BgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYDVQQDExNUZXN0IFBDQSAoMTAy
NCBiaXQpMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCdoWk/3+WcMlfjIrkg
40ketmnQaEogQe1LLcuOJV6rKfUSAsPgwgsabJ/wn8TxA1yy3eKJbFl3O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DHWjMvt+l1pjJBsSEZ0HX9AAIIVx0RQmbFGS+F2Q
hhu5l77WnnZOQ9vvhV5u7NPCUF9nhU3jh60qWWO8mkc=
-----END RSA PRIVATE KEY-----
subject=/C=US/O=RSA Data Security, Inc./OU=Commercial Certification Authority
issuer= /C=US/O=RSA Data Security, Inc./OU=Commercial Certification Authority
notBefore=941104185834Z
notAfter =991103185834Z
-----BEGIN X509 CERTIFICATE-----
MIICIzCCAZACBQJBAAAWMA0GCSqGSIb3DQEBAgUAMFwxCzAJBgNVBAYTAlVTMSAw
HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjErMCkGA1UECxMiQ29tbWVy
Y2lhbCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NDExMDQxODU4MzRaFw05
OTExMDMxODU4MzRaMFwxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdSU0EgRGF0YSBT
ZWN1cml0eSwgSW5jLjErMCkGA1UECxMiQ29tbWVyY2lhbCBDZXJ0aWZpY2F0aW9u
IEF1dGhvcml0eTCBmzANBgkqhkiG9w0BAQEFAAOBiQAwgYUCfgCk+4Fie84QJ93o
975sbsZwmdu41QUDaSiCnHJ/lj+O7Kwpkj+KFPhCdr69XQO5kNTQvAayUTNfxMK/
touPmbZiImDd298ggrTKoi8tUO2UMt7gVY3UaOLgTNLNBRYulWZcYVI4HlGogqHE
7yXpCuaLK44xZtn42f29O2nZ6wIDAQABMA0GCSqGSIb3DQEBAgUAA34AdrW2EP4j
9/dZYkuwX5zBaLxJu7NJbyFHXSudVMQAKD+YufKKg5tgf+tQx6sFEC097TgCwaVI
0v5loMC86qYjFmZsGySp8+x5NRhPJsjjr1BKx6cxa9B8GJ1Qv6km+iYrRpwUqbtb
MJhCKLVLU7tDCZJAuqiqWqTGtotXTcU=
-----END X509 CERTIFICATE-----
subject=/C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority
issuer= /C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority
notBefore=941109235417Z
notAfter =991231235417Z
-----BEGIN X509 CERTIFICATE-----
MIICKTCCAZYCBQJBAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMSAw
HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJl
IFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NDExMDkyMzU0MTda
Fw05OTEyMzEyMzU0MTdaMF8xCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdSU0EgRGF0
YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJlIFNlcnZlciBDZXJ0aWZp
Y2F0aW9uIEF1dGhvcml0eTCBmzANBgkqhkiG9w0BAQEFAAOBiQAwgYUCfgCSznrB
roM+WqqJg1esJQF2DK2ujiw3zus1eGRUA+WEQFHJv48I4oqCCNIWhjdV6bEhAq12
aIGaBaJLyUslZiJWbIgHj/eBWW2EB2VwE3F2Ppt3TONQiVaYSLkdpykaEy5KEVmc
HhXVSVQsczppgrGXOZxtcGdI5d0t1sgeewIDAQABMA0GCSqGSIb3DQEBAgUAA34A
iNHReSHO4ovo+MF9NFM/YYPZtgs4F7boviGNjwC4i1N+RGceIr2XJ+CchcxK9oU7
suK+ktPlDemvXA4MRpX/oRxePug2WHpzpgr4IhFrwwk4fia7c+8AvQKk8xQNMD9h
cHsg/jKjn7P0Z1LctO6EjJY2IN6BCINxIYoPnqk=
-----END X509 CERTIFICATE-----
subject=/C=ZA/SP=Western Cape/L=Cape Town/O=Thawte Consulting cc
/OU=Certification Services Division/CN=Thawte Server CA
/Email=server-certs@thawte.com
issuer= /C=ZA/SP=Western Cape/L=Cape Town/O=Thawte Consulting cc
/OU=Certification Services Division/CN=Thawte Server CA
/Email=server-certs@thawte.com
-----BEGIN CERTIFICATE-----
MIIC+TCCAmICAQAwDQYJKoZIhvcNAQEEBQAwgcQxCzAJBgNVBAYTAlpBMRUwEwYD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axhhKdrpM01bjV0Pc+qQIDAQABAAAAADANBgkqhkiG
9w0BAQQFAAOBgQA+1nJryNt8VBRjRr07ArDAV/3jAH7GjDc9jsrxZS68ost9v06C
TvTNKGL+LISNmFLXl+JXhgGB0JZ9fvyYzNgHQ46HBUng1H6voalfJgS2KdEo50wW
8EFZYMDkT1k4uynwJqkVN2QJK/2q4/A/VCov5h6SlM8Affg2W+1TLqvqkwAA
-----END CERTIFICATE-----
subject=/L=Internet/O=VeriSign, Inc./OU=VeriSign Class 2 CA - Individual Subscriber
issuer= /L=Internet/O=VeriSign, Inc./OU=VeriSign Class 2 CA - Individual Subscriber
-----BEGIN CERTIFICATE-----
MIIEkzCCA/ygAwIBAgIRANDTUpSRL3nTFeMrMayFSPAwDQYJKoZIhvcNAQECBQAw
YjERMA8GA1UEBxMISW50ZXJuZXQxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTQw
MgYDVQQLEytWZXJpU2lnbiBDbGFzcyAyIENBIC0gSW5kaXZpZHVhbCBTdWJzY3Jp
YmVyMB4XDTk2MDYwNDAwMDAwMFoXDTk4MDYwNDIzNTk1OVowYjERMA8GA1UEBxMI
SW50ZXJuZXQxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTQwMgYDVQQLEytWZXJp
U2lnbiBDbGFzcyAyIENBIC0gSW5kaXZpZHVhbCBTdWJzY3JpYmVyMIGfMA0GCSqG
SIb3DQEBAQUAA4GNADCBiQKBgQC6A+2czKGRcYMfm8gdnk+0de99TDDzsqo0v5nb
RsbUmMcdRQ7nsMbRWe0SAb/9QoLTZ/cJ0iOBqdrkz7UpqqKarVoTSdlSMVM92tWp
3bJncZHQD1t4xd6lQVdI1/T6R+5J0T1ukOdsI9Jmf+F28S6g3R3L1SFwiHKeZKZv
z+793wIDAQABo4ICRzCCAkMwggIpBgNVHQMBAf8EggIdMIICGTCCAhUwggIRBgtg
hkgBhvhFAQcBATCCAgAWggGrVGhpcyBjZXJ0aWZpY2F0ZSBpbmNvcnBvcmF0ZXMg
YnkgcmVmZXJlbmNlLCBhbmQgaXRzIHVzZSBpcyBzdHJpY3RseSBzdWJqZWN0IHRv
LCB0aGUgVmVyaVNpZ24gQ2VydGlmaWNhdGlvbiBQcmFjdGljZSBTdGF0ZW1lbnQg
KENQUyksIGF2YWlsYWJsZSBhdDogaHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL0NQ
Uy0xLjA7IGJ5IEUtbWFpbCBhdCBDUFMtcmVxdWVzdHNAdmVyaXNpZ24uY29tOyBv
ciBieSBtYWlsIGF0IFZlcmlTaWduLCBJbmMuLCAyNTkzIENvYXN0IEF2ZS4sIE1v
dW50YWluIFZpZXcsIENBIDk0MDQzIFVTQSBUZWwuICsxICg0MTUpIDk2MS04ODMw
IENvcHlyaWdodCAoYykgMTk5NiBWZXJpU2lnbiwgSW5jLiAgQWxsIFJpZ2h0cyBS
ZXNlcnZlZC4gQ0VSVEFJTiBXQVJSQU5USUVTIERJU0NMQUlNRUQgYW5kIExJQUJJ
TElUWSBMSU1JVEVELqAOBgxghkgBhvhFAQcBAQGhDgYMYIZIAYb4RQEHAQECMC8w
LRYraHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL3JlcG9zaXRvcnkvQ1BTLTEuMDAU
BglghkgBhvhCAQEBAf8EBAMCAgQwDQYJKoZIhvcNAQECBQADgYEApRJRkNBqLLgs
53IR/d18ODdLOWMTZ+QOOxBrq460iBEdUwgF8vmPRX1ku7UiDeNzaLlurE6eFqHq
2zPyK5j60zfTLVJMWKcQWwTJLjHtXrW8pxhNtFc6Fdvy5ZkHnC/9NIl7/t4U6WqB
p4y+p7SdMIkEwIZfds0VbnQyX5MRUJY=
-----END CERTIFICATE-----
subject=/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
issuer= /C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
-----BEGIN CERTIFICATE-----
MIICMTCCAZoCBQKhAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMRcw
FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMg
UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NjAxMjkwMDAwMDBa
Fw05OTEyMzEyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2ln
biwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZp
Y2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyVxZ
nvIbigEUtBDfBEDb41evakVAj4QMC9Ez2dkRz+4CWB8l9yqoRAWq7AMfeH+ek7ma
AKojfdashaJjRcdyJ8z0TMZ1cdI5709C8HXfCpDGjiBvmA/4rCNfcCk2pMmG57Ga
IMtTpYXnPb59mv4kRTPcdhXtD6JxZExlLoFoRacCAwEAATANBgkqhkiG9w0BAQIF
AAOBgQB1Zmw+0c2B27X4LzZRtvdCvM1Cr9wO+hVs+GeTVzrrtpLotgHKjLeOQ7RJ
Zfk+7r11Ri7J/CVdqMcvi5uPaM+0nJcYwE3vH9mvgrPmZLiEXIqaB1JDYft0nls6
NvxMsvwaPxUupVs8G5DsiCnkWRb5zget7Ond2tIxik/W2O8XjQ==
-----END CERTIFICATE-----
subject=/C=US/O=VeriSign, Inc./OU=Class 4 Public Primary Certification Authority
issuer= /C=US/O=VeriSign, Inc./OU=Class 4 Public Primary Certification Authority
-----BEGIN CERTIFICATE-----
MIICMTCCAZoCBQKmAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMRcw
FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgNCBQdWJsaWMg
UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NjAxMjkwMDAwMDBa
Fw05OTEyMzEyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2ln
biwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgNCBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZp
Y2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0LJ1
9njQrlpQ9OlQqZ+M1++RlHDo0iSQdomF1t+s5gEXMoDwnZNHvJplnR+Xrr/phnVj
IIm9gFidBAydqMEk6QvlMXi9/C0MN2qeeIDpRnX57aP7E3vIwUzSo+/1PLBij0pd
O92VZ48TucE81qcmm+zDO3rZTbxtm+gVAePwR6kCAwEAATANBgkqhkiG9w0BAQIF
AAOBgQBT3dPwnCR+QKri/AAa19oM/DJhuBUNlvP6Vxt/M3yv6ZiaYch6s7f/sdyZ
g9ysEvxwyR84Qu1E9oAuW2szaayc01znX1oYx7EteQSWQZGZQbE8DbqEOcY7l/Am
yY7uvcxClf8exwI/VAx49byqYHwCaejcrOICdmHEPgPq0ook0Q==
-----END CERTIFICATE-----

View file

@ -1,64 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
$ssl_ctx=SSL::CTX->new("SSLv3_client");
#$ssl_ctx->set_options("-info_callback" =>
# sub {
# print STDERR $_[0]->state()."\n";
# }
# );
$conn="localhost:4433";
$conn=$ARGV[0] if $#ARGV >= 0;
print $ssl_ctx."\n";
$bio=BIO->new_buffer_ssl_connect($ssl_ctx);
$bio->hostname($conn) || die $bio->error();
#$bio->set_callback(
# sub {
# my($bio,$state,$cmd,$buf,$lart,$ret)=@_;
# print STDERR "$state:$cmd\n";
# return($ret);
# }
# );
#$b=$bio;
#do {
# print STDERR $b->type."\n";
# } while ($b=$b->next_bio);
(($ret=$bio->syswrite("GET / HTTP/1.0\r\n\r\n")) > 0) || die $bio->error();
$bio->flush;
$data="";
while (1)
{
$ret=$bio->getline;
$ret =~ s/[\r\n]//g;
print STDERR "$ret\n";
last if $ret eq "";
$server=$1 if $ret=~ /^Server: (.*)/;
}
print "server is $server\n";
$x509=$ssl->get_peer_certificate();
print "version :".$x509->get_version()."\n";
print "serialNumber:".$x509->get_serialNumber()->bn2hex."\n";
print "subject :".$x509->get_subject_name()."\n";
print "issuer :". $x509->get_issuer_name()."\n";
$c=$ssl->get_current_cipher;
($i,$a)=$c->get_bits;
$v=$c->get_version;
$n=$c->get_name;
$ssl=$bio->get_ssl();
print "protocol=".$ssl->get_version."\n";
print "bits=$i($a) cipher type=$v cipher=$n\n";

View file

@ -1,71 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
$ssl_ctx=SSL::CTX->new("SSLv3");
#$ssl_ctx->set_options("-info_callback" =>
# sub {
# print STDERR $_[0]->state()."\n";
# }
# );
$conn="localhost:4433";
$conn=$ARGV[0] if $#ARGV >= 0;
$bio=BIO->new("connect");
$bio->hostname($conn) || die $ssl->error();
#$bbio=BIO->new("buffer");
#$bbio->push($cbio);
#$bio=$bbio;
#$bio->set_callback(
# sub {
# my($bio,$state,$cmd,$buf,$lart,$ret)=@_;
# print STDERR "$state:$cmd\n";
# return($ret);
# }
# );
print STDERR "-1 ABCD\n";
$ssl=$ssl_ctx->new_ssl;
print STDERR "000 ABCD\n";
$ssl->set_bio($bio);
print STDERR "00 ABCD\n";
(($ret=$ssl->connect()) > 0) || die $ssl->error();
print STDERR "0 ABCD\n";
(($ret=$ssl->syswrite("GET / HTTP/1.0\r\n\r\n")) > 0) || die $ssl->error();
print STDERR "1 ABCD\n";
$data="";
while (1)
{
print STDERR "2 ABCD\n";
$ret=$ssl->sysread($buf,1024);
print STDERR "3 ABCD\n";
last if $ret <= 0;
$data.=$buf;
}
print STDERR "4 ABCD\n";
@a=split(/[\r]\n/,$data);
($server)=grep(/^Server:/,@a);
print "$server\n";
$x509=$ssl->get_peer_certificate();
print "subject:".$x509->get_subject_name()."\n";
print "issuer:". $x509->get_issuer_name()."\n";
$c=$ssl->get_current_cipher;
($i,$a)=$c->get_bits;
$v=$c->get_version;
$n=$c->get_name;
print "protocol=".$ssl->get_version."\n";
print "bits=$i($a) cipher type=$v cipher=$n\n";

View file

@ -1,43 +0,0 @@
SSL_CTX::new(method)
SSLv3
SSLv3_client
SSLv3_server
SSLv23
SSLv23_client
SSLv23_server
SSLv2
SSLv2_client
SSLv2_server
SSL_CTX::use_PrivateKey_file(file[,type])
type eq "der" or "pem". Default == 'pem'.
SSL_CTX::set_options(...)
-info_callback function
SSL::new(SSL_CTX)
SSL::connect(); returns 0, -1 or 1
SSL::accept(); return 0, -1 or 1
SSL::sysread(); as per sysread
SSL::syswrite(); as per syswrite
SSL::set_bio(bio);
SSL::set_options(...)
-info_callback function
-connect_state
-accept_state
SSL::state(); the state in numeric and text form.
SSL::references(); debug stuff
SSL::get_peer_certificate()
SSL::do_handshake()
SSL::renegotiate()
SSL::shutdown()
SSL::get_version()
SSL::get_current_cipher();
(key,alg)=SSL_CIPHER::get_bits();
SSL_CIPHER::get_version();
SSL_CIPHER::get_name();

View file

@ -1,474 +0,0 @@
#include "p5SSLeay.h"
static int p5_ssl_ex_ssl_ptr=0;
static int p5_ssl_ex_ssl_info_callback=0;
static int p5_ssl_ex_ssl_ctx_ptr=0;
static int p5_ssl_ctx_ex_ssl_info_callback=0;
typedef struct ssl_ic_args_st {
SV *cb;
SV *arg;
} SSL_IC_ARGS;
static void p5_ssl_info_callback(ssl,mode,ret)
SSL *ssl;
int mode;
int ret;
{
int i;
SV *me,*cb;
me=(SV *)SSL_get_ex_data(ssl,p5_ssl_ex_ssl_ptr);
cb=(SV *)SSL_get_ex_data(ssl,p5_ssl_ex_ssl_info_callback);
if (cb == NULL)
cb=(SV *)SSL_CTX_get_ex_data(
SSL_get_SSL_CTX(ssl),p5_ssl_ctx_ex_ssl_info_callback);
if (cb != NULL)
{
dSP;
PUSHMARK(sp);
XPUSHs(me);
XPUSHs(sv_2mortal(newSViv(mode)));
XPUSHs(sv_2mortal(newSViv(ret)));
PUTBACK;
i=perl_call_sv(cb,G_DISCARD);
}
else
{
croak("Internal error in SSL p5_ssl_info_callback");
}
}
int boot_ssl()
{
p5_ssl_ex_ssl_ptr=
SSL_get_ex_new_index(0,"SSLeay::SSL",ex_new,NULL,ex_cleanup);
p5_ssl_ex_ssl_info_callback=
SSL_get_ex_new_index(0,"ssl_info_callback",NULL,NULL,
ex_cleanup);
p5_ssl_ex_ssl_ctx_ptr=
SSL_get_ex_new_index(0,"ssl_ctx_ptr",NULL,NULL,
ex_cleanup);
p5_ssl_ctx_ex_ssl_info_callback=
SSL_CTX_get_ex_new_index(0,"ssl_ctx_info_callback",NULL,NULL,
ex_cleanup);
return(1);
}
MODULE = SSLeay::SSL PACKAGE = SSLeay::SSL::CTX PREFIX = p5_SSL_CTX_
VERSIONCHECK: DISABLE
void
p5_SSL_CTX_new(...)
PREINIT:
SSL_METHOD *meth;
SSL_CTX *ctx;
char *method;
PPCODE:
pr_name("p5_SSL_CTX_new");
if ((items == 1) && SvPOK(ST(0)))
method=SvPV(ST(0),na);
else if ((items == 2) && SvPOK(ST(1)))
method=SvPV(ST(1),na);
else
croak("Usage: SSLeay::SSL_CTX::new(type)");
if (strcmp(method,"SSLv3") == 0)
meth=SSLv3_method();
else if (strcmp(method,"SSLv3_client") == 0)
meth=SSLv3_client_method();
else if (strcmp(method,"SSLv3_server") == 0)
meth=SSLv3_server_method();
else if (strcmp(method,"SSLv23") == 0)
meth=SSLv23_method();
else if (strcmp(method,"SSLv23_client") == 0)
meth=SSLv23_client_method();
else if (strcmp(method,"SSLv23_server") == 0)
meth=SSLv23_server_method();
else if (strcmp(method,"SSLv2") == 0)
meth=SSLv2_method();
else if (strcmp(method,"SSLv2_client") == 0)
meth=SSLv2_client_method();
else if (strcmp(method,"SSLv2_server") == 0)
meth=SSLv2_server_method();
else
{
croak("Not passed a valid SSL method name, should be 'SSLv[23] [client|server]'");
}
EXTEND(sp,1);
PUSHs(sv_newmortal());
ctx=SSL_CTX_new(meth);
sv_setref_pv(ST(0), "SSLeay::SSL::CTX", (void*)ctx);
int
p5_SSL_CTX_use_PrivateKey_file(ctx,file,...)
SSL_CTX *ctx;
char *file;
PREINIT:
int i=SSL_FILETYPE_PEM;
char *ptr;
CODE:
pr_name("p5_SSL_CTX_use_PrivateKey_file");
if (items > 3)
croak("SSLeay::SSL::CTX::use_PrivateKey_file(ssl_ctx,file[,type])");
if (items == 3)
{
ptr=SvPV(ST(2),na);
if (strcmp(ptr,"der") == 0)
i=SSL_FILETYPE_ASN1;
else
i=SSL_FILETYPE_PEM;
}
RETVAL=SSL_CTX_use_RSAPrivateKey_file(ctx,file,i);
OUTPUT:
RETVAL
int
p5_SSL_CTX_set_options(ctx,...)
SSL_CTX *ctx;
PREINIT:
int i;
char *ptr;
SV *sv;
CODE:
pr_name("p5_SSL_CTX_set_options");
for (i=1; i<items; i++)
{
if (!SvPOK(ST(i)))
croak("Usage: SSLeay::SSL_CTX::set_options(ssl_ctx[,option,value]+)");
ptr=SvPV(ST(i),na);
if (strcmp(ptr,"-info_callback") == 0)
{
SSL_CTX_set_info_callback(ctx,
p5_ssl_info_callback);
sv=sv_mortalcopy(ST(i+1));
SvREFCNT_inc(sv);
SSL_CTX_set_ex_data(ctx,
p5_ssl_ctx_ex_ssl_info_callback,
(char *)sv);
i++;
}
else
{
croak("SSLeay::SSL_CTX::set_options(): unknown option");
}
}
void
p5_SSL_CTX_DESTROY(ctx)
SSL_CTX *ctx
PREINIT:
SV *sv;
PPCODE:
pr_name_d("p5_SSL_CTX_DESTROY",ctx->references);
SSL_CTX_free(ctx);
MODULE = SSLeay::SSL PACKAGE = SSLeay::SSL PREFIX = p5_SSL_
void
p5_SSL_new(...)
PREINIT:
SV *sv_ctx;
SSL_CTX *ctx;
SSL *ssl;
int i;
SV *arg;
PPCODE:
pr_name("p5_SSL_new");
if ((items != 1) && (items != 2))
croak("Usage: SSLeay::SSL::new(ssl_ctx)");
if (sv_derived_from(ST(items-1),"SSLeay::SSL::CTX"))
{
IV tmp = SvIV((SV*)SvRV(ST(items-1)));
ctx=(SSL_CTX *)tmp;
sv_ctx=ST(items-1);
}
else
croak("ssl_ctx is not of type SSLeay::SSL::CTX");
EXTEND(sp,1);
PUSHs(sv_newmortal());
ssl=SSL_new(ctx);
sv_setref_pv(ST(0), "SSLeay::SSL", (void*)ssl);
/* 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
* count, it will never be DESTROYED */
arg=newSVsv(ST(0));
SSL_set_ex_data(ssl,p5_ssl_ex_ssl_ptr,(char *)arg);
SvREFCNT_inc(sv_ctx);
SSL_set_ex_data(ssl,p5_ssl_ex_ssl_ctx_ptr,(char *)sv_ctx);
int
p5_SSL_connect(ssl)
SSL *ssl;
CODE:
RETVAL=SSL_connect(ssl);
OUTPUT:
RETVAL
int
p5_SSL_accept(ssl)
SSL *ssl;
CODE:
RETVAL=SSL_connect(ssl);
OUTPUT:
RETVAL
int
p5_SSL_sysread(ssl,in,num, ...)
SSL *ssl;
SV *in;
int num;
PREINIT:
int i,n,olen;
int offset;
char *p;
CODE:
offset=0;
if (!SvPOK(in))
sv_setpvn(in,"",0);
SvPV(in,olen);
if (items > 3)
{
offset=SvIV(ST(3));
if (offset < 0)
{
if (-offset > olen)
croak("Offset outside string");
offset+=olen;
}
}
if ((num+offset) > olen)
{
SvGROW(in,num+offset+1);
p=SvPV(in,i);
memset(&(p[olen]),0,(num+offset)-olen+1);
}
p=SvPV(in,n);
i=SSL_read(ssl,p+offset,num);
RETVAL=i;
if (i <= 0) i=0;
SvCUR_set(in,offset+i);
OUTPUT:
RETVAL
int
p5_SSL_syswrite(ssl,in, ...)
SSL *ssl;
SV *in;
PREINIT:
char *ptr;
int len,in_len;
int offset=0;
int n;
CODE:
ptr=SvPV(in,in_len);
if (items > 2)
{
len=SvOK(ST(2))?SvIV(ST(2)):in_len;
if (items > 3)
{
offset=SvIV(ST(3));
if (offset < 0)
{
if (-offset > in_len)
croak("Offset outside string");
offset+=in_len;
}
else if ((offset >= in_len) && (in_len > 0))
croak("Offset outside string");
}
if (len >= (in_len-offset))
len=in_len-offset;
}
else
len=in_len;
RETVAL=SSL_write(ssl,ptr+offset,len);
OUTPUT:
RETVAL
void
p5_SSL_set_bio(ssl,bio)
SSL *ssl;
BIO *bio;
CODE:
bio->references++;
SSL_set_bio(ssl,bio,bio);
int
p5_SSL_set_options(ssl,...)
SSL *ssl;
PREINIT:
int i;
char *ptr;
SV *sv;
CODE:
pr_name("p5_SSL_set_options");
for (i=1; i<items; i++)
{
if (!SvPOK(ST(i)))
croak("Usage: SSLeay::SSL::set_options(ssl[,option,value]+)");
ptr=SvPV(ST(i),na);
if (strcmp(ptr,"-info_callback") == 0)
{
SSL_set_info_callback(ssl,
p5_ssl_info_callback);
sv=sv_mortalcopy(ST(i+1));
SvREFCNT_inc(sv);
SSL_set_ex_data(ssl,
p5_ssl_ex_ssl_info_callback,(char *)sv);
i++;
}
else if (strcmp(ptr,"-connect_state") == 0)
{
SSL_set_connect_state(ssl);
}
else if (strcmp(ptr,"-accept_state") == 0)
{
SSL_set_accept_state(ssl);
}
else
{
croak("SSLeay::SSL::set_options(): unknown option");
}
}
void
p5_SSL_state(ssl)
SSL *ssl;
PREINIT:
int state;
PPCODE:
pr_name("p5_SSL_state");
EXTEND(sp,1);
PUSHs(sv_newmortal());
state=SSL_state(ssl);
sv_setpv(ST(0),SSL_state_string_long(ssl));
sv_setiv(ST(0),state);
SvPOK_on(ST(0));
void
p5_SSL_DESTROY(ssl)
SSL *ssl;
CODE:
pr_name_dd("p5_SSL_DESTROY",ssl->references,ssl->ctx->references);
fprintf(stderr,"SSL_DESTROY %d\n",ssl->references);
SSL_free(ssl);
int
p5_SSL_references(ssl)
SSL *ssl;
CODE:
RETVAL=ssl->references;
OUTPUT:
RETVAL
int
p5_SSL_do_handshake(ssl)
SSL *ssl;
CODE:
RETVAL=SSL_do_handshake(ssl);
OUTPUT:
RETVAL
int
p5_SSL_renegotiate(ssl)
SSL *ssl;
CODE:
RETVAL=SSL_renegotiate(ssl);
OUTPUT:
RETVAL
int
p5_SSL_shutdown(ssl)
SSL *ssl;
CODE:
RETVAL=SSL_shutdown(ssl);
OUTPUT:
RETVAL
char *
p5_SSL_get_version(ssl)
SSL *ssl;
CODE:
RETVAL=SSL_get_version(ssl);
OUTPUT:
RETVAL
SSL_CIPHER *
p5_SSL_get_current_cipher(ssl)
SSL *ssl;
CODE:
RETVAL=SSL_get_current_cipher(ssl);
OUTPUT:
RETVAL
X509 *
p5_SSL_get_peer_certificate(ssl)
SSL *ssl
CODE:
RETVAL=SSL_get_peer_certificate(ssl);
OUTPUT:
RETVAL
MODULE = SSLeay::SSL PACKAGE = SSLeay::SSL::CIPHER PREFIX = p5_SSL_CIPHER_
int
p5_SSL_CIPHER_get_bits(sc)
SSL_CIPHER *sc
PREINIT:
int i,ret;
PPCODE:
EXTEND(sp,2);
PUSHs(sv_newmortal());
PUSHs(sv_newmortal());
ret=SSL_CIPHER_get_bits(sc,&i);
sv_setiv(ST(0),(IV)ret);
sv_setiv(ST(1),(IV)i);
char *
p5_SSL_CIPHER_get_version(sc)
SSL_CIPHER *sc
CODE:
RETVAL=SSL_CIPHER_get_version(sc);
OUTPUT:
RETVAL
char *
p5_SSL_CIPHER_get_name(sc)
SSL_CIPHER *sc
CODE:
RETVAL=SSL_CIPHER_get_name(sc);
OUTPUT:
RETVAL
MODULE = SSLeay::SSL PACKAGE = SSLeay::BIO PREFIX = p5_BIO_
void
p5_BIO_get_ssl(bio)
BIO *bio;
PREINIT:
SSL *ssl;
SV *ret;
int i;
PPCODE:
if ((i=BIO_get_ssl(bio,&ssl)) > 0)
{
ret=(SV *)SSL_get_ex_data(ssl,p5_ssl_ex_ssl_ptr);
ret=sv_mortalcopy(ret);
}
else
ret= &sv_undef;
EXTEND(sp,1);
PUSHs(ret);

View file

@ -1,35 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
$ssl_ctx=SSL::CTX->new("SSLv3");
$ssl_ctx->set_options("-info_callback" =>
sub {
print STDERR $_[0]->state()."\n";
}
);
$ssl_ctx->use_PrivateKey_file("server.pem");
$conn="localhost:4433";
$conn=$ARGV[0] if $#ARGV >= 0;
$bio=BIO->new("connect");
$bio->hostname($conn) || die $ssl->error();
$ssl=$ssl_ctx->new_ssl;
$ssl->set_bio($bio);
(($ret=$ssl->connect()) > 0) || die $ssl->error();
(($ret=$ssl->write("GET / HTTP/1.0\r\n\r\n")) > 0) || die $ssl->error();
while (1)
{
$ret=$ssl->read($buf,10240);
last if ($ret <= 0);
print $buf;
}

View file

@ -1,40 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
$ssl_ctx=SSL::CTX->new("SSLv3");
#$ssl_ctx->set_options("-info_callback" =>
# sub {
# print STDOUT $_[0]->state()."\n";
# }
# );
# create a ssl bio
$bssl=BIO->new("ssl");
$bssl->set_ssl($ssl_ctx->new_ssl()) || die $bssl->error();
$bssl->get_ssl->set_options("-connect_state") || die $ssl->error();
$bssl->set_callback(sub { printf "XXXXXXXXXXXXXXXXXXXXXX %d %s\n",$_[1],$_[0]->type; });
# create connect bio
$host="localhost:4433";
$host=$ARGV[0] if $#ARGV >= 0;
$bio=BIO->new("connect");
$bio->hostname($host) || die $bio->error();
# push it in
$bssl->push($bio);
(($ret=$bssl->write("GET / HTTP/1.0\r\n\r\n")) > 0) || die $bssl->error();
while (1)
{
$ret=$bssl->read($buf,10240);
last if ($ret <= 0);
print $buf;
}

View file

@ -1,12 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
$a=SSLeay::BN::dec2bn("1231353465324563455");
print "a=$a\n".$a->bn2dec."\n";
$b=SSLeay::BN::dec2bn("98790816238765235");
print "a=$a\nb=$b\n";
print $a->gcd($b)."\n";

View file

@ -1,32 +0,0 @@
30373b8dbfc38d360bda81fad2fb462e 8 0 8 des-ecb
a5f61a73a0894979d46c2481e9f27151 8 8 1 des-cfb
a64a08dc69e79becccde95bed6239fca 8 8 1 des-ofb
553d168193e54100524541f2c473b705 8 8 8 des-cbc
bb75383e4aad6d83418dde16c6cea6f5 16 0 8 des-ede
3ea71cd9a2e50d82d66b433e9471eeb2 16 8 1 des-ede-cfb
3d56b76d43dc8d51647773bc9719a355 16 8 1 des-ede-ofb
eafa89aae63167b9798639c0e31223b4 16 8 8 des-ede-cbc
a952f8c409fb0df75a7df1aa54ba30b8 24 0 8 des-ede3
0badccc43a14d8503d33f32a2345bbd2 24 8 1 des-ede3-cfb
bae638c0e33850d02c792ed0e3d6b600 24 8 1 des-ede3-ofb
ec4522bbefabf0198126683e661325e2 24 8 8 des-ede3-cbc
4431f05d198d8afc003aeec85bea01b9 24 8 8 desx-cbc
606af8d6f30c1fd9c647df5eb716ae0f 16 0 1 rc4
4aaaf7e4bc3fd2caa6318a4852f636f4 5 0 1 rc4-40
77e0851e8c96c4a1e26140d1ec822036 16 0 8 idea-ecb
a28e51e283519fde0e128bcb697bc23e 16 8 1 idea-cfb
17d0e70f07de6c08e9673d52987599ab 16 8 1 idea-ofb
0687cf6ca11ee45f8bf9c29525405a4d 16 8 8 idea-cbc
e2268681a63198fe38282b0a1bb6ed36 16 0 8 rc2-ecb
f48748e6386790e639bbee4fccaa5067 16 8 8 rc2-cbc
f250cfe829ef797d6866e32526ec4fe4 5 8 8 rc2-40-cbc
a372f970b6c346341a2899bb872a7349 16 8 1 rc2-cfb
d2da66102dea6b833f0fbf71e2cb4988 16 8 1 rc2-ofb
237b0ef0e4f7fb28a5708d59773caecf 16 0 8 bf-ecb
c58cf5da90472caf0f0b7fafb0590977 16 8 1 bf-cfb
1f3e49e2e27f9ad177a6a64b09d361ed 16 8 1 bf-ofb
66acaf2cb5f301580c59fa17d005b716 16 8 8 bf-cbc
3548c9fe9fcd13f647ae177a15915af9 16 0 8 cast5-ecb
e8d074ad8cc0d3d828da80ab18452f91 16 8 1 cast5-cfb
5331eb4351c2048c27c8a8901fd29e20 16 8 1 cast5-ofb
8033607fdb68598cc62c379af218eeeb 16 8 8 cast5-cbc

View file

@ -1,30 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
($a=SSLeay::BN::new()) || die "unable to make bignum\n";
($b=SSLeay::BN::new()) || die "unable to make bignum\n";
$a=SSLeay::BN::hex2bn("123456789ABCDEF");
$b=SSLeay::BN::hex2bn("123456789ABCDEF");
$mod=SSLeay::BN::hex2bn("fedcba9876543201");
$c=SSLeay::BN::hex2bn("1234");
print "a=".$a->bn2hex()."\n";
print "b=".$b->bn2hex()."\n";
print "c=".$c->bn2hex()."\n";
print $a->mul($b)->bn2hex."\n";
($d,$r)=$b->div($c);
print "($d)($r)\n";
printf "%s x %s + %s\n",$c->bn2hex,$d->bn2hex,$r->bn2hex;
$g=$d;
for (;;)
{
$a=$a->mod_mul($a,$mod);
print $a->bn2hex."\n";
}

View file

@ -1,36 +0,0 @@
30373b8dbfc38d360bda81fad2fb462e 8 0 8 des-ecb
a5f61a73a0894979d46c2481e9f27151 8 8 1 des-cfb
a64a08dc69e79becccde95bed6239fca 8 8 1 des-ofb
553d168193e54100524541f2c473b705 8 8 8 des-cbc
bb75383e4aad6d83418dde16c6cea6f5 16 0 8 des-ede
3ea71cd9a2e50d82d66b433e9471eeb2 16 8 1 des-ede-cfb
3d56b76d43dc8d51647773bc9719a355 16 8 1 des-ede-ofb
eafa89aae63167b9798639c0e31223b4 16 8 8 des-ede-cbc
a952f8c409fb0df75a7df1aa54ba30b8 24 0 8 des-ede3
0badccc43a14d8503d33f32a2345bbd2 24 8 1 des-ede3-cfb
bae638c0e33850d02c792ed0e3d6b600 24 8 1 des-ede3-ofb
ec4522bbefabf0198126683e661325e2 24 8 8 des-ede3-cbc
4431f05d198d8afc003aeec85bea01b9 24 8 8 desx-cbc
606af8d6f30c1fd9c647df5eb716ae0f 16 0 1 rc4
4aaaf7e4bc3fd2caa6318a4852f636f4 5 0 1 rc4-40
77e0851e8c96c4a1e26140d1ec822036 16 0 8 idea-ecb
a28e51e283519fde0e128bcb697bc23e 16 8 1 idea-cfb
17d0e70f07de6c08e9673d52987599ab 16 8 1 idea-ofb
0687cf6ca11ee45f8bf9c29525405a4d 16 8 8 idea-cbc
e2268681a63198fe38282b0a1bb6ed36 16 0 8 rc2-ecb
f48748e6386790e639bbee4fccaa5067 16 8 8 rc2-cbc
f250cfe829ef797d6866e32526ec4fe4 5 8 8 rc2-40-cbc
a372f970b6c346341a2899bb872a7349 16 8 1 rc2-cfb
d2da66102dea6b833f0fbf71e2cb4988 16 8 1 rc2-ofb
237b0ef0e4f7fb28a5708d59773caecf 16 0 8 bf-ecb
c58cf5da90472caf0f0b7fafb0590977 16 8 1 bf-cfb
1f3e49e2e27f9ad177a6a64b09d361ed 16 8 1 bf-ofb
66acaf2cb5f301580c59fa17d005b716 16 8 8 bf-cbc
3548c9fe9fcd13f647ae177a15915af9 16 0 8 cast5-ecb
e8d074ad8cc0d3d828da80ab18452f91 16 8 1 cast5-cfb
5331eb4351c2048c27c8a8901fd29e20 16 8 1 cast5-ofb
8033607fdb68598cc62c379af218eeeb 16 8 8 cast5-cbc
e3a6760eb5e79bf4063cf0791e99842d 16 0 8 rc5-ecb
2f5eab0d0992dcce8615a5a60966391a 16 8 1 rc5-cfb
c5893e49e73342db2957b83b70f23e27 16 8 1 rc5-ofb
683ce60c8b7bf028ec0d3dc0f018a1a4 16 8 8 rc5-cbc

View file

@ -1,28 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
@md=();
($c=SSLeay::Cipher::new("idea")) ||
die "'des' is an unknown cipher algorithm\n";
printf "name =%s\n" ,$c->name();
printf "key length=%2d\n",$c->key_length();
printf "iv length =%2d\n",$c->iv_length();
printf "block size=%2d\n",$c->block_size();
$data="1234";
$c->init("01234567","abcdefgh",1);
$in=$c->update($data);
$in.=$c->final();
$c->init("01234567","abcdefgh",0);
$out=$c->update($in);
$out.=$c->final();
print $data;
print " -> ";
print $out;
print "\n";

View file

@ -1,19 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
@md=();
($c=SSLeay::Cipher::new("idea")) ||
die "'des' is an unknown cipher algorithm\n";
$key=" ";
$iv=" ";
$c->init($key,$iv,0);
while (<>)
{
print $c->update($_);
}
print $c->final();

View file

@ -1,19 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
# 2687145 * 3003 * 10^5072 - 1.
$a=SSLeay::BN::set_word(99);
$b=SSLeay::BN::set_word(100);
$aa=$a->dup;
$bb=$b->dup;
$c=$a*$b;
$bb+=$a;
print "$a*$b=$c\n";
print "$bb\n";

View file

@ -1,38 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
# 2687145 * 3003 * 10^5072 - 1.
$a=SSLeay::BN::set_word(2687145);
$b=SSLeay::BN::set_word(3003);
$c=SSLeay::BN::set_word(10);
$d=SSLeay::BN::set_word(5072);
$e=SSLeay::BN::set_word(1);
print $a->bn2hex()."\n";
print $b->bn2hex()."\n";
print $c->bn2hex()."\n";
print $d->bn2hex()."\n";
print $e->bn2hex()."\n";
$f=(($a->mul($b)->mul($c->exp($d)))->sub($e));
#print "$a $b\n";
$c=$a->mul($b);
print "1->".$c->bn2hex()." \n";
$c=$a*$b;
print "2->".$c->bn2hex()." \n";
$a*=$b;
print "3->$a\n";
print $f->bn2hex()." $a\n";
print $a."\n";
print "$a=(($b*$c)/$d);\n";
$a=(($b*$c)/$d);
print "$a\n";

View file

@ -1,23 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
$num ="a43f6a8885a308d313198a2e03707344a4093822";
$num.="299f31d0082efa98ec4e6c89452821e638d01377";
$num.="be5466cf34e90c6cc0ac29b7c97c50dd3f84d5b5";
$num.="b54709179216d5d98979fb1bd1310ba698dfb5ac";
$num.="2ffd72dbd01adfb7b8e1afed6a267e96ba7c9045";
$num.="f12c7f9924a19947b3916cf70801f2e2858efc16";
$num.="636920d871574e69a458fea3f4933d7e0d95748f";
$num.="728eb658718bcd5882154aee7b54a41dc25a59b5";
$num.="9c30d5392af26013c5d1b023286085f0ca417918";
$num.="b8db38ef8e79dcb0603a180e6c9e0e8bb01e8a3e";
$num.="d71577c1bd314b2778af2fda55605c60e65525f3";
$num.="aa55ab945748986263e8144055ca396a2aab10b6";
$num.="b4cc5c341141e8cea15486af7c8f14a7";
$a=SSLeay::BN::hex2bn($num);
print "num bits =".$a->num_bits."\n";
print $a->is_prime(50,sub {print STDERR $_[0]?"+":"."})."\n";

View file

@ -1,14 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
$a=SSLeay::BN::dec2bn("1234");
foreach (1..4)
{
$a*=$a;
print $a."\n",$a->bn2dec()."\n";
}

View file

@ -1,26 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
@md=();
foreach ("md2", "md5", "sha", "sha1", "mdc2", "ripemd160")
{
($f=MD->new($_)) ||
die "$_ is an unknown message digest algorithm\n";
push(@md,$f);
}
while (<>)
{
foreach $md (@md)
{ $md->update($_); }
}
foreach (@md)
{
$digest=$_->final();
printf "%-4s=%s\n",$_->name(),unpack("H*",$digest);
}

View file

@ -1,15 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
for ($i=1; $i<1000; $i++)
{
$a.=$i%10;
$y=SSLeay::BN::dec2bn($a);
$z=SSLeay::BN::bn2dec($y);
print "$a\n$y\n$z\n";
}

View file

@ -14,83 +14,83 @@ INPUT
T_DATUM
$var.dptr=SvPV($arg,$var.dsize);
T_MD_CTX
if (sv_derived_from($arg, \"SSLeay::MD\")) {
if (sv_derived_from($arg, \"OpenSSL::MD\")) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = (EVP_MD_CTX *) tmp;
}
else
croak(\"$var is not of type SSLeay::MD\")
croak(\"$var is not of type OpenSSL::MD\")
T_CIPHER_CTX
if (sv_derived_from($arg, \"SSLeay::Cipher\")) {
if (sv_derived_from($arg, \"OpenSSL::Cipher\")) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = (EVP_CIPHER_CTX *) tmp;
}
else
croak(\"$var is not of type SSLeay::Cipher\")
croak(\"$var is not of type OpenSSL::Cipher\")
T_BIGNUM
sv_to_BIGNUM(&($var),$arg,\"$var is not of type SSLeay::MD, int or string\")
sv_to_BIGNUM(&($var),$arg,\"$var is not of type OpenSSL::MD, int or string\")
T_SSL_METHOD
if (sv_derived_from($arg, \"SSLeay::SSL::METHOD\")) {
if (sv_derived_from($arg, \"OpenSSL::SSL::METHOD\")) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = (SSL_METHOD *) tmp;
}
else
croak(\"$var is not of type SSLeay::SSL::METHOD\")
croak(\"$var is not of type OpenSSL::SSL::METHOD\")
T_SSL_CTX
if (sv_derived_from($arg, \"SSLeay::SSL::CTX\")) {
if (sv_derived_from($arg, \"OpenSSL::SSL::CTX\")) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = (SSL_CTX *) tmp;
}
else
croak(\"$var is not of type SSLeay::SSL::CTX\")
croak(\"$var is not of type OpenSSL::SSL::CTX\")
T_SSL_CIPHER
if (sv_derived_from($arg, \"SSLeay::SSL::CIPHER\")) {
if (sv_derived_from($arg, \"OpenSSL::SSL::CIPHER\")) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = (SSL_CIPHER *) tmp;
}
else
croak(\"$var is not of type SSLeay::SSL::CIPHER\")
croak(\"$var is not of type OpenSSL::SSL::CIPHER\")
T_SSL
if (sv_derived_from($arg, \"SSLeay::SSL\")) {
if (sv_derived_from($arg, \"OpenSSL::SSL\")) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = (SSL *) tmp;
}
else
croak(\"$var is not of type SSLeay::SSL\")
croak(\"$var is not of type OpenSSL::SSL\")
T_BIO
if (sv_derived_from($arg, \"SSLeay::BIO\")) {
if (sv_derived_from($arg, \"OpenSSL::BIO\")) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = (BIO *) tmp;
}
else
croak(\"$var is not of type SSLeay::BIO\")
croak(\"$var is not of type OpenSSL::BIO\")
T_X509
if (sv_derived_from($arg, \"SSLeay::X509\")) {
if (sv_derived_from($arg, \"OpenSSL::X509\")) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = (X509 *) tmp;
}
else
croak(\"$var is not of type SSLeay::X509\")
croak(\"$var is not of type OpenSSL::X509\")
OUTPUT
T_DATUM
sv_setpvn($arg,$var.dptr,$var.dsize);
T_MD_CTX
sv_setref_pv($arg, \"SSLeay::MD\", (void*)$var);
sv_setref_pv($arg, \"OpenSSL::MD\", (void*)$var);
T_CIPHER_CTX
sv_setref_pv($arg, \"SSLeay::Cipher\", (void*)$var);
sv_setref_pv($arg, \"OpenSSL::Cipher\", (void*)$var);
T_BIGNUM
sv_setref_pv($arg, \"SSLeay::BN\", (void*)$var);
sv_setref_pv($arg, \"OpenSSL::BN\", (void*)$var);
T_SSL_METHOD
sv_setref_pv($arg, \"SSLeay::SSL::METHOD\", (void*)$var);
sv_setref_pv($arg, \"OpenSSL::SSL::METHOD\", (void*)$var);
T_SSL_CTX
sv_setref_pv($arg, \"SSLeay::SSL::CTX\", (void*)$var);
sv_setref_pv($arg, \"OpenSSL::SSL::CTX\", (void*)$var);
T_SSL_CIPHER
sv_setref_pv($arg, \"SSLeay::SSL::CIPHER\", (void*)$var);
sv_setref_pv($arg, \"OpenSSL::SSL::CIPHER\", (void*)$var);
T_SSL
sv_setref_pv($arg, \"SSLeay::SSL\", (void*)$var);
sv_setref_pv($arg, \"OpenSSL::SSL\", (void*)$var);
T_BIO
sv_setref_pv($arg, \"SSLeay::BIO\", (void*)$var);
sv_setref_pv($arg, \"OpenSSL::BIO\", (void*)$var);
T_X509
sv_setref_pv($arg, \"SSLeay::X509\", (void*)$var);
sv_setref_pv($arg, \"OpenSSL::X509\", (void*)$var);

View file

@ -1,6 +0,0 @@
X509::new()
X509::get_verson()
X509::get_serial_number()
X509::get_subject_name()
X509::get_issuer_name()

View file

@ -1,74 +0,0 @@
#include "p5SSLeay.h"
MODULE = SSLeay::X509 PACKAGE = SSLeay::X509 PREFIX = p5_X509_
PROTOTYPES: ENABLE
VERSIONCHECK: DISABLE
void
p5_X509_new(void )
PREINIT:
X509 *x509;
SV *arg;
PPCODE:
pr_name("p5_X509_new");
EXTEND(sp,1);
PUSHs(sv_newmortal());
x509=X509_new();
sv_setref_pv(ST(0),"SSLeay::X509",(void *)x509);
char *
p5_X509_get_subject_name(x509)
X509 *x509;
PREINIT:
char *p;
X509_NAME *name;
char buf[1024];
int i;
CODE:
name=X509_get_subject_name(x509);
X509_NAME_oneline(name,buf,sizeof(buf));
p= &(buf[0]);
RETVAL=p;
OUTPUT:
RETVAL
char *
p5_X509_get_issuer_name(x509)
X509 *x509;
PREINIT:
char *p;
X509_NAME *name;
char buf[1024];
int i;
CODE:
name=X509_get_issuer_name(x509);
X509_NAME_oneline(name,buf,sizeof(buf));
p= &(buf[0]);
RETVAL=p;
OUTPUT:
RETVAL
int
p5_X509_get_version(x509)
X509 *x509;
CODE:
RETVAL=X509_get_version(x509);
OUTPUT:
RETVAL
BIGNUM *
p5_X509_get_serialNumber(x509)
X509 *x509;
CODE:
RETVAL=ASN1_INTEGER_to_BN(X509_get_serialNumber(x509),NULL);
OUTPUT:
RETVAL
void
p5_X509_DESTROY(x509)
X509 *x509;
CODE:
pr_name("p5_X509_DESTROY");
X509_free(x509);

View file

@ -1,102 +0,0 @@
/* perl/xstmp.c */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
/*
* This file was generated automatically by xsubpp version 1.9402 from the
* contents of SSLeay.xs. Do not edit this file, edit SSLeay.xs instead.
*
* ANY CHANGES MADE HERE WILL BE LOST!
*
*/
#line 1 "SSLeay.xs"
#ifdef __cplusplus
extern "C" {
#endif
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#ifdef __cplusplus
}
#endif
typedef struct datum_st
{
char *dptr;
int dsize;
} datum;
#include "crypto.h"
#include "buffer.h"
#include "bio.h"
#include "evp.h"
#include "err.h"
#include "x509.h"
#include "ssl.h"
#if 0
#define pr_name(name) printf("%s\n",name)
#define pr_name_d(name,p2) printf("%s %d\n",name,p2)
#define pr_name_dd(name,p2,p3) printf("%s %d %d\n",name,p2,p3)
#else
#define pr_name(name)
#define pr_name_d(name,p2)
#define pr_name_dd(name,p2,p3)
#endif
#include "callback.c"

View file

@ -1,7 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
$message=SSLeay::BN::dec2bn("936345681743241125150760694794510965960940252288797108931456691368672287489405603308617928680920874760917824938589009714909675985261365549781893129784821682998948722");
print $message->bn2hex."\n";

View file

@ -1,19 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
$a=SSLeay::BN::new();
$a+="1234567";
print $a->bn2hex()."\n";
for (1 .. 20)
{
$a*=$a;
$b=$a->bn2hex();
print " ".$b."\n".length($b)."\n";
}

View file

@ -1,32 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
use Benchmark;
$buf=('x' x (1024*1024));
$buf=('x' x (1024*1024));
@md=();
foreach $name ("md2", "mdc2", "sha", "ripemd160", "sha1", "md5")
{
if (($name eq "md2") || ($name eq "mdc2"))
{ $num=5; }
else { $num=100; }
$t=timeit($num,'&hash($name)');
printf "%6d000 bytes/sec:$name\n",int(($num*1024*1024)/$t->[1]/1000);
}
sub hash
{
my($name)=@_;
my($f,$digest);
($f=MD->new($name)) ||
die "$_ is an unknown message digest algorithm\n";
$f->update($buf);
$digest=$f->final();
}

View file

@ -1,22 +0,0 @@
#!/usr/local/bin/perl
use ExtUtils::testlib;
use SSLeay;
$a=SSLeay::BN::dec2bn("12345678901234567890");
$b=SSLeay::BN::dec2bn("98765432109876543210");
print "a=$a\n";
print "b=$b\n";
$n=$a*$b;
$m=$n+"1223123235345634764534567889";
$l=$m*88888888;
$r=$l/$b;
print "a=$a\n";
print "b=$b\n";
print "n=$n\n";
print "m=$m\n";
print "l=$l\n";
print "r=$r\n";