Initial Commit

This commit is contained in:
root
2017-02-25 23:55:24 +01:00
commit 1fe2e8ab62
4868 changed files with 1487355 additions and 0 deletions

6
openssl-1.0.2f/util/FreeBSD.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
perl util/perlpath.pl /usr/bin
perl util/ssldir.pl /usr/local
perl util/mk1mf.pl FreeBSD >Makefile.FreeBSD
perl Configure FreeBSD

123
openssl-1.0.2f/util/add_cr.pl Executable file
View File

@@ -0,0 +1,123 @@
#!/usr/local/bin/perl
#
# This adds a copyright message to a souce code file.
# It also gets the file name correct.
#
# perl util/add_cr.pl *.[ch] */*.[ch] */*/*.[ch]
#
foreach (@ARGV)
{
&dofile($_);
}
sub dofile
{
local($file)=@_;
open(IN,"<$file") || die "unable to open $file:$!\n";
print STDERR "doing $file\n";
@in=<IN>;
return(1) if ($in[0] =~ / NOCW /);
@out=();
open(OUT,">$file.out") || die "unable to open $file.$$:$!\n";
push(@out,"/* $file */\n");
if (($in[1] !~ /^\/\* Copyright \(C\) [0-9-]+ Eric Young \(eay\@cryptsoft.com\)/))
{
push(@out,&Copyright);
$i=2;
@a=grep(/ Copyright \(C\) /,@in);
if ($#a >= 0)
{
while (($i <= $#in) && ($in[$i] ne " */\n"))
{ $i++; }
$i++ if ($in[$i] eq " */\n");
while (($i <= $#in) && ($in[$i] =~ /^\s*$/))
{ $i++; }
push(@out,"\n");
for ( ; $i <= $#in; $i++)
{ push(@out,$in[$i]); }
}
else
{ push(@out,@in); }
}
else
{
shift(@in);
push(@out,@in);
}
print OUT @out;
close(IN);
close(OUT);
rename("$file","$file.orig") || die "unable to rename $file:$!\n";
rename("$file.out",$file) || die "unable to rename $file.out:$!\n";
}
sub Copyright
{
return <<'EOF';
/* 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.]
*/
EOF
}

134
openssl-1.0.2f/util/bat.sh Executable file
View File

@@ -0,0 +1,134 @@
#!/usr/local/bin/perl
$infile="/home/eay/ssl/SSLeay/MINFO";
open(IN,"<$infile") || die "unable to open $infile:$!\n";
$_=<IN>;
for (;;)
{
chop;
($key,$val)=/^([^=]+)=(.*)/;
if ($key eq "RELATIVE_DIRECTORY")
{
if ($lib ne "")
{
$uc=$lib;
$uc =~ s/^lib(.*)\.a/$1/;
$uc =~ tr/a-z/A-Z/;
$lib_nam{$uc}=$uc;
$lib_obj{$uc}.=$libobj." ";
}
last if ($val eq "FINISHED");
$lib="";
$libobj="";
$dir=$val;
}
if ($key eq "TEST")
{ $test.=&var_add($dir,$val); }
if (($key eq "PROGS") || ($key eq "E_OBJ"))
{ $e_exe.=&var_add($dir,$val); }
if ($key eq "LIB")
{
$lib=$val;
$lib =~ s/^.*\/([^\/]+)$/$1/;
}
if ($key eq "EXHEADER")
{ $exheader.=&var_add($dir,$val); }
if ($key eq "HEADER")
{ $header.=&var_add($dir,$val); }
if ($key eq "LIBSRC")
{ $libsrc.=&var_add($dir,$val); }
if (!($_=<IN>))
{ $_="RELATIVE_DIRECTORY=FINISHED\n"; }
}
close(IN);
@a=split(/\s+/,$libsrc);
foreach (@a)
{
print "${_}.c\n";
}
sub var_add
{
local($dir,$val)=@_;
local(@a,$_,$ret);
return("") if $no_engine && $dir =~ /\/engine/;
return("") if $no_idea && $dir =~ /\/idea/;
return("") if $no_rc2 && $dir =~ /\/rc2/;
return("") if $no_rc4 && $dir =~ /\/rc4/;
return("") if $no_rsa && $dir =~ /\/rsa/;
return("") if $no_rsa && $dir =~ /^rsaref/;
return("") if $no_dsa && $dir =~ /\/dsa/;
return("") if $no_dh && $dir =~ /\/dh/;
if ($no_des && $dir =~ /\/des/)
{
if ($val =~ /read_pwd/)
{ return("$dir/read_pwd "); }
else
{ return(""); }
}
return("") if $no_mdc2 && $dir =~ /\/mdc2/;
return("") if $no_sock && $dir =~ /\/proxy/;
return("") if $no_bf && $dir =~ /\/bf/;
return("") if $no_cast && $dir =~ /\/cast/;
$val =~ s/^\s*(.*)\s*$/$1/;
@a=split(/\s+/,$val);
grep(s/\.[och]$//,@a);
@a=grep(!/^e_.*_3d$/,@a) if $no_des;
@a=grep(!/^e_.*_d$/,@a) if $no_des;
@a=grep(!/^e_.*_i$/,@a) if $no_idea;
@a=grep(!/^e_.*_r2$/,@a) if $no_rc2;
@a=grep(!/^e_.*_bf$/,@a) if $no_bf;
@a=grep(!/^e_.*_c$/,@a) if $no_cast;
@a=grep(!/^e_rc4$/,@a) if $no_rc4;
@a=grep(!/(^s2_)|(^s23_)/,@a) if $no_ssl2;
@a=grep(!/(^s3_)|(^s23_)/,@a) if $no_ssl3;
@a=grep(!/(_sock$)|(_acpt$)|(_conn$)|(^pxy_)/,@a) if $no_sock;
@a=grep(!/(^md2)|(_md2$)/,@a) if $no_md2;
@a=grep(!/(^md5)|(_md5$)/,@a) if $no_md5;
@a=grep(!/(^d2i_r_)|(^i2d_r_)/,@a) if $no_rsa;
@a=grep(!/(^p_open$)|(^p_seal$)/,@a) if $no_rsa;
@a=grep(!/(^pem_seal$)/,@a) if $no_rsa;
@a=grep(!/(m_dss$)|(m_dss1$)/,@a) if $no_dsa;
@a=grep(!/(^d2i_s_)|(^i2d_s_)|(_dsap$)/,@a) if $no_dsa;
@a=grep(!/^n_pkey$/,@a) if $no_rsa || $no_rc4;
@a=grep(!/_dhp$/,@a) if $no_dh;
@a=grep(!/(^sha[^1])|(_sha$)|(m_dss$)/,@a) if $no_sha;
@a=grep(!/(^sha1)|(_sha1$)|(m_dss1$)/,@a) if $no_sha1;
@a=grep(!/_mdc2$/,@a) if $no_mdc2;
@a=grep(!/^engine$/,@a) if $no_engine;
@a=grep(!/(^rsa$)|(^genrsa$)|(^req$)|(^ca$)/,@a) if $no_rsa;
@a=grep(!/(^dsa$)|(^gendsa$)|(^dsaparam$)/,@a) if $no_dsa;
@a=grep(!/^gendsa$/,@a) if $no_sha1;
@a=grep(!/(^dh$)|(^gendh$)/,@a) if $no_dh;
@a=grep(!/(^dh)|(_sha1$)|(m_dss1$)/,@a) if $no_sha1;
grep($_="$dir/$_",@a);
@a=grep(!/(^|\/)s_/,@a) if $no_sock;
@a=grep(!/(^|\/)bio_sock/,@a) if $no_sock;
$ret=join(' ',@a)." ";
return($ret);
}

64
openssl-1.0.2f/util/ck_errf.pl Executable file
View File

@@ -0,0 +1,64 @@
#!/usr/local/bin/perl
#
# This is just a quick script to scan for cases where the 'error'
# function name in a XXXerr() macro is wrong.
#
# Run in the top level by going
# perl util/ck_errf.pl */*.c */*/*.c
#
my $err_strict = 0;
my $bad = 0;
foreach $file (@ARGV)
{
if ($file eq "-strict")
{
$err_strict = 1;
next;
}
open(IN,"<$file") || die "unable to open $file\n";
$func="";
while (<IN>)
{
if (!/;$/ && /^\**([a-zA-Z].*[\s*])?([A-Za-z_0-9]+)\(.*([),]|$)/)
{
/^([^()]*(\([^()]*\)[^()]*)*)\(/;
$1 =~ /([A-Za-z_0-9]*)$/;
$func = $1;
$func =~ tr/A-Z/a-z/;
}
if (/([A-Z0-9]+)err\(([^,]+)/ && ! /ckerr_ignore/)
{
$errlib=$1;
$n=$2;
if ($func eq "")
{ print "$file:$.:???:$n\n"; $bad = 1; next; }
if ($n !~ /([^_]+)_F_(.+)$/)
{
# print "check -$file:$.:$func:$n\n";
next;
}
$lib=$1;
$n=$2;
if ($lib ne $errlib)
{ print "$file:$.:$func:$n [${errlib}err]\n"; $bad = 1; next; }
$n =~ tr/A-Z/a-z/;
if (($n ne $func) && ($errlib ne "SYS"))
{ print "$file:$.:$func:$n\n"; $bad = 1; next; }
# print "$func:$1\n";
}
}
close(IN);
}
if ($bad && $err_strict)
{
print STDERR "FATAL: error discrepancy\n";
exit 1;
}

View File

@@ -0,0 +1,58 @@
#!/usr/local/bin/perl -w
# Clean the dependency list in a makefile of standard includes...
# Written by Ben Laurie <ben@algroup.co.uk> 19 Jan 1999
use strict;
while(<STDIN>) {
print;
last if /^# DO NOT DELETE THIS LINE/;
}
my %files;
my $thisfile="";
while(<STDIN>) {
my ($dummy, $file,$deps)=/^((.*):)? (.*)$/;
my $origfile="";
$thisfile=$file if defined $file;
next if !defined $deps;
$origfile=$thisfile;
$origfile=~s/\.o$/.c/;
my @deps=split ' ',$deps;
@deps=grep(!/^\//,@deps);
@deps=grep(!/^\\$/,@deps);
@deps=grep(!/^$origfile$/,@deps);
# pull out the kludged kerberos header (if present).
@deps=grep(!/^[.\/]+\/krb5.h/,@deps);
push @{$files{$thisfile}},@deps;
}
my $file;
foreach $file (sort keys %files) {
my $len=0;
my $dep;
my $origfile=$file;
$origfile=~s/\.o$/.c/;
$file=~s/^\.\///;
push @{$files{$file}},$origfile;
my $prevdep="";
# Remove leading ./ before sorting
my @deps = map { $_ =~ s/^\.\///; $_ } @{$files{$file}};
foreach $dep (sort @deps) {
$dep=~s/^\.\///;
next if $prevdep eq $dep; # to exterminate duplicates...
$prevdep = $dep;
$len=0 if $len+length($dep)+1 >= 80;
if($len == 0) {
print "\n$file:";
$len=length($file)+1;
}
print " $dep";
$len+=length($dep)+1;
}
}
print "\n";

View File

@@ -0,0 +1,78 @@
#!/usr/local/bin/perl
use strict;
use Fcntl;
# copy-if-different.pl
# Copy to the destination if the source is not the same as it.
my @filelist;
foreach my $arg (@ARGV) {
$arg =~ s|\\|/|g; # compensate for bug/feature in cygwin glob...
foreach (glob $arg)
{
push @filelist, $_;
}
}
my $fnum = @filelist;
if ($fnum <= 1)
{
die "Need at least two filenames";
}
my $dest = pop @filelist;
if ($fnum > 2 && ! -d $dest)
{
die "Destination must be a directory";
}
foreach (@filelist)
{
my $dfile;
if (-d $dest)
{
$dfile = $_;
$dfile =~ s|^.*[/\\]([^/\\]*)$|$1|;
$dfile = "$dest/$dfile";
}
else
{
$dfile = $dest;
}
my $buf;
if (-f $dfile)
{
sysopen(IN, $_, O_RDONLY|O_BINARY) || die "Can't Open $_";
sysopen(OUT, $dfile, O_RDONLY|O_BINARY)
|| die "Can't Open $dfile";
while (sysread IN, $buf, 10240)
{
my $b2;
goto copy if !sysread(OUT, $b2, 10240) || $buf ne $b2;
}
goto copy if sysread(OUT, $buf, 1);
close(IN);
close(OUT);
print "NOT copying: $_ to $dfile\n";
next;
}
copy:
sysopen(IN, $_, O_RDONLY|O_BINARY) || die "Can't Open $_";
sysopen(OUT, $dfile, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY)
|| die "Can't Open $dfile";
while (sysread IN, $buf, 10240)
{
syswrite(OUT, $buf, length($buf));
}
close(IN);
close(OUT);
print "Copying: $_ to $dfile\n";
}

View File

@@ -0,0 +1,70 @@
#!/usr/local/bin/perl
use Fcntl;
# copy.pl
# Perl script 'copy' comment. On Windows the built in "copy" command also
# copies timestamps: this messes up Makefile dependencies.
my $stripcr = 0;
my $arg;
foreach $arg (@ARGV) {
if ($arg eq "-stripcr")
{
$stripcr = 1;
next;
}
$arg =~ s|\\|/|g; # compensate for bug/feature in cygwin glob...
foreach (glob $arg)
{
push @filelist, $_;
}
}
$fnum = @filelist;
if ($fnum <= 1)
{
die "Need at least two filenames";
}
$dest = pop @filelist;
if ($fnum > 2 && ! -d $dest)
{
die "Destination must be a directory";
}
foreach (@filelist)
{
if (-d $dest)
{
$dfile = $_;
$dfile =~ s|^.*[/\\]([^/\\]*)$|$1|;
$dfile = "$dest/$dfile";
}
else
{
$dfile = $dest;
}
sysopen(IN, $_, O_RDONLY|O_BINARY) || die "Can't Open $_";
sysopen(OUT, $dfile, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY)
|| die "Can't Open $dfile";
while (sysread IN, $buf, 10240)
{
if ($stripcr)
{
$buf =~ tr/\015//d;
}
syswrite(OUT, $buf, length($buf));
}
close(IN);
close(OUT);
print "Copying: $_ to $dfile\n";
}

154
openssl-1.0.2f/util/cygwin.sh Executable file
View File

@@ -0,0 +1,154 @@
#!/bin/bash
#
# This script configures, builds and packs the binary package for
# the Cygwin net distribution version of OpenSSL
#
# Uncomment when debugging
#set -x
CONFIG_OPTIONS="--prefix=/usr shared zlib no-idea no-rc5"
INSTALL_PREFIX=/tmp/install/INSTALL
VERSION=
SHLIB_VERSION_NUMBER=
SUBVERSION=$1
function cleanup()
{
rm -rf ${INSTALL_PREFIX}/etc
rm -rf ${INSTALL_PREFIX}/usr
}
function get_openssl_version()
{
eval `grep '^VERSION=' Makefile`
if [ -z "${VERSION}" ]
then
echo "Error: Couldn't retrieve OpenSSL version from Makefile."
echo " Check value of variable VERSION in Makefile."
exit 1
fi
eval `grep '^SHLIB_VERSION_NUMBER=' Makefile`
if [ -z "${SHLIB_VERSION_NUMBER}" ]
then
echo "Error: Couldn't retrieve OpenSSL shared lib version from Makefile."
echo " Check value of variable SHLIB_VERSION_NUMBER in Makefile."
exit 1
fi
}
function base_install()
{
mkdir -p ${INSTALL_PREFIX}
cleanup
make install INSTALL_PREFIX="${INSTALL_PREFIX}"
}
function doc_install()
{
DOC_DIR=${INSTALL_PREFIX}/usr/share/doc/openssl
mkdir -p ${DOC_DIR}
cp CHANGES CHANGES.SSLeay INSTALL LICENSE NEWS README ${DOC_DIR}
create_cygwin_readme
}
function certs_install()
{
CERTS_DIR=${INSTALL_PREFIX}/usr/ssl/certs
mkdir -p ${CERTS_DIR}
cp -rp certs/* ${CERTS_DIR}
}
function create_cygwin_readme()
{
README_DIR=${INSTALL_PREFIX}/usr/share/doc/Cygwin
README_FILE=${README_DIR}/openssl-${VERSION}.README
mkdir -p ${README_DIR}
cat > ${README_FILE} <<- EOF
The Cygwin version has been built using the following configure:
./config ${CONFIG_OPTIONS}
The IDEA and RC5 algorithms are disabled due to patent and/or
licensing issues.
EOF
}
function create_profile_files()
{
PROFILE_DIR=${INSTALL_PREFIX}/etc/profile.d
mkdir -p $PROFILE_DIR
cat > ${PROFILE_DIR}/openssl.sh <<- "EOF"
export MANPATH="${MANPATH}:/usr/ssl/man"
EOF
cat > ${PROFILE_DIR}/openssl.csh <<- "EOF"
if ( $?MANPATH ) then
setenv MANPATH "${MANPATH}:/usr/ssl/man"
else
setenv MANPATH ":/usr/ssl/man"
endif
EOF
}
if [ -z "${SUBVERSION}" ]
then
echo "Usage: $0 subversion"
exit 1
fi
if [ ! -f config ]
then
echo "You must start this script in the OpenSSL toplevel source dir."
exit 1
fi
./config ${CONFIG_OPTIONS}
get_openssl_version
make depend || exit 1
make || exit 1
base_install
doc_install
certs_install
create_cygwin_readme
create_profile_files
cd ${INSTALL_PREFIX}
chmod u+w usr/lib/engines/*.so
strip usr/bin/*.exe usr/bin/*.dll usr/lib/engines/*.so
chmod u-w usr/lib/engines/*.so
# Runtime package
tar cjf libopenssl${SHLIB_VERSION_NUMBER//[!0-9]/}-${VERSION}-${SUBVERSION}.tar.bz2 \
usr/bin/cyg*dll
# Base package
find etc usr/bin/openssl.exe usr/bin/c_rehash usr/lib/engines usr/share/doc \
usr/ssl/certs usr/ssl/man/man[157] usr/ssl/misc usr/ssl/openssl.cnf \
usr/ssl/private \
-empty -o \! -type d |
tar cjfT openssl-${VERSION}-${SUBVERSION}.tar.bz2 -
# Development package
find usr/include usr/lib/*.a usr/lib/pkgconfig usr/ssl/man/man3 \
-empty -o \! -type d |
tar cjfT openssl-devel-${VERSION}-${SUBVERSION}.tar.bz2 -
ls -l openssl-${VERSION}-${SUBVERSION}.tar.bz2
ls -l openssl-devel-${VERSION}-${SUBVERSION}.tar.bz2
ls -l libopenssl${SHLIB_VERSION_NUMBER//[!0-9]/}-${VERSION}-${SUBVERSION}.tar.bz2
cleanup
exit 0

7
openssl-1.0.2f/util/deleof.pl Executable file
View File

@@ -0,0 +1,7 @@
#!/usr/local/bin/perl
while (<>)
{
print
last if (/^# DO NOT DELETE THIS LINE/);
}

View File

@@ -0,0 +1,34 @@
$! DELTREE.COM
$
$ call deltree 'p1'
$ exit $status
$
$ deltree: subroutine ! P1 is a name of a directory
$ on control_y then goto dt_STOP
$ on warning then goto dt_exit
$ _dt_def = f$trnlnm("SYS$DISK")+f$directory()
$ if f$parse(p1) .eqs. "" then exit
$ set default 'f$parse(p1,,,"DEVICE")''f$parse(p1,,,"DIRECTORY")'
$ p1 = f$parse(p1,,,"NAME") + f$parse(p1,,,"TYPE")
$ _fp = f$parse(".DIR",p1)
$ dt_loop:
$ _f = f$search(_fp)
$ if _f .eqs. "" then goto dt_loopend
$ call deltree [.'f$parse(_f,,,"NAME")']*.*
$ goto dt_loop
$ dt_loopend:
$ _fp = f$parse(p1,".;*")
$ if f$search(_fp) .eqs. "" then goto dt_exit
$ set noon
$ set file/prot=(S:RWED,O:RWED,G:RWED,W:RWED) '_fp'
$ set on
$ delete/nolog '_fp'
$ dt_exit:
$ set default '_dt_def'
$ goto dt_end
$ dt_STOP:
$ set default '_dt_def'
$ stop/id=""
$ exit
$ dt_end:
$ endsubroutine

View File

@@ -0,0 +1,18 @@
#!/usr/local/bin/perl
if ($#ARGV < 0) {
die "dirname.pl: too few arguments\n";
} elsif ($#ARGV > 0) {
die "dirname.pl: too many arguments\n";
}
my $d = $ARGV[0];
if ($d =~ m|.*/.*|) {
$d =~ s|/[^/]*$||;
} else {
$d = ".";
}
print $d,"\n";
exit(0);

19
openssl-1.0.2f/util/do_ms.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/sh
#
# generate the Microsoft makefiles and .def files
#
PATH=util:../util:$PATH
# perl util/mk1mf.pl no-sock VC-MSDOS >ms/msdos.mak
# perl util/mk1mf.pl VC-W31-32 >ms/w31.mak
perl util/mk1mf.pl dll VC-WIN16 >ms/w31dll.mak
# perl util/mk1mf.pl VC-WIN32 >ms/nt.mak
perl util/mk1mf.pl dll VC-WIN32 >ms/ntdll.mak
perl util/mk1mf.pl Mingw32 >ms/mingw32.mak
perl util/mk1mf.pl Mingw32-files >ms/mingw32f.mak
perl util/mkdef.pl 16 libeay > ms/libeay16.def
perl util/mkdef.pl 32 libeay > ms/libeay32.def
perl util/mkdef.pl 16 ssleay > ms/ssleay16.def
perl util/mkdef.pl 32 ssleay > ms/ssleay32.def

39
openssl-1.0.2f/util/domd Executable file
View File

@@ -0,0 +1,39 @@
#!/bin/sh
# Do a makedepend, only leave out the standard headers
# Written by Ben Laurie <ben@algroup.co.uk> 19 Jan 1999
TOP=$1
shift
if [ "$1" = "-MD" ]; then
shift
MAKEDEPEND=$1
shift
fi
if [ "$MAKEDEPEND" = "" ]; then MAKEDEPEND=makedepend; fi
cp Makefile Makefile.save
# fake the presence of Kerberos
touch $TOP/krb5.h
if ${MAKEDEPEND} --version 2>&1 | grep "clang" > /dev/null ||
echo $MAKEDEPEND | grep "gcc" > /dev/null; then
args=""
while [ $# -gt 0 ]; do
if [ "$1" != "--" ]; then args="$args $1"; fi
shift
done
sed -e '/^# DO NOT DELETE.*/,$d' < Makefile > Makefile.tmp
echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' >> Makefile.tmp
${MAKEDEPEND} -Werror -D OPENSSL_DOING_MAKEDEPEND -M $args >> Makefile.tmp || exit 1
${PERL} $TOP/util/clean-depend.pl < Makefile.tmp > Makefile.new
RC=$?
rm -f Makefile.tmp
else
${MAKEDEPEND} -D OPENSSL_DOING_MAKEDEPEND $@ && \
${PERL} $TOP/util/clean-depend.pl < Makefile > Makefile.new
RC=$?
fi
mv Makefile.new Makefile
# unfake the presence of Kerberos
rm $TOP/krb5.h
exit $RC

33
openssl-1.0.2f/util/err-ins.pl Executable file
View File

@@ -0,0 +1,33 @@
#!/usr/local/bin/perl
#
# tack error codes onto the end of a file
#
open(ERR,$ARGV[0]) || die "unable to open error file '$ARGV[0]':$!\n";
@err=<ERR>;
close(ERR);
open(IN,$ARGV[1]) || die "unable to open header file '$ARGV[1]':$!\n";
@out="";
while (<IN>)
{
push(@out,$_);
last if /BEGIN ERROR CODES/;
}
close(IN);
open(OUT,">$ARGV[1]") || die "unable to open header file '$ARGV[1]':$1\n";
print OUT @out;
print OUT @err;
print OUT <<"EOF";
#ifdef __cplusplus
}
#endif
#endif
EOF
close(OUT);

View File

@@ -0,0 +1,26 @@
#!/usr/bin/perl
$/ = ""; # Eat a paragraph at once.
while(<STDIN>) {
chop;
s/\n/ /gm;
if (/^=head1 /) {
$name = 0;
} elsif ($name) {
if (/ - /) {
s/ - .*//;
s/,\s+/,/g;
s/\s+,/,/g;
s/^\s+//g;
s/\s+$//g;
s/\s/_/g;
push @words, split ',';
}
}
if (/^=head1 *NAME *$/) {
$name = 1;
}
}
print join("\n", @words),"\n";

View File

@@ -0,0 +1,12 @@
#!/usr/bin/perl
while(<STDIN>) {
if (/=for\s+comment\s+openssl_manual_section:(\S+)/)
{
print "$1\n";
exit 0;
}
}
print "$ARGV[0]\n";

67
openssl-1.0.2f/util/files.pl Executable file
View File

@@ -0,0 +1,67 @@
#!/usr/local/bin/perl
#
# used to generate the file MINFO for use by util/mk1mf.pl
# It is basically a list of all variables from the passed makefile
#
while ($ARGV[0] =~ /^(\S+)\s*=(.*)$/)
{
$sym{$1} = $2;
shift;
}
$s="";
while (<>)
{
chop;
s/#.*//;
if (/^(\S+)\s*=\s*(.*)$/)
{
$o="";
($s,$b)=($1,$2);
for (;;)
{
if ($b =~ /\\$/)
{
chop($b);
$o.=$b." ";
$b=<>;
chop($b);
}
else
{
$o.=$b." ";
last;
}
}
$o =~ s/^\s+//;
$o =~ s/\s+$//;
$o =~ s/\s+/ /g;
$o =~ s/\$[({]([^)}]+)[)}]/$sym{$1}/g;
$sym{$s}=$o if !exists $sym{$s};
}
}
$pwd=`pwd`; chop($pwd);
if ($sym{'TOP'} eq ".")
{
$n=0;
$dir=".";
}
else {
$n=split(/\//,$sym{'TOP'});
@_=split(/\//,$pwd);
$z=$#_-$n+1;
foreach $i ($z .. $#_) { $dir.=$_[$i]."/"; }
chop($dir);
}
print "RELATIVE_DIRECTORY=$dir\n";
foreach (sort keys %sym)
{
print "$_=$sym{$_}\n";
}
print "RELATIVE_DIRECTORY=\n";

14
openssl-1.0.2f/util/fixNT.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/sh
#
# clean up the mess that NT makes of my source tree
#
if [ -f makefile -a ! -f Makefile ]; then
/bin/mv makefile Makefile
fi
chmod +x Configure util/*
echo cleaning
/bin/rm -f `find . -name '*.$$$' -print` 2>/dev/null >/dev/null
echo 'removing those damn ^M'
perl -pi -e 's/\015//' `find . -type 'f' -print |grep -v '.obj$' |grep -v '.der$' |grep -v '.gz'`
make -f Makefile links

View File

@@ -0,0 +1,767 @@
-bap
-bbo
-br
-brs
-c33
-cd33
-ce
-ci4
-cli0
-cp33
-d0
-di1
-hnl
-i4
-il1
-ip0
-l78
-lp
-nbad
-nbc
-ncdb
-ncs
-nfc1
-nfca
-npcs
-nprs
-npsl
-nsc
-ppi1
-saf
-sai
-saw
-sob
-ss
-ts0
-T ACCESS_DESCRIPTION
-T ADDED_OBJ
-T AEP_BBOOL
-T AEP_CHAR
-T AEP_CHAR_PTR
-T AEP_CONNECTION_ENTRY
-T AEP_CONNECTION_HNDL
-T AEP_CONNECTION_HNDL_PTR
-T AEP_FLAGS
-T AEP_RV
-T AEP_TRANSACTION_ID
-T AEP_TRANSACTION_ID_PTR
-T AEP_U16
-T AEP_U32
-T AEP_U32_PTR
-T AEP_U64_PTR
-T AEP_U8
-T AEP_U8_PTR
-T AEP_VOID_PTR
-T AEP_VOID_PTR_PTR
-T AES_KEY
-T APP_INFO
-T ARGS
-T ASIdOrRange
-T ASIdOrRanges
-T ASIdentifierChoice
-T ASIdentifiers
-T ASN1_ADB
-T ASN1_ADB_TABLE
-T ASN1_AUX
-T ASN1_BIT_STRING
-T ASN1_BMPSTRING
-T ASN1_BOOLEAN
-T ASN1_COMPAT_FUNCS
-T ASN1_CTX
-T ASN1_ENCODING
-T ASN1_ENUMERATED
-T ASN1_EXTERN_FUNCS
-T ASN1_GENERALIZEDTIME
-T ASN1_GENERALSTRING
-T ASN1_IA5STRING
-T ASN1_INTEGER
-T ASN1_ITEM
-T ASN1_ITEM_EXP
-T ASN1_NULL
-T ASN1_OBJECT
-T ASN1_OCTET_STRING
-T ASN1_PCTX
-T ASN1_PRIMITIVE_FUNCS
-T ASN1_PRINTABLESTRING
-T ASN1_PRINT_ARG
-T ASN1_SCTX
-T ASN1_STREAM_ARG
-T ASN1_STRING
-T ASN1_STRING_TABLE
-T ASN1_T61STRING
-T ASN1_TEMPLATE
-T ASN1_TIME
-T ASN1_TLC
-T ASN1_TYPE
-T ASN1_UNIVERSALSTRING
-T ASN1_UTCTIME
-T ASN1_UTF8STRING
-T ASN1_VALUE
-T ASN1_VISIBLESTRING
-T ASN1_const_CTX
-T AUTHORITY_INFO_ACCESS
-T AUTHORITY_KEYID
-T BASIC_CONSTRAINTS
-T BF_KEY
-T BF_LONG
-T BIGNUM
-T BIO
-T BIO_ACCEPT
-T BIO_ASN1_BUF_CTX
-T BIO_ASN1_EX_FUNCS
-T BIO_B64_CTX
-T BIO_CONNECT
-T BIO_ENC_CTX
-T BIO_F_BUFFER_CTX
-T BIO_LINEBUFFER_CTX
-T BIO_METHOD
-T BIO_OK_CTX
-T BIO_SSL
-T BIT_STRING_BITNAME
-T BN_BLINDING
-T BN_CTX
-T BN_GENCB
-T BN_MONT_CTX
-T BN_POOL
-T BN_POOL_ITEM
-T BN_RECP_CTX
-T BN_STACK
-T BN_ULONG
-T BUF_MEM
-T BY_DIR
-T BY_DIR_ENTRY
-T BY_DIR_HASH
-T Bytef
-T CAMELLIA_KEY
-T CAST_KEY
-T CAST_LONG
-T CA_DB
-T CCM128_CONTEXT
-T CERT
-T CERTIFICATEPOLICIES
-T CERT_PKEY
-T CIPHER_ORDER
-T CMAC_CTX
-T CMS_AuthenticatedData
-T CMS_CertificateChoices
-T CMS_CompressedData
-T CMS_ContentInfo
-T CMS_DigestedData
-T CMS_EncapsulatedContentInfo
-T CMS_EncryptedContentInfo
-T CMS_EncryptedData
-T CMS_EnvelopedData
-T CMS_IssuerAndSerialNumber
-T CMS_KEKIdentifier
-T CMS_KEKRecipientInfo
-T CMS_KeyAgreeRecipientIdentifier
-T CMS_KeyAgreeRecipientInfo
-T CMS_KeyTransRecipientInfo
-T CMS_OriginatorIdentifierOrKey
-T CMS_OriginatorInfo
-T CMS_OriginatorPublicKey
-T CMS_OtherCertificateFormat
-T CMS_OtherKeyAttribute
-T CMS_OtherRecipientInfo
-T CMS_OtherRevocationInfoFormat
-T CMS_PasswordRecipientInfo
-T CMS_Receipt
-T CMS_ReceiptRequest
-T CMS_ReceiptsFrom
-T CMS_RecipientEncryptedKey
-T CMS_RecipientIdentifier
-T CMS_RecipientInfo
-T CMS_RecipientKeyIdentifier
-T CMS_RevocationInfoChoice
-T CMS_SignedData
-T CMS_SignerIdentifier
-T CMS_SignerInfo
-T COMP_CTX
-T COMP_METHOD
-T CONF
-T CONF_IMODULE
-T CONF_METHOD
-T CONF_MODULE
-T CONF_VALUE
-T CRYPTO_EX_DATA
-T CRYPTO_EX_DATA_FUNCS
-T CRYPTO_EX_DATA_IMPL
-T CRYPTO_EX_dup
-T CRYPTO_EX_dup
-T CRYPTO_EX_free
-T CRYPTO_EX_free
-T CRYPTO_EX_new
-T CRYPTO_EX_new
-T CRYPTO_MEM_LEAK_CB
-T CRYPTO_THREADID
-T CRYPTO_dynlock_value
-T DB_ATTR
-T DES_LONG
-T DES_cblock
-T DES_key_schedule
-T DH
-T DH_METHOD
-T DH_PKEY_CTX
-T DIST_POINT
-T DIST_POINT_NAME
-T DRBG_CTX
-T DSA
-T DSA_METHOD
-T DSA_SIG
-T DSO
-T DSO_FUNC_TYPE
-T DSO_MERGER_FUNC
-T DSO_METHOD
-T DSO_NAME_CONVERTER_FUNC
-T DSO_VMS_INTERNAL
-T DTLS1_BITMAP
-T DTLS1_RECORD_DATA
-T DTLS1_STATE
-T Dl_info
-T ECDH_DATA
-T ECDH_METHOD
-T ECDSA_DATA
-T ECDSA_METHOD
-T ECDSA_SIG
-T ECPARAMETERS
-T ECPKPARAMETERS
-T EC_EXTRA_DATA
-T EC_GROUP
-T EC_KEY
-T EC_METHOD
-T EC_POINT
-T EC_PRE_COMP
-T EC_PRIVATEKEY
-T EC_builtin_curve
-T EDIPARTYNAME
-T ENGINE
-T ENGINE_CIPHERS_PTR
-T ENGINE_CLEANUP_CB
-T ENGINE_CLEANUP_ITEM
-T ENGINE_CMD_DEFN
-T ENGINE_CTRL_FUNC_PTR
-T ENGINE_DIGESTS_PTR
-T ENGINE_GEN_FUNC_PTR
-T ENGINE_GEN_INT_FUNC_PTR
-T ENGINE_LOAD_KEY_PTR
-T ENGINE_PILE
-T ENGINE_PILE_DOALL
-T ENGINE_PKEY_ASN1_METHS_PTR
-T ENGINE_PKEY_METHS_PTR
-T ENGINE_SSL_CLIENT_CERT_PTR
-T ENGINE_TABLE
-T ENUMERATED_NAMES
-T ERR_FNS
-T ERR_STATE
-T ERR_STRING_DATA
-T ESS_CERT_ID
-T ESS_ISSUER_SERIAL
-T ESS_SIGNING_CERT
-T EVP_AES_HMAC_SHA1
-T EVP_AES_HMAC_SHA256
-T EVP_CIPHER
-T EVP_CIPHER_CTX
-T EVP_CIPHER_INFO
-T EVP_ENCODE_CTX
-T EVP_MD
-T EVP_MD_CTX
-T EVP_PBE_CTL
-T EVP_PBE_KEYGEN
-T EVP_PKEY
-T EVP_PKEY_ASN1_METHOD
-T EVP_PKEY_CTX
-T EVP_PKEY_METHOD
-T EVP_PKEY_gen_cb
-T EX_CLASS_ITEM
-T E_GMP_RSA_CTX
-T E_RSAX_MOD_CTX
-T FILE
-T F_DIGITALSIGNATUREVERIFY
-T F_PUBLICKEYEXTRACT
-T GCM128_CONTEXT
-T GENERAL_NAME
-T GENERAL_NAMES
-T GENERAL_SUBTREE
-T GEN_SESSION_CB
-T HASH_CTX
-T HEAPENTRY32
-T HEAPLIST32
-T HEARTBEAT_TEST_FIXTURE
-T HMAC_CTX
-T ICA_KEY_RSA_CRT
-T ICA_KEY_RSA_CRT_REC
-T ICA_KEY_RSA_MODEXPO
-T ICA_KEY_RSA_MODEXPO_REC
-T IDEA_KEY_SCHEDULE
-T IPAddrBlocks
-T IPAddressFamily
-T IPAddressOrRange
-T IPAddressOrRanges
-T ISSUING_DIST_POINT
-T JPAKE_CTX
-T JPAKE_STEP1
-T JPAKE_STEP2
-T JPAKE_STEP3A
-T JPAKE_STEP3B
-T JPAKE_STEP_PART
-T JPAKE_ZKP
-T KEY_TABLE_TYPE
-T KRB5_APREQBODY
-T KRB5_AUTHDATA
-T KRB5_AUTHENTBODY
-T KRB5_CHECKSUM
-T KRB5_ENCDATA
-T KRB5_ENCKEY
-T KRB5_PRINCNAME
-T KRB5_TKTBODY
-T KSSL_CTX
-T KSSL_ERR
-T LHASH
-T LHASH_COMP_FN_TYPE
-T LHASH_DOALL_ARG_FN_TYPE
-T LHASH_DOALL_FN_TYPE
-T LHASH_HASH_FN_TYPE
-T LHASH_NODE
-T LPDIR_CTX
-T LPHEAPENTRY32
-T LPHEAPLIST32
-T LPMODULEENTRY32
-T LPMODULEENTRY32W
-T LPPROCESSENTRY32
-T LPPROCESSENTRY32W
-T LPTHREADENTRY32
-T LP_DIR_CTX
-T MD2_CTX
-T MD4_CTX
-T MD5_CTX
-T MDC2_CTX
-T MD_DATA
-T MEM
-T MEM_LEAK
-T MEM_OBJECT_DATA
-T MIME_HEADER
-T MIME_PARAM
-T MODULEENTRY32
-T MODULEENTRY32W
-T MS_FAR
-T NAME_CONSTRAINTS
-T NAME_FUNCS
-T NBIO_TEST
-T NDEF_SUPPORT
-T NETSCAPE_CERT_SEQUENCE
-T NETSCAPE_ENCRYPTED_PKEY
-T NETSCAPE_PKEY
-T NETSCAPE_SPKAC
-T NETSCAPE_SPKI
-T NETSCAPE_X509
-T NET_API_FUNCTION
-T NOTICEREF
-T OBJ_NAME
-T OCB128_CONTEXT
-T OCB_BLOCK
-T OCSP_BASICRESP
-T OCSP_CERTID
-T OCSP_CERTSTATUS
-T OCSP_CRLID
-T OCSP_ONEREQ
-T OCSP_REQINFO
-T OCSP_REQUEST
-T OCSP_REQ_CTX
-T OCSP_RESPBYTES
-T OCSP_RESPDATA
-T OCSP_RESPID
-T OCSP_RESPONSE
-T OCSP_REVOKEDINFO
-T OCSP_SERVICELOC
-T OCSP_SIGNATURE
-T OCSP_SINGLERESP
-T OCSP_TBLSTR
-T OPENSSL_BLOCK
-T OPENSSL_CSTRING
-T OPENSSL_DIR_CTX
-T OPENSSL_ITEM
-T OPENSSL_PSTRING
-T OPENSSL_STRING
-T OPENSSL_STRING
-T OTHERNAME
-T P256_POINT
-T P256_POINT_AFFINE
-T PBE2PARAM
-T PBEPARAM
-T PBKDF2PARAM
-T PCRYPTO_MEM_LEAK_CB
-T PEM_CTX
-T PEM_ENCODE_SEAL_CTX
-T PEM_USER
-T PHEAPENTRY32
-T PHEAPLIST32
-T PKCS12
-T PKCS12_BAGS
-T PKCS12_SAFEBAG
-T PKCS7
-T PKCS7_DIGEST
-T PKCS7_ENCRYPT
-T PKCS7_ENC_CONTENT
-T PKCS7_ENVELOPE
-T PKCS7_ISSUER_AND_SERIAL
-T PKCS7_RECIP_INFO
-T PKCS7_SIGNED
-T PKCS7_SIGNER_INFO
-T PKCS7_SIGN_ENVELOPE
-T PKCS8_PRIV_KEY_INFO
-T PKEY_USAGE_PERIOD
-T PMODULEENTRY32
-T PMODULEENTRY32W
-T POLICYINFO
-T POLICYQUALINFO
-T POLICY_CONSTRAINTS
-T POLICY_MAPPING
-T POLICY_MAPPINGS
-T PPROCESSENTRY32
-T PPROCESSENTRY32W
-T PRECOMP256_ROW
-T PROCESSENTRY32
-T PROCESSENTRY32W
-T PROXY_CERT_INFO_EXTENSION
-T PROXY_POLICY
-T PTHREADENTRY32
-T PW_CB_DATA
-T RAND_METHOD
-T RC2_KEY
-T RC4_KEY
-T RC5_32_KEY
-T RIPEMD160_CTX
-T RSA
-T RSA_METHOD
-T RSA_OAEP_PARAMS
-T RSA_PKEY_CTX
-T RSA_PSS_PARAMS
-T SCT
-T SEED_KEY_SCHEDULE
-T SESS_CERT
-T SHA256_CTX
-T SHA512_CTX
-T SHA_CTX
-T SRP_ARG
-T SRP_CLIENT_ARG
-T SRP_CTX
-T SRP_SERVER_ARG
-T SRP_VBASE
-T SRP_gN_cache
-T SRP_user_pwd
-T SRTP_PROTECTION_PROFILE
-T SSL
-T SSL2_STATE
-T SSL3_BUFFER
-T SSL3_BUF_FREELIST
-T SSL3_BUF_FREELIST_ENTRY
-T SSL3_COMP
-T SSL3_ENC_METHOD
-T SSL3_RECORD
-T SSL3_STATE
-T SSL_CIPHER
-T SSL_COMP
-T SSL_CONF_CTX
-T SSL_CTX
-T SSL_EXCERT
-T SSL_METHOD
-T SSL_SESSION
-T SSL_SESSION_ASN1
-T STACK_OF
-T STORE
-T STORE_ATTR_INFO
-T STORE_ATTR_TYPES
-T STORE_CERTIFICATE_STATUS
-T STORE_CLEANUP_FUNC_PTR
-T STORE_CTRL_FUNC_PTR
-T STORE_END_OBJECT_FUNC_PTR
-T STORE_GENERATE_OBJECT_FUNC_PTR
-T STORE_GENERIC_FUNC_PTR
-T STORE_GET_OBJECT_FUNC_PTR
-T STORE_HANDLE_OBJECT_FUNC_PTR
-T STORE_INITIALISE_FUNC_PTR
-T STORE_METHOD
-T STORE_MODIFY_OBJECT_FUNC_PTR
-T STORE_NEXT_OBJECT_FUNC_PTR
-T STORE_OBJECT
-T STORE_OBJECT_TYPES
-T STORE_PARAM_TYPES
-T STORE_START_OBJECT_FUNC_PTR
-T STORE_STORE_OBJECT_FUNC_PTR
-T SW_ALGTYPE
-T SW_BYTE
-T SW_COMMAND_BITMAP
-T SW_COMMAND_CODE
-T SW_CONTEXT_HANDLE
-T SW_CRT
-T SW_DSA
-T SW_EXP
-T SW_LARGENUMBER
-T SW_NVDATA
-T SW_OSHANDLE
-T SW_PARAM
-T SW_STATE
-T SW_STATUS
-T SW_U16
-T SW_U32
-T SW_U64
-T SXNET
-T SXNETID
-T TCHAR
-T TEST_INFO
-T THREADENTRY32
-T TIMEOUT_PARAM
-T TLS_SESSION_TICKET_EXT
-T TLS_SIGALGS
-T TS_ACCURACY
-T TS_MSG_IMPRINT
-T TS_REQ
-T TS_RESP
-T TS_RESP_CTX
-T TS_STATUS_INFO
-T TS_TST_INFO
-T TS_VERIFY_CTX
-T TXT_DB
-T UI
-T UINT64
-T UI_METHOD
-T UI_STRING
-T USERNOTICE
-T WCHAR
-T WHIRLPOOL_CTX
-T WINAPI
-T WSAAPI
-T X509
-T X509V3_CONF_METHOD
-T X509V3_CTX
-T X509V3_EXT_D2I
-T X509V3_EXT_FREE
-T X509V3_EXT_I2D
-T X509V3_EXT_I2R
-T X509V3_EXT_I2S
-T X509V3_EXT_METHOD
-T X509V3_EXT_NEW
-T X509V3_EXT_R2I
-T X509V3_EXT_S2I
-T X509V3_EXT_V2I
-T X509_ALGOR
-T X509_ATTRIBUTE
-T X509_CERT_AUX
-T X509_CERT_FILE_CTX
-T X509_CERT_PAIR
-T X509_CINF
-T X509_CRL
-T X509_CRL_INFO
-T X509_CRL_METHOD
-T X509_EXTENSION
-T X509_INFO
-T X509_LOOKUP
-T X509_LOOKUP_METHOD
-T X509_NAME
-T X509_NAME_ENTRY
-T X509_OBJECT
-T X509_OBJECTS
-T X509_PKEY
-T X509_POLICY_CACHE
-T X509_POLICY_DATA
-T X509_POLICY_LEVEL
-T X509_POLICY_NODE
-T X509_POLICY_TREE
-T X509_PUBKEY
-T X509_PURPOSE
-T X509_REQ
-T X509_REQ_INFO
-T X509_REVOKED
-T X509_SIG
-T X509_STORE
-T X509_STORE_CTX
-T X509_TRUST
-T X509_VAL
-T X509_VERIFY_PARAM
-T X509_VERIFY_PARAM_ID
-T X9_62_CHARACTERISTIC_TWO
-T X9_62_CURVE
-T X9_62_FIELDID
-T X9_62_PENTANOMIAL
-T XTS128_CONTEXT
-T ZEN_MD_DATA
-T _LHASH
-T _STACK
-T __int64
-T _ossl_old_des_cblock
-T asn1_ps_func
-T bio_dgram_data
-T bio_info_cb
-T char_io
-T conf_finish_func
-T conf_init_func
-T const_DES_cblock
-T d2i_of_void
-T des_cblock
-T dynamic_data_ctx
-T dynamic_fns
-T engine_table_doall_cb
-T i2d_of_void
-T int_dhx942_dh
-T nid_triple
-T pem_password_cb
-T pitem
-T piterator
-T pqueue_s
-T session_op
-T size_t
-T tag_exp_arg
-T testdata
-T time_t
-T time_t
-T u32
-T u64
-T u8
-T v3_ext_ctx
-T v3_ext_method
-T STACK_OF_ACCESS_DESCRIPTION_
-T STACK_OF_ASIdOrRange_
-T STACK_OF_ASN1_ADB_TABLE_
-T STACK_OF_ASN1_INTEGER_
-T STACK_OF_ASN1_OBJECT_
-T STACK_OF_ASN1_STRING_TABLE_
-T STACK_OF_ASN1_TYPE_
-T STACK_OF_ASN1_UTF8STRING_
-T STACK_OF_ASN1_VALUE_
-T STACK_OF_BIO_
-T STACK_OF_BY_DIR_ENTRY_
-T STACK_OF_BY_DIR_HASH_
-T STACK_OF_CMS_CertificateChoices_
-T STACK_OF_CMS_RecipientEncryptedKey_
-T STACK_OF_CMS_RecipientInfo_
-T STACK_OF_CMS_RevocationInfoChoice_
-T STACK_OF_CMS_SignerInfo_
-T STACK_OF_CONF_IMODULE_
-T STACK_OF_CONF_MODULE_
-T STACK_OF_CONF_VALUE_
-T STACK_OF_CRYPTO_EX_DATA_FUNCS_
-T STACK_OF_CRYPTO_dynlock_
-T STACK_OF_DIST_POINT_
-T STACK_OF_ENGINE_
-T STACK_OF_ENGINE_CLEANUP_ITEM_
-T STACK_OF_ESS_CERT_ID_
-T STACK_OF_EVP_PBE_CTL_
-T STACK_OF_EVP_PKEY_ASN1_METHOD_
-T STACK_OF_EVP_PKEY_METHOD_
-T STACK_OF_GENERAL_NAMES_
-T STACK_OF_GENERAL_NAME_
-T STACK_OF_GENERAL_SUBTREE_
-T STACK_OF_IPAddressFamily_
-T STACK_OF_IPAddressOrRange_
-T STACK_OF_KRB5_APREQBODY_
-T STACK_OF_KRB5_AUTHENTBODY_
-T STACK_OF_KRB5_TKTBODY_
-T STACK_OF_MEM_OBJECT_DATA_
-T STACK_OF_MIME_HEADER_
-T STACK_OF_MIME_PARAM_
-T STACK_OF_NAME_FUNCS_
-T STACK_OF_OCSP_CERTID_
-T STACK_OF_OCSP_ONEREQ_
-T STACK_OF_OCSP_RESPID_
-T STACK_OF_OCSP_SINGLERESP_
-T STACK_OF_OPENSSL_BLOCK_
-T STACK_OF_OPENSSL_PSTRING_
-T STACK_OF_OPENSSL_STRING_
-T STACK_OF_PKCS12_SAFEBAG_
-T STACK_OF_PKCS7_
-T STACK_OF_PKCS7_RECIP_INFO_
-T STACK_OF_PKCS7_SIGNER_INFO_
-T STACK_OF_POLICYINFO_
-T STACK_OF_POLICYQUALINFO_
-T STACK_OF_POLICY_MAPPING_
-T STACK_OF_Request_
-T STACK_OF_SCT_
-T STACK_OF_SRP_gN_
-T STACK_OF_SRP_gN_cache_
-T STACK_OF_SRP_user_pwd_
-T STACK_OF_SRTP_PROTECTION_PROFILE_
-T STACK_OF_SSL_CIPHER_
-T STACK_OF_SSL_COMP_
-T STACK_OF_STORE_ATTR_INFO_
-T STACK_OF_STRING_
-T STACK_OF_SXNETID_
-T STACK_OF_SingleResponse_
-T STACK_OF_UI_STRING_
-T STACK_OF_X509V3_EXT_METHOD_
-T STACK_OF_X509_
-T STACK_OF_X509_ALGOR_
-T STACK_OF_X509_ATTRIBUTE_
-T STACK_OF_X509_CRL_
-T STACK_OF_X509_EXTENSION_
-T STACK_OF_X509_INFO_
-T STACK_OF_X509_LOOKUP_
-T STACK_OF_X509_NAME_
-T STACK_OF_X509_NAME_ENTRY_
-T STACK_OF_X509_OBJECT_
-T STACK_OF_X509_POLICY_DATA_
-T STACK_OF_X509_POLICY_NODE_
-T STACK_OF_X509_PURPOSE_
-T STACK_OF_X509_REVOKED_
-T STACK_OF_X509_TRUST_
-T STACK_OF_X509_VERIFY_PARAM_
-T STACK_OF_nid_triple_
-T STACK_OF_void_
-T LHASH_OF_ADDED_OBJ_
-T LHASH_OF_APP_INFO_
-T LHASH_OF_CONF_VALUE_
-T LHASH_OF_ENGINE_PILE_
-T LHASH_OF_ERR_STATE_
-T LHASH_OF_ERR_STRING_DATA_
-T LHASH_OF_EX_CLASS_ITEM_
-T LHASH_OF_FUNCTION_
-T LHASH_OF_MEM_
-T LHASH_OF_OBJ_NAME_
-T LHASH_OF_OPENSSL_STRING_
-T LHASH_OF_SSL_SESSION_
-T LHASH_OF_STRING_
-T clock_t
-T custom_ext_methods
-T hm_fragment
-T krb5_auth_context
-T krb5_authdata
-T KRB5_CALLCONV
-T krb5_ccache
-T krb5_context
-T krb5_creds
-T krb5_data
-T krb5_deltat
-T krb5_flags
-T krb5_int32
-T krb5_keyblock
-T krb5_keytab
-T krb5_keytab_entry
-T krb5_octet
-T krb5_principal
-T krb5_principal_data
-T krb5_rcache
-T krb5_ticket
-T krb5_ticket_times
-T krb5_timestamp
-T record_pqueue
-T ssl_ctx_st
-T ssl_flag_tbl
-T ssl_st
-T ssl_trace_tbl
-T _stdcall
-T tls12_lookup
-T OPTIONS
-T OPT_PAIR
-T uint64_t
-T int64_t
-T uint32_t
-T int32_t
-T uint16_t
-T int16_t
-T uint8_t
-T int8_t
-T STRINT_PAIR
-T felem
-T felem_bytearray
-T SH_LIST
-T PACKET
-T RECORD_LAYER

108
openssl-1.0.2f/util/install.sh Executable file
View File

@@ -0,0 +1,108 @@
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5; it is not part of GNU.
#
# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
#
# This script is compatible with the BSD install script, but was written
# from scratch.
#
# set DOITPROG to echo to test this script
doit="${DOITPROG:-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG:-mv}"
cpprog="${CPPROG:-cp}"
chmodprog="${CHMODPROG:-chmod}"
chownprog="${CHOWNPROG:-chown}"
chgrpprog="${CHGRPPROG:-chgrp}"
stripprog="${STRIPPROG:-strip}"
rmprog="${RMPROG:-rm}"
instcmd="$mvprog"
chmodcmd=""
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
src=""
dst=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
fi
# if destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
fi
# get rid of the old one and mode the new one in
$doit $rmcmd $dst
$doit $instcmd $src $dst
# and set any options; do chmod last to preserve setuid bits
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; fi
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; fi
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; fi
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; fi
exit 0

4416
openssl-1.0.2f/util/libeay.num Executable file

File diff suppressed because it is too large Load Diff

1319
openssl-1.0.2f/util/mk1mf.pl Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,35 @@
#!/usr/local/bin/perl
my ($cflags, $platform) = @ARGV;
$cflags = "compiler: $cflags";
$date = localtime();
print <<"END_OUTPUT";
#ifndef MK1MF_BUILD
/* auto-generated by util/mkbuildinf.pl for crypto/cversion.c */
#define CFLAGS cflags
/*
* Generate CFLAGS as an array of individual characters. This is a
* workaround for the situation where CFLAGS gets too long for a C90 string
* literal
*/
static const char cflags[] = {
END_OUTPUT
my $ctr = 0;
foreach my $c (split //, $cflags) {
# Max 18 characters per line
if (($ctr++ % 18) == 0) {
if ($ctr != 1) {
print "\n";
}
print " ";
}
print "'$c',";
}
print <<"END_OUTPUT";
'\\0'
};
#define PLATFORM "platform: $platform"
#define DATE "built on: $date"
#endif
END_OUTPUT

220
openssl-1.0.2f/util/mkcerts.sh Executable file
View File

@@ -0,0 +1,220 @@
#!/bin/sh
# This script will re-make all the required certs.
# cd apps
# sh ../util/mkcerts.sh
# mv ca-cert.pem pca-cert.pem ../certs
# cd ..
# cat certs/*.pem >>apps/server.pem
# cat certs/*.pem >>apps/server2.pem
# SSLEAY=`pwd`/apps/ssleay; export SSLEAY
# sh tools/c_rehash certs
#
CAbits=1024
SSLEAY="../apps/openssl"
CONF="-config ../apps/openssl.cnf"
# create pca request.
echo creating $CAbits bit PCA cert request
$SSLEAY req $CONF \
-new -md5 -newkey $CAbits \
-keyout pca-key.pem \
-out pca-req.pem -nodes >/dev/null <<EOF
AU
Queensland
.
CryptSoft Pty Ltd
.
Test PCA (1024 bit)
EOF
if [ $? != 0 ]; then
echo problems generating PCA request
exit 1
fi
#sign it.
echo
echo self signing PCA
$SSLEAY x509 -md5 -days 1461 \
-req -signkey pca-key.pem \
-CAcreateserial -CAserial pca-cert.srl \
-in pca-req.pem -out pca-cert.pem
if [ $? != 0 ]; then
echo problems self signing PCA cert
exit 1
fi
echo
# create ca request.
echo creating $CAbits bit CA cert request
$SSLEAY req $CONF \
-new -md5 -newkey $CAbits \
-keyout ca-key.pem \
-out ca-req.pem -nodes >/dev/null <<EOF
AU
Queensland
.
CryptSoft Pty Ltd
.
Test CA (1024 bit)
EOF
if [ $? != 0 ]; then
echo problems generating CA request
exit 1
fi
#sign it.
echo
echo signing CA
$SSLEAY x509 -md5 -days 1461 \
-req \
-CAcreateserial -CAserial pca-cert.srl \
-CA pca-cert.pem -CAkey pca-key.pem \
-in ca-req.pem -out ca-cert.pem
if [ $? != 0 ]; then
echo problems signing CA cert
exit 1
fi
echo
# create server request.
echo creating 512 bit server cert request
$SSLEAY req $CONF \
-new -md5 -newkey 512 \
-keyout s512-key.pem \
-out s512-req.pem -nodes >/dev/null <<EOF
AU
Queensland
.
CryptSoft Pty Ltd
.
Server test cert (512 bit)
EOF
if [ $? != 0 ]; then
echo problems generating 512 bit server cert request
exit 1
fi
#sign it.
echo
echo signing 512 bit server cert
$SSLEAY x509 -md5 -days 365 \
-req \
-CAcreateserial -CAserial ca-cert.srl \
-CA ca-cert.pem -CAkey ca-key.pem \
-in s512-req.pem -out server.pem
if [ $? != 0 ]; then
echo problems signing 512 bit server cert
exit 1
fi
echo
# create 1024 bit server request.
echo creating 1024 bit server cert request
$SSLEAY req $CONF \
-new -md5 -newkey 1024 \
-keyout s1024key.pem \
-out s1024req.pem -nodes >/dev/null <<EOF
AU
Queensland
.
CryptSoft Pty Ltd
.
Server test cert (1024 bit)
EOF
if [ $? != 0 ]; then
echo problems generating 1024 bit server cert request
exit 1
fi
#sign it.
echo
echo signing 1024 bit server cert
$SSLEAY x509 -md5 -days 365 \
-req \
-CAcreateserial -CAserial ca-cert.srl \
-CA ca-cert.pem -CAkey ca-key.pem \
-in s1024req.pem -out server2.pem
if [ $? != 0 ]; then
echo problems signing 1024 bit server cert
exit 1
fi
echo
# create 512 bit client request.
echo creating 512 bit client cert request
$SSLEAY req $CONF \
-new -md5 -newkey 512 \
-keyout c512-key.pem \
-out c512-req.pem -nodes >/dev/null <<EOF
AU
Queensland
.
CryptSoft Pty Ltd
.
Client test cert (512 bit)
EOF
if [ $? != 0 ]; then
echo problems generating 512 bit client cert request
exit 1
fi
#sign it.
echo
echo signing 512 bit client cert
$SSLEAY x509 -md5 -days 365 \
-req \
-CAcreateserial -CAserial ca-cert.srl \
-CA ca-cert.pem -CAkey ca-key.pem \
-in c512-req.pem -out client.pem
if [ $? != 0 ]; then
echo problems signing 512 bit client cert
exit 1
fi
echo cleanup
cat pca-key.pem >> pca-cert.pem
cat ca-key.pem >> ca-cert.pem
cat s512-key.pem >> server.pem
cat s1024key.pem >> server2.pem
cat c512-key.pem >> client.pem
for i in pca-cert.pem ca-cert.pem server.pem server2.pem client.pem
do
$SSLEAY x509 -issuer -subject -in $i -noout >$$
cat $$
/bin/cat $i >>$$
/bin/mv $$ $i
done
#/bin/rm -f *key.pem *req.pem *.srl
echo Finished

1557
openssl-1.0.2f/util/mkdef.pl Executable file

File diff suppressed because it is too large Load Diff

34
openssl-1.0.2f/util/mkdir-p.pl Executable file
View File

@@ -0,0 +1,34 @@
#!/usr/local/bin/perl
# mkdir-p.pl
# On some systems, the -p option to mkdir (= also create any missing parent
# directories) is not available.
my $arg;
foreach $arg (@ARGV) {
$arg =~ tr|\\|/|;
&do_mkdir_p($arg);
}
sub do_mkdir_p {
local($dir) = @_;
$dir =~ s|/*\Z(?!\n)||s;
if (-d $dir) {
return;
}
if ($dir =~ m|[^/]/|s) {
local($parent) = $dir;
$parent =~ s|[^/]*\Z(?!\n)||s;
do_mkdir_p($parent);
}
mkdir($dir, 0777) || die "Cannot create directory $dir: $!\n";
print "created directory `$dir'\n";
}

View File

@@ -0,0 +1,818 @@
#!/usr/local/bin/perl -w
my $config = "crypto/err/openssl.ec";
my $hprefix = "openssl/";
my $debug = 0;
my $rebuild = 0;
my $static = 1;
my $recurse = 0;
my $reindex = 0;
my $dowrite = 0;
my $staticloader = "";
my $pack_errcode;
my $load_errcode;
my $errcount;
my $year = (localtime)[5] + 1900;
while (@ARGV) {
my $arg = $ARGV[0];
if($arg eq "-conf") {
shift @ARGV;
$config = shift @ARGV;
} elsif($arg eq "-hprefix") {
shift @ARGV;
$hprefix = shift @ARGV;
} elsif($arg eq "-debug") {
$debug = 1;
shift @ARGV;
} elsif($arg eq "-rebuild") {
$rebuild = 1;
shift @ARGV;
} elsif($arg eq "-recurse") {
$recurse = 1;
shift @ARGV;
} elsif($arg eq "-reindex") {
$reindex = 1;
shift @ARGV;
} elsif($arg eq "-nostatic") {
$static = 0;
shift @ARGV;
} elsif($arg eq "-staticloader") {
$staticloader = "static ";
shift @ARGV;
} elsif($arg eq "-write") {
$dowrite = 1;
shift @ARGV;
} elsif($arg eq "-help" || $arg eq "-h" || $arg eq "-?" || $arg eq "--help") {
print STDERR <<"EOF";
mkerr.pl [options] ...
Options:
-conf F Use the config file F instead of the default one:
crypto/err/openssl.ec
-hprefix P Prepend the filenames in generated #include <header>
statements with prefix P. Default: 'openssl/' (without
the quotes, naturally)
-debug Turn on debugging verbose output on stderr.
-rebuild Rebuild all header and C source files, irrespective of the
fact if any error or function codes have been added/removed.
Default: only update files for libraries which saw change
(of course, this requires '-write' as well, or no
files will be touched!)
-recurse scan a preconfigured set of directories / files for error and
function codes:
(<crypto/*.c>, <crypto/*/*.c>, <ssl/*.c>, <apps/*.c>)
When this option is NOT specified, the filelist is taken from
the commandline instead. Here, wildcards may be embedded. (Be
sure to escape those to prevent the shell from expanding them
for you when you wish mkerr.pl to do so instead.)
Default: take file list to scan from the command line.
-reindex Discard the numeric values previously assigned to the error
and function codes as extracted from the scanned header files;
instead renumber all of them starting from 100. (Note that
the numbers assigned through 'R' records in the config file
remain intact.)
Default: keep previously assigned numbers. (You are warned
when collisions are detected.)
-nostatic Generates a different source code, where these additional
functions are generated for each library specified in the
config file:
void ERR_load_<LIB>_strings(void);
void ERR_unload_<LIB>_strings(void);
void ERR_<LIB>_error(int f, int r, char *fn, int ln);
#define <LIB>err(f,r) ERR_<LIB>_error(f,r,__FILE__,__LINE__)
while the code facilitates the use of these in an environment
where the error support routines are dynamically loaded at
runtime.
Default: 'static' code generation.
-staticloader Prefix generated functions with the 'static' scope modifier.
Default: don't write any scope modifier prefix.
-write Actually (over)write the generated code to the header and C
source files as assigned to each library through the config
file.
Default: don't write.
-help / -h / -? / --help Show this help text.
... Additional arguments are added to the file list to scan,
assuming '-recurse' was NOT specified on the command line.
EOF
exit 1;
} else {
last;
}
}
if($recurse) {
@source = (<crypto/*.c>, <crypto/*/*.c>, <ssl/*.c>);
} else {
@source = @ARGV;
}
# Read in the config file
open(IN, "<$config") || die "Can't open config file $config";
# Parse config file
while(<IN>)
{
if(/^L\s+(\S+)\s+(\S+)\s+(\S+)/) {
$hinc{$1} = $2;
$libinc{$2} = $1;
$cskip{$3} = $1;
if($3 ne "NONE") {
$csrc{$1} = $3;
$fmax{$1} = 100;
$rmax{$1} = 100;
$fassigned{$1} = ":";
$rassigned{$1} = ":";
$fnew{$1} = 0;
$rnew{$1} = 0;
}
} elsif (/^F\s+(\S+)/) {
# Add extra function with $1
} elsif (/^R\s+(\S+)\s+(\S+)/) {
$rextra{$1} = $2;
$rcodes{$1} = $2;
}
}
close IN;
# Scan each header file in turn and make a list of error codes
# and function names
while (($hdr, $lib) = each %libinc)
{
next if($hdr eq "NONE");
print STDERR "Scanning header file $hdr\n" if $debug;
my $line = "", $def= "", $linenr = 0, $gotfile = 0;
if (open(IN, "<$hdr")) {
$gotfile = 1;
while(<IN>) {
$linenr++;
print STDERR "line: $linenr\r" if $debug;
last if(/BEGIN\s+ERROR\s+CODES/);
if ($line ne '') {
$_ = $line . $_;
$line = '';
}
if (/\\$/) {
$line = $_;
next;
}
if(/\/\*/) {
if (not /\*\//) { # multiline comment...
$line = $_; # ... just accumulate
next;
} else {
s/\/\*.*?\*\///gs; # wipe it
}
}
if ($cpp) {
$cpp++ if /^#\s*if/;
$cpp-- if /^#\s*endif/;
next;
}
$cpp = 1 if /^#.*ifdef.*cplusplus/; # skip "C" declaration
next if (/^\#/); # skip preprocessor directives
s/{[^{}]*}//gs; # ignore {} blocks
if (/\{|\/\*/) { # Add a } so editor works...
$line = $_;
} else {
$def .= $_;
}
}
}
print STDERR " \r" if $debug;
$defnr = 0;
# Delete any DECLARE_ macros
$def =~ s/DECLARE_\w+\([\w,\s]+\)//gs;
foreach (split /;/, $def) {
$defnr++;
print STDERR "def: $defnr\r" if $debug;
# The goal is to collect function names from function declarations.
s/^[\n\s]*//g;
s/[\n\s]*$//g;
# Skip over recognized non-function declarations
next if(/typedef\W/ or /DECLARE_STACK_OF/ or /TYPEDEF_.*_OF/);
# Remove STACK_OF(foo)
s/STACK_OF\(\w+\)/void/;
# Reduce argument lists to empty ()
# fold round brackets recursively: (t(*v)(t),t) -> (t{}{},t) -> {}
while(/\(.*\)/s) {
s/\([^\(\)]+\)/\{\}/gs;
s/\(\s*\*\s*(\w+)\s*\{\}\s*\)/$1/gs; #(*f{}) -> f
}
# pretend as we didn't use curly braces: {} -> ()
s/\{\}/\(\)/gs;
if (/(\w+)\s*\(\).*/s) { # first token prior [first] () is
my $name = $1; # a function name!
$name =~ tr/[a-z]/[A-Z]/;
$ftrans{$name} = $1;
} elsif (/[\(\)]/ and not (/=/)) {
print STDERR "Header $hdr: cannot parse: $_;\n";
}
}
print STDERR " \r" if $debug;
next if $reindex;
# Scan function and reason codes and store them: keep a note of the
# maximum code used.
if ($gotfile) {
while(<IN>) {
if(/^\#\s*define\s+(\S+)\s+(\S+)/) {
$name = $1;
$code = $2;
next if $name =~ /^${lib}err/;
unless($name =~ /^${lib}_([RF])_(\w+)$/) {
print STDERR "Invalid error code $name\n";
next;
}
if($1 eq "R") {
$rcodes{$name} = $code;
if ($rassigned{$lib} =~ /:$code:/) {
print STDERR "!! ERROR: $lib reason code $code assigned twice (collision at $name)\n";
++$errcount;
}
$rassigned{$lib} .= "$code:";
if(!(exists $rextra{$name}) &&
($code > $rmax{$lib}) ) {
$rmax{$lib} = $code;
}
} else {
if ($fassigned{$lib} =~ /:$code:/) {
print STDERR "!! ERROR: $lib function code $code assigned twice (collision at $name)\n";
++$errcount;
}
$fassigned{$lib} .= "$code:";
if($code > $fmax{$lib}) {
$fmax{$lib} = $code;
}
$fcodes{$name} = $code;
}
}
}
}
if ($debug) {
if (defined($fmax{$lib})) {
print STDERR "Max function code fmax" . "{" . "$lib" . "} = $fmax{$lib}\n";
$fassigned{$lib} =~ m/^:(.*):$/;
@fassigned = sort {$a <=> $b} split(":", $1);
print STDERR " @fassigned\n";
}
if (defined($rmax{$lib})) {
print STDERR "Max reason code rmax" . "{" . "$lib" . "} = $rmax{$lib}\n";
$rassigned{$lib} =~ m/^:(.*):$/;
@rassigned = sort {$a <=> $b} split(":", $1);
print STDERR " @rassigned\n";
}
}
if ($lib eq "SSL") {
if ($rmax{$lib} >= 1000) {
print STDERR "!! ERROR: SSL error codes 1000+ are reserved for alerts.\n";
print STDERR "!! Any new alerts must be added to $config.\n";
++$errcount;
print STDERR "\n";
}
}
close IN;
}
# Scan each C source file and look for function and reason codes
# This is done by looking for strings that "look like" function or
# reason codes: basically anything consisting of all upper case and
# numerics which has _F_ or _R_ in it and which has the name of an
# error library at the start. This seems to work fine except for the
# oddly named structure BIO_F_CTX which needs to be ignored.
# If a code doesn't exist in list compiled from headers then mark it
# with the value "X" as a place holder to give it a value later.
# Store all function and reason codes found in %ufcodes and %urcodes
# so all those unreferenced can be printed out.
foreach $file (@source) {
# Don't parse the error source file.
next if exists $cskip{$file};
print STDERR "File loaded: ".$file."\r" if $debug;
open(IN, "<$file") || die "Can't open source file $file\n";
while(<IN>) {
# skip obsoleted source files entirely!
last if(/^#error\s+obsolete/);
if(/(([A-Z0-9]+)_F_([A-Z0-9_]+))/) {
next unless exists $csrc{$2};
next if($1 eq "BIO_F_BUFFER_CTX");
$ufcodes{$1} = 1;
if(!exists $fcodes{$1}) {
$fcodes{$1} = "X";
$fnew{$2}++;
}
$notrans{$1} = 1 unless exists $ftrans{$3};
print STDERR "Function: $1\t= $fcodes{$1} (lib: $2, name: $3)\n" if $debug;
}
if(/(([A-Z0-9]+)_R_[A-Z0-9_]+)/) {
next unless exists $csrc{$2};
$urcodes{$1} = 1;
if(!exists $rcodes{$1}) {
$rcodes{$1} = "X";
$rnew{$2}++;
}
print STDERR "Reason: $1\t= $rcodes{$1} (lib: $2)\n" if $debug;
}
}
close IN;
}
print STDERR " \n" if $debug;
# Now process each library in turn.
foreach $lib (keys %csrc)
{
my $hfile = $hinc{$lib};
my $cfile = $csrc{$lib};
if(!$fnew{$lib} && !$rnew{$lib}) {
print STDERR "$lib:\t\tNo new error codes\n";
next unless $rebuild;
} else {
print STDERR "$lib:\t\t$fnew{$lib} New Functions,";
print STDERR " $rnew{$lib} New Reasons.\n";
next unless $dowrite;
}
# If we get here then we have some new error codes so we
# need to rebuild the header file and C file.
# Make a sorted list of error and reason codes for later use.
my @function = sort grep(/^${lib}_/,keys %fcodes);
my @reasons = sort grep(/^${lib}_/,keys %rcodes);
# Rewrite the header file
if (open(IN, "<$hfile")) {
# Copy across the old file
while(<IN>) {
push @out, $_;
last if (/BEGIN ERROR CODES/);
}
close IN;
} else {
push @out,
"/* ====================================================================\n",
" * Copyright (c) 2001-$year The OpenSSL Project. All rights reserved.\n",
" *\n",
" * Redistribution and use in source and binary forms, with or without\n",
" * modification, are permitted provided that the following conditions\n",
" * are met:\n",
" *\n",
" * 1. Redistributions of source code must retain the above copyright\n",
" * notice, this list of conditions and the following disclaimer. \n",
" *\n",
" * 2. Redistributions in binary form must reproduce the above copyright\n",
" * notice, this list of conditions and the following disclaimer in\n",
" * the documentation and/or other materials provided with the\n",
" * distribution.\n",
" *\n",
" * 3. All advertising materials mentioning features or use of this\n",
" * software must display the following acknowledgment:\n",
" * \"This product includes software developed by the OpenSSL Project\n",
" * for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n",
" *\n",
" * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n",
" * endorse or promote products derived from this software without\n",
" * prior written permission. For written permission, please contact\n",
" * openssl-core\@openssl.org.\n",
" *\n",
" * 5. Products derived from this software may not be called \"OpenSSL\"\n",
" * nor may \"OpenSSL\" appear in their names without prior written\n",
" * permission of the OpenSSL Project.\n",
" *\n",
" * 6. Redistributions of any form whatsoever must retain the following\n",
" * acknowledgment:\n",
" * \"This product includes software developed by the OpenSSL Project\n",
" * for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n",
" *\n",
" * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n",
" * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n",
" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n",
" * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR\n",
" * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n",
" * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n",
" * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n",
" * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n",
" * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n",
" * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n",
" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n",
" * OF THE POSSIBILITY OF SUCH DAMAGE.\n",
" * ====================================================================\n",
" *\n",
" * This product includes cryptographic software written by Eric Young\n",
" * (eay\@cryptsoft.com). This product includes software written by Tim\n",
" * Hudson (tjh\@cryptsoft.com).\n",
" *\n",
" */\n",
"\n",
"#ifndef HEADER_${lib}_ERR_H\n",
"#define HEADER_${lib}_ERR_H\n",
"\n",
"#ifdef __cplusplus\n",
"extern \"C\" {\n",
"#endif\n",
"\n",
"/* BEGIN ERROR CODES */\n";
}
open (OUT, ">$hfile") || die "Can't Open File $hfile for writing\n";
print OUT @out;
undef @out;
print OUT <<"EOF";
/*
* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
EOF
if($static) {
print OUT <<"EOF";
${staticloader}void ERR_load_${lib}_strings(void);
EOF
} else {
print OUT <<"EOF";
${staticloader}void ERR_load_${lib}_strings(void);
${staticloader}void ERR_unload_${lib}_strings(void);
${staticloader}void ERR_${lib}_error(int function, int reason, char *file, int line);
# define ${lib}err(f,r) ERR_${lib}_error((f),(r),__FILE__,__LINE__)
EOF
}
print OUT <<"EOF";
/* Error codes for the $lib functions. */
/* Function codes. */
EOF
foreach $i (@function) {
$z=48 - length($i);
if($fcodes{$i} eq "X") {
$fassigned{$lib} =~ m/^:([^:]*):/;
$findcode = $1;
if (!defined($findcode)) {
$findcode = $fmax{$lib};
}
while ($fassigned{$lib} =~ m/:$findcode:/) {
$findcode++;
}
$fcodes{$i} = $findcode;
$fassigned{$lib} .= "$findcode:";
print STDERR "New Function code $i\n" if $debug;
}
printf OUT "# define $i%s $fcodes{$i}\n"," " x $z;
}
print OUT "\n/* Reason codes. */\n";
foreach $i (@reasons) {
$z=48 - length($i);
if($rcodes{$i} eq "X") {
$rassigned{$lib} =~ m/^:([^:]*):/;
$findcode = $1;
if (!defined($findcode)) {
$findcode = $rmax{$lib};
}
while ($rassigned{$lib} =~ m/:$findcode:/) {
$findcode++;
}
$rcodes{$i} = $findcode;
$rassigned{$lib} .= "$findcode:";
print STDERR "New Reason code $i\n" if $debug;
}
printf OUT "# define $i%s $rcodes{$i}\n"," " x $z;
}
print OUT <<"EOF";
#ifdef __cplusplus
}
#endif
#endif
EOF
close OUT;
# Rewrite the C source file containing the error details.
# First, read any existing reason string definitions:
my %err_reason_strings;
if (open(IN,"<$cfile")) {
my $line = "";
while (<IN>) {
chomp;
$_ = $line . $_;
$line = "";
if (/{ERR_(FUNC|REASON)\(/) {
if (/\b(${lib}_R_\w*)\b.*\"(.*)\"/) {
$err_reason_strings{$1} = $2;
} elsif (/\b${lib}_F_(\w*)\b.*\"(.*)\"/) {
if (!exists $ftrans{$1} && ($1 ne $2)) {
print STDERR "WARNING: Mismatched function string $2\n";
$ftrans{$1} = $2;
}
} else {
$line = $_;
}
}
}
close(IN);
}
my $hincf;
if($static) {
$hfile =~ /([^\/]+)$/;
$hincf = "<${hprefix}$1>";
} else {
$hincf = "\"$hfile\"";
}
# If static we know the error code at compile time so use it
# in error definitions.
if ($static)
{
$pack_errcode = "ERR_LIB_${lib}";
$load_errcode = "0";
}
else
{
$pack_errcode = "0";
$load_errcode = "ERR_LIB_${lib}";
}
open (OUT,">$cfile") || die "Can't open $cfile for writing";
print OUT <<"EOF";
/* $cfile */
/* ====================================================================
* Copyright (c) 1999-$year The OpenSSL Project. All rights reserved.
*
* 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 above 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 acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core\@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED 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 OpenSSL PROJECT OR
* ITS 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.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay\@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh\@cryptsoft.com).
*
*/
/*
* NOTE: this file was auto generated by the mkerr.pl script: any changes
* made to it will be overwritten when the script next updates this file,
* only reason strings will be preserved.
*/
#include <stdio.h>
#include <openssl/err.h>
#include $hincf
/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR
# define ERR_FUNC(func) ERR_PACK($pack_errcode,func,0)
# define ERR_REASON(reason) ERR_PACK($pack_errcode,0,reason)
static ERR_STRING_DATA ${lib}_str_functs[] = {
EOF
# Add each function code: if a function name is found then use it.
foreach $i (@function) {
my $fn;
$i =~ /^${lib}_F_(\S+)$/;
$fn = $1;
if(exists $ftrans{$fn}) {
$fn = $ftrans{$fn};
}
# print OUT "{ERR_PACK($pack_errcode,$i,0),\t\"$fn\"},\n";
if(length($i) + length($fn) > 58) {
print OUT " {ERR_FUNC($i),\n \"$fn\"},\n";
} else {
print OUT " {ERR_FUNC($i), \"$fn\"},\n";
}
}
print OUT <<"EOF";
{0, NULL}
};
static ERR_STRING_DATA ${lib}_str_reasons[] = {
EOF
# Add each reason code.
foreach $i (@reasons) {
my $rn;
my $rstr = "ERR_REASON($i)";
if (exists $err_reason_strings{$i}) {
$rn = $err_reason_strings{$i};
} else {
$i =~ /^${lib}_R_(\S+)$/;
$rn = $1;
$rn =~ tr/_[A-Z]/ [a-z]/;
}
if(length($i) + length($rn) > 56) {
print OUT " {${rstr},\n \"$rn\"},\n";
} else {
print OUT " {${rstr}, \"$rn\"},\n";
}
}
if($static) {
print OUT <<"EOF";
{0, NULL}
};
#endif
${staticloader}void ERR_load_${lib}_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(${lib}_str_functs[0].error) == NULL) {
ERR_load_strings($load_errcode, ${lib}_str_functs);
ERR_load_strings($load_errcode, ${lib}_str_reasons);
}
#endif
}
EOF
} else {
print OUT <<"EOF";
{0, NULL}
};
#endif
#ifdef ${lib}_LIB_NAME
static ERR_STRING_DATA ${lib}_lib_name[] = {
{0, ${lib}_LIB_NAME},
{0, NULL}
};
#endif
static int ${lib}_lib_error_code = 0;
static int ${lib}_error_init = 1;
${staticloader}void ERR_load_${lib}_strings(void)
{
if (${lib}_lib_error_code == 0)
${lib}_lib_error_code = ERR_get_next_error_library();
if (${lib}_error_init) {
${lib}_error_init = 0;
#ifndef OPENSSL_NO_ERR
ERR_load_strings(${lib}_lib_error_code, ${lib}_str_functs);
ERR_load_strings(${lib}_lib_error_code, ${lib}_str_reasons);
#endif
#ifdef ${lib}_LIB_NAME
${lib}_lib_name->error = ERR_PACK(${lib}_lib_error_code, 0, 0);
ERR_load_strings(0, ${lib}_lib_name);
#endif
}
}
${staticloader}void ERR_unload_${lib}_strings(void)
{
if (${lib}_error_init == 0) {
#ifndef OPENSSL_NO_ERR
ERR_unload_strings(${lib}_lib_error_code, ${lib}_str_functs);
ERR_unload_strings(${lib}_lib_error_code, ${lib}_str_reasons);
#endif
#ifdef ${lib}_LIB_NAME
ERR_unload_strings(0, ${lib}_lib_name);
#endif
${lib}_error_init = 1;
}
}
${staticloader}void ERR_${lib}_error(int function, int reason, char *file, int line)
{
if (${lib}_lib_error_code == 0)
${lib}_lib_error_code = ERR_get_next_error_library();
ERR_PUT_error(${lib}_lib_error_code, function, reason, file, line);
}
EOF
}
close OUT;
undef %err_reason_strings;
}
if($debug && %notrans) {
print STDERR "The following function codes were not translated:\n";
foreach(sort keys %notrans)
{
print STDERR "$_\n";
}
}
# Make a list of unreferenced function and reason codes
foreach (keys %fcodes) {
push (@funref, $_) unless exists $ufcodes{$_};
}
foreach (keys %rcodes) {
push (@runref, $_) unless exists $urcodes{$_};
}
if($debug && @funref) {
print STDERR "The following function codes were not referenced:\n";
foreach(sort @funref)
{
print STDERR "$_\n";
}
}
if($debug && @runref) {
print STDERR "The following reason codes were not referenced:\n";
foreach(sort @runref)
{
print STDERR "$_\n";
}
}
if($errcount) {
print STDERR "There were errors, failing...\n\n";
exit $errcount;
}

143
openssl-1.0.2f/util/mkfiles.pl Executable file
View File

@@ -0,0 +1,143 @@
#!/usr/local/bin/perl
#
# This is a hacked version of files.pl for systems that can't do a 'make files'.
# Do a perl util/mkminfo.pl >MINFO to build MINFO
# Written by Steve Henson 1999.
# List of directories to process
my @dirs = (
".",
"crypto",
"crypto/md2",
"crypto/md4",
"crypto/md5",
"crypto/sha",
"crypto/mdc2",
"crypto/hmac",
"crypto/cmac",
"crypto/ripemd",
"crypto/des",
"crypto/rc2",
"crypto/rc4",
"crypto/rc5",
"crypto/idea",
"crypto/bf",
"crypto/cast",
"crypto/aes",
"crypto/camellia",
"crypto/seed",
"crypto/modes",
"crypto/bn",
"crypto/rsa",
"crypto/dsa",
"crypto/dso",
"crypto/dh",
"crypto/ec",
"crypto/ecdh",
"crypto/ecdsa",
"crypto/buffer",
"crypto/bio",
"crypto/stack",
"crypto/lhash",
"crypto/rand",
"crypto/err",
"crypto/objects",
"crypto/evp",
"crypto/asn1",
"crypto/pem",
"crypto/x509",
"crypto/x509v3",
"crypto/cms",
"crypto/conf",
"crypto/jpake",
"crypto/txt_db",
"crypto/pkcs7",
"crypto/pkcs12",
"crypto/comp",
"crypto/engine",
"crypto/ocsp",
"crypto/ui",
"crypto/krb5",
#"crypto/store",
"crypto/pqueue",
"crypto/whrlpool",
"crypto/ts",
"crypto/srp",
"ssl",
"apps",
"engines",
"engines/ccgost",
"test",
"tools"
);
%top;
foreach (@dirs) {
&files_dir ($_, "Makefile");
}
exit(0);
sub files_dir
{
my ($dir, $makefile) = @_;
my %sym;
open (IN, "$dir/$makefile") || die "Can't open $dir/$makefile";
my $s="";
while (<IN>)
{
chop;
s/#.*//;
if (/^(\S+)\s*=\s*(.*)$/)
{
$o="";
($s,$b)=($1,$2);
for (;;)
{
if ($b =~ /\\$/)
{
chop($b);
$o.=$b." ";
$b=<IN>;
chop($b);
}
else
{
$o.=$b." ";
last;
}
}
$o =~ s/^\s+//;
$o =~ s/\s+$//;
$o =~ s/\s+/ /g;
$o =~ s/\$[({]([^)}]+)[)}]/$top{$1} or $sym{$1}/ge;
$sym{$s}=($top{$s} or $o);
}
}
print "RELATIVE_DIRECTORY=$dir\n";
foreach (sort keys %sym)
{
print "$_=$sym{$_}\n";
}
if ($dir eq "." && defined($sym{"BUILDENV"}))
{
foreach (split(' ',$sym{"BUILDENV"}))
{
/^(.+)=/;
$top{$1}=$sym{$1};
}
}
print "RELATIVE_DIRECTORY=\n";
close (IN);
}

73
openssl-1.0.2f/util/mklink.pl Executable file
View File

@@ -0,0 +1,73 @@
#!/usr/local/bin/perl
# mklink.pl
# The first command line argument is a non-empty relative path
# specifying the "from" directory.
# Each other argument is a file name not containing / and
# names a file in the current directory.
#
# For each of these files, we create in the "from" directory a link
# of the same name pointing to the local file.
#
# We assume that the directory structure is a tree, i.e. that it does
# not contain symbolic links and that the parent of / is never referenced.
# Apart from this, this script should be able to handle even the most
# pathological cases.
use Cwd;
my $from = shift;
my @files = @ARGV;
my @from_path = split(/[\\\/]/, $from);
my $pwd = getcwd();
chomp($pwd);
my @pwd_path = split(/[\\\/]/, $pwd);
my @to_path = ();
my $dirname;
foreach $dirname (@from_path) {
# In this loop, @to_path always is a relative path from
# @pwd_path (interpreted is an absolute path) to the original pwd.
# At the end, @from_path (as a relative path from the original pwd)
# designates the same directory as the absolute path @pwd_path,
# which means that @to_path then is a path from there to the original pwd.
next if ($dirname eq "" || $dirname eq ".");
if ($dirname eq "..") {
@to_path = (pop(@pwd_path), @to_path);
} else {
@to_path = ("..", @to_path);
push(@pwd_path, $dirname);
}
}
my $to = join('/', @to_path);
my $file;
$symlink_exists=eval {symlink("",""); 1};
if ($^O eq "msys") { $symlink_exists=0 };
foreach $file (@files) {
my $err = "";
if ($symlink_exists) {
unlink "$from/$file";
symlink("$to/$file", "$from/$file") or $err = " [$!]";
} else {
unlink "$from/$file";
open (OLD, "<$file") or die "Can't open $file: $!";
open (NEW, ">$from/$file") or die "Can't open $from/$file: $!";
binmode(OLD);
binmode(NEW);
while (<OLD>) {
print NEW $_;
}
close (OLD) or die "Can't close $file: $!";
close (NEW) or die "Can't close $from/$file: $!";
}
print $file . " => $from/$file$err\n";
}

71
openssl-1.0.2f/util/mkrc.pl Executable file
View File

@@ -0,0 +1,71 @@
#!/bin/env perl
#
open FD,"crypto/opensslv.h";
while(<FD>) {
if (/OPENSSL_VERSION_NUMBER\s+(0x[0-9a-f]+)/i) {
$ver = hex($1);
$v1 = ($ver>>28);
$v2 = ($ver>>20)&0xff;
$v3 = ($ver>>12)&0xff;
$v4 = ($ver>> 4)&0xff;
$beta = $ver&0xf;
$version = "$v1.$v2.$v3";
if ($beta==0xf) { $version .= chr(ord('a')+$v4-1) if ($v4); }
elsif ($beta==0){ $version .= "-dev"; }
else { $version .= "-beta$beta"; }
last;
}
}
close(FD);
$filename = $ARGV[0]; $filename =~ /(.*)\.([^.]+)$/;
$basename = $1;
$extname = $2;
if ($extname =~ /dll/i) { $description = "OpenSSL shared library"; }
else { $description = "OpenSSL application"; }
print <<___;
#include <winver.h>
LANGUAGE 0x09,0x01
1 VERSIONINFO
FILEVERSION $v1,$v2,$v3,$v4
PRODUCTVERSION $v1,$v2,$v3,$v4
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x01L
#else
FILEFLAGS 0x00L
#endif
FILEOS VOS__WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
// Required:
VALUE "CompanyName", "The OpenSSL Project, http://www.openssl.org/\\0"
VALUE "FileDescription", "$description\\0"
VALUE "FileVersion", "$version\\0"
VALUE "InternalName", "$basename\\0"
VALUE "OriginalFilename", "$filename\\0"
VALUE "ProductName", "The OpenSSL Toolkit\\0"
VALUE "ProductVersion", "$version\\0"
// Optional:
//VALUE "Comments", "\\0"
VALUE "LegalCopyright", "Copyright © 1998-2006 The OpenSSL Project. Copyright © 1995-1998 Eric A. Young, Tim J. Hudson. All rights reserved.\\0"
//VALUE "LegalTrademarks", "\\0"
//VALUE "PrivateBuild", "\\0"
//VALUE "SpecialBuild", "\\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 0x4b0
END
END
___

194
openssl-1.0.2f/util/mkstack.pl Executable file
View File

@@ -0,0 +1,194 @@
#!/usr/local/bin/perl -w
# This is a utility that searches out "DECLARE_STACK_OF()"
# declarations in .h and .c files, and updates/creates/replaces
# the corresponding macro declarations in crypto/stack/safestack.h.
# As it's not generally possible to have macros that generate macros,
# we need to control this from the "outside", here in this script.
#
# Geoff Thorpe, June, 2000 (with massive Perl-hacking
# help from Steve Robb)
my $safestack = "crypto/stack/safestack";
my $do_write;
while (@ARGV) {
my $arg = $ARGV[0];
if($arg eq "-write") {
$do_write = 1;
}
shift @ARGV;
}
@source = (<crypto/*.[ch]>, <crypto/*/*.[ch]>, <ssl/*.[ch]>, <apps/*.[ch]>);
foreach $file (@source) {
next if -l $file;
# Open the .c/.h file for reading
open(IN, "< $file") || die "Can't open $file for reading: $!";
while(<IN>) {
if (/^DECLARE_STACK_OF\(([^)]+)\)/) {
push @stacklst, $1;
}
if (/^DECLARE_SPECIAL_STACK_OF\(([^,\s]+)\s*,\s*([^>\s]+)\)/) {
push @sstacklst, [$1, $2];
}
if (/^DECLARE_ASN1_SET_OF\(([^)]+)\)/) {
push @asn1setlst, $1;
}
if (/^DECLARE_PKCS12_STACK_OF\(([^)]+)\)/) {
push @p12stklst, $1;
}
if (/^DECLARE_LHASH_OF\(([^)]+)\)/) {
push @lhashlst, $1;
}
}
close(IN);
}
my $old_stackfile = "";
my $new_stackfile = "";
my $inside_block = 0;
my $type_thing;
open(IN, "< $safestack.h") || die "Can't open input file: $!";
while(<IN>) {
$old_stackfile .= $_;
if (m|^/\* This block of defines is updated by util/mkstack.pl, please do not touch! \*/|) {
$inside_block = 1;
}
if (m|^/\* End of util/mkstack.pl block, you may now edit :-\) \*/|) {
$inside_block = 0;
} elsif ($inside_block == 0) {
$new_stackfile .= $_;
}
next if($inside_block != 1);
$new_stackfile .= "/* This block of defines is updated by util/mkstack.pl, please do not touch! */";
foreach $type_thing (sort @stacklst) {
$new_stackfile .= <<EOF;
#define sk_${type_thing}_new(cmp) SKM_sk_new($type_thing, (cmp))
#define sk_${type_thing}_new_null() SKM_sk_new_null($type_thing)
#define sk_${type_thing}_free(st) SKM_sk_free($type_thing, (st))
#define sk_${type_thing}_num(st) SKM_sk_num($type_thing, (st))
#define sk_${type_thing}_value(st, i) SKM_sk_value($type_thing, (st), (i))
#define sk_${type_thing}_set(st, i, val) SKM_sk_set($type_thing, (st), (i), (val))
#define sk_${type_thing}_zero(st) SKM_sk_zero($type_thing, (st))
#define sk_${type_thing}_push(st, val) SKM_sk_push($type_thing, (st), (val))
#define sk_${type_thing}_unshift(st, val) SKM_sk_unshift($type_thing, (st), (val))
#define sk_${type_thing}_find(st, val) SKM_sk_find($type_thing, (st), (val))
#define sk_${type_thing}_find_ex(st, val) SKM_sk_find_ex($type_thing, (st), (val))
#define sk_${type_thing}_delete(st, i) SKM_sk_delete($type_thing, (st), (i))
#define sk_${type_thing}_delete_ptr(st, ptr) SKM_sk_delete_ptr($type_thing, (st), (ptr))
#define sk_${type_thing}_insert(st, val, i) SKM_sk_insert($type_thing, (st), (val), (i))
#define sk_${type_thing}_set_cmp_func(st, cmp) SKM_sk_set_cmp_func($type_thing, (st), (cmp))
#define sk_${type_thing}_dup(st) SKM_sk_dup($type_thing, st)
#define sk_${type_thing}_pop_free(st, free_func) SKM_sk_pop_free($type_thing, (st), (free_func))
#define sk_${type_thing}_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy($type_thing, (st), (copy_func), (free_func))
#define sk_${type_thing}_shift(st) SKM_sk_shift($type_thing, (st))
#define sk_${type_thing}_pop(st) SKM_sk_pop($type_thing, (st))
#define sk_${type_thing}_sort(st) SKM_sk_sort($type_thing, (st))
#define sk_${type_thing}_is_sorted(st) SKM_sk_is_sorted($type_thing, (st))
EOF
}
foreach $type_thing (sort { $a->[0] cmp $b->[0]} @sstacklst) {
my $t1 = $type_thing->[0];
my $t2 = $type_thing->[1];
$new_stackfile .= <<EOF;
#define sk_${t1}_new(cmp) ((STACK_OF($t1) *)sk_new(CHECKED_SK_CMP_FUNC($t2, cmp)))
#define sk_${t1}_new_null() ((STACK_OF($t1) *)sk_new_null())
#define sk_${t1}_push(st, val) sk_push(CHECKED_STACK_OF($t1, st), CHECKED_PTR_OF($t2, val))
#define sk_${t1}_find(st, val) sk_find(CHECKED_STACK_OF($t1, st), CHECKED_PTR_OF($t2, val))
#define sk_${t1}_value(st, i) (($t1)sk_value(CHECKED_STACK_OF($t1, st), i))
#define sk_${t1}_num(st) SKM_sk_num($t1, st)
#define sk_${t1}_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF($t1, st), CHECKED_SK_FREE_FUNC($t2, free_func))
#define sk_${t1}_deep_copy(st, copy_func, free_func) ((STACK_OF($t1) *)sk_deep_copy(CHECKED_STACK_OF($t1, st), CHECKED_SK_COPY_FUNC($t2, copy_func), CHECKED_SK_FREE_FUNC($t2, free_func)))
#define sk_${t1}_insert(st, val, i) sk_insert(CHECKED_STACK_OF($t1, st), CHECKED_PTR_OF($t2, val), i)
#define sk_${t1}_free(st) SKM_sk_free(${t1}, st)
#define sk_${t1}_set(st, i, val) sk_set(CHECKED_STACK_OF($t1, st), i, CHECKED_PTR_OF($t2, val))
#define sk_${t1}_zero(st) SKM_sk_zero($t1, (st))
#define sk_${t1}_unshift(st, val) sk_unshift(CHECKED_STACK_OF($t1, st), CHECKED_PTR_OF($t2, val))
#define sk_${t1}_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF($t1), st), CHECKED_CONST_PTR_OF($t2, val))
#define sk_${t1}_delete(st, i) SKM_sk_delete($t1, (st), (i))
#define sk_${t1}_delete_ptr(st, ptr) ($t1 *)sk_delete_ptr(CHECKED_STACK_OF($t1, st), CHECKED_PTR_OF($t2, ptr))
#define sk_${t1}_set_cmp_func(st, cmp) \\
((int (*)(const $t2 * const *,const $t2 * const *)) \\
sk_set_cmp_func(CHECKED_STACK_OF($t1, st), CHECKED_SK_CMP_FUNC($t2, cmp)))
#define sk_${t1}_dup(st) SKM_sk_dup($t1, st)
#define sk_${t1}_shift(st) SKM_sk_shift($t1, (st))
#define sk_${t1}_pop(st) ($t2 *)sk_pop(CHECKED_STACK_OF($t1, st))
#define sk_${t1}_sort(st) SKM_sk_sort($t1, (st))
#define sk_${t1}_is_sorted(st) SKM_sk_is_sorted($t1, (st))
EOF
}
foreach $type_thing (sort @asn1setlst) {
$new_stackfile .= <<EOF;
#define d2i_ASN1_SET_OF_${type_thing}(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\
SKM_ASN1_SET_OF_d2i($type_thing, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
#define i2d_ASN1_SET_OF_${type_thing}(st, pp, i2d_func, ex_tag, ex_class, is_set) \\
SKM_ASN1_SET_OF_i2d($type_thing, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
#define ASN1_seq_pack_${type_thing}(st, i2d_func, buf, len) \\
SKM_ASN1_seq_pack($type_thing, (st), (i2d_func), (buf), (len))
#define ASN1_seq_unpack_${type_thing}(buf, len, d2i_func, free_func) \\
SKM_ASN1_seq_unpack($type_thing, (buf), (len), (d2i_func), (free_func))
EOF
}
foreach $type_thing (sort @p12stklst) {
$new_stackfile .= <<EOF;
#define PKCS12_decrypt_d2i_${type_thing}(algor, d2i_func, free_func, pass, passlen, oct, seq) \\
SKM_PKCS12_decrypt_d2i($type_thing, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq))
EOF
}
foreach $type_thing (sort @lhashlst) {
my $lc_tt = lc $type_thing;
$new_stackfile .= <<EOF;
#define lh_${type_thing}_new() LHM_lh_new(${type_thing},${lc_tt})
#define lh_${type_thing}_insert(lh,inst) LHM_lh_insert(${type_thing},lh,inst)
#define lh_${type_thing}_retrieve(lh,inst) LHM_lh_retrieve(${type_thing},lh,inst)
#define lh_${type_thing}_delete(lh,inst) LHM_lh_delete(${type_thing},lh,inst)
#define lh_${type_thing}_doall(lh,fn) LHM_lh_doall(${type_thing},lh,fn)
#define lh_${type_thing}_doall_arg(lh,fn,arg_type,arg) \\
LHM_lh_doall_arg(${type_thing},lh,fn,arg_type,arg)
#define lh_${type_thing}_error(lh) LHM_lh_error(${type_thing},lh)
#define lh_${type_thing}_num_items(lh) LHM_lh_num_items(${type_thing},lh)
#define lh_${type_thing}_down_load(lh) LHM_lh_down_load(${type_thing},lh)
#define lh_${type_thing}_node_stats_bio(lh,out) \\
LHM_lh_node_stats_bio(${type_thing},lh,out)
#define lh_${type_thing}_node_usage_stats_bio(lh,out) \\
LHM_lh_node_usage_stats_bio(${type_thing},lh,out)
#define lh_${type_thing}_stats_bio(lh,out) \\
LHM_lh_stats_bio(${type_thing},lh,out)
#define lh_${type_thing}_free(lh) LHM_lh_free(${type_thing},lh)
EOF
}
$new_stackfile .= "/* End of util/mkstack.pl block, you may now edit :-) */\n";
$inside_block = 2;
}
if ($new_stackfile eq $old_stackfile) {
print "No changes to $safestack.h.\n";
exit 0; # avoid unnecessary rebuild
}
if ($do_write) {
print "Writing new $safestack.h.\n";
open OUT, ">$safestack.h" || die "Can't open output file";
print OUT $new_stackfile;
close OUT;
}

View File

@@ -0,0 +1,148 @@
#!/bin/sh
#
# openssl-format-source
# - format source tree according to OpenSSL coding style using indent
#
# usage:
# openssl-format-source [-v] [-n] [file|directory] ...
#
# note: the indent options assume GNU indent v2.2.10 which was released
# Feb-2009 so if you have an older indent the options may not
# match what is expected
#
# any marked block comment blocks have to be moved to align manually after
# the reformatting has been completed as marking a block causes indent to
# not move it at all ...
#
PATH=/usr/local/bin:/bin:/usr/bin:$PATH
export PATH
HERE="`dirname $0`"
set -e
if [ $# -eq 0 ]; then
echo "usage: $0 [-v] [-n] [-c] [sourcefile|sourcedir] ..." >&2
exit 1
fi
VERBOSE=false
DONT=false
STOPARGS=false
COMMENTS=false
DEBUG=""
# for this exercise, we want to force the openssl style, so we roll
# our own indent profile, which is at a well known location
INDENT_PROFILE="$HERE/indent.pro"
export INDENT_PROFILE
if [ ! -f "$INDENT_PROFILE" ]; then
echo "$0: unable to locate the openssl indent.pro file" >&2
exit 1
fi
# Extra arguments; for adding the comment-formatting
INDENT_ARGS=""
for i
do
if [ "$STOPARGS" != "true" ]; then
case $i in
--) STOPARGS="true"; continue;;
-n) DONT="true"; continue;;
-v) VERBOSE="true";
echo "INDENT_PROFILE=$INDENT_PROFILE";
continue;;
-c) COMMENTS="true";
INDENT_ARGS="-fc1 -fca -cdb -sc";
continue;;
-nc) COMMENTS="true";
continue;;
-d) DEBUG='eval tee "$j.pre" |'
continue;;
esac
fi
if [ -d "$i" ]; then
LIST=`find "$i" -name '*.[ch]' -print`
else
if [ ! -f "$i" ]; then
echo "$0: source file not found: $i" >&2
exit 1
fi
LIST="$i"
fi
for j in $LIST
do
# ignore symlinks - we only ever process the base file - so if we
# expand a directory tree we need to ignore any located symlinks
if [ -d "$i" ]; then
if [ -h "$j" ]; then
continue;
fi
fi
if [ "$VERBOSE" = "true" ]; then
echo "$j"
fi
if [ "$DONT" = "false" ]; then
tmp=$(mktemp /tmp/indent.XXXXXX)
trap 'rm -f "$tmp"' HUP INT TERM EXIT
case `basename $j` in
# the list of files that indent is unable to handle correctly
# that we simply leave alone for manual formatting now
obj_dat.h|aes_core.c|aes_x86core.c|ecp_nistz256.c)
echo "skipping $j"
;;
*)
if [ "$COMMENTS" = "true" ]; then
# we have to mark single line comments as /*- ...*/ to stop indent
# messing with them, run expand then indent as usual but with the
# the process-comments options and then undo that marking, and then
# finally re-run indent without process-comments so the marked-to-
# be-ignored comments we did automatically end up getting moved
# into the right possition within the code as indent leaves marked
# comments entirely untouched - we appear to have no way to avoid
# the double processing and get the desired output
cat "$j" | \
expand | \
perl -0 -np \
-e 's/(\n#[ \t]*ifdef[ \t]+__cplusplus\n[^\n]*\n#[ \t]*endif\n)/\n\/**INDENT-OFF**\/$1\/**INDENT-ON**\/\n/g;' \
-e 's/(\n\/\*\!)/\n\/**/g;' \
-e 's/(STACK_OF|LHASH_OF)\(([^ \t,\)]+)\)( |\n)/$1_$2_$3/g;' \
| \
perl -np \
-e 's/^([ \t]*)\/\*([ \t]+.*)\*\/[ \t]*$/if (length("$1$2")<75) {$c="-"}else{$c=""}; "$1\/*$c$2*\/"/e;' \
-e 's/^\/\* ((Copyright|=|----).*)$/\/*-$1/;' \
-e 's/^((DECLARE|IMPLEMENT)_(EXTERN_ASN1|ASN1|ADB|STACK_OF|PKCS12_STACK_OF).*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \
-e 's/^([ \t]*(make_dh|make_dh_bn|make_rfc5114_td)\(.*\)[ \t,]*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \
-e 's/^(ASN1_ADB_TEMPLATE\(.*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \
-e 's/^((ASN1|ADB)_.*_(end|END)\(.*[\){=,;]+[ \t]*)$/$1\n\/**INDENT-ON**\//;' \
-e '/ASN1_(ITEM_ref|ITEM_ptr|ITEM_rptr|PCTX)/ || s/^((ASN1|ADB)_[^\*]*[){=,]+[ \t]*)$/\/**INDENT-OFF**\/\n$1/;' \
-e 's/^(} (ASN1|ADB)_[^\*]*[\){=,;]+)$/$1\n\/**INDENT-ON**\//;' \
| \
$DEBUG indent $INDENT_ARGS | \
perl -np \
-e 's/^([ \t]*)\/\*-(.*)\*\/[ \t]*$/$1\/*$2*\//;' \
-e 's/^\/\*-((Copyright|=|----).*)$/\/* $1/;' \
| indent | \
perl -0 -np \
-e 's/\/\*\*INDENT-(ON|OFF)\*\*\/\n//g;' \
| perl -np \
-e 's/(STACK_OF|LHASH_OF)_([^ \t,]+)_( |\/)/$1($2)$3/g;' \
-e 's/(STACK_OF|LHASH_OF)_([^ \t,]+)_$/$1($2)/g;' \
| perl "$HERE"/su-filter.pl \
> "$tmp"
else
expand "$j" | indent $INDENT_ARGS > "$tmp"
fi;
mv "$tmp" "$j"
;;
esac
fi
done
done

View File

@@ -0,0 +1,26 @@
#!/bin/sh
HERE="`echo $0 | sed -e 's|[^/]*$||'`"
OPENSSL="${HERE}../apps/openssl"
if [ -d "${HERE}../engines" -a "x$OPENSSL_ENGINES" = "x" ]; then
OPENSSL_ENGINES="${HERE}../engines"; export OPENSSL_ENGINES
fi
if [ -x "${OPENSSL}.exe" ]; then
# The original reason for this script existence is to work around
# certain caveats in run-time linker behaviour. On Windows platforms
# adjusting $PATH used to be sufficient, but with introduction of
# SafeDllSearchMode in XP/2003 the only way to get it right in
# *all* possible situations is to copy newly built .DLLs to apps/
# and test/, which is now done elsewhere... The $PATH is adjusted
# for backward compatibility (and nostagical reasons:-).
if [ "$OSTYPE" != msdosdjgpp ]; then
PATH="${HERE}..:$PATH"; export PATH
fi
exec "${OPENSSL}.exe" "$@"
elif [ -x "${OPENSSL}" -a -x "${HERE}shlib_wrap.sh" ]; then
exec "${HERE}shlib_wrap.sh" "${OPENSSL}" "$@"
else
exec "${OPENSSL}" "$@" # hope for the best...
fi

35
openssl-1.0.2f/util/perlpath.pl Executable file
View File

@@ -0,0 +1,35 @@
#!/usr/local/bin/perl
#
# modify the '#!/usr/local/bin/perl'
# line in all scripts that rely on perl.
#
require "find.pl";
$#ARGV == 0 || print STDERR "usage: perlpath newpath (eg /usr/bin)\n";
&find(".");
sub wanted
{
return unless /\.pl$/ || /^[Cc]onfigur/;
open(IN,"<$_") || die "unable to open $dir/$_:$!\n";
@a=<IN>;
close(IN);
if (-d $ARGV[0]) {
$a[0]="#!$ARGV[0]/perl\n";
}
else {
$a[0]="#!$ARGV[0]\n";
}
# Playing it safe...
$new="$_.new";
open(OUT,">$new") || die "unable to open $dir/$new:$!\n";
print OUT @a;
close(OUT);
rename($new,$_) || die "unable to rename $dir/$new:$!\n";
chmod(0755,$_) || die "unable to chmod $dir/$new:$!\n";
}

View File

@@ -0,0 +1,139 @@
#!/usr/local/bin/perl
# Borland C++ builder 3 and 4 -- Janez Jere <jj@void.si>
#
$ssl= "ssleay32";
$crypto="libeay32";
$o='\\';
$cp='copy';
$rm='del';
# C compiler stuff
$cc='bcc32';
$lflags="-ap -Tpe -x -Gn ";
$mlflags='';
$out_def="out32";
$tmp_def="tmp32";
$inc_def="inc32";
#enable max error messages, disable most common warnings
$cflags="-DWIN32_LEAN_AND_MEAN -q -w-ccc -w-rch -w-pia -w-aus -w-par -w-inl -c -tWC -tWM -DOPENSSL_SYSNAME_WIN32 -DL_ENDIAN -DDSO_WIN32 -D_stricmp=stricmp -D_strnicmp=strnicmp ";
if ($debug)
{
$cflags.="-Od -y -v -vi- -D_DEBUG";
$mlflags.=' ';
}
else
{
$cflags.="-O2 -ff -fp";
}
$obj='.obj';
$ofile="-o";
# EXE linking stuff
$link="ilink32";
$efile="";
$exep='.exe';
if ($no_sock)
{ $ex_libs=""; }
else { $ex_libs="cw32mt.lib import32.lib crypt32.lib ws2_32.lib"; }
# static library stuff
$mklib='tlib /P64';
$ranlib='';
$plib="";
$libp=".lib";
$shlibp=($shlib)?".dll":".lib";
$lfile='';
$shlib_ex_obj="";
$app_ex_obj="c0x32.obj";
$asm=(`nasm -v 2>NUL` ge `nasmw -v 2>NUL`?"nasm":"nasmw")." -f obj -d__omf__";
$asm.=" -g" if $debug;
$afile='-o';
$bn_mulw_obj='';
$bn_mulw_src='';
$des_enc_obj='';
$des_enc_src='';
$bf_enc_obj='';
$bf_enc_src='';
if (!$no_asm)
{
$bn_mulw_obj='crypto\bn\asm\bn_win32.obj';
$bn_mulw_src='crypto\bn\asm\bn_win32.asm';
$des_enc_obj='crypto\des\asm\d_win32.obj crypto\des\asm\y_win32.obj';
$des_enc_src='crypto\des\asm\d_win32.asm crypto\des\asm\y_win32.asm';
$bf_enc_obj='crypto\bf\asm\b_win32.obj';
$bf_enc_src='crypto\bf\asm\b_win32.asm';
$cast_enc_obj='crypto\cast\asm\c_win32.obj';
$cast_enc_src='crypto\cast\asm\c_win32.asm';
$rc4_enc_obj='crypto\rc4\asm\r4_win32.obj';
$rc4_enc_src='crypto\rc4\asm\r4_win32.asm';
$rc5_enc_obj='crypto\rc5\asm\r5_win32.obj';
$rc5_enc_src='crypto\rc5\asm\r5_win32.asm';
$md5_asm_obj='crypto\md5\asm\m5_win32.obj';
$md5_asm_src='crypto\md5\asm\m5_win32.asm';
$sha1_asm_obj='crypto\sha\asm\s1_win32.obj';
$sha1_asm_src='crypto\sha\asm\s1_win32.asm';
$rmd160_asm_obj='crypto\ripemd\asm\rm_win32.obj';
$rmd160_asm_src='crypto\ripemd\asm\rm_win32.asm';
$cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DRMD160_ASM";
}
if ($shlib)
{
$mlflags.=" $lflags /dll";
# $cflags =~ s| /MD| /MT|;
$lib_cflag=" /GD -D_WINDLL -D_DLL";
$out_def="out32dll";
$tmp_def="tmp32dll";
}
sub do_lib_rule
{
local($objs,$target,$name,$shlib)=@_;
local($ret,$Name);
$taget =~ s/\//$o/g if $o ne '/';
($Name=$name) =~ tr/a-z/A-Z/;
# $target="\$(LIB_D)$o$target";
$ret.="$target: $objs\n";
if (!$shlib)
{
$ret.=<<___;
-\$(RM) $lfile$target
\$(MKLIB) $lfile$target \@&&!
+\$(**: = &^
+)
!
___
}
else
{
local($ex)=($target =~ /O_SSL/)?' $(L_CRYPTO)':'';
$ex.=' ws2_32.lib gdi32.lib';
$ret.="\t\$(LINK) \$(MLFLAGS) $efile$target /def:ms/${Name}.def @<<\n \$(SHLIB_EX_OBJ) $objs $ex\n<<\n";
}
$ret.="\n";
return($ret);
}
sub do_link_rule
{
local($target,$files,$dep_libs,$libs)=@_;
local($ret,$_);
$file =~ s/\//$o/g if $o ne '/';
$n=&bname($target);
$ret.="$target: $files $dep_libs\n";
$ret.="\t\$(LINK) \$(LFLAGS) $files \$(APP_EX_OBJ), $target,, $libs\n\n";
return($ret);
}
1;

View File

@@ -0,0 +1,104 @@
#!/usr/local/bin/perl
#
# Mingw32.pl -- Mingw
#
$o='/';
$cp='cp';
$rm='rm -f';
$mkdir='gmkdir';
$o='\\';
$cp='copy';
$rm='del';
$mkdir='mkdir';
# C compiler stuff
$cc='gcc';
if ($debug)
{ $cflags="-DL_ENDIAN -DDSO_WIN32 -g2 -ggdb"; }
else
{ $cflags="-DL_ENDIAN -DDSO_WIN32 -fomit-frame-pointer -O3 -mcpu=i486 -Wall"; }
if ($gaswin and !$no_asm)
{
$bn_asm_obj='$(OBJ_D)\bn-win32.o';
$bn_asm_src='crypto/bn/asm/bn-win32.s';
$bnco_asm_obj='$(OBJ_D)\co-win32.o';
$bnco_asm_src='crypto/bn/asm/co-win32.s';
$des_enc_obj='$(OBJ_D)\d-win32.o $(OBJ_D)\y-win32.o';
$des_enc_src='crypto/des/asm/d-win32.s crypto/des/asm/y-win32.s';
$bf_enc_obj='$(OBJ_D)\b-win32.o';
$bf_enc_src='crypto/bf/asm/b-win32.s';
# $cast_enc_obj='$(OBJ_D)\c-win32.o';
# $cast_enc_src='crypto/cast/asm/c-win32.s';
$rc4_enc_obj='$(OBJ_D)\r4-win32.o';
$rc4_enc_src='crypto/rc4/asm/r4-win32.s';
$rc5_enc_obj='$(OBJ_D)\r5-win32.o';
$rc5_enc_src='crypto/rc5/asm/r5-win32.s';
$md5_asm_obj='$(OBJ_D)\m5-win32.o';
$md5_asm_src='crypto/md5/asm/m5-win32.s';
$rmd160_asm_obj='$(OBJ_D)\rm-win32.o';
$rmd160_asm_src='crypto/ripemd/asm/rm-win32.s';
$sha1_asm_obj='$(OBJ_D)\s1-win32.o';
$sha1_asm_src='crypto/sha/asm/s1-win32.s';
$cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DOPENSSL_BN_ASM_PART_WORDS";
}
$obj='.o';
$ofile='-o ';
# EXE linking stuff
$link='${CC}';
$lflags='${CFLAGS}';
$efile='-o ';
$exep='';
$ex_libs="-lws2_32 -lgdi32";
# static library stuff
$mklib='ar r';
$mlflags='';
$ranlib='ranlib';
$plib='lib';
$libp=".a";
$shlibp=".a";
$lfile='';
$asm='as';
$afile='-o ';
#$bn_asm_obj="";
#$bn_asm_src="";
#$des_enc_obj="";
#$des_enc_src="";
#$bf_enc_obj="";
#$bf_enc_src="";
sub do_lib_rule
{
local($obj,$target,$name,$shlib)=@_;
local($ret,$_,$Name);
$target =~ s/\//$o/g if $o ne '/';
$target="$target";
($Name=$name) =~ tr/a-z/A-Z/;
$ret.="$target: \$(${Name}OBJ)\n";
$ret.="\tif exist $target \$(RM) $target\n";
$ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n";
$ret.="\t\$(RANLIB) $target\n\n";
}
sub do_link_rule
{
local($target,$files,$dep_libs,$libs)=@_;
local($ret,$_);
$file =~ s/\//$o/g if $o ne '/';
$n=&bname($target);
$ret.="$target: $files $dep_libs\n";
$ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n";
return($ret);
}
1;

View File

@@ -0,0 +1,120 @@
#!/usr/local/bin/perl
#
# OS2-EMX.pl - for EMX GCC on OS/2
#
$o='/';
$cp='cp';
$rm='rm -f';
$preamble = "SHELL=sh\n";
# C compiler stuff
$cc='gcc';
$cflags="-DL_ENDIAN -O3 -fomit-frame-pointer -m486 -Zmtd -Wall ";
$cflags.="-Zomf " if $shlib;
$shl_cflag="-Zdll";
if ($debug) {
$cflags.="-g ";
}
$obj=$shlib ? '.obj' : '.o';
$ofile='-o ';
# EXE linking stuff
$link='${CC}';
$lflags='${CFLAGS} -Zbsd-signals -s';
$efile='-o ';
$exep='.exe';
$ex_libs="-lsocket";
# static library stuff
$mklib='ar r';
$mlflags='';
$ranlib="ar s";
$plib='';
$libp=$shlib ? ".lib" : ".a";
$shlibp=$shlib ? ".dll" : ".a";
$lfile='';
$asm=$shlib ? 'as -Zomf' : 'as';
$afile='-o ';
$bn_asm_obj="";
$bn_asm_src="";
$des_enc_obj="";
$des_enc_src="";
$bf_enc_obj="";
$bf_enc_src="";
if (!$no_asm)
{
$bn_asm_obj="crypto/bn/asm/bn-os2$obj crypto/bn/asm/co-os2$obj";
$bn_asm_src="crypto/bn/asm/bn-os2.asm crypto/bn/asm/co-os2.asm";
$des_enc_obj="crypto/des/asm/d-os2$obj crypto/des/asm/y-os2$obj";
$des_enc_src="crypto/des/asm/d-os2.asm crypto/des/asm/y-os2.asm";
$bf_enc_obj="crypto/bf/asm/b-os2$obj";
$bf_enc_src="crypto/bf/asm/b-os2.asm";
$cast_enc_obj="crypto/cast/asm/c-os2$obj";
$cast_enc_src="crypto/cast/asm/c-os2.asm";
$rc4_enc_obj="crypto/rc4/asm/r4-os2$obj";
$rc4_enc_src="crypto/rc4/asm/r4-os2.asm";
$rc5_enc_obj="crypto/rc5/asm/r5-os2$obj";
$rc5_enc_src="crypto/rc5/asm/r5-os2.asm";
$md5_asm_obj="crypto/md5/asm/m5-os2$obj";
$md5_asm_src="crypto/md5/asm/m5-os2.asm";
$sha1_asm_obj="crypto/sha/asm/s1-os2$obj";
$sha1_asm_src="crypto/sha/asm/s1-os2.asm";
$rmd160_asm_obj="crypto/ripemd/asm/rm-os2$obj";
$rmd160_asm_src="crypto/ripemd/asm/rm-os2.asm";
$cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DOPENSSL_BN_ASM_PART_WORDS";
}
if ($shlib)
{
$mlflags.=" $lflags -Zdll";
$lib_cflag=" -D_DLL";
$out_def="out_dll";
$tmp_def="tmp_dll";
}
sub do_lib_rule
{
local($obj,$target,$name,$shlib)=@_;
local($ret,$_,$Name);
$target =~ s/\//$o/g if $o ne '/';
$target="$target";
($Name=$name) =~ tr/a-z/A-Z/;
$ret.="$target: \$(${Name}OBJ)\n";
if (!$shlib)
{
$ret.="\t\$(RM) $target\n";
$ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n";
$ret.="\t\$(RANLIB) $target\n\n";
}
else
{
local($ex)=($target =~ /O_SSL/)?' $(L_CRYPTO)':'';
$ex.=' -lsocket';
$ret.="\t\$(LINK) \$(SHLIB_CFLAGS) \$(MLFLAGS) $efile$target \$(SHLIB_EX_OBJ) \$(${Name}OBJ) $ex os2/${Name}.def\n";
$ret.="\temximp -o $out_def/$name.a os2/${Name}.def\n";
$ret.="\temximp -o $out_def/$name.lib os2/${Name}.def\n\n";
}
}
sub do_link_rule
{
local($target,$files,$dep_libs,$libs)=@_;
local($ret,$_);
$file =~ s/\//$o/g if $o ne '/';
$n=&bname($target);
$ret.="$target: $files $dep_libs\n";
$ret.="\t\$(LINK) ${efile}$target \$(CFLAG) \$(LFLAGS) $files $libs\n\n";
return($ret);
}
1;

View File

@@ -0,0 +1,423 @@
#!/usr/local/bin/perl
# VC-32.pl - unified script for Microsoft Visual C++, covering Win32,
# Win64 and WinCE [follow $FLAVOR variable to trace the differences].
#
$ssl= "ssleay32";
$crypto="libeay32";
if ($fips && !$shlib)
{
$crypto="libeayfips32";
$crypto_compat = "libeaycompat32.lib";
}
else
{
$crypto="libeay32";
}
$o='\\';
$cp='$(PERL) util/copy.pl';
$mkdir='$(PERL) util/mkdir-p.pl';
$rm='del /Q';
$zlib_lib="zlib1.lib";
# Santize -L options for ms link
$l_flags =~ s/-L("\[^"]+")/\/libpath:$1/g;
$l_flags =~ s/-L(\S+)/\/libpath:$1/g;
my $ff = "";
# C compiler stuff
$cc='cl';
if ($FLAVOR =~ /WIN64/)
{
# Note that we currently don't have /WX on Win64! There is a lot of
# warnings, but only of two types:
#
# C4344: conversion from '__int64' to 'int/long', possible loss of data
# C4267: conversion from 'size_t' to 'int/long', possible loss of data
#
# Amount of latter type is minimized by aliasing strlen to function of
# own desing and limiting its return value to 2GB-1 (see e_os.h). As
# per 0.9.8 release remaining warnings were explicitly examined and
# considered safe to ignore.
#
$base_cflags= " $mf_cflag";
my $f = $shlib || $fips ?' /MD':' /MT';
$opt_cflags=$f.' /Ox';
$dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG';
$lflags="/nologo /subsystem:console /opt:ref";
*::perlasm_compile_target = sub {
my ($target,$source,$bname)=@_;
my $ret;
$bname =~ s/(.*)\.[^\.]$/$1/;
$ret=<<___;
\$(TMP_D)$o$bname.asm: $source
set ASM=\$(ASM)
\$(PERL) $source \$\@
$target: \$(TMP_D)$o$bname.asm
\$(ASM) $afile\$\@ \$(TMP_D)$o$bname.asm
___
}
}
elsif ($FLAVOR =~ /CE/)
{
# sanity check
die '%OSVERSION% is not defined' if (!defined($ENV{'OSVERSION'}));
die '%PLATFORM% is not defined' if (!defined($ENV{'PLATFORM'}));
die '%TARGETCPU% is not defined' if (!defined($ENV{'TARGETCPU'}));
#
# Idea behind this is to mimic flags set by eVC++ IDE...
#
$wcevers = $ENV{'OSVERSION'}; # WCENNN
die '%OSVERSION% value is insane' if ($wcevers !~ /^WCE([1-9])([0-9]{2})$/);
$wcecdefs = "-D_WIN32_WCE=$1$2 -DUNDER_CE=$1$2"; # -D_WIN32_WCE=NNN
$wcelflag = "/subsystem:windowsce,$1.$2"; # ...,N.NN
$wceplatf = $ENV{'PLATFORM'};
$wceplatf =~ tr/a-z0-9 /A-Z0-9_/d;
$wcecdefs .= " -DWCE_PLATFORM_$wceplatf";
$wcetgt = $ENV{'TARGETCPU'}; # just shorter name...
SWITCH: for($wcetgt) {
/^X86/ && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_";
$wcelflag.=" /machine:X86"; last; };
/^ARMV4[IT]/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
$wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/);
$wcecdefs.=" -QRarch4T -QRinterwork-return";
$wcelflag.=" /machine:THUMB"; last; };
/^ARM/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
$wcelflag.=" /machine:ARM"; last; };
/^MIPSIV/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
$wcecdefs.=" -D_MIPS64 -QMmips4 -QMn32";
$wcelflag.=" /machine:MIPSFPU"; last; };
/^MIPS16/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
$wcecdefs.=" -DMIPSII -QMmips16";
$wcelflag.=" /machine:MIPS16"; last; };
/^MIPSII/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
$wcecdefs.=" -QMmips2";
$wcelflag.=" /machine:MIPS"; last; };
/^R4[0-9]{3}/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000";
$wcelflag.=" /machine:MIPS"; last; };
/^SH[0-9]/ && do { $wcecdefs.=" -D$wcetgt -D_$wcetgt_ -DSHx";
$wcecdefs.=" -Qsh4" if ($wcetgt =~ /^SH4/);
$wcelflag.=" /machine:$wcetgt"; last; };
{ $wcecdefs.=" -D$wcetgt -D_$wcetgt_";
$wcelflag.=" /machine:$wcetgt"; last; };
}
$cc=($ENV{CC} or "cl");
$base_cflags=' /W3 /WX /GF /Gy /nologo -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -DOPENSSL_SMALL_FOOTPRINT';
$base_cflags.=" $wcecdefs";
$base_cflags.=' -I$(WCECOMPAT)/include' if (defined($ENV{'WCECOMPAT'}));
$base_cflags.=' -I$(PORTSDK_LIBPATH)/../../include' if (defined($ENV{'PORTSDK_LIBPATH'}));
if (`$cc 2>&1` =~ /Version ([0-9]+)\./ && $1>=14) {
$base_cflags.=$shlib?' /MD':' /MT';
} else {
$base_cflags.=' /MC';
}
$opt_cflags=' /O1i'; # optimize for space, but with intrinsics...
$dbg_cflags=' /Od -DDEBUG -D_DEBUG';
$lflags="/nologo /opt:ref $wcelflag";
}
else # Win32
{
$base_cflags= " $mf_cflag";
my $f = $shlib || $fips ?' /MD':' /MT';
$ff = "/fixed";
$opt_cflags=$f.' /Ox /O2 /Ob2';
$dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG';
$lflags="/nologo /subsystem:console /opt:ref";
}
$lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib
$mlflags='';
$out_def ="out32"; $out_def.="dll" if ($shlib);
$out_def.='_$(TARGETCPU)' if ($FLAVOR =~ /CE/);
$tmp_def ="tmp32"; $tmp_def.="dll" if ($shlib);
$tmp_def.='_$(TARGETCPU)' if ($FLAVOR =~ /CE/);
$inc_def="inc32";
if ($debug)
{
$cflags=$dbg_cflags.$base_cflags;
}
else
{
$cflags=$opt_cflags.$base_cflags;
}
# generate symbols.pdb unconditionally
$app_cflag.=" /Zi /Fd\$(TMP_D)/app";
$lib_cflag.=" /Zi /Fd\$(TMP_D)/lib";
$lflags.=" /debug";
$obj='.obj';
$asm_suffix='.asm';
$ofile="/Fo";
# EXE linking stuff
$link="link";
$rsc="rc";
$efile="/out:";
$exep='.exe';
if ($no_sock) { $ex_libs=''; }
elsif ($FLAVOR =~ /CE/) { $ex_libs='ws2.lib'; }
else { $ex_libs='ws2_32.lib'; }
if ($FLAVOR =~ /CE/)
{
$ex_libs.=' crypt32.lib'; # for e_capi.c
if (defined($ENV{WCECOMPAT}))
{
$ex_libs.= ' $(WCECOMPAT)/lib';
if (-f "$ENV{WCECOMPAT}/lib/$ENV{TARGETCPU}/wcecompatex.lib")
{
$ex_libs.='/$(TARGETCPU)/wcecompatex.lib';
}
else
{
$ex_libs.='/wcecompatex.lib';
}
}
$ex_libs.=' $(PORTSDK_LIBPATH)/portlib.lib' if (defined($ENV{'PORTSDK_LIBPATH'}));
$ex_libs.=' /nodefaultlib coredll.lib corelibc.lib' if ($ENV{'TARGETCPU'} eq "X86");
}
else
{
$ex_libs.=' gdi32.lib advapi32.lib crypt32.lib user32.lib';
$ex_libs.=' bufferoverflowu.lib' if ($FLAVOR =~ /WIN64/ and `cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
# WIN32 UNICODE build gets linked with unicows.lib for
# backward compatibility with Win9x.
$ex_libs="unicows.lib $ex_libs" if ($FLAVOR =~ /WIN32/ and $cflags =~ /\-DUNICODE/);
}
# static library stuff
$mklib='lib /nologo';
$ranlib='';
$plib="";
$libp=".lib";
$shlibp=($shlib)?".dll":".lib";
$lfile='/out:';
$shlib_ex_obj="";
$app_ex_obj="setargv.obj" if ($FLAVOR !~ /CE/);
if ($FLAVOR =~ /WIN64A/) {
if (`nasm -v 2>NUL` =~ /NASM version ([0-9]+\.[0-9]+)/ && $1 >= 2.0) {
$asm='nasm -f win64 -DNEAR -Ox -g';
$afile='-o ';
} else {
$asm='ml64 /c /Cp /Cx /Zi';
$afile='/Fo';
}
} elsif ($FLAVOR =~ /WIN64I/) {
$asm='ias -d debug';
$afile="-o ";
} elsif ($nasm) {
my $ver=`nasm -v 2>NUL`;
my $vew=`nasmw -v 2>NUL`;
# pick newest version
$asm=($ver ge $vew?"nasm":"nasmw")." -f win32";
$asmtype="win32n";
$afile='-o ';
} else {
$asm='ml /nologo /Cp /coff /c /Cx /Zi';
$afile='/Fo';
$asmtype="win32";
}
$bn_asm_obj='';
$bn_asm_src='';
$des_enc_obj='';
$des_enc_src='';
$bf_enc_obj='';
$bf_enc_src='';
if (!$no_asm)
{
win32_import_asm($mf_bn_asm, "bn", \$bn_asm_obj, \$bn_asm_src);
win32_import_asm($mf_aes_asm, "aes", \$aes_asm_obj, \$aes_asm_src);
win32_import_asm($mf_des_asm, "des", \$des_enc_obj, \$des_enc_src);
win32_import_asm($mf_bf_asm, "bf", \$bf_enc_obj, \$bf_enc_src);
win32_import_asm($mf_cast_asm, "cast", \$cast_enc_obj, \$cast_enc_src);
win32_import_asm($mf_rc4_asm, "rc4", \$rc4_enc_obj, \$rc4_enc_src);
win32_import_asm($mf_rc5_asm, "rc5", \$rc5_enc_obj, \$rc5_enc_src);
win32_import_asm($mf_md5_asm, "md5", \$md5_asm_obj, \$md5_asm_src);
win32_import_asm($mf_sha_asm, "sha", \$sha1_asm_obj, \$sha1_asm_src);
win32_import_asm($mf_rmd_asm, "ripemd", \$rmd160_asm_obj, \$rmd160_asm_src);
win32_import_asm($mf_wp_asm, "whrlpool", \$whirlpool_asm_obj, \$whirlpool_asm_src);
win32_import_asm($mf_cpuid_asm, "", \$cpuid_asm_obj, \$cpuid_asm_src);
$perl_asm = 1;
}
if ($shlib && $FLAVOR !~ /CE/)
{
$mlflags.=" $lflags /dll";
$lib_cflag.=" -D_WINDLL";
#
# Engage Applink...
#
$app_ex_obj.=" \$(OBJ_D)\\applink.obj /implib:\$(TMP_D)\\junk.lib";
$cflags.=" -DOPENSSL_USE_APPLINK -I.";
# I'm open for better suggestions than overriding $banner...
$banner=<<'___';
@echo Building OpenSSL
$(OBJ_D)\applink.obj: ms\applink.c
$(CC) /Fo$(OBJ_D)\applink.obj $(APP_CFLAGS) -c ms\applink.c
$(OBJ_D)\uplink.obj: ms\uplink.c ms\applink.c
$(CC) /Fo$(OBJ_D)\uplink.obj $(SHLIB_CFLAGS) -c ms\uplink.c
$(INCO_D)\applink.c: ms\applink.c
$(CP) ms\applink.c $(INCO_D)\applink.c
EXHEADER= $(EXHEADER) $(INCO_D)\applink.c
LIBS_DEP=$(LIBS_DEP) $(OBJ_D)\applink.obj
CRYPTOOBJ=$(OBJ_D)\uplink.obj $(CRYPTOOBJ)
___
$banner.=<<'___' if ($FLAVOR =~ /WIN64/);
CRYPTOOBJ=ms\uptable.obj $(CRYPTOOBJ)
___
}
elsif ($shlib && $FLAVOR =~ /CE/)
{
$mlflags.=" $lflags /dll";
$lflags.=' /entry:mainCRTstartup' if(defined($ENV{'PORTSDK_LIBPATH'}));
$lib_cflag.=" -D_WINDLL -D_DLL";
}
sub do_lib_rule
{
my($objs,$target,$name,$shlib,$ign,$base_addr) = @_;
local($ret);
$taget =~ s/\//$o/g if $o ne '/';
my $base_arg;
if ($base_addr ne "")
{
$base_arg= " /base:$base_addr";
}
else
{
$base_arg = "";
}
if ($name ne "")
{
$name =~ tr/a-z/A-Z/;
$name = "/def:ms/${name}.def";
}
# $target="\$(LIB_D)$o$target";
# $ret.="$target: $objs\n";
if (!$shlib)
{
# $ret.="\t\$(RM) \$(O_$Name)\n";
$ret.="$target: $objs\n";
$ret.="\t\$(MKLIB) $lfile$target @<<\n $objs\n<<\n";
}
else
{
local($ex)=($target =~ /O_CRYPTO/)?'':' $(L_CRYPTO)';
$ex.=" $zlib_lib" if $zlib_opt == 1 && $target =~ /O_CRYPTO/;
if ($fips && $target =~ /O_CRYPTO/)
{
$ret.="$target: $objs \$(PREMAIN_DSO_EXE)";
$ret.="\n\tSET FIPS_LINK=\$(LINK)\n";
$ret.="\tSET FIPS_CC=\$(CC)\n";
$ret.="\tSET FIPS_CC_ARGS=/Fo\$(OBJ_D)${o}fips_premain.obj \$(SHLIB_CFLAGS) -c\n";
$ret.="\tSET PREMAIN_DSO_EXE=\$(PREMAIN_DSO_EXE)\n";
$ret.="\tSET FIPS_SHA1_EXE=\$(FIPS_SHA1_EXE)\n";
$ret.="\tSET FIPS_TARGET=$target\n";
$ret.="\tSET FIPSLIB_D=\$(FIPSLIB_D)\n";
$ret.="\t\$(FIPSLINK) \$(MLFLAGS) $ff /map $base_arg $efile$target ";
$ret.="$name @<<\n \$(SHLIB_EX_OBJ) $objs \$(EX_LIBS) ";
$ret.="\$(OBJ_D)${o}fips_premain.obj $ex\n<<\n";
}
else
{
$ret.="$target: $objs";
$ret.="\n\t\$(LINK) \$(MLFLAGS) $efile$target $name @<<\n \$(SHLIB_EX_OBJ) $objs $ex \$(EX_LIBS)\n<<\n";
}
$ret.="\tIF EXIST \$@.manifest mt -nologo -manifest \$@.manifest -outputresource:\$@;2\n\n";
}
$ret.="\n";
return($ret);
}
sub do_link_rule
{
my($target,$files,$dep_libs,$libs,$standalone)=@_;
local($ret,$_);
$file =~ s/\//$o/g if $o ne '/';
$n=&bname($target);
$ret.="$target: $files $dep_libs";
if ($standalone == 1)
{
$ret.=" \$(OBJ_D)${o}applink.obj" if $shlib;
$ret.="\n";
$ret.=" \$(LINK) \$(LFLAGS) $efile$target @<<\n\t";
if ($files =~ /O_FIPSCANISTER/ && !$fipscanisterbuild) {
$ret.= "\$(EX_LIBS) ";
$ret.= "\$(OBJ_D)${o}applink.obj " if $shlib;
}
$ret.="$files $libs\n<<\n";
}
elsif ($standalone == 2)
{
$ret.="\n";
$ret.="\tSET FIPS_LINK=\$(LINK)\n";
$ret.="\tSET FIPS_CC=\$(CC)\n";
$ret.="\tSET FIPS_CC_ARGS=/Fo\$(OBJ_D)${o}fips_premain.obj \$(SHLIB_CFLAGS) -c\n";
$ret.="\tSET PREMAIN_DSO_EXE=\n";
$ret.="\tSET FIPS_TARGET=$target\n";
$ret.="\tSET FIPS_SHA1_EXE=\$(FIPS_SHA1_EXE)\n";
$ret.="\tSET FIPSLIB_D=\$(FIPSLIB_D)\n";
$ret.="\t\$(FIPSLINK) \$(LFLAGS) $ff /map $efile$target @<<\n";
$ret.="\t\$(APP_EX_OBJ) $files \$(OBJ_D)${o}fips_premain.obj $libs\n<<\n";
}
else
{
$ret.="\n";
$ret.="\t\$(LINK) \$(LFLAGS) $efile$target @<<\n";
$ret.="\t\$(APP_EX_OBJ) $files $libs\n<<\n";
}
$ret.="\tIF EXIST \$@.manifest mt -nologo -manifest \$@.manifest -outputresource:\$@;1\n\n";
return($ret);
}
sub win32_import_asm
{
my ($mf_var, $asm_name, $oref, $sref) = @_;
my $asm_dir;
if ($asm_name eq "")
{
$asm_dir = "crypto\\";
}
else
{
$asm_dir = "crypto\\$asm_name\\asm\\";
}
$$oref = "";
$mf_var =~ s/\.o$/.obj/g;
foreach (split(/ /, $mf_var))
{
$$oref .= $asm_dir . $_ . " ";
}
$$oref =~ s/ $//;
$$sref = $$oref;
$$sref =~ s/\.obj/.asm/g;
}
1;

View File

@@ -0,0 +1,104 @@
#!/usr/local/bin/perl
#
# linux.pl - the standard unix makefile stuff.
#
$o='/';
$cp='/bin/cp';
$rm='/bin/rm -f';
# C compiler stuff
$cc='gcc';
if ($debug)
{ $cflags="-g2 -ggdb -DREF_CHECK -DCRYPTO_MDEBUG"; }
elsif ($profile)
{ $cflags="-pg -O3"; }
else
{ $cflags="-O3 -fomit-frame-pointer"; }
if (!$no_asm)
{
$bn_asm_obj='$(OBJ_D)/bn86-elf.o';
$bn_asm_src='crypto/bn/asm/bn86unix.cpp';
$bnco_asm_obj='$(OBJ_D)/co86-elf.o';
$bnco_asm_src='crypto/bn/asm/co86unix.cpp';
$des_enc_obj='$(OBJ_D)/dx86-elf.o $(OBJ_D)/yx86-elf.o';
$des_enc_src='crypto/des/asm/dx86unix.cpp crypto/des/asm/yx86unix.cpp';
$bf_enc_obj='$(OBJ_D)/bx86-elf.o';
$bf_enc_src='crypto/bf/asm/bx86unix.cpp';
$cast_enc_obj='$(OBJ_D)/cx86-elf.o';
$cast_enc_src='crypto/cast/asm/cx86unix.cpp';
$rc4_enc_obj='$(OBJ_D)/rx86-elf.o';
$rc4_enc_src='crypto/rc4/asm/rx86unix.cpp';
$rc5_enc_obj='$(OBJ_D)/r586-elf.o';
$rc5_enc_src='crypto/rc5/asm/r586unix.cpp';
$md5_asm_obj='$(OBJ_D)/mx86-elf.o';
$md5_asm_src='crypto/md5/asm/mx86unix.cpp';
$rmd160_asm_obj='$(OBJ_D)/rm86-elf.o';
$rmd160_asm_src='crypto/ripemd/asm/rm86unix.cpp';
$sha1_asm_obj='$(OBJ_D)/sx86-elf.o';
$sha1_asm_src='crypto/sha/asm/sx86unix.cpp';
$cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DOPENSSL_BN_ASM_PART_WORDS";
}
$cflags.=" -DTERMIO -DL_ENDIAN -m486 -Wall";
if ($shlib)
{
$shl_cflag=" -DPIC -fpic";
$shlibp=".so.$ssl_version";
$so_shlibp=".so";
}
sub do_shlib_rule
{
local($obj,$target,$name,$shlib,$so_name)=@_;
local($ret,$_,$Name);
$target =~ s/\//$o/g if $o ne '/';
($Name=$name) =~ tr/a-z/A-Z/;
$ret.="$target: \$(${Name}OBJ)\n";
$ret.="\t\$(RM) target\n";
$ret.="\tgcc \${CFLAGS} -shared -Wl,-soname,$target -o $target \$(${Name}OBJ)\n";
($t=$target) =~ s/(^.*)\/[^\/]*$/$1/;
if ($so_name ne "")
{
$ret.="\t\$(RM) \$(LIB_D)$o$so_name\n";
$ret.="\tln -s $target \$(LIB_D)$o$so_name\n\n";
}
}
sub do_link_rule
{
local($target,$files,$dep_libs,$libs)=@_;
local($ret,$_);
$file =~ s/\//$o/g if $o ne '/';
$n=&bname($target);
$ret.="$target: $files $dep_libs\n";
$ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n";
return($ret);
}
sub do_asm_rule
{
local($target,$src)=@_;
local($ret,@s,@t,$i);
$target =~ s/\//$o/g if $o ne "/";
$src =~ s/\//$o/g if $o ne "/";
@s=split(/\s+/,$src);
@t=split(/\s+/,$target);
for ($i=0; $i<=$#s; $i++)
{
$ret.="$t[$i]: $s[$i]\n";
$ret.="\tgcc -E -DELF \$(SRC_D)$o$s[$i]|\$(AS) $afile$t[$i]\n\n";
}
return($ret);
}
1;

View File

@@ -0,0 +1,532 @@
# Metrowerks Codewarrior or gcc / nlmconv for NetWare
#
$version_header = "crypto/opensslv.h";
open(IN, "$version_header") or die "Couldn't open $version_header: $!";
while (<IN>) {
if (/^#define[\s\t]+OPENSSL_VERSION_NUMBER[\s\t]+0x(\d)(\d{2})(\d{2})(\d{2})/)
{
# die "OpenSSL version detected: $1.$2.$3.$4\n";
#$nlmvernum = "$1,$2,$3";
$nlmvernum = "$1,".($2*10+$3).",".($4*1);
#$nlmverstr = "$1.".($2*1).".".($3*1).($4?(chr(96+$4)):"");
break;
}
}
close(IN) or die "Couldn't close $version_header: $!";
$readme_file = "README";
open(IN, $readme_file) or die "Couldn't open $readme_file: $!";
while (<IN>) {
if (/^[\s\t]+OpenSSL[\s\t]+(\d)\.(\d{1,2})\.(\d{1,2})([a-z])(.*)/)
{
#$nlmvernum = "$1,$2,$3";
#$nlmvernum = "$1,".($2*10+$3).",".($4*1);
$nlmverstr = "$1.$2.$3$4$5";
}
elsif (/^[\s\t]+(Copyright \(c\) \d{4}\-\d{4} The OpenSSL Project)$/)
{
$nlmcpystr = $1;
}
break if ($nlmvernum && $nlmcpystr);
}
close(IN) or die "Couldn't close $readme_file: $!";
# Define stacksize here
$nlmstack = "32768";
# some default settings here in case we failed to find them in README
$nlmvernum = "1,0,0" if (!$nlmvernum);
$nlmverstr = "OpenSSL" if (!$nlmverstr);
$nlmcpystr = "Copyright (c) 1998-now The OpenSSL Project" if (!$nlmcpystr);
# die "OpenSSL copyright: $nlmcpystr\nOpenSSL verstring: $nlmverstr\nOpenSSL vernumber: $nlmvernum\n";
# The import files and other misc imports needed to link
@misc_imports = ("GetProcessSwitchCount", "RunningProcess",
"GetSuperHighResolutionTimer");
if ($LIBC)
{
@import_files = ("libc.imp");
@module_files = ("libc");
$libarch = "LIBC";
}
else
{
# clib build
@import_files = ("clib.imp");
push(@import_files, "socklib.imp") if ($BSDSOCK);
@module_files = ("clib");
# push(@misc_imports, "_rt_modu64%16", "_rt_divu64%16");
$libarch = "CLIB";
}
if ($BSDSOCK)
{
$libarch .= "-BSD";
}
else
{
$libarch .= "-WS2";
push(@import_files, "ws2nlm.imp");
}
# The "IMPORTS" environment variable must be set and point to the location
# where import files (*.imp) can be found.
# Example: set IMPORTS=c:\ndk\nwsdk\imports
$import_path = $ENV{"IMPORTS"} || die ("IMPORTS environment variable not set\n");
# The "PRELUDE" environment variable must be set and point to the location
# and name of the prelude source to link with ( nwpre.obj is recommended ).
# Example: set PRELUDE=c:\codewar\novell support\metrowerks support\libraries\runtime\nwpre.obj
$prelude = $ENV{"PRELUDE"} || die ("PRELUDE environment variable not set\n");
# The "INCLUDES" environment variable must be set and point to the location
# where import files (*.imp) can be found.
$include_path = $ENV{"INCLUDE"} || die ("INCLUDES environment variable not set\n");
$include_path =~ s/\\/\//g;
$include_path = join(" -I", split(/;/, $include_path));
# check for gcc compiler
$gnuc = $ENV{"GNUC"};
#$ssl= "ssleay32";
#$crypto="libeay32";
if ($gnuc)
{
# C compiler
$cc='gcc';
# Linker
$link='nlmconv';
# librarian
$mklib='ar';
$o='/';
# cp command
$cp='cp -af';
# rm command
$rm='rm -f';
# mv command
$mv='mv -f';
# mkdir command
$mkdir='gmkdir';
#$ranlib='ranlib';
}
else
{
# C compiler
$cc='mwccnlm';
# Linker
$link='mwldnlm';
# librarian
$mklib='mwldnlm';
# Path separator
$o='\\';
# cp command
$cp='copy >nul:';
# rm command
$rm='del /f /q';
}
# assembler
if ($nw_nasm)
{
$asm=(`nasm -v 2>NUL` gt `nasmw -v 2>NUL`?"nasm":"nasmw");
if ($gnuc)
{
$asm.=" -s -f elf";
}
else
{
$asm.=" -s -f coff -d __coff__";
}
$afile="-o ";
$asm.=" -g" if $debug;
}
elsif ($nw_mwasm)
{
$asm="mwasmnlm -maxerrors 20";
$afile="-o ";
$asm.=" -g" if $debug;
}
elsif ($nw_masm)
{
# masm assembly settings - it should be possible to use masm but haven't
# got it working.
# $asm='ml /Cp /coff /c /Cx';
# $asm.=" /Zi" if $debug;
# $afile='/Fo';
die("Support for masm assembler not yet functional\n");
}
else
{
$asm="";
$afile="";
}
if ($gnuc)
{
# compile flags for GNUC
# additional flags based upon debug | non-debug
if ($debug)
{
$cflags="-g -DDEBUG";
}
else
{
$cflags="-O2";
}
$cflags.=" -nostdinc -I$include_path \\
-fno-builtin -fpcc-struct-return -fno-strict-aliasing \\
-funsigned-char -Wall -Wno-unused -Wno-uninitialized";
# link flags
$lflags="-T";
}
else
{
# compile flags for CodeWarrior
# additional flags based upon debug | non-debug
if ($debug)
{
$cflags="-opt off -g -sym internal -DDEBUG";
}
else
{
# CodeWarrior compiler has a problem with optimizations for floating
# points - no optimizations until further investigation
# $cflags="-opt all";
}
# NOTES: Several c files in the crypto subdirectory include headers from
# their local directories. Metrowerks wouldn't find these h files
# without adding individual include directives as compile flags
# or modifying the c files. Instead of adding individual include
# paths for each subdirectory a recursive include directive
# is used ( -ir crypto ).
#
# A similar issue exists for the engines and apps subdirectories.
#
# Turned off the "possible" warnings ( -w nopossible ). Metrowerks
# complained a lot about various stuff. May want to turn back
# on for further development.
$cflags.=" -nostdinc -ir crypto -ir ssl -ir engines -ir apps -I$include_path \\
-msgstyle gcc -align 4 -processor pentium -char unsigned \\
-w on -w nolargeargs -w nopossible -w nounusedarg -w nounusedexpr \\
-w noimplicitconv -relax_pointers -nosyspath -maxerrors 20";
# link flags
$lflags="-msgstyle gcc -zerobss -nostdlib -sym internal -commandfile";
}
# common defines
$cflags.=" -DL_ENDIAN -DOPENSSL_SYSNAME_NETWARE -U_WIN32";
# If LibC build add in NKS_LIBC define and set the entry/exit
# routines - The default entry/exit routines are for CLib and don't exist
# in LibC
if ($LIBC)
{
$cflags.=" -DNETWARE_LIBC";
$nlmstart = "_LibCPrelude";
$nlmexit = "_LibCPostlude";
@nlm_flags = ("pseudopreemption", "flag_on 64");
}
else
{
$cflags.=" -DNETWARE_CLIB";
$nlmstart = "_Prelude";
$nlmexit = "_Stop";
}
# If BSD Socket support is requested, set a define for the compiler
if ($BSDSOCK)
{
$cflags.=" -DNETWARE_BSDSOCK";
if (!$LIBC)
{
$cflags.=" -DNETDB_USE_INTERNET";
}
}
# linking stuff
# for the output directories use the mk1mf.pl values with "_nw" appended
if ($shlib)
{
if ($LIBC)
{
$out_def.="_nw_libc_nlm";
$tmp_def.="_nw_libc_nlm";
$inc_def.="_nw_libc_nlm";
}
else # NETWARE_CLIB
{
$out_def.="_nw_clib_nlm";
$tmp_def.="_nw_clib_nlm";
$inc_def.="_nw_clib_nlm";
}
}
else
{
if ($gnuc) # GNUC Tools
{
$libp=".a";
$shlibp=".a";
$lib_flags="-cr";
}
else # CodeWarrior
{
$libp=".lib";
$shlibp=".lib";
$lib_flags="-nodefaults -type library -o";
}
if ($LIBC)
{
$out_def.="_nw_libc";
$tmp_def.="_nw_libc";
$inc_def.="_nw_libc";
}
else # NETWARE_CLIB
{
$out_def.="_nw_clib";
$tmp_def.="_nw_clib";
$inc_def.="_nw_clib";
}
}
# used by mk1mf.pl
$obj='.o';
$ofile='-o ';
$efile='';
$exep='.nlm';
$ex_libs='';
if (!$no_asm)
{
$bn_asm_obj="\$(OBJ_D)${o}bn-nw${obj}";
$bn_asm_src="crypto${o}bn${o}asm${o}bn-nw.asm";
$bnco_asm_obj="\$(OBJ_D)${o}co-nw${obj}";
$bnco_asm_src="crypto${o}bn${o}asm${o}co-nw.asm";
$aes_asm_obj="\$(OBJ_D)${o}a-nw${obj}";
$aes_asm_src="crypto${o}aes${o}asm${o}a-nw.asm";
$des_enc_obj="\$(OBJ_D)${o}d-nw${obj} \$(OBJ_D)${o}y-nw${obj}";
$des_enc_src="crypto${o}des${o}asm${o}d-nw.asm crypto${o}des${o}asm${o}y-nw.asm";
$bf_enc_obj="\$(OBJ_D)${o}b-nw${obj}";
$bf_enc_src="crypto${o}bf${o}asm${o}b-nw.asm";
$cast_enc_obj="\$(OBJ_D)${o}c-nw${obj}";
$cast_enc_src="crypto${o}cast${o}asm${o}c-nw.asm";
$rc4_enc_obj="\$(OBJ_D)${o}r4-nw${obj}";
$rc4_enc_src="crypto${o}rc4${o}asm${o}r4-nw.asm";
$rc5_enc_obj="\$(OBJ_D)${o}r5-nw${obj}";
$rc5_enc_src="crypto${o}rc5${o}asm${o}r5-nw.asm";
$md5_asm_obj="\$(OBJ_D)${o}m5-nw${obj}";
$md5_asm_src="crypto${o}md5${o}asm${o}m5-nw.asm";
$sha1_asm_obj="\$(OBJ_D)${o}s1-nw${obj} \$(OBJ_D)${o}sha256-nw${obj} \$(OBJ_D)${o}sha512-nw${obj}";
$sha1_asm_src="crypto${o}sha${o}asm${o}s1-nw.asm crypto${o}sha${o}asm${o}sha256-nw.asm crypto${o}sha${o}asm${o}sha512-nw.asm";
$rmd160_asm_obj="\$(OBJ_D)${o}rm-nw${obj}";
$rmd160_asm_src="crypto${o}ripemd${o}asm${o}rm-nw.asm";
$whirlpool_asm_obj="\$(OBJ_D)${o}wp-nw${obj}";
$whirlpool_asm_src="crypto${o}whrlpool${o}asm${o}wp-nw.asm";
$cpuid_asm_obj="\$(OBJ_D)${o}x86cpuid-nw${obj}";
$cpuid_asm_src="crypto${o}x86cpuid-nw.asm";
$cflags.=" -DOPENSSL_CPUID_OBJ -DBN_ASM -DOPENSSL_BN_ASM_PART_WORDS -DMD5_ASM -DWHIRLPOOL_ASM";
$cflags.=" -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM";
$cflags.=" -DAES_ASM -DRMD160_ASM";
}
else
{
$bn_asm_obj='';
$bn_asm_src='';
$bnco_asm_obj='';
$bnco_asm_src='';
$aes_asm_obj='';
$aes_asm_src='';
$des_enc_obj='';
$des_enc_src='';
$bf_enc_obj='';
$bf_enc_src='';
$cast_enc_obj='';
$cast_enc_src='';
$rc4_enc_obj='';
$rc4_enc_src='';
$rc5_enc_obj='';
$rc5_enc_src='';
$md5_asm_obj='';
$md5_asm_src='';
$sha1_asm_obj='';
$sha1_asm_src='';
$rmd160_asm_obj='';
$rmd160_asm_src='';
$whirlpool_asm_obj='';
$whirlpool_asm_src='';
$cpuid_asm_obj='';
$cpuid_asm_src='';
}
# create the *.def linker command files in \openssl\netware\ directory
sub do_def_file
{
# strip off the leading path
my($target) = bname(shift);
my($i);
if ($target =~ /(.*).nlm/)
{
$target = $1;
}
# special case for openssl - the mk1mf.pl defines E_EXE = openssl
if ($target =~ /E_EXE/)
{
$target =~ s/\$\(E_EXE\)/openssl/;
}
# Note: originally tried to use full path ( \openssl\netware\$target.def )
# Metrowerks linker choked on this with an assertion failure. bug???
#
my($def_file) = "netware${o}$target.def";
open(DEF_OUT, ">$def_file") || die("unable to open file $def_file\n");
print( DEF_OUT "# command file generated by netware.pl for NLM target.\n" );
print( DEF_OUT "# do not edit this file - all your changes will be lost!!\n" );
print( DEF_OUT "#\n");
print( DEF_OUT "DESCRIPTION \"$target ($libarch) - OpenSSL $nlmverstr\"\n");
print( DEF_OUT "COPYRIGHT \"$nlmcpystr\"\n");
print( DEF_OUT "VERSION $nlmvernum\n");
print( DEF_OUT "STACK $nlmstack\n");
print( DEF_OUT "START $nlmstart\n");
print( DEF_OUT "EXIT $nlmexit\n");
# special case for openssl
if ($target eq "openssl")
{
print( DEF_OUT "SCREENNAME \"OpenSSL $nlmverstr\"\n");
}
else
{
print( DEF_OUT "SCREENNAME \"DEFAULT\"\n");
}
foreach $i (@misc_imports)
{
print( DEF_OUT "IMPORT $i\n");
}
foreach $i (@import_files)
{
print( DEF_OUT "IMPORT \@$import_path${o}$i\n");
}
foreach $i (@module_files)
{
print( DEF_OUT "MODULE $i\n");
}
foreach $i (@nlm_flags)
{
print( DEF_OUT "$i\n");
}
if ($gnuc)
{
if ($target =~ /openssl/)
{
print( DEF_OUT "INPUT ${tmp_def}${o}openssl${obj}\n");
print( DEF_OUT "INPUT ${tmp_def}${o}openssl${libp}\n");
}
else
{
print( DEF_OUT "INPUT ${tmp_def}${o}${target}${obj}\n");
}
print( DEF_OUT "INPUT $prelude\n");
print( DEF_OUT "INPUT ${out_def}${o}${ssl}${libp} ${out_def}${o}${crypto}${libp}\n");
print( DEF_OUT "OUTPUT $target.nlm\n");
}
close(DEF_OUT);
return($def_file);
}
sub do_lib_rule
{
my($objs,$target,$name,$shlib)=@_;
my($ret);
$ret.="$target: $objs\n";
if (!$shlib)
{
$ret.="\t\@echo Building Lib: $name\n";
$ret.="\t\$(MKLIB) $lib_flags $target $objs\n";
$ret.="\t\@echo .\n"
}
else
{
die( "Building as NLM not currently supported!" );
}
$ret.="\n";
return($ret);
}
sub do_link_rule
{
my($target,$files,$dep_libs,$libs)=@_;
my($ret);
my($def_file) = do_def_file($target);
$ret.="$target: $files $dep_libs\n";
# NOTE: When building the test nlms no screen name is given
# which causes the console screen to be used. By using the console
# screen there is no "<press any key to continue>" message which
# requires user interaction. The test script ( do_tests.pl ) needs
# to be able to run the tests without requiring user interaction.
#
# However, the sample program "openssl.nlm" is used by the tests and is
# a interactive sample so a screen is desired when not be run by the
# tests. To solve the problem, two versions of the program are built:
# openssl2 - no screen used by tests
# openssl - default screen - use for normal interactive modes
#
# special case for openssl - the mk1mf.pl defines E_EXE = openssl
if ($target =~ /E_EXE/)
{
my($target2) = $target;
$target2 =~ s/\(E_EXE\)/\(E_EXE\)2/;
# openssl2
my($def_file2) = do_def_file($target2);
if ($gnuc)
{
$ret.="\t\$(MKLIB) $lib_flags \$(TMP_D)${o}\$(E_EXE).a \$(filter-out \$(TMP_D)${o}\$(E_EXE)${obj},$files)\n";
$ret.="\t\$(LINK) \$(LFLAGS) $def_file2\n";
$ret.="\t\@$mv \$(E_EXE)2.nlm \$(TEST_D)\n";
}
else
{
$ret.="\t\$(LINK) \$(LFLAGS) $def_file2 $files \"$prelude\" $libs -o $target2\n";
}
}
if ($gnuc)
{
$ret.="\t\$(LINK) \$(LFLAGS) $def_file\n";
$ret.="\t\@$mv \$(\@F) \$(TEST_D)\n";
}
else
{
$ret.="\t\$(LINK) \$(LFLAGS) $def_file $files \"$prelude\" $libs -o $target\n";
}
$ret.="\n";
return($ret);
}
1;

View File

@@ -0,0 +1,38 @@
#!/usr/local/bin/perl
#
# linux.pl - the standard unix makefile stuff.
#
$o='/';
$cp='/bin/cp';
$rm='/bin/rm -f';
# C compiler stuff
$cc='cc';
if ($debug)
{ $cflags="-g -DREF_CHECK -DCRYPTO_MDEBUG"; }
else
{ $cflags="-O2"; }
$cflags.=" -std1 -DL_ENDIAN";
if (!$no_asm)
{
$bn_asm_obj='$(OBJ_D)/mips1.o';
$bn_asm_src='crypto/bn/asm/mips1.s';
}
sub do_link_rule
{
local($target,$files,$dep_libs,$libs)=@_;
local($ret,$_);
$file =~ s/\//$o/g if $o ne '/';
$n=&bname($target);
$ret.="$target: $files $dep_libs\n";
$ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n";
return($ret);
}
1;

View File

@@ -0,0 +1,442 @@
#!/usr/local/bin/perl
#
# unix.pl - the standard unix makefile stuff.
#
$o='/';
$cp='/bin/cp';
$rm='/bin/rm -f';
# C compiler stuff
if ($gcc)
{
$cc='gcc';
if ($debug)
{ $cflags="-g2 -ggdb"; }
else
{ $cflags="-O3 -fomit-frame-pointer"; }
}
else
{
$cc='cc';
if ($debug)
{ $cflags="-g"; }
else
{ $cflags="-O"; }
}
$obj='.o';
$asm_suffix='.s';
$ofile='-o ';
# EXE linking stuff
$link='${CC}';
$lflags='${CFLAG}';
$efile='-o ';
$exep='';
$ex_libs="";
# static library stuff
$mklib='ar r';
$mlflags='';
$ranlib=&which("ranlib") or $ranlib="true";
$plib='lib';
$libp=".a";
$shlibp=".a";
$lfile='';
$asm='as';
$afile='-o ';
$bn_asm_obj="";
$bn_asm_src="";
$des_enc_obj="";
$des_enc_src="";
$bf_enc_obj="";
$bf_enc_src="";
%perl1 = (
'md5-x86_64' => 'crypto/md5',
'x86_64-mont' => 'crypto/bn',
'x86_64-mont5' => 'crypto/bn',
'x86_64-gf2m' => 'crypto/bn',
'aes-x86_64' => 'crypto/aes',
'vpaes-x86_64' => 'crypto/aes',
'bsaes-x86_64' => 'crypto/aes',
'aesni-x86_64' => 'crypto/aes',
'aesni-sha1-x86_64' => 'crypto/aes',
'sha1-x86_64' => 'crypto/sha',
'e_padlock-x86_64' => 'engines',
'rc4-x86_64' => 'crypto/rc4',
'rc4-md5-x86_64' => 'crypto/rc4',
'ghash-x86_64' => 'crypto/modes',
'aesni-gcm-x86_64' => 'crypto/modes',
'aesni-sha256-x86_64' => 'crypto/aes',
'rsaz-x86_64' => 'crypto/bn',
'rsaz-avx2' => 'crypto/bn',
'aesni-mb-x86_64' => 'crypto/aes',
'sha1-mb-x86_64' => 'crypto/sha',
'sha256-mb-x86_64' => 'crypto/sha',
'ecp_nistz256-x86_64' => 'crypto/ec',
);
# If I were feeling more clever, these could probably be extracted
# from makefiles.
sub platform_perlasm_compile_target
{
local($target, $source, $bname) = @_;
for $p (keys %perl1)
{
if ($target eq "\$(OBJ_D)/$p.o")
{
return << "EOF";
\$(TMP_D)/$p.s: $perl1{$p}/asm/$p.pl
\$(PERL) $perl1{$p}/asm/$p.pl \$(PERLASM_SCHEME) > \$@
EOF
}
}
if ($target eq '$(OBJ_D)/x86_64cpuid.o')
{
return << 'EOF';
$(TMP_D)/x86_64cpuid.s: crypto/x86_64cpuid.pl
$(PERL) crypto/x86_64cpuid.pl $(PERLASM_SCHEME) > $@
EOF
}
elsif ($target eq '$(OBJ_D)/sha256-x86_64.o')
{
return << 'EOF';
$(TMP_D)/sha256-x86_64.s: crypto/sha/asm/sha512-x86_64.pl
$(PERL) crypto/sha/asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@
EOF
}
elsif ($target eq '$(OBJ_D)/sha512-x86_64.o')
{
return << 'EOF';
$(TMP_D)/sha512-x86_64.s: crypto/sha/asm/sha512-x86_64.pl
$(PERL) crypto/sha/asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@
EOF
}
elsif ($target eq '$(OBJ_D)/sha512-x86_64.o')
{
return << 'EOF';
$(TMP_D)/sha512-x86_64.s: crypto/sha/asm/sha512-x86_64.pl
$(PERL) crypto/sha/asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@
EOF
}
die $target;
}
sub special_compile_target
{
local($target) = @_;
if ($target eq 'crypto/bn/x86_64-gcc')
{
return << "EOF";
\$(TMP_D)/x86_64-gcc.o: crypto/bn/asm/x86_64-gcc.c
\$(CC) \$(CFLAGS) -c -o \$@ crypto/bn/asm/x86_64-gcc.c
EOF
}
return undef;
}
sub do_lib_rule
{
local($obj,$target,$name,$shlib)=@_;
local($ret,$_,$Name);
$target =~ s/\//$o/g if $o ne '/';
$target="$target";
($Name=$name) =~ tr/a-z/A-Z/;
$ret.="$target: \$(${Name}OBJ)\n";
$ret.="\t\$(RM) $target\n";
$ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n";
$ret.="\t\$(RANLIB) $target\n\n";
}
sub do_link_rule
{
local($target,$files,$dep_libs,$libs)=@_;
local($ret,$_);
$file =~ s/\//$o/g if $o ne '/';
$n=&bname($target);
$ret.="$target: $files $dep_libs\n";
$ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n";
return($ret);
}
sub which
{
my ($name)=@_;
my $path;
foreach $path (split /:/, $ENV{PATH})
{
if (-x "$path/$name")
{
return "$path/$name";
}
}
}
sub fixtests
{
my ($str, $tests) = @_;
foreach my $t (keys %$tests)
{
$str =~ s/(\.\/)?\$\($t\)/\$(TEST_D)\/$tests->{$t}/g;
}
return $str;
}
sub fixdeps
{
my ($str, $fakes) = @_;
my @t = split(/\s+/, $str);
$str = '';
foreach my $t (@t)
{
$str .= ' ' if $str ne '';
if (exists($fakes->{$t}))
{
$str .= $fakes->{$t};
next;
}
if ($t =~ /^[^\/]+$/)
{
$str .= '$(TEST_D)/' . $t;
}
else
{
$str .= $t;
}
}
return $str;
}
sub fixrules
{
my ($str) = @_;
# Compatible with -j...
$str =~ s/^(\s+@?)/$1cd \$(TEST_D) && /;
return $str;
# Compatible with not -j.
my @t = split("\n", $str);
$str = '';
my $prev;
foreach my $t (@t)
{
$t =~ s/^\s+//;
if (!$prev)
{
if ($t =~ /^@/)
{
$t =~ s/^@/\@cd \$(TEST_D) && /;
}
elsif ($t !~ /^\s*#/)
{
$t = 'cd $(TEST_D) && ' . $t;
}
}
$str .= "\t$t\n";
$prev = $t =~/\\$/;
}
return $str;
}
sub copy_scripts
{
my ($sed, $src, @targets) = @_;
my $s = '';
foreach my $t (@targets)
{
# Copy first so we get file modes...
$s .= "\$(TEST_D)/$t: \$(SRC_D)/$src/$t\n\tcp \$(SRC_D)/$src/$t \$(TEST_D)/$t\n";
$s .= "\tsed -e 's/\\.\\.\\/apps/..\\/\$(OUT_D)/' -e 's/\\.\\.\\/util/..\\/\$(TEST_D)/' < \$(SRC_D)/$src/$t > \$(TEST_D)/$t\n" if $sed;
$s .= "\n";
}
return $s;
}
sub get_tests
{
my ($makefile) = @_;
open(M, $makefile) || die "Can't open $makefile: $!";
my %targets;
my %deps;
my %tests;
my %alltests;
my %fakes;
while (my $line = <M>)
{
chomp $line;
while ($line =~ /^(.*)\\$/)
{
$line = $1 . <M>;
}
if ($line =~ /^alltests:(.*)$/)
{
my @t = split(/\s+/, $1);
foreach my $t (@t)
{
$targets{$t} = '';
$alltests{$t} = undef;
}
}
if (($line =~ /^(?<t>\S+):(?<d>.*)$/ && exists $targets{$1})
|| $line =~ /^(?<t>test_(ss|gen) .*):(?<d>.*)/)
{
my $t = $+{t};
my $d = $+{d};
# If there are multiple targets stupid FreeBSD make runs the
# rules once for each dependency that matches one of the
# targets. Running the same rule twice concurrently causes
# breakage, so replace with a fake target.
if ($t =~ /\s/)
{
++$fake;
my @targets = split /\s+/, $t;
$t = "_fake$fake";
foreach my $f (@targets)
{
$fakes{$f} = $t;
}
}
$deps{$t} = $d;
$deps{$t} =~ s/#.*$//;
for (;;)
{
$line = <M>;
chomp $line;
last if $line eq '';
$targets{$t} .= "$line\n";
}
next;
}
if ($line =~ /^(\S+TEST)=\s*(\S+)$/)
{
$tests{$1} = $2;
next;
}
}
delete $alltests{test_jpake} if $no_jpake;
delete $targets{test_ige} if $no_ige;
delete $alltests{test_md2} if $no_md2;
delete $alltests{test_rc5} if $no_rc5;
my $tests;
foreach my $t (keys %tests)
{
$tests .= "$t = $tests{$t}\n";
}
my $each;
foreach my $t (keys %targets)
{
next if $t eq '';
my $d = $deps{$t};
$d =~ s/\.\.\/apps/\$(BIN_D)/g;
$d =~ s/\.\.\/util/\$(TEST_D)/g;
$d = fixtests($d, \%tests);
$d = fixdeps($d, \%fakes);
my $r = $targets{$t};
$r =~ s/\.\.\/apps/..\/\$(BIN_D)/g;
$r =~ s/\.\.\/util/..\/\$(TEST_D)/g;
$r =~ s/\.\.\/(\S+)/\$(SRC_D)\/$1/g;
$r = fixrules($r);
next if $r eq '';
$t =~ s/\s+/ \$(TEST_D)\//g;
$each .= "$t: test_scripts $d\n\t\@echo '$t test started'\n$r\t\@echo '$t test done'\n\n";
}
# FIXME: Might be a clever way to figure out what needs copying
my @copies = ( 'bctest',
'testgen',
'cms-test.pl',
'tx509',
'test.cnf',
'testenc',
'tocsp',
'testca',
'CAss.cnf',
'testtsa',
'CAtsa.cnf',
'Uss.cnf',
'P1ss.cnf',
'P2ss.cnf',
'tcrl',
'tsid',
'treq',
'tpkcs7',
'tpkcs7d',
'testcrl.pem',
'testx509.pem',
'v3-cert1.pem',
'v3-cert2.pem',
'testreq2.pem',
'testp7.pem',
'pkcs7-1.pem',
'trsa',
'testrsa.pem',
'testsid.pem',
'testss',
'testssl',
'testsslproxy',
'serverinfo.pem',
);
my $copies = copy_scripts(1, 'test', @copies);
$copies .= copy_scripts(0, 'test', ('smcont.txt'));
my @utils = ( 'shlib_wrap.sh',
'opensslwrap.sh',
);
$copies .= copy_scripts(1, 'util', @utils);
my @apps = ( 'CA.sh',
'openssl.cnf',
'server2.pem',
);
$copies .= copy_scripts(1, 'apps', @apps);
$copies .= copy_scripts(1, 'crypto/evp', ('evptests.txt'));
$scripts = "test_scripts: \$(TEST_D)/CA.sh \$(TEST_D)/opensslwrap.sh \$(TEST_D)/openssl.cnf \$(TEST_D)/shlib_wrap.sh ocsp smime\n";
$scripts .= "\nocsp:\n\tcp -R test/ocsp-tests \$(TEST_D)\n";
$scripts .= "\smime:\n\tcp -R test/smime-certs \$(TEST_D)\n";
my $all = 'test:';
foreach my $t (keys %alltests)
{
if (exists($fakes{$t}))
{
$all .= " $fakes{$t}";
}
else
{
$all .= " $t";
}
}
return "$scripts\n$copies\n$tests\n$all\n\n$each";
}
1;

1184
openssl-1.0.2f/util/pod2man.pl Executable file

File diff suppressed because it is too large Load Diff

58
openssl-1.0.2f/util/pod2mantest Executable file
View File

@@ -0,0 +1,58 @@
#!/bin/sh
# This script is used by test/Makefile to check whether a sane 'pod2man'
# is installed.
# ('make install' should not try to run 'pod2man' if it does not exist or if
# it is a broken 'pod2man' version that is known to cause trouble. if we find
# the system 'pod2man' to be broken, we use our own copy instead)
#
# In any case, output an appropriate command line for running (or not
# running) pod2man.
IFS=:
if test "$OSTYPE" = "msdosdjgpp"; then IFS=";"; fi
try_without_dir=true
# First we try "pod2man", then "$dir/pod2man" for each item in $PATH.
for dir in dummy${IFS}$PATH; do
if [ "$try_without_dir" = true ]; then
# first iteration
pod2man=pod2man
try_without_dir=false
else
# second and later iterations
pod2man="$dir/pod2man"
if [ ! -f "$pod2man" ]; then # '-x' is not available on Ultrix
pod2man=''
fi
fi
if [ ! "$pod2man" = '' ]; then
failure=none
if "$pod2man" --section=1 --center=OpenSSL --release=dev pod2mantest.pod | fgrep OpenSSL >/dev/null; then
:
else
failure=BasicTest
fi
if [ "$failure" = none ]; then
if "$pod2man" --section=1 --center=OpenSSL --release=dev pod2mantest.pod | grep '^MARKER - ' >/dev/null; then
failure=MultilineTest
fi
fi
if [ "$failure" = none ]; then
echo "$pod2man"
exit 0
fi
echo "$pod2man does not work properly ('$failure' failed). Looking for another pod2man ..." >&2
fi
done
echo "No working pod2man found. Consider installing a new version." >&2
echo "As a workaround, we'll use a bundled old copy of pod2man.pl." >&2
echo "$1 ../../util/pod2man.pl"

View File

@@ -0,0 +1,15 @@
=pod
=head1 NAME
foo, bar,
MARKER - test of multiline name section
=head1 DESCRIPTION
This is a test .pod file to see if we have a buggy pod2man or not.
If we have a buggy implementation, we will get a line matching the
regular expression "^ +MARKER - test of multiline name section *$"
at the end of the resulting document.
=cut

10
openssl-1.0.2f/util/point.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/sh
rm -f "$2"
if test "$OSTYPE" = msdosdjgpp || test "x$PLATFORM" = xmingw ; then
cp "$1" "$2"
else
ln -s "$1" "$2"
fi
echo "$2 => $1"

View File

@@ -0,0 +1,202 @@
#!/usr/local/bin/perl -w
#
# Run the test suite and generate a report
#
if (! -f "Configure") {
print "Please run perl util/selftest.pl in the OpenSSL directory.\n";
exit 1;
}
my $report="testlog";
my $os="??";
my $version="??";
my $platform0="??";
my $platform="??";
my $options="??";
my $last="??";
my $ok=0;
my $cc="cc";
my $cversion="??";
my $sep="-----------------------------------------------------------------------------\n";
my $not_our_fault="\nPlease ask your system administrator/vendor for more information.\n[Problems with your operating system setup should not be reported\nto the OpenSSL project.]\n";
open(OUT,">$report") or die;
print OUT "OpenSSL self-test report:\n\n";
$uname=`uname -a`;
$uname="??\n" if $uname eq "";
$c=`sh config -t`;
foreach $_ (split("\n",$c)) {
$os=$1 if (/Operating system: (.*)$/);
$platform0=$1 if (/Configuring for (.*)$/);
}
system "sh config" if (! -f "Makefile");
if (open(IN,"<Makefile")) {
while (<IN>) {
$version=$1 if (/^VERSION=(.*)$/);
$platform=$1 if (/^PLATFORM=(.*)$/);
$options=$1 if (/^OPTIONS=(.*)$/);
$cc=$1 if (/^CC= *(.*)$/);
}
close(IN);
} else {
print OUT "Error running config!\n";
}
$cversion=`$cc -v 2>&1`;
$cversion=`$cc -V 2>&1` if $cversion =~ "[Uu]sage";
$cversion=`$cc -V |head -1` if $cversion =~ "Error";
$cversion=`$cc --version` if $cversion eq "";
$cversion =~ s/Reading specs.*\n//;
$cversion =~ s/usage.*\n//;
chomp $cversion;
if (open(IN,"<CHANGES")) {
while(<IN>) {
if (/\*\) (.{0,55})/ && !/applies to/) {
$last=$1;
last;
}
}
close(IN);
}
print OUT "OpenSSL version: $version\n";
print OUT "Last change: $last...\n";
print OUT "Options: $options\n" if $options ne "";
print OUT "OS (uname): $uname";
print OUT "OS (config): $os\n";
print OUT "Target (default): $platform0\n";
print OUT "Target: $platform\n";
print OUT "Compiler: $cversion\n";
print OUT "\n";
print "Checking compiler...\n";
if (open(TEST,">cctest.c")) {
print TEST "#include <stdio.h>\n#include <stdlib.h>\n#include <errno.h>\nmain(){printf(\"Hello world\\n\");}\n";
close(TEST);
system("$cc -o cctest cctest.c");
if (`./cctest` !~ /Hello world/) {
print OUT "Compiler doesn't work.\n";
print OUT $not_our_fault;
goto err;
}
system("ar r cctest.a /dev/null");
if (not -f "cctest.a") {
print OUT "Check your archive tool (ar).\n";
print OUT $not_our_fault;
goto err;
}
} else {
print OUT "Can't create cctest.c\n";
}
if (open(TEST,">cctest.c")) {
print TEST "#include <stdio.h>\n#include <stdlib.h>\n#include <openssl/opensslv.h>\nmain(){printf(OPENSSL_VERSION_TEXT);}\n";
close(TEST);
system("$cc -o cctest -Iinclude cctest.c");
$cctest = `./cctest`;
if ($cctest !~ /OpenSSL $version/) {
if ($cctest =~ /OpenSSL/) {
print OUT "#include uses headers from different OpenSSL version!\n";
} else {
print OUT "Can't compile test program!\n";
}
print OUT $not_our_fault;
goto err;
}
} else {
print OUT "Can't create cctest.c\n";
}
print "Running make...\n";
if (system("make 2>&1 | tee make.log") > 255) {
print OUT "make failed!\n";
if (open(IN,"<make.log")) {
print OUT $sep;
while (<IN>) {
print OUT;
}
close(IN);
print OUT $sep;
} else {
print OUT "make.log not found!\n";
}
goto err;
}
# Not sure why this is here. The tests themselves can detect if their
# particular feature isn't included, and should therefore skip themselves.
# To skip *all* tests just because one algorithm isn't included is like
# shooting mosquito with an elephant gun...
# -- Richard Levitte, inspired by problem report 1089
#
#$_=$options;
#s/no-asm//;
#s/no-shared//;
#s/no-krb5//;
#if (/no-/)
#{
# print OUT "Test skipped.\n";
# goto err;
#}
print "Running make test...\n";
if (system("make test 2>&1 | tee maketest.log") > 255)
{
print OUT "make test failed!\n";
} else {
$ok=1;
}
if ($ok and open(IN,"<maketest.log")) {
while (<IN>) {
$ok=2 if /^platform: $platform/;
}
close(IN);
}
if ($ok != 2) {
print OUT "Failure!\n";
if (open(IN,"<make.log")) {
print OUT $sep;
while (<IN>) {
print OUT;
}
close(IN);
print OUT $sep;
} else {
print OUT "make.log not found!\n";
}
if (open(IN,"<maketest.log")) {
while (<IN>) {
print OUT;
}
close(IN);
print OUT $sep;
} else {
print OUT "maketest.log not found!\n";
}
} else {
print OUT "Test passed.\n";
}
err:
close(OUT);
print "\n";
open(IN,"<$report") or die;
while (<IN>) {
if (/$sep/) {
print "[...]\n";
last;
}
print;
}
print "\nTest report in file $report\n";
die if $ok != 2;

View File

@@ -0,0 +1,97 @@
#!/bin/sh
[ $# -ne 0 ] || set -x # debug mode without arguments:-)
THERE="`echo $0 | sed -e 's|[^/]*$||' 2>/dev/null`.."
[ -d "${THERE}" ] || exec "$@" # should never happen...
# Alternative to this is to parse ${THERE}/Makefile...
LIBCRYPTOSO="${THERE}/libcrypto.so"
if [ -f "$LIBCRYPTOSO" ]; then
while [ -h "$LIBCRYPTOSO" ]; do
LIBCRYPTOSO="${THERE}/`ls -l "$LIBCRYPTOSO" | sed -e 's|.*\-> ||'`"
done
SOSUFFIX=`echo ${LIBCRYPTOSO} | sed -e 's|.*\.so||' 2>/dev/null`
LIBSSLSO="${THERE}/libssl.so${SOSUFFIX}"
fi
SYSNAME=`(uname -s) 2>/dev/null`;
case "$SYSNAME" in
SunOS|IRIX*)
# SunOS and IRIX run-time linkers evaluate alternative
# variables depending on target ABI...
rld_var=LD_LIBRARY_PATH
case "`(/usr/bin/file "$LIBCRYPTOSO") 2>/dev/null`" in
*ELF\ 64*SPARC*|*ELF\ 64*AMD64*)
[ -n "$LD_LIBRARY_PATH_64" ] && rld_var=LD_LIBRARY_PATH_64
LD_PRELOAD_64="$LIBCRYPTOSO $LIBSSLSO"; export LD_PRELOAD_64
preload_var=LD_PRELOAD_64
;;
# Why are newly built .so's preloaded anyway? Because run-time
# .so lookup path embedded into application takes precedence
# over LD_LIBRARY_PATH and as result application ends up linking
# to previously installed .so's. On IRIX instead of preloading
# newly built .so's we trick run-time linker to fail to find
# the installed .so by setting _RLD_ROOT variable.
*ELF\ 32*MIPS*)
#_RLD_LIST="$LIBCRYPTOSO:$LIBSSLSO:DEFAULT"; export _RLD_LIST
_RLD_ROOT=/no/such/dir; export _RLD_ROOT
eval $rld_var=\"/usr/lib'${'$rld_var':+:$'$rld_var'}'\"
preload_var=_RLD_LIST
;;
*ELF\ N32*MIPS*)
[ -n "$LD_LIBRARYN32_PATH" ] && rld_var=LD_LIBRARYN32_PATH
#_RLDN32_LIST="$LIBCRYPTOSO:$LIBSSLSO:DEFAULT"; export _RLDN32_LIST
_RLDN32_ROOT=/no/such/dir; export _RLDN32_ROOT
eval $rld_var=\"/usr/lib32'${'$rld_var':+:$'$rld_var'}'\"
preload_var=_RLDN32_LIST
;;
*ELF\ 64*MIPS*)
[ -n "$LD_LIBRARY64_PATH" ] && rld_var=LD_LIBRARY64_PATH
#_RLD64_LIST="$LIBCRYPTOSO:$LIBSSLSO:DEFAULT"; export _RLD64_LIST
_RLD64_ROOT=/no/such/dir; export _RLD64_ROOT
eval $rld_var=\"/usr/lib64'${'$rld_var':+:$'$rld_var'}'\"
preload_var=_RLD64_LIST
;;
esac
eval $rld_var=\"${THERE}'${'$rld_var':+:$'$rld_var'}'\"; export $rld_var
unset rld_var
;;
*) LD_LIBRARY_PATH="${THERE}:$LD_LIBRARY_PATH" # Linux, ELF HP-UX
DYLD_LIBRARY_PATH="${THERE}:$DYLD_LIBRARY_PATH" # MacOS X
SHLIB_PATH="${THERE}:$SHLIB_PATH" # legacy HP-UX
LIBPATH="${THERE}:$LIBPATH" # AIX, OS/2
export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH
# Even though $PATH is adjusted [for Windows sake], it doesn't
# necessarily does the trick. Trouble is that with introduction
# of SafeDllSearchMode in XP/2003 it's more appropriate to copy
# .DLLs in vicinity of executable, which is done elsewhere...
if [ "$OSTYPE" != msdosdjgpp ]; then
PATH="${THERE}:$PATH"; export PATH
fi
;;
esac
if [ -f "$LIBCRYPTOSO" -a -z "$preload_var" ]; then
# Following three lines are major excuse for isolating them into
# this wrapper script. Original reason for setting LD_PRELOAD
# was to make it possible to pass 'make test' when user linked
# with -rpath pointing to previous version installation. Wrapping
# it into a script makes it possible to do so on multi-ABI
# platforms.
case "$SYSNAME" in
*BSD|QNX) LD_PRELOAD="$LIBCRYPTOSO:$LIBSSLSO" ;; # *BSD, QNX
*) LD_PRELOAD="$LIBCRYPTOSO $LIBSSLSO" ;; # SunOS, Linux, ELF HP-UX
esac
_RLD_LIST="$LIBCRYPTOSO:$LIBSSLSO:DEFAULT" # Tru64, o32 IRIX
DYLD_INSERT_LIBRARIES="$LIBCRYPTOSO:$LIBSSLSO" # MacOS X
export LD_PRELOAD _RLD_LIST DYLD_INSERT_LIBRARIES
fi
cmd="$1${EXE_EXT}"
shift
if [ $# -eq 0 ]; then
exec "$cmd" # old sh, such as Tru64 4.x, fails to expand empty "$@"
else
exec "$cmd" "$@"
fi

80
openssl-1.0.2f/util/sp-diff.pl Executable file
View File

@@ -0,0 +1,80 @@
#!/usr/local/bin/perl
#
# This file takes as input, the files that have been output from
# ssleay speed.
# It prints a table of the relative differences with %100 being 'no difference'
#
($#ARGV == 1) || die "$0 speedout1 speedout2\n";
%one=&loadfile($ARGV[0]);
%two=&loadfile($ARGV[1]);
$line=0;
foreach $a ("md2","md4","md5","sha","sha1","rc4","des cfb","des cbc","des ede3",
"idea cfb","idea cbc","rc2 cfb","rc2 cbc","blowfish cbc","cast cbc")
{
if (defined($one{$a,8}) && defined($two{$a,8}))
{
print "type 8 byte% 64 byte% 256 byte% 1024 byte% 8192 byte%\n"
unless $line;
$line++;
printf "%-12s ",$a;
foreach $b (8,64,256,1024,8192)
{
$r=$two{$a,$b}/$one{$a,$b}*100;
printf "%12.2f",$r;
}
print "\n";
}
}
foreach $a (
"rsa 512","rsa 1024","rsa 2048","rsa 4096",
"dsa 512","dsa 1024","dsa 2048",
)
{
if (defined($one{$a,1}) && defined($two{$a,1}))
{
$r1=($one{$a,1}/$two{$a,1})*100;
$r2=($one{$a,2}/$two{$a,2})*100;
printf "$a bits %% %6.2f %% %6.2f\n",$r1,$r2;
}
}
sub loadfile
{
local($file)=@_;
local($_,%ret);
open(IN,"<$file") || die "unable to open '$file' for input\n";
$header=1;
while (<IN>)
{
$header=0 if /^[dr]sa/;
if (/^type/) { $header=0; next; }
next if $header;
chop;
@a=split;
if ($a[0] =~ /^[dr]sa$/)
{
($n,$t1,$t2)=($_ =~ /^([dr]sa\s+\d+)\s+bits\s+([.\d]+)s\s+([.\d]+)/);
$ret{$n,1}=$t1;
$ret{$n,2}=$t2;
}
else
{
$n=join(' ',grep(/[^k]$/,@a));
@k=grep(s/k$//,@a);
$ret{$n, 8}=$k[0];
$ret{$n, 64}=$k[1];
$ret{$n, 256}=$k[2];
$ret{$n,1024}=$k[3];
$ret{$n,8192}=$k[4];
}
}
close(IN);
return(%ret);
}

39
openssl-1.0.2f/util/speed.sh Executable file
View File

@@ -0,0 +1,39 @@
#!/bin/sh
#
# This is a ugly script use, in conjuction with editing the 'b'
# configuration in the $(TOP)/Configure script which will
# output when finished a file called speed.log which is the
# timings of SSLeay with various options turned on or off.
#
# from the $(TOP) directory
# Edit Configure, modifying things to do with the b/bl-4c-2c etc
# configurations.
#
make clean
perl Configure b
make
apps/ssleay version -v -b -f >speed.1
apps/ssleay speed >speed.1l
perl Configure bl-4c-2c
/bin/rm -f crypto/rc4/*.o crypto/bn/bn*.o crypto/md2/md2_dgst.o
make
apps/ssleay speed rc4 rsa md2 >speed.2l
perl Configure bl-4c-ri
/bin/rm -f crypto/rc4/rc4*.o
make
apps/ssleay speed rc4 >speed.3l
perl Configure b2-is-ri-dp
/bin/rm -f crypto/idea/i_*.o crypto/rc4/*.o crypto/des/ecb_enc.o crypto/bn/bn*.o
apps/ssleay speed rsa rc4 idea des >speed.4l
cat speed.1 >speed.log
cat speed.1l >>speed.log
perl util/sp-diff.pl speed.1l speed.2l >>speed.log
perl util/sp-diff.pl speed.1l speed.3l >>speed.log
perl util/sp-diff.pl speed.1l speed.4l >>speed.log

147
openssl-1.0.2f/util/src-dep.pl Executable file
View File

@@ -0,0 +1,147 @@
#!/usr/local/bin/perl
# we make up an array of
# $file{function_name}=filename;
# $unres{filename}="func1 func2 ...."
$debug=1;
#$nm_func="parse_linux";
$nm_func="parse_solaris";
foreach (@ARGV)
{
&$nm_func($_);
}
foreach $file (sort keys %unres)
{
@a=split(/\s+/,$unres{$file});
%ff=();
foreach $func (@a)
{
$f=$file{$func};
$ff{$f}=1 if $f ne "";
}
foreach $a (keys %ff)
{ $we_need{$file}.="$a "; }
}
foreach $file (sort keys %we_need)
{
# print " $file $we_need{$file}\n";
foreach $bit (split(/\s+/,$we_need{$file}))
{ push(@final,&walk($bit)); }
foreach (@final) { $fin{$_}=1; }
@final="";
foreach (sort keys %fin)
{ push(@final,$_); }
print "$file: @final\n";
}
sub walk
{
local($f)=@_;
local(@a,%seen,@ret,$r);
@ret="";
$f =~ s/^\s+//;
$f =~ s/\s+$//;
return "" if ($f =~ "^\s*$");
return(split(/\s/,$done{$f})) if defined ($done{$f});
return if $in{$f} > 0;
$in{$f}++;
push(@ret,$f);
foreach $r (split(/\s+/,$we_need{$f}))
{
push(@ret,&walk($r));
}
$in{$f}--;
$done{$f}=join(" ",@ret);
return(@ret);
}
sub parse_linux
{
local($name)=@_;
open(IN,"nm $name|") || die "unable to run 'nn $name':$!\n";
while (<IN>)
{
chop;
next if /^\s*$/;
if (/^[^[](.*):$/)
{
$file=$1;
$file="$1.c" if /\[(.*).o\]/;
print STDERR "$file\n";
$we_need{$file}=" ";
next;
}
@a=split(/\s*\|\s*/);
next unless $#a == 7;
next unless $a[4] eq "GLOB";
if ($a[6] eq "UNDEF")
{
$unres{$file}.=$a[7]." ";
}
else
{
if ($file{$a[7]} ne "")
{
print STDERR "duplicate definition of $a[7],\n$file{$a[7]} and $file \n";
}
else
{
$file{$a[7]}=$file;
}
}
}
close(IN);
}
sub parse_solaris
{
local($name)=@_;
open(IN,"nm $name|") || die "unable to run 'nn $name':$!\n";
while (<IN>)
{
chop;
next if /^\s*$/;
if (/^(\S+):$/)
{
$file=$1;
#$file="$1.c" if $file =~ /^(.*).o$/;
print STDERR "$file\n";
$we_need{$file}=" ";
next;
}
@a=split(/\s*\|\s*/);
next unless $#a == 7;
next unless $a[4] eq "GLOB";
if ($a[6] eq "UNDEF")
{
$unres{$file}.=$a[7]." ";
print STDERR "$file needs $a[7]\n" if $debug;
}
else
{
if ($file{$a[7]} ne "")
{
print STDERR "duplicate definition of $a[7],\n$file{$a[7]} and $file \n";
}
else
{
$file{$a[7]}=$file;
print STDERR "$file has $a[7]\n" if $debug;
}
}
}
close(IN);
}

370
openssl-1.0.2f/util/ssleay.num Executable file
View File

@@ -0,0 +1,370 @@
ERR_load_SSL_strings 1 EXIST::FUNCTION:
SSL_CIPHER_description 2 EXIST::FUNCTION:
SSL_CTX_add_client_CA 3 EXIST::FUNCTION:
SSL_CTX_add_session 4 EXIST::FUNCTION:
SSL_CTX_check_private_key 5 EXIST::FUNCTION:
SSL_CTX_ctrl 6 EXIST::FUNCTION:
SSL_CTX_flush_sessions 7 EXIST::FUNCTION:
SSL_CTX_free 8 EXIST::FUNCTION:
SSL_CTX_get_client_CA_list 9 EXIST::FUNCTION:
SSL_CTX_get_verify_callback 10 EXIST::FUNCTION:
SSL_CTX_get_verify_mode 11 EXIST::FUNCTION:
SSL_CTX_new 12 EXIST::FUNCTION:
SSL_CTX_remove_session 13 EXIST::FUNCTION:
SSL_CTX_set_cipher_list 15 EXIST::FUNCTION:
SSL_CTX_set_client_CA_list 16 EXIST::FUNCTION:
SSL_CTX_set_default_passwd_cb 17 EXIST::FUNCTION:
SSL_CTX_set_ssl_version 19 EXIST::FUNCTION:
SSL_CTX_set_verify 21 EXIST::FUNCTION:
SSL_CTX_use_PrivateKey 22 EXIST::FUNCTION:
SSL_CTX_use_PrivateKey_ASN1 23 EXIST::FUNCTION:
SSL_CTX_use_PrivateKey_file 24 EXIST::FUNCTION:STDIO
SSL_CTX_use_RSAPrivateKey 25 EXIST::FUNCTION:RSA
SSL_CTX_use_RSAPrivateKey_ASN1 26 EXIST::FUNCTION:RSA
SSL_CTX_use_RSAPrivateKey_file 27 EXIST::FUNCTION:RSA,STDIO
SSL_CTX_use_certificate 28 EXIST::FUNCTION:
SSL_CTX_use_certificate_ASN1 29 EXIST::FUNCTION:
SSL_CTX_use_certificate_file 30 EXIST::FUNCTION:STDIO
SSL_SESSION_free 31 EXIST::FUNCTION:
SSL_SESSION_new 32 EXIST::FUNCTION:
SSL_SESSION_print 33 EXIST::FUNCTION:BIO
SSL_SESSION_print_fp 34 EXIST::FUNCTION:FP_API
SSL_accept 35 EXIST::FUNCTION:
SSL_add_client_CA 36 EXIST::FUNCTION:
SSL_alert_desc_string 37 EXIST::FUNCTION:
SSL_alert_desc_string_long 38 EXIST::FUNCTION:
SSL_alert_type_string 39 EXIST::FUNCTION:
SSL_alert_type_string_long 40 EXIST::FUNCTION:
SSL_check_private_key 41 EXIST::FUNCTION:
SSL_clear 42 EXIST::FUNCTION:
SSL_connect 43 EXIST::FUNCTION:
SSL_copy_session_id 44 EXIST::FUNCTION:
SSL_ctrl 45 EXIST::FUNCTION:
SSL_dup 46 EXIST::FUNCTION:
SSL_dup_CA_list 47 EXIST::FUNCTION:
SSL_free 48 EXIST::FUNCTION:
SSL_get_certificate 49 EXIST::FUNCTION:
SSL_get_cipher_list 52 EXIST::FUNCTION:
SSL_get_ciphers 55 EXIST::FUNCTION:
SSL_get_client_CA_list 56 EXIST::FUNCTION:
SSL_get_default_timeout 57 EXIST::FUNCTION:
SSL_get_error 58 EXIST::FUNCTION:
SSL_get_fd 59 EXIST::FUNCTION:
SSL_get_peer_cert_chain 60 EXIST::FUNCTION:
SSL_get_peer_certificate 61 EXIST::FUNCTION:
SSL_get_rbio 63 EXIST::FUNCTION:BIO
SSL_get_read_ahead 64 EXIST::FUNCTION:
SSL_get_shared_ciphers 65 EXIST::FUNCTION:
SSL_get_ssl_method 66 EXIST::FUNCTION:
SSL_get_verify_callback 69 EXIST::FUNCTION:
SSL_get_verify_mode 70 EXIST::FUNCTION:
SSL_get_version 71 EXIST::FUNCTION:
SSL_get_wbio 72 EXIST::FUNCTION:BIO
SSL_load_client_CA_file 73 EXIST::FUNCTION:STDIO
SSL_load_error_strings 74 EXIST::FUNCTION:
SSL_new 75 EXIST::FUNCTION:
SSL_peek 76 EXIST::FUNCTION:
SSL_pending 77 EXIST::FUNCTION:
SSL_read 78 EXIST::FUNCTION:
SSL_renegotiate 79 EXIST::FUNCTION:
SSL_rstate_string 80 EXIST::FUNCTION:
SSL_rstate_string_long 81 EXIST::FUNCTION:
SSL_set_accept_state 82 EXIST::FUNCTION:
SSL_set_bio 83 EXIST::FUNCTION:BIO
SSL_set_cipher_list 84 EXIST::FUNCTION:
SSL_set_client_CA_list 85 EXIST::FUNCTION:
SSL_set_connect_state 86 EXIST::FUNCTION:
SSL_set_fd 87 EXIST::FUNCTION:SOCK
SSL_set_read_ahead 88 EXIST::FUNCTION:
SSL_set_rfd 89 EXIST::FUNCTION:SOCK
SSL_set_session 90 EXIST::FUNCTION:
SSL_set_ssl_method 91 EXIST::FUNCTION:
SSL_set_verify 94 EXIST::FUNCTION:
SSL_set_wfd 95 EXIST::FUNCTION:SOCK
SSL_shutdown 96 EXIST::FUNCTION:
SSL_state_string 97 EXIST::FUNCTION:
SSL_state_string_long 98 EXIST::FUNCTION:
SSL_use_PrivateKey 99 EXIST::FUNCTION:
SSL_use_PrivateKey_ASN1 100 EXIST::FUNCTION:
SSL_use_PrivateKey_file 101 EXIST::FUNCTION:STDIO
SSL_use_RSAPrivateKey 102 EXIST::FUNCTION:RSA
SSL_use_RSAPrivateKey_ASN1 103 EXIST::FUNCTION:RSA
SSL_use_RSAPrivateKey_file 104 EXIST::FUNCTION:RSA,STDIO
SSL_use_certificate 105 EXIST::FUNCTION:
SSL_use_certificate_ASN1 106 EXIST::FUNCTION:
SSL_use_certificate_file 107 EXIST::FUNCTION:STDIO
SSL_write 108 EXIST::FUNCTION:
SSLeay_add_ssl_algorithms 109 NOEXIST::FUNCTION:
SSLv23_client_method 110 EXIST::FUNCTION:RSA
SSLv23_method 111 EXIST::FUNCTION:RSA
SSLv23_server_method 112 EXIST::FUNCTION:RSA
SSLv2_client_method 113 EXIST::FUNCTION:RSA,SSL2
SSLv2_method 114 EXIST::FUNCTION:RSA,SSL2
SSLv2_server_method 115 EXIST::FUNCTION:RSA,SSL2
SSLv3_client_method 116 EXIST::FUNCTION:SSL3_METHOD
SSLv3_method 117 EXIST::FUNCTION:SSL3_METHOD
SSLv3_server_method 118 EXIST::FUNCTION:SSL3_METHOD
d2i_SSL_SESSION 119 EXIST::FUNCTION:
i2d_SSL_SESSION 120 EXIST::FUNCTION:
BIO_f_ssl 121 EXIST::FUNCTION:BIO
BIO_new_ssl 122 EXIST::FUNCTION:BIO
BIO_proxy_ssl_copy_session_id 123 NOEXIST::FUNCTION:
BIO_ssl_copy_session_id 124 EXIST::FUNCTION:BIO
SSL_do_handshake 125 EXIST::FUNCTION:
SSL_get_privatekey 126 EXIST::FUNCTION:
SSL_get_current_cipher 127 EXIST::FUNCTION:
SSL_CIPHER_get_bits 128 EXIST::FUNCTION:
SSL_CIPHER_get_version 129 EXIST::FUNCTION:
SSL_CIPHER_get_name 130 EXIST::FUNCTION:
BIO_ssl_shutdown 131 EXIST::FUNCTION:BIO
SSL_SESSION_cmp 132 NOEXIST::FUNCTION:
SSL_SESSION_hash 133 NOEXIST::FUNCTION:
SSL_SESSION_get_time 134 EXIST::FUNCTION:
SSL_SESSION_set_time 135 EXIST::FUNCTION:
SSL_SESSION_get_timeout 136 EXIST::FUNCTION:
SSL_SESSION_set_timeout 137 EXIST::FUNCTION:
SSL_CTX_get_ex_data 138 EXIST::FUNCTION:
SSL_CTX_get_quiet_shutdown 140 EXIST::FUNCTION:
SSL_CTX_load_verify_locations 141 EXIST::FUNCTION:
SSL_CTX_set_default_verify_paths 142 EXIST:!VMS:FUNCTION:
SSL_CTX_set_def_verify_paths 142 EXIST:VMS:FUNCTION:
SSL_CTX_set_ex_data 143 EXIST::FUNCTION:
SSL_CTX_set_quiet_shutdown 145 EXIST::FUNCTION:
SSL_SESSION_get_ex_data 146 EXIST::FUNCTION:
SSL_SESSION_set_ex_data 148 EXIST::FUNCTION:
SSL_get_SSL_CTX 150 EXIST::FUNCTION:
SSL_get_ex_data 151 EXIST::FUNCTION:
SSL_get_quiet_shutdown 153 EXIST::FUNCTION:
SSL_get_session 154 EXIST::FUNCTION:
SSL_get_shutdown 155 EXIST::FUNCTION:
SSL_get_verify_result 157 EXIST::FUNCTION:
SSL_set_ex_data 158 EXIST::FUNCTION:
SSL_set_info_callback 160 EXIST::FUNCTION:
SSL_set_quiet_shutdown 161 EXIST::FUNCTION:
SSL_set_shutdown 162 EXIST::FUNCTION:
SSL_set_verify_result 163 EXIST::FUNCTION:
SSL_version 164 EXIST::FUNCTION:
SSL_get_info_callback 165 EXIST::FUNCTION:
SSL_state 166 EXIST::FUNCTION:
SSL_CTX_get_ex_new_index 167 EXIST::FUNCTION:
SSL_SESSION_get_ex_new_index 168 EXIST::FUNCTION:
SSL_get_ex_new_index 169 EXIST::FUNCTION:
TLSv1_method 170 EXIST::FUNCTION:
TLSv1_server_method 171 EXIST::FUNCTION:
TLSv1_client_method 172 EXIST::FUNCTION:
BIO_new_buffer_ssl_connect 173 EXIST::FUNCTION:BIO
BIO_new_ssl_connect 174 EXIST::FUNCTION:BIO
SSL_get_ex_data_X509_STORE_CTX_idx 175 EXIST:!VMS:FUNCTION:
SSL_get_ex_d_X509_STORE_CTX_idx 175 EXIST:VMS:FUNCTION:
SSL_CTX_set_tmp_dh_callback 176 EXIST::FUNCTION:DH
SSL_CTX_set_tmp_rsa_callback 177 EXIST::FUNCTION:RSA
SSL_CTX_set_timeout 178 EXIST::FUNCTION:
SSL_CTX_get_timeout 179 EXIST::FUNCTION:
SSL_CTX_get_cert_store 180 EXIST::FUNCTION:
SSL_CTX_set_cert_store 181 EXIST::FUNCTION:
SSL_want 182 EXIST::FUNCTION:
SSL_library_init 183 EXIST::FUNCTION:
SSL_COMP_add_compression_method 184 EXIST::FUNCTION:COMP
SSL_add_file_cert_subjects_to_stack 185 EXIST:!VMS:FUNCTION:STDIO
SSL_add_file_cert_subjs_to_stk 185 EXIST:VMS:FUNCTION:STDIO
SSL_set_tmp_rsa_callback 186 EXIST::FUNCTION:RSA
SSL_set_tmp_dh_callback 187 EXIST::FUNCTION:DH
SSL_add_dir_cert_subjects_to_stack 188 EXIST:!VMS:FUNCTION:STDIO
SSL_add_dir_cert_subjs_to_stk 188 EXIST:VMS:FUNCTION:STDIO
SSL_set_session_id_context 189 EXIST::FUNCTION:
SSL_CTX_use_certificate_chain_file 222 EXIST:!VMS:FUNCTION:STDIO
SSL_CTX_use_cert_chain_file 222 EXIST:VMS:FUNCTION:STDIO
SSL_CTX_set_verify_depth 225 EXIST::FUNCTION:
SSL_set_verify_depth 226 EXIST::FUNCTION:
SSL_CTX_get_verify_depth 228 EXIST::FUNCTION:
SSL_get_verify_depth 229 EXIST::FUNCTION:
SSL_CTX_set_session_id_context 231 EXIST::FUNCTION:
SSL_CTX_set_cert_verify_callback 232 EXIST:!VMS:FUNCTION:
SSL_CTX_set_cert_verify_cb 232 EXIST:VMS:FUNCTION:
SSL_test_functions 233 EXIST::FUNCTION:UNIT_TEST
SSL_CTX_set_default_passwd_cb_userdata 235 EXIST:!VMS:FUNCTION:
SSL_CTX_set_def_passwd_cb_ud 235 EXIST:VMS:FUNCTION:
SSL_set_purpose 236 EXIST::FUNCTION:
SSL_CTX_set_trust 237 EXIST::FUNCTION:
SSL_CTX_set_purpose 238 EXIST::FUNCTION:
SSL_set_trust 239 EXIST::FUNCTION:
SSL_get_finished 240 EXIST::FUNCTION:
SSL_get_peer_finished 241 EXIST::FUNCTION:
SSL_get1_session 242 EXIST::FUNCTION:
SSL_CTX_callback_ctrl 243 EXIST::FUNCTION:
SSL_callback_ctrl 244 EXIST::FUNCTION:
SSL_CTX_sessions 245 EXIST::FUNCTION:
SSL_get_rfd 246 EXIST::FUNCTION:
SSL_get_wfd 247 EXIST::FUNCTION:
kssl_cget_tkt 248 EXIST::FUNCTION:KRB5
SSL_has_matching_session_id 249 EXIST::FUNCTION:
kssl_err_set 250 EXIST::FUNCTION:KRB5
kssl_ctx_show 251 EXIST::FUNCTION:KRB5
kssl_validate_times 252 EXIST::FUNCTION:KRB5
kssl_check_authent 253 EXIST::FUNCTION:KRB5
kssl_ctx_new 254 EXIST::FUNCTION:KRB5
kssl_build_principal_2 255 EXIST::FUNCTION:KRB5
kssl_skip_confound 256 EXIST::FUNCTION:KRB5
kssl_sget_tkt 257 EXIST::FUNCTION:KRB5
SSL_set_generate_session_id 258 EXIST::FUNCTION:
kssl_ctx_setkey 259 EXIST::FUNCTION:KRB5
kssl_ctx_setprinc 260 EXIST::FUNCTION:KRB5
kssl_ctx_free 261 EXIST::FUNCTION:KRB5
kssl_krb5_free_data_contents 262 EXIST::FUNCTION:KRB5
kssl_ctx_setstring 263 EXIST::FUNCTION:KRB5
SSL_CTX_set_generate_session_id 264 EXIST::FUNCTION:
SSL_renegotiate_pending 265 EXIST::FUNCTION:
SSL_CTX_set_msg_callback 266 EXIST::FUNCTION:
SSL_set_msg_callback 267 EXIST::FUNCTION:
DTLSv1_client_method 268 EXIST::FUNCTION:
SSL_CTX_set_tmp_ecdh_callback 269 EXIST::FUNCTION:ECDH
SSL_set_tmp_ecdh_callback 270 EXIST::FUNCTION:ECDH
SSL_COMP_get_name 271 EXIST::FUNCTION:COMP
SSL_get_current_compression 272 EXIST::FUNCTION:COMP
DTLSv1_method 273 EXIST::FUNCTION:
SSL_get_current_expansion 274 EXIST::FUNCTION:COMP
DTLSv1_server_method 275 EXIST::FUNCTION:
SSL_COMP_get_compression_methods 276 EXIST:!VMS:FUNCTION:COMP
SSL_COMP_get_compress_methods 276 EXIST:VMS:FUNCTION:COMP
SSL_SESSION_get_id 277 EXIST::FUNCTION:
SSL_CTX_sess_set_new_cb 278 EXIST::FUNCTION:
SSL_CTX_sess_get_get_cb 279 EXIST::FUNCTION:
SSL_CTX_sess_set_get_cb 280 EXIST::FUNCTION:
SSL_CTX_set_cookie_verify_cb 281 EXIST::FUNCTION:
SSL_CTX_get_info_callback 282 EXIST::FUNCTION:
SSL_CTX_set_cookie_generate_cb 283 EXIST::FUNCTION:
SSL_CTX_set_client_cert_cb 284 EXIST::FUNCTION:
SSL_CTX_sess_set_remove_cb 285 EXIST::FUNCTION:
SSL_CTX_set_info_callback 286 EXIST::FUNCTION:
SSL_CTX_sess_get_new_cb 287 EXIST::FUNCTION:
SSL_CTX_get_client_cert_cb 288 EXIST::FUNCTION:
SSL_CTX_sess_get_remove_cb 289 EXIST::FUNCTION:
SSL_set_SSL_CTX 290 EXIST::FUNCTION:
SSL_get_servername 291 EXIST::FUNCTION:TLSEXT
SSL_get_servername_type 292 EXIST::FUNCTION:TLSEXT
SSL_CTX_set_client_cert_engine 293 EXIST::FUNCTION:ENGINE
SSL_CTX_use_psk_identity_hint 294 EXIST::FUNCTION:PSK
SSL_CTX_set_psk_client_callback 295 EXIST::FUNCTION:PSK
PEM_write_bio_SSL_SESSION 296 EXIST::FUNCTION:
SSL_get_psk_identity_hint 297 EXIST::FUNCTION:PSK
SSL_set_psk_server_callback 298 EXIST::FUNCTION:PSK
SSL_use_psk_identity_hint 299 EXIST::FUNCTION:PSK
SSL_set_psk_client_callback 300 EXIST::FUNCTION:PSK
PEM_read_SSL_SESSION 301 EXIST:!WIN16:FUNCTION:
PEM_read_bio_SSL_SESSION 302 EXIST::FUNCTION:
SSL_CTX_set_psk_server_callback 303 EXIST::FUNCTION:PSK
SSL_get_psk_identity 304 EXIST::FUNCTION:PSK
PEM_write_SSL_SESSION 305 EXIST:!WIN16:FUNCTION:
SSL_set_session_ticket_ext 306 EXIST::FUNCTION:
SSL_set_session_secret_cb 307 EXIST::FUNCTION:
SSL_set_session_ticket_ext_cb 308 EXIST::FUNCTION:
SSL_set1_param 309 EXIST::FUNCTION:
SSL_CTX_set1_param 310 EXIST::FUNCTION:
SSL_tls1_key_exporter 311 NOEXIST::FUNCTION:
SSL_renegotiate_abbreviated 312 EXIST::FUNCTION:
TLSv1_1_method 313 EXIST::FUNCTION:
TLSv1_1_client_method 314 EXIST::FUNCTION:
TLSv1_1_server_method 315 EXIST::FUNCTION:
SSL_CTX_set_srp_client_pwd_callback 316 EXIST:!VMS:FUNCTION:SRP
SSL_CTX_set_srp_client_pwd_cb 316 EXIST:VMS:FUNCTION:SRP
SSL_get_srp_g 317 EXIST::FUNCTION:SRP
SSL_CTX_set_srp_username_callback 318 EXIST:!VMS:FUNCTION:SRP
SSL_CTX_set_srp_un_cb 318 EXIST:VMS:FUNCTION:SRP
SSL_get_srp_userinfo 319 EXIST::FUNCTION:SRP
SSL_set_srp_server_param 320 EXIST::FUNCTION:SRP
SSL_set_srp_server_param_pw 321 EXIST::FUNCTION:SRP
SSL_get_srp_N 322 EXIST::FUNCTION:SRP
SSL_get_srp_username 323 EXIST::FUNCTION:SRP
SSL_CTX_set_srp_password 324 EXIST::FUNCTION:SRP
SSL_CTX_set_srp_strength 325 EXIST::FUNCTION:SRP
SSL_CTX_set_srp_verify_param_callback 326 EXIST:!VMS:FUNCTION:SRP
SSL_CTX_set_srp_vfy_param_cb 326 EXIST:VMS:FUNCTION:SRP
SSL_CTX_set_srp_miss_srp_un_cb 327 NOEXIST::FUNCTION:
SSL_CTX_set_srp_missing_srp_username_callback 327 NOEXIST::FUNCTION:
SSL_CTX_set_srp_cb_arg 328 EXIST::FUNCTION:SRP
SSL_CTX_set_srp_username 329 EXIST::FUNCTION:SRP
SSL_CTX_SRP_CTX_init 330 EXIST::FUNCTION:SRP
SSL_SRP_CTX_init 331 EXIST::FUNCTION:SRP
SRP_Calc_A_param 332 EXIST::FUNCTION:SRP
SRP_generate_server_master_secret 333 EXIST:!VMS:FUNCTION:SRP
SRP_gen_server_master_secret 333 EXIST:VMS:FUNCTION:SRP
SSL_CTX_SRP_CTX_free 334 EXIST::FUNCTION:SRP
SRP_generate_client_master_secret 335 EXIST:!VMS:FUNCTION:SRP
SRP_gen_client_master_secret 335 EXIST:VMS:FUNCTION:SRP
SSL_srp_server_param_with_username 336 EXIST:!VMS:FUNCTION:SRP
SSL_srp_server_param_with_un 336 EXIST:VMS:FUNCTION:SRP
SRP_have_to_put_srp_username 337 NOEXIST::FUNCTION:
SSL_SRP_CTX_free 338 EXIST::FUNCTION:SRP
SSL_set_debug 339 EXIST::FUNCTION:
SSL_SESSION_get0_peer 340 EXIST::FUNCTION:
TLSv1_2_client_method 341 EXIST::FUNCTION:
SSL_SESSION_set1_id_context 342 EXIST::FUNCTION:
TLSv1_2_server_method 343 EXIST::FUNCTION:
SSL_cache_hit 344 EXIST::FUNCTION:
SSL_get0_kssl_ctx 345 EXIST::FUNCTION:KRB5
SSL_set0_kssl_ctx 346 EXIST::FUNCTION:KRB5
SSL_SESSION_get0_id 347 NOEXIST::FUNCTION:
SSL_set_state 348 EXIST::FUNCTION:
SSL_CIPHER_get_id 349 EXIST::FUNCTION:
TLSv1_2_method 350 EXIST::FUNCTION:
SSL_SESSION_get_id_len 351 NOEXIST::FUNCTION:
kssl_ctx_get0_client_princ 352 EXIST::FUNCTION:KRB5
SSL_export_keying_material 353 EXIST::FUNCTION:TLSEXT
SSL_set_tlsext_use_srtp 354 EXIST::FUNCTION:SRTP
SSL_CTX_set_next_protos_advertised_cb 355 EXIST:!VMS:FUNCTION:NEXTPROTONEG
SSL_CTX_set_next_protos_adv_cb 355 EXIST:VMS:FUNCTION:NEXTPROTONEG
SSL_get0_next_proto_negotiated 356 EXIST::FUNCTION:NEXTPROTONEG
SSL_get_selected_srtp_profile 357 EXIST::FUNCTION:SRTP
SSL_CTX_set_tlsext_use_srtp 358 EXIST::FUNCTION:SRTP
SSL_select_next_proto 359 EXIST::FUNCTION:TLSEXT
SSL_get_srtp_profiles 360 EXIST::FUNCTION:SRTP
SSL_CTX_set_next_proto_select_cb 361 EXIST:!VMS:FUNCTION:NEXTPROTONEG
SSL_CTX_set_next_proto_sel_cb 361 EXIST:VMS:FUNCTION:NEXTPROTONEG
SSL_SESSION_get_compress_id 362 EXIST::FUNCTION:
SSL_get0_param 363 EXIST::FUNCTION:
SSL_CTX_get0_privatekey 364 EXIST::FUNCTION:
SSL_get_shared_sigalgs 365 EXIST::FUNCTION:TLSEXT
SSL_CONF_CTX_finish 366 EXIST::FUNCTION:
DTLS_method 367 EXIST::FUNCTION:
DTLS_client_method 368 EXIST::FUNCTION:
SSL_CIPHER_standard_name 369 EXIST::FUNCTION:SSL_TRACE
SSL_set_alpn_protos 370 EXIST::FUNCTION:
SSL_CTX_set_srv_supp_data 371 NOEXIST::FUNCTION:
SSL_CONF_cmd_argv 372 EXIST::FUNCTION:
DTLSv1_2_server_method 373 EXIST::FUNCTION:
SSL_COMP_set0_compression_methods 374 EXIST:!VMS:FUNCTION:COMP
SSL_COMP_set0_compress_methods 374 EXIST:VMS:FUNCTION:COMP
SSL_CTX_set_cert_cb 375 EXIST::FUNCTION:
SSL_CTX_add_client_custom_ext 376 EXIST::FUNCTION:TLSEXT
SSL_is_server 377 EXIST::FUNCTION:
SSL_CTX_get0_param 378 EXIST::FUNCTION:
SSL_CONF_cmd 379 EXIST::FUNCTION:
SSL_CTX_get_ssl_method 380 EXIST::FUNCTION:
SSL_CONF_CTX_set_ssl_ctx 381 EXIST::FUNCTION:
SSL_CIPHER_find 382 EXIST::FUNCTION:
SSL_CTX_use_serverinfo 383 EXIST::FUNCTION:TLSEXT
DTLSv1_2_client_method 384 EXIST::FUNCTION:
SSL_get0_alpn_selected 385 EXIST::FUNCTION:
SSL_CONF_CTX_clear_flags 386 EXIST::FUNCTION:
SSL_CTX_set_alpn_protos 387 EXIST::FUNCTION:
SSL_CTX_add_server_custom_ext 389 EXIST::FUNCTION:TLSEXT
SSL_CTX_get0_certificate 390 EXIST::FUNCTION:
SSL_CTX_set_alpn_select_cb 391 EXIST::FUNCTION:
SSL_CONF_cmd_value_type 392 EXIST::FUNCTION:
SSL_set_cert_cb 393 EXIST::FUNCTION:
SSL_get_sigalgs 394 EXIST::FUNCTION:TLSEXT
SSL_CONF_CTX_set1_prefix 395 EXIST::FUNCTION:
SSL_CONF_CTX_new 396 EXIST::FUNCTION:
SSL_CONF_CTX_set_flags 397 EXIST::FUNCTION:
SSL_CONF_CTX_set_ssl 398 EXIST::FUNCTION:
SSL_check_chain 399 EXIST::FUNCTION:TLSEXT
SSL_certs_clear 400 EXIST::FUNCTION:
SSL_CONF_CTX_free 401 EXIST::FUNCTION:
SSL_trace 402 EXIST::FUNCTION:SSL_TRACE
SSL_CTX_set_cli_supp_data 403 NOEXIST::FUNCTION:
DTLSv1_2_method 404 EXIST::FUNCTION:
DTLS_server_method 405 EXIST::FUNCTION:
SSL_CTX_use_serverinfo_file 406 EXIST::FUNCTION:STDIO,TLSEXT
SSL_COMP_free_compression_methods 407 EXIST:!VMS:FUNCTION:COMP
SSL_COMP_free_compress_methods 407 EXIST:VMS:FUNCTION:COMP
SSL_extension_supported 409 EXIST::FUNCTION:TLSEXT

View File

@@ -0,0 +1,260 @@
#!/usr/bin/env perl
#
# su-filter.pl
#
use strict;
my $in_su = 0;
my $indent = 0;
my $out;
my $braces = 0;
my $arrcnt;
my $data;
my $tststr;
my $incomm = 0;
while(<>) {
$tststr = $_;
$incomm++ while $tststr =~ /\/\*/g;
$incomm-- while $tststr =~ /\*\//g;
if($in_su == 1) {
if(/}(.*);/) {
$out .= $_;
do_output($out);
$in_su = 0;
} elsif(/^ *\} [^\s]+(\[\d*\])* = \{/) {
$tststr = $1;
$arrcnt = 0;
$arrcnt++ while $tststr =~ /\[/g;
$in_su++;
$braces = 1;
/^(.* = \{)(.*)$/;
$data = $2;
$out .= $1."\n";
} else {
$out .= $_;
}
} elsif($in_su == 2) {
$data .= $_;
if(/};$/) {
#$data = "\n$data";
$data =~ s/\n */\n/g;
$data =~ s/};\n?//s;
my @strucdata = structureData($data);
$out .= displayData($indent, 0, \@strucdata);
$out .= "\n$indent};\n";
do_output($out);
$in_su = 0;
}
} elsif($incomm <= 0 && /( *)(static )?(const )?(union|struct) ([^\s]+ )?\{/) {
$in_su = 1;
$indent = $1;
$out = $_;
next;
} else {
do_output($_);
}
}
sub structureData {
my $data = $_[0];
my @datalist = split(/(\{|\}|,|"|#|\n|\/\*|\*\/|\(|\))/, $data);
my $item;
my $dataitem = "";
my @struclist = ();
my $substruc;
my $inquote = 0;
my $inbrace = 0;
my $preproc = 0;
my $comment = 0;
my $inparen = 0;
foreach $item (@datalist) {
if($comment) {
if($item eq "*/") {
$comment = 0;
$dataitem .= "*/";
push @struclist, $dataitem;
$dataitem = "";
next;
}
$dataitem .= $item;
next;
}
if($inquote) {
$dataitem .= $item;
if($item eq "\"") {
$inquote--;
}
next;
}
if($preproc) {
if($item eq "\n") {
$preproc = 0;
push @struclist, $dataitem;
$dataitem = "";
next;
}
$dataitem .= $item;
next;
}
if($inbrace) {
if($item eq "}") {
$inbrace --;
if(!$inbrace) {
$substruc = structureData($dataitem);
$dataitem = $substruc;
next;
}
} elsif($item eq "{") {
$inbrace++;
} elsif ($item eq "\"") {
$inquote++;
}
$dataitem .= $item;
next;
}
if($inparen) {
if($item eq ")") {
$inparen--;
}
$dataitem .= $item;
next;
}
if($item eq "\n") {
next;
}
if($item eq "#") {
$preproc = 1;
push @struclist, $dataitem;
$dataitem = "#";
next;
}
if($item eq "/*") {
$comment = 1;
push @struclist, $dataitem;
$dataitem= "/*";
next;
}
if($item eq "\"") {
$dataitem .= $item;
$inquote++;
next;
}
if($item eq "{") {
$inbrace++;
next;
}
if($item eq ",") {
push @struclist, $dataitem;
$dataitem = "";
next;
}
if($item eq "(") {
$dataitem .= $item;
$inparen++;
next;
}
if($item =~ /^\s*$/) {
next;
}
if(ref $dataitem eq 'ARRAY') {
push @struclist, $dataitem;
$dataitem = "";
}
$dataitem .= $item;
}
push @struclist, $dataitem;
return \@struclist;
}
sub displayData {
my $indent = shift;
my $depth = shift;
my $data = shift;
my $item;
my $out = "";
my $currline = "";
my $first = 1;
my $prevpreproc = 0;
my $prevcomment = 0;
foreach $item (@{$data}) {
if($item =~ /^\/\*/) {
#Comment
$item =~ s/\n/\n$indent/g;
if($out =~ /\n\s*$/s) {
$out .= $item."\n".$indent;
} else {
$out .= "\n".$indent.$item."\n".$indent;
}
$currline = $indent;
$prevcomment = 1;
next;
}
$item =~ s/^\s+//;
if($item =~ /^#/) {
#Pre-processor directive
if($out =~ /\n\s*$/s) {
$out =~ s/\n\s*$/\n/;
$out .= $item."\n".$indent;
} else {
$out .= "\n".$item."\n".$indent;
}
$currline = $indent;
$prevpreproc = 1;
next;
}
if($first) {
$first = 0;
if($depth != 0) {
$out .= $indent;
$currline = $indent;
}
} else {
if(!$prevpreproc && !$prevcomment) {
$out .= ", ";
$currline .= ", ";
if($depth == 1) {
$out .= "\n";
$currline = "";
}
if($depth == 1) {
$out .= $indent;
$currline .= $indent;
}
}
}
$prevpreproc = 0;
$prevcomment = 0;
if (ref $item eq 'ARRAY') {
if($depth == 0) {
$out .= displayData("$indent ", $depth+1, $item);
} else {
$out .= "{\n".displayData("$indent ", $depth+1, $item)."\n".$indent."}";
$currline = $indent."}";
}
} else {
if(length $currline.$item > 79) {
$currline = $indent;
$out .= "\n$indent";
}
$out .= $item;
$currline .= $item;
}
}
return $out;
}
sub do_output {
my $out = shift;
# Strip any trailing whitespace
$out =~ s/\s+\n/\n/g;
print $out;
}

17
openssl-1.0.2f/util/tab_num.pl Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/local/bin/perl
$num=1;
$width=40;
while (<>)
{
chop;
$i=length($_);
$n=$width-$i;
$i=int(($n+7)/8);
print $_.("\t" x $i).$num."\n";
$num++;
}

View File

@@ -0,0 +1,17 @@
#! /bin/sh
#
# Very simple script to detect and convert files that we want to re-encode to UTF8
git ls-tree -r --name-only HEAD | \
while read F; do
charset=`file -bi "$F" | sed -e 's|.*charset=||'`
if [ "$charset" != "utf-8" -a "$charset" != "binary" -a "$charset" != "us-ascii" ]; then
iconv -f ISO-8859-1 -t UTF8 < "$F" > "$F.utf8" && \
( cmp -s "$F" "$F.utf8" || \
( echo "$F"
mv "$F" "$F.iso-8859-1"
mv "$F.utf8" "$F"
)
)
fi
done

42
openssl-1.0.2f/util/x86asm.sh Executable file
View File

@@ -0,0 +1,42 @@
#!/bin/sh
echo Generating x86 assember
echo Bignum
(cd crypto/bn/asm; perl x86.pl cpp > bn86unix.cpp)
(cd crypto/bn/asm; perl x86.pl win32 > bn-win32.asm)
echo DES
(cd crypto/des/asm; perl des-586.pl cpp > dx86unix.cpp)
(cd crypto/des/asm; perl des-586.pl win32 > d-win32.asm)
echo "crypt(3)"
(cd crypto/des/asm; perl crypt586.pl cpp > yx86unix.cpp)
(cd crypto/des/asm; perl crypt586.pl win32 > y-win32.asm)
echo Blowfish
(cd crypto/bf/asm; perl bf-586.pl cpp > bx86unix.cpp)
(cd crypto/bf/asm; perl bf-586.pl win32 > b-win32.asm)
echo CAST5
(cd crypto/cast/asm; perl cast-586.pl cpp > cx86unix.cpp)
(cd crypto/cast/asm; perl cast-586.pl win32 > c-win32.asm)
echo RC4
(cd crypto/rc4/asm; perl rc4-586.pl cpp > rx86unix.cpp)
(cd crypto/rc4/asm; perl rc4-586.pl win32 > r4-win32.asm)
echo MD5
(cd crypto/md5/asm; perl md5-586.pl cpp > mx86unix.cpp)
(cd crypto/md5/asm; perl md5-586.pl win32 > m5-win32.asm)
echo SHA1
(cd crypto/sha/asm; perl sha1-586.pl cpp > sx86unix.cpp)
(cd crypto/sha/asm; perl sha1-586.pl win32 > s1-win32.asm)
echo RIPEMD160
(cd crypto/ripemd/asm; perl rmd-586.pl cpp > rm86unix.cpp)
(cd crypto/ripemd/asm; perl rmd-586.pl win32 > rm-win32.asm)
echo RC5/32
(cd crypto/rc5/asm; perl rc5-586.pl cpp > r586unix.cpp)
(cd crypto/rc5/asm; perl rc5-586.pl win32 > r5-win32.asm)