Commit a0ecb9b8 authored by Richard Levitte's avatar Richard Levitte
Browse files

Remove the perl/ subdirectory. It hasn't been worked on for ages, is

very broken, and there are working modules in CPAN, which makes our
module even more moot.
parent 4bf4bc78
Loading
Loading
Loading
Loading
+1 −17
Original line number Diff line number Diff line

  OpenSSL STATUS                           Last modified at
  ______________                           $Date: 2002/02/28 12:42:00 $
  ______________                           $Date: 2002/02/28 22:07:50 $

  DEVELOPMENT STATE

@@ -91,22 +91,6 @@
                    which apparently is not flexible enough to generate
                    libcrypto)


    o  The perl/ stuff needs a major overhaul. Currently it's
       totally obsolete. Either we clean it up and enhance it to be up-to-date
       with the C code or we also could replace it with the really nice
       Net::SSLeay package we can find under
       http://www.neuronio.pt/SSLeay.pm.html.  Ralf uses this package for a
       longer time and it works fine and is a nice Perl module. Best would be
       to convince the author to work for the OpenSSL project and create a
       Net::OpenSSL or Crypt::OpenSSL package out of it and maintains it for
       us.

       Status: Ralf thinks we should both contact the author of Net::SSLeay
               and look how much effort it is to bring Eric's perl/ stuff up
               to date.
               Paul +1

  WISHES

    o  Add variants of DH_generate_parameters() and BN_generate_prime() [etc?]

perl/MANIFEST

deleted100644 → 0
+0 −17
Original line number Diff line number Diff line
README.1ST
MANIFEST
Makefile.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
t/01-use.t
t/02-version.t
t/03-bio.t

perl/Makefile.PL

deleted100644 → 0
+0 −45
Original line number Diff line number Diff line
##
##  Makefile.PL -- Perl MakeMaker specification
##

open(IN,"<../Makefile.ssl") || die "unable to open Makefile.ssl!\n";
while(<IN>) {
    $V=$1 if (/^VERSION=(.*)$/);
}
close(IN);
print "Configuring companion Perl module for OpenSSL $V\n";

use ExtUtils::MakeMaker;

WriteMakefile(
    'OPTIMIZE'      => '',
    'DISTNAME'      => "openssl-$V",
    'NAME'          => 'OpenSSL',
    'VERSION_FROM'  => 'OpenSSL.pm',
    'LIBS'          => ( $^O eq 'MSWin32'
                         ? [ '-L../out32dll -lssleay32 -llibeay32' ]
                         : [ '-L.. -lssl -lcrypto' ]                 ),
    'DEFINE'        => '',
    'INC'           => '-I../include',
    'H'             => ['openssl.h'],
    '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',
    },
);

perl/OpenSSL.pm

deleted100644 → 0
+0 −90
Original line number Diff line number Diff line
##
##  OpenSSL.pm
##

package OpenSSL;

require 5.000;
use Exporter;
use DynaLoader;

@ISA    = qw(Exporter DynaLoader);
@EXPORT = qw();

$VERSION = '0.94';
bootstrap OpenSSL;

@OpenSSL::BN::ISA        = qw(OpenSSL::ERR);
@OpenSSL::MD::ISA        = qw(OpenSSL::ERR);
@OpenSSL::Cipher::ISA    = qw(OpenSSL::ERR);
@OpenSSL::SSL::CTX::ISA  = qw(OpenSSL::ERR);
@OpenSSL::BIO::ISA       = qw(OpenSSL::ERR);
@OpenSSL::SSL::ISA       = qw(OpenSSL::ERR);

@BN::ISA                 = qw(OpenSSL::BN);
@MD::ISA                 = qw(OpenSSL::MD);
@Cipher::ISA             = qw(OpenSSL::Cipher);
@SSL::ISA                = qw(OpenSSL::SSL);
@SSL::CTX::ISA           = qw(OpenSSL::SSL::CTX);
@BIO::ISA                = qw(OpenSSL::BIO);

@OpenSSL::MD::names = qw(
    md2 md5 sha sha1 ripemd160 mdc2
);

@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
    desx-cbc rc4 rc4-40
    idea-ecb idea-cfb idea-ofb idea-cbc
    rc2-ecb rc2-cbc rc2-40-cbc rc2-cfb rc2-ofb
    bf-ecb bf-cfb bf-ofb bf-cbc
    cast5-ecb cast5-cfb cast5-ofb cast5-cbc
    rc5-ecb rc5-cfb rc5-ofb rc5-cbc
);

sub OpenSSL::SSL::CTX::new_ssl { 
    OpenSSL::SSL::new($_[0]);
}

sub OpenSSL::ERR::error {
    my($o) = @_;
    my($s, $ret);

    while (($s = $o->get_error()) != 0) {
        $ret.=$s."\n";
    }
    return($ret);
}

@OpenSSL::Cipher::aliases = qw(
    des desx des3 idea rc2 bf cast
);

package OpenSSL::BN;

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]; OpenSSL::BN::sub($_[0],$_[1]); },
"*"    => sub { mul($_[0],$_[1]); },
"**"   => sub { ($_[1],$_[0])=($_[0],$_[1]) if $_[2]; OpenSSL::BN::exp($_[0],$_[1]); },
"/"    => sub { ($_[1],$_[0])=($_[0],$_[1]) if $_[2]; (div($_[0],$_[1]))[0]; },
"%"    => sub { ($_[1],$_[0])=($_[0],$_[1]) if $_[2]; mod($_[0],$_[1]); },
"<<"   => sub { lshift($_[0],$_[1]); },
">>"   => sub { rshift($_[0],$_[1]); },
"<=>"  => sub { OpenSSL::BN::cmp($_[0],$_[1]); },
'""'   => sub { bn2dec($_[0]); },
'0+'   => sub { dec2bn($_[0]); },
"bool" => sub { ref($_[0]) eq "OpenSSL::BN"; };

sub OpenSSL::BIO::do_accept { 
    OpenSSL::BIO::do_handshake(@_);
}

1;

perl/OpenSSL.xs

deleted100644 → 0
+0 −109
Original line number Diff line number Diff line
/*
**  OpenSSL.xs
*/

#include "openssl.h"

SV *
new_ref(type, obj, mort)
  char *type;
  char *obj;
{
    SV *ret;

    if (mort)
        ret = sv_newmortal();
    else
        ret = newSViv(0);
#ifdef DEBUG
    printf(">new_ref %d\n",type);
#endif
    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;

#ifdef DEBUG
    printf("ex_new %08X %s\n",obj,argp); 
#endif
    sv = sv_newmortal();
    sv_setref_pv(sv, argp, (void *)obj);
#ifdef DEBUG
    printf("%d>new_ref '%s'\n", sv, argp);
#endif
    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");
#ifdef DEBUG
    printf("ex_cleanup %08X %s\n", obj, argp);
#endif
    if (data != NULL)
        SvREFCNT_dec((SV *)data);
}

MODULE = OpenSSL  PACKAGE = OpenSSL

PROTOTYPES: ENABLE

BOOT:
    boot_bio();
    boot_cipher();
    boot_digest();
    boot_err();
    boot_ssl();

	/*								*/
	/* The next macro is the completely correct way to call a C	*/
	/* function that uses perl calling conventions but is not	*/
	/* registered with perl.					*/
	/*								*/
	/* The second macro seems to work for this context.  (We just	*/
	/* need a mark for the called function since we don't have	*/
	/* any local variables and what-not.)				*/
	/*								*/
	/* Unfortunately, we need to do this because these boot_*	*/
	/* functions are auto-generated by xsubpp and are normally	*/
	/* called from DyncLoader, but we're pulling them in here.	*/
	/*								*/
#define FULL_callBootFunc(func) { \
	    dSP; \
	    ENTER; \
	    SAVETMPS; \
	    PUSHMARK(SP); \
    		func(); \
	    FREETMPS; \
	    LEAVE; \
	}
#define callBootFunc(func) { \
	    PUSHMARK(SP); \
    		func(); \
	}
    callBootFunc(boot_OpenSSL__BN);
    callBootFunc(boot_OpenSSL__BIO);
    callBootFunc(boot_OpenSSL__Cipher);
    callBootFunc(boot_OpenSSL__MD);
    callBootFunc(boot_OpenSSL__ERR);
    callBootFunc(boot_OpenSSL__SSL);
    callBootFunc(boot_OpenSSL__X509);
Loading