quantum init

This commit is contained in:
zhaoxiaomeng
2018-01-04 13:38:57 +08:00
committed by Simon
parent d11f845fde
commit 53af3b51ae
2361 changed files with 387455 additions and 144458 deletions

6
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
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
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);
}

View File

@@ -1,11 +1,5 @@
#! /usr/bin/env perl
# Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
#!/usr/local/bin/perl
#
# Licensed under the OpenSSL license (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
# in the file LICENSE in the source distribution or at
# https://www.openssl.org/source/license.html
# This is just a quick script to scan for cases where the 'error'
# function name in a XXXerr() macro is wrong.
#
@@ -27,7 +21,7 @@ foreach $file (@ARGV)
$func="";
while (<IN>)
{
if (!/;$/ && /^\**([a-zA-Z_].*[\s*])?([A-Za-z_0-9]+)\(.*([),]|$)/)
if (!/;$/ && /^\**([a-zA-Z].*[\s*])?([A-Za-z_0-9]+)\(.*([),]|$)/)
{
/^([^()]*(\([^()]*\)[^()]*)*)\(/;
$1 =~ /([A-Za-z_0-9]*)$/;

58
util/clean-depend.pl Executable file
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";

78
util/copy-if-different.pl Normal file
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 qq("$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

@@ -1,11 +1,4 @@
#! /usr/bin/env perl
# Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the OpenSSL license (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
# in the file LICENSE in the source distribution or at
# https://www.openssl.org/source/license.html
#!/usr/local/bin/perl
use Fcntl;

154
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
util/deleof.pl Executable file
View File

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

34
util/deltree.com Normal file
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

18
util/dirname.pl Normal file
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
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

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

26
util/extract-names.pl Normal file
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";

12
util/extract-section.pl Normal file
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
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
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

@@ -14,7 +14,7 @@
-i4
-il1
-ip0
-l80
-l78
-lp
-nbad
-nbc
@@ -35,6 +35,24 @@
-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
@@ -89,7 +107,6 @@
-T BIGNUM
-T BIO
-T BIO_ACCEPT
-T BIO_ADDR
-T BIO_ASN1_BUF_CTX
-T BIO_ASN1_EX_FUNCS
-T BIO_B64_CTX
@@ -170,7 +187,10 @@
-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
@@ -231,6 +251,7 @@
-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
@@ -267,13 +288,34 @@
-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
@@ -340,7 +382,7 @@
-T OPENSSL_ITEM
-T OPENSSL_PSTRING
-T OPENSSL_STRING
-T OSSL_ASYNC_FD
-T OPENSSL_STRING
-T OTHERNAME
-T P256_POINT
-T P256_POINT_AFFINE
@@ -411,6 +453,8 @@
-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
@@ -419,12 +463,48 @@
-T SSL_COMP
-T SSL_CONF_CTX
-T SSL_CTX
-T SSL_DANE
-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
@@ -512,7 +592,6 @@
-T asn1_ps_func
-T bio_dgram_data
-T bio_info_cb
-T BIO_callack_fn
-T char_io
-T conf_finish_func
-T conf_init_func
@@ -574,6 +653,9 @@
-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_
@@ -600,6 +682,7 @@
-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_
@@ -639,6 +722,26 @@
-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
@@ -662,10 +765,3 @@
-T SH_LIST
-T PACKET
-T RECORD_LAYER
-T ASYNC_FIBRE
-T ASYNC_CTX
-T ASYNC_JOB
-T intmax_t
-T uintmax_t
-T pqueue
-T danetls_record

108
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

4418
util/libeay.num Executable file

File diff suppressed because it is too large Load Diff

1356
util/mk1mf.pl Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -1,41 +1,35 @@
#! /usr/bin/env perl
# Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the OpenSSL license (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
# in the file LICENSE in the source distribution or at
# https://www.openssl.org/source/license.html
#!/usr/local/bin/perl
my ($cflags, $platform) = @ARGV;
$cflags = "compiler: $cflags";
$date = localtime();
print <<"END_OUTPUT";
/* 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[] = {
#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) {
$c =~ s|([\\'])|\\$1|;
# Max 16 characters per line
if (($ctr++ % 16) == 0) {
# Max 18 characters per line
if (($ctr++ % 18) == 0) {
if ($ctr != 1) {
print "\n";
}
print " ";
print " ";
}
print "'$c',";
}
print <<"END_OUTPUT";
'\\0'
};
#define PLATFORM "platform: $platform"
#define DATE "built on: $date"
};
#define PLATFORM "platform: $platform"
#define DATE "built on: $date"
#endif
END_OUTPUT

View File

@@ -18,7 +18,7 @@ CONF="-config ../apps/openssl.cnf"
# create pca request.
echo creating $CAbits bit PCA cert request
$SSLEAY req $CONF \
-new -sha256 -newkey $CAbits \
-new -md5 -newkey $CAbits \
-keyout pca-key.pem \
-out pca-req.pem -nodes >/dev/null <<EOF
AU
@@ -40,7 +40,7 @@ fi
#sign it.
echo
echo self signing PCA
$SSLEAY x509 -sha256 -days 36525 \
$SSLEAY x509 -md5 -days 1461 \
-req -signkey pca-key.pem \
-CAcreateserial -CAserial pca-cert.srl \
-in pca-req.pem -out pca-cert.pem
@@ -54,7 +54,7 @@ echo
# create ca request.
echo creating $CAbits bit CA cert request
$SSLEAY req $CONF \
-new -sha256 -newkey $CAbits \
-new -md5 -newkey $CAbits \
-keyout ca-key.pem \
-out ca-req.pem -nodes >/dev/null <<EOF
AU
@@ -76,7 +76,7 @@ fi
#sign it.
echo
echo signing CA
$SSLEAY x509 -sha256 -days 36525 \
$SSLEAY x509 -md5 -days 1461 \
-req \
-CAcreateserial -CAserial pca-cert.srl \
-CA pca-cert.pem -CAkey pca-key.pem \
@@ -91,7 +91,7 @@ echo
# create server request.
echo creating 512 bit server cert request
$SSLEAY req $CONF \
-new -sha256 -newkey 512 \
-new -md5 -newkey 512 \
-keyout s512-key.pem \
-out s512-req.pem -nodes >/dev/null <<EOF
AU
@@ -113,7 +113,7 @@ fi
#sign it.
echo
echo signing 512 bit server cert
$SSLEAY x509 -sha256 -days 36525 \
$SSLEAY x509 -md5 -days 365 \
-req \
-CAcreateserial -CAserial ca-cert.srl \
-CA ca-cert.pem -CAkey ca-key.pem \
@@ -128,7 +128,7 @@ echo
# create 1024 bit server request.
echo creating 1024 bit server cert request
$SSLEAY req $CONF \
-new -sha256 -newkey 1024 \
-new -md5 -newkey 1024 \
-keyout s1024key.pem \
-out s1024req.pem -nodes >/dev/null <<EOF
AU
@@ -150,7 +150,7 @@ fi
#sign it.
echo
echo signing 1024 bit server cert
$SSLEAY x509 -sha256 -days 36525 \
$SSLEAY x509 -md5 -days 365 \
-req \
-CAcreateserial -CAserial ca-cert.srl \
-CA ca-cert.pem -CAkey ca-key.pem \
@@ -165,7 +165,7 @@ echo
# create 512 bit client request.
echo creating 512 bit client cert request
$SSLEAY req $CONF \
-new -sha256 -newkey 512 \
-new -md5 -newkey 512 \
-keyout c512-key.pem \
-out c512-req.pem -nodes >/dev/null <<EOF
AU
@@ -187,7 +187,7 @@ fi
#sign it.
echo
echo signing 512 bit client cert
$SSLEAY x509 -sha256 -days 36525 \
$SSLEAY x509 -md5 -days 365 \
-req \
-CAcreateserial -CAserial ca-cert.srl \
-CA ca-cert.pem -CAkey ca-key.pem \

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,6 @@
#! /usr/bin/env perl
# Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the OpenSSL license (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
# in the file LICENSE in the source distribution or at
# https://www.openssl.org/source/license.html
#!/usr/local/bin/perl
# mkdir-p.pl
# On some systems, the -p option to mkdir (= also create any missing parent
# directories) is not available.
@@ -33,12 +29,6 @@ sub do_mkdir_p {
do_mkdir_p($parent);
}
unless (mkdir($dir, 0777)) {
if (-d $dir) {
# We raced against another instance doing the same thing.
return;
}
die "Cannot create directory $dir: $!\n";
}
mkdir($dir, 0777) || die "Cannot create directory $dir: $!\n";
print "created directory `$dir'\n";
}

View File

@@ -1,22 +1,14 @@
#! /usr/bin/env perl
# Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the OpenSSL license (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
# in the file LICENSE in the source distribution or at
# https://www.openssl.org/source/license.html
#!/usr/local/bin/perl -w
my $config = "crypto/err/openssl.ec";
my $hprefix = "openssl/";
my $debug = 0;
my $unref = 0;
my $rebuild = 0;
my $static = 1;
my $recurse = 0;
my $reindex = 0;
my $dowrite = 0;
my $staticloader = "";
my @t = localtime();
my $YEAR = @t[5] + 1900;
my $pack_errcode;
my $load_errcode;
@@ -34,7 +26,6 @@ while (@ARGV) {
$hprefix = shift @ARGV;
} elsif($arg eq "-debug") {
$debug = 1;
$unref = 1;
shift @ARGV;
} elsif($arg eq "-rebuild") {
$rebuild = 1;
@@ -51,9 +42,6 @@ while (@ARGV) {
} elsif($arg eq "-staticloader") {
$staticloader = "static ";
shift @ARGV;
} elsif($arg eq "-unref") {
$unref = 1;
shift @ARGV;
} elsif($arg eq "-write") {
$dowrite = 1;
shift @ARGV;
@@ -69,8 +57,6 @@ Options:
-hprefix P Prepend the filenames in generated #include <header>
statements with prefix P. Default: 'openssl/' (without
the quotes, naturally)
NOTE: not used any more because our include directory
structure has changed.
-debug Turn on debugging verbose output on stderr.
@@ -103,7 +89,7 @@ Options:
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,OPENSSL_FILE,OPENSSL_LINE)
#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.
@@ -112,8 +98,6 @@ Options:
-staticloader Prefix generated functions with the 'static' scope modifier.
Default: don't write any scope modifier prefix.
-unref Print out unreferenced function and reason codes.
-write Actually (over)write the generated code to the header and C
source files as assigned to each library through the config
file.
@@ -132,7 +116,7 @@ EOF
}
if($recurse) {
@source = ( <crypto/*.c>, <crypto/*/*.c>, <ssl/*.c>, <ssl/*/*.c> )
@source = (<crypto/*.c>, <crypto/*/*.c>, <ssl/*.c>);
} else {
@source = @ARGV;
}
@@ -344,18 +328,9 @@ foreach $file (@source) {
next if exists $cskip{$file};
print STDERR "File loaded: ".$file."\r" if $debug;
open(IN, "<$file") || die "Can't open source file $file\n";
my $func;
my $linenr = 0;
while(<IN>) {
# skip obsoleted source files entirely!
last if(/^#error\s+obsolete/);
$linenr++;
if (!/;$/ && /^\**([a-zA-Z_].*[\s*])?([A-Za-z_0-9]+)\(.*([),]|$)/)
{
/^([^()]*(\([^()]*\)[^()]*)*)\(/;
$1 =~ /([A-Za-z_0-9]*)$/;
$func = $1;
}
if(/(([A-Z0-9]+)_F_([A-Z0-9_]+))/) {
next unless exists $csrc{$2};
@@ -365,11 +340,7 @@ foreach $file (@source) {
$fcodes{$1} = "X";
$fnew{$2}++;
}
$ftrans{$3} = $func unless exists $ftrans{$3};
if (uc $func ne $3) {
print STDERR "ERROR: mismatch $file:$linenr $func:$3\n";
$errcount++;
}
$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_]+)/) {
@@ -393,6 +364,7 @@ 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,";
@@ -426,13 +398,58 @@ foreach $lib (keys %csrc)
$cpp = 1;
$cplusplus = 1;
push @out,
"/*\n",
" * Copyright 1995-$YEAR The OpenSSL Project Authors. All Rights Reserved.\n",
"/* ====================================================================\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",
" * Licensed under the OpenSSL license (the \"License\"). You may not use\n",
" * this file except in compliance with the License. You can obtain a copy\n",
" * in the file LICENSE in the source distribution or at\n",
" * https://www.openssl.org/source/license.html\n",
" */\n",
"\n",
"#ifndef HEADER_${lib}_ERR_H\n",
@@ -457,15 +474,15 @@ foreach $lib (keys %csrc)
EOF
if($static) {
print OUT <<"EOF";
${staticloader}int ERR_load_${lib}_strings(void);
${staticloader}void ERR_load_${lib}_strings(void);
EOF
} else {
print OUT <<"EOF";
${staticloader}int ERR_load_${lib}_strings(void);
${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),OPENSSL_FILE,OPENSSL_LINE)
# define ${lib}err(f,r) ERR_${lib}_error((f),(r),__FILE__,__LINE__)
EOF
}
@@ -534,7 +551,7 @@ EOF
if (open(IN,"<$cfile")) {
my $line = "";
while (<IN>) {
s|\R$||; # Better chomp
chomp;
$_ = $line . $_;
$line = "";
if (/{ERR_(FUNC|REASON)\(/) {
@@ -557,12 +574,8 @@ EOF
my $hincf;
if($static) {
$hincf = $hfile;
$hincf =~ s|.*include/||;
if ($hincf =~ m|^openssl/|) {
$hincf = "<${hincf}>";
} else {
$hincf = "\"${hincf}\"";
}
$hincf =~ s|.*/||g;
$hincf = "<${hprefix}${hincf}>";
} else {
$hincf = "\"$hfile\"";
}
@@ -585,14 +598,65 @@ EOF
open (OUT,">$cfile") || die "Can't open $cfile for writing";
print OUT <<"EOF";
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-$YEAR The OpenSSL Project Authors. All Rights Reserved.
/* $cfile */
/* ====================================================================
* Copyright (c) 1999-$year The OpenSSL Project. All rights reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
* 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>
@@ -652,7 +716,7 @@ if($static) {
#endif
${staticloader}int ERR_load_${lib}_strings(void)
${staticloader}void ERR_load_${lib}_strings(void)
{
#ifndef OPENSSL_NO_ERR
@@ -661,7 +725,6 @@ ${staticloader}int ERR_load_${lib}_strings(void)
ERR_load_strings($load_errcode, ${lib}_str_reasons);
}
#endif
return 1;
}
EOF
} else {
@@ -681,7 +744,7 @@ static ERR_STRING_DATA ${lib}_lib_name[] = {
static int ${lib}_lib_error_code = 0;
static int ${lib}_error_init = 1;
${staticloader}int ERR_load_${lib}_strings(void)
${staticloader}void ERR_load_${lib}_strings(void)
{
if (${lib}_lib_error_code == 0)
${lib}_lib_error_code = ERR_get_next_error_library();
@@ -698,7 +761,6 @@ ${staticloader}int ERR_load_${lib}_strings(void)
ERR_load_strings(0, ${lib}_lib_name);
#endif
}
return 1;
}
${staticloader}void ERR_unload_${lib}_strings(void)
@@ -748,7 +810,7 @@ foreach (keys %rcodes) {
push (@runref, $_) unless exists $urcodes{$_};
}
if($unref && @funref) {
if($debug && @funref) {
print STDERR "The following function codes were not referenced:\n";
foreach(sort @funref)
{
@@ -756,7 +818,7 @@ if($unref && @funref) {
}
}
if($unref && @runref) {
if($debug && @runref) {
print STDERR "The following reason codes were not referenced:\n";
foreach(sort @runref)
{

143
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);
}

75
util/mklink.pl Executable file
View File

@@ -0,0 +1,75 @@
#!/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) {
if (!-l "$from/$file") {
unlink "$from/$file";
symlink("$to/$file", "$from/$file") or $err = " [$!]";
}
} elsif (-d "$from" && (!-f "$from/$file" || ((stat("$file"))[9] > (stat("$from/$file"))[9]))) {
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";
}

View File

@@ -1,18 +1,6 @@
#! /usr/bin/env perl
# Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
#!/bin/env perl
#
# Licensed under the OpenSSL license (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
# in the file LICENSE in the source distribution or at
# https://www.openssl.org/source/license.html
use lib ".";
use configdata;
use File::Spec::Functions;
my $versionfile = catfile($config{sourcedir},"include/openssl/opensslv.h");
open FD, $versionfile or die "Couldn't open include/openssl/opensslv.h: $!\n";
open FD,"crypto/opensslv.h";
while(<FD>) {
if (/OPENSSL_VERSION_NUMBER\s+(0x[0-9a-f]+)/i) {
$ver = hex($1);
@@ -69,7 +57,7 @@ BEGIN
VALUE "ProductVersion", "$version\\0"
// Optional:
//VALUE "Comments", "\\0"
VALUE "LegalCopyright", "Copyright 1998-2016 The OpenSSL Authors. All rights reserved.\\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"

194
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

@@ -1,12 +1,4 @@
#!/bin/sh
#
# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the OpenSSL license (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
# in the file LICENSE in the source distribution or at
# https://www.openssl.org/source/license.html
#
# openssl-format-source
# - format source tree according to OpenSSL coding style using indent
@@ -29,9 +21,6 @@ HERE="`dirname $0`"
set -e
INDENT=indent
uname -s | grep BSD > /dev/null && type gindent > /dev/null 2>&1 && INDENT=gindent
if [ $# -eq 0 ]; then
echo "usage: $0 [-v] [-n] [-c] [sourcefile|sourcedir] ..." >&2
exit 1
@@ -41,7 +30,6 @@ VERBOSE=false
DONT=false
STOPARGS=false
COMMENTS=false
CHANGED=false
DEBUG=""
# for this exercise, we want to force the openssl style, so we roll
@@ -94,6 +82,10 @@ do
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
@@ -122,20 +114,20 @@ do
-e 's/(STACK_OF|LHASH_OF)\(([^ \t,\)]+)\)( |\n)/$1_$2_$3/g;' \
| \
perl -np \
-e 's/^([ \t]*)\/\*([ \t]+.*)\*\/[ \t]*$/my ($x1,$x2) = ($1, $2); if (length("$x1$x2")<75 && $x2 !~ m#^\s*\*INDENT-(ON|OFF)\*\s*$#) {$c="-"}else{$c=""}; "$x1\/*$c$x2*\/"/e;' \
-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)_.*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \
-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 | \
$DEBUG indent $INDENT_ARGS | \
perl -np \
-e 's/^([ \t]*)\/\*-(.*)\*\/[ \t]*$/$1\/*$2*\//;' \
-e 's/^\/\*-((Copyright|=|----).*)$/\/* $1/;' \
| $INDENT | \
| indent | \
perl -0 -np \
-e 's/\/\*\*INDENT-(ON|OFF)\*\*\/\n//g;' \
| perl -np \
@@ -144,20 +136,9 @@ do
| perl "$HERE"/su-filter.pl \
> "$tmp"
else
expand "$j" | $INDENT $INDENT_ARGS > "$tmp"
expand "$j" | indent $INDENT_ARGS > "$tmp"
fi;
if cmp -s "$tmp" "$j"; then
if [ "$VERBOSE" = "true" ]; then
echo "$j unchanged"
fi
rm "$tmp"
else
if [ "$VERBOSE" = "true" ]; then
echo "$j changed"
fi
CHANGED=true
mv "$tmp" "$j"
fi
mv "$tmp" "$j"
;;
esac
fi
@@ -165,11 +146,3 @@ do
done
if [ "$VERBOSE" = "true" ]; then
echo
if [ "$CHANGED" = "true" ]; then
echo "SOURCE WAS MODIFIED"
else
echo "SOURCE WAS NOT MODIFIED"
fi
fi

35
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";
}

139
util/pl/BC-32.pl Normal file
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_CMD) \$(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_CMD) \$(LFLAGS) $files \$(APP_EX_OBJ), $target,, $libs\n\n";
return($ret);
}
1;

104
util/pl/Mingw32.pl Normal file
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_CMD) ${efile}$target \$(LFLAGS) $files $libs\n\n";
return($ret);
}
1;

120
util/pl/OS2-EMX.pl Normal file
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_CMD) \$(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_CMD) ${efile}$target \$(CFLAG) \$(LFLAGS) $files $libs\n\n";
return($ret);
}
1;

423
util/pl/VC-32.pl Normal file
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_CMD)\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_CMD) \$(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_CMD) \$(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_CMD)\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_CMD) \$(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;

104
util/pl/linux.pl Normal file
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_CMD) ${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;

532
util/pl/netware.pl Normal file
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_CMD) \$(LFLAGS) $def_file2\n";
$ret.="\t\@$mv \$(E_EXE)2.nlm \$(TEST_D)\n";
}
else
{
$ret.="\t\$(LINK_CMD) \$(LFLAGS) $def_file2 $files \"$prelude\" $libs -o $target2\n";
}
}
if ($gnuc)
{
$ret.="\t\$(LINK_CMD) \$(LFLAGS) $def_file\n";
$ret.="\t\@$mv \$(\@F) \$(TEST_D)\n";
}
else
{
$ret.="\t\$(LINK_CMD) \$(LFLAGS) $def_file $files \"$prelude\" $libs -o $target\n";
}
$ret.="\n";
return($ret);
}
1;

38
util/pl/ultrix.pl Normal file
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_CMD) ${efile}$target \$(LFLAGS) $files $libs\n\n";
return($ret);
}
1;

442
util/pl/unix.pl Normal file
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_CMD) ${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
util/pod2man.pl Executable file

File diff suppressed because it is too large Load Diff

58
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"

15
util/pod2mantest.pod Normal file
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

View File

@@ -1,12 +1,7 @@
#! /usr/bin/env perl
# Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
#!/usr/local/bin/perl -w
#
# Licensed under the OpenSSL license (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
# in the file LICENSE in the source distribution or at
# https://www.openssl.org/source/license.html
# Run the test suite and generate a report
#
if (! -f "Configure") {
print "Please run perl util/selftest.pl in the OpenSSL directory.\n";
@@ -59,7 +54,7 @@ $cversion=`$cc -V |head -1` if $cversion =~ "Error";
$cversion=`$cc --version` if $cversion eq "";
$cversion =~ s/Reading specs.*\n//;
$cversion =~ s/usage.*\n//;
$cversion =~ s|\R$||;
chomp $cversion;
if (open(IN,"<CHANGES")) {
while(<IN>) {

80
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
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
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
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_METHOD
SSLv2_method 114 EXIST::FUNCTION:RSA,SSL2_METHOD
SSLv2_server_method 115 EXIST::FUNCTION:RSA,SSL2_METHOD
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:
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:
SSL_get_current_compression 272 EXIST::FUNCTION:
DTLSv1_method 273 EXIST::FUNCTION:
SSL_get_current_expansion 274 EXIST::FUNCTION:
DTLSv1_server_method 275 EXIST::FUNCTION:
SSL_COMP_get_compression_methods 276 EXIST:!VMS:FUNCTION:
SSL_COMP_get_compress_methods 276 EXIST:VMS:FUNCTION:
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:
SSL_COMP_set0_compress_methods 374 EXIST:VMS:FUNCTION:
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:
SSL_COMP_free_compress_methods 407 EXIST:VMS:FUNCTION:
SSL_extension_supported 409 EXIST::FUNCTION:TLSEXT

View File

@@ -1,11 +1,7 @@
#! /usr/bin/env perl
# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
#!/usr/bin/env perl
#
# su-filter.pl
#
# Licensed under the OpenSSL license (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
# in the file LICENSE in the source distribution or at
# https://www.openssl.org/source/license.html
use strict;
my $in_su = 0;
@@ -51,7 +47,7 @@ while(<>) {
do_output($out);
$in_su = 0;
}
} elsif($incomm <= 0 && /( *)(static )?(const )?(union|struct) ([a-zA-Z_\$][\$0-9a-zA-Z_]+ )?\{/) {
} elsif($incomm <= 0 && /( *)(static )?(const )?(union|struct) ([^\s]+ )?\{/) {
$in_su = 1;
$indent = $1;
$out = $_;

17
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++;
}

17
util/toutf8.sh Normal file
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
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)