summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/util')
-rw-r--r--src/lib/libcrypto/util/FreeBSD.sh6
-rw-r--r--src/lib/libcrypto/util/add_cr.pl123
-rw-r--r--src/lib/libcrypto/util/bat.sh132
-rw-r--r--src/lib/libcrypto/util/ck_errf.pl44
-rw-r--r--src/lib/libcrypto/util/deleof.pl7
-rw-r--r--src/lib/libcrypto/util/do_ms.sh17
-rw-r--r--src/lib/libcrypto/util/err-ins.pl33
-rw-r--r--src/lib/libcrypto/util/files.pl61
-rw-r--r--src/lib/libcrypto/util/fixNT.sh14
-rw-r--r--src/lib/libcrypto/util/install.sh108
-rw-r--r--src/lib/libcrypto/util/libeay.num1065
-rw-r--r--src/lib/libcrypto/util/mk1mf.pl793
-rw-r--r--src/lib/libcrypto/util/mkcerts.sh220
-rw-r--r--src/lib/libcrypto/util/mkdef.pl292
-rw-r--r--src/lib/libcrypto/util/perlpath.pl30
-rw-r--r--src/lib/libcrypto/util/pl/BC-16.pl146
-rw-r--r--src/lib/libcrypto/util/pl/BC-32.pl135
-rw-r--r--src/lib/libcrypto/util/pl/VC-16.pl173
-rw-r--r--src/lib/libcrypto/util/pl/VC-32.pl133
-rw-r--r--src/lib/libcrypto/util/pl/linux.pl96
-rw-r--r--src/lib/libcrypto/util/pl/unix.pl83
-rw-r--r--src/lib/libcrypto/util/point.sh4
-rw-r--r--src/lib/libcrypto/util/sp-diff.pl80
-rw-r--r--src/lib/libcrypto/util/speed.sh39
-rw-r--r--src/lib/libcrypto/util/src-dep.pl147
-rw-r--r--src/lib/libcrypto/util/ssleay.num156
-rw-r--r--src/lib/libcrypto/util/tab_num.pl17
-rw-r--r--src/lib/libcrypto/util/x86asm.sh42
28 files changed, 4196 insertions, 0 deletions
diff --git a/src/lib/libcrypto/util/FreeBSD.sh b/src/lib/libcrypto/util/FreeBSD.sh
new file mode 100644
index 0000000000..db8edfc6aa
--- /dev/null
+++ b/src/lib/libcrypto/util/FreeBSD.sh
@@ -0,0 +1,6 @@
1#!/bin/sh
2
3perl util/perlpath.pl /usr/bin
4perl util/ssldir.pl /usr/local
5perl util/mk1mf.pl FreeBSD >Makefile.FreeBSD
6perl Configure FreeBSD
diff --git a/src/lib/libcrypto/util/add_cr.pl b/src/lib/libcrypto/util/add_cr.pl
new file mode 100644
index 0000000000..ddd6d61e2d
--- /dev/null
+++ b/src/lib/libcrypto/util/add_cr.pl
@@ -0,0 +1,123 @@
1#!/usr/bin/perl
2#
3# This adds a copyright message to a souce code file.
4# It also gets the file name correct.
5#
6# perl util/add_cr.pl *.[ch] */*.[ch] */*/*.[ch]
7#
8
9foreach (@ARGV)
10 {
11 &dofile($_);
12 }
13
14sub dofile
15 {
16 local($file)=@_;
17
18 open(IN,"<$file") || die "unable to open $file:$!\n";
19
20 print STDERR "doing $file\n";
21 @in=<IN>;
22
23 return(1) if ($in[0] =~ / NOCW /);
24
25 @out=();
26 open(OUT,">$file.out") || die "unable to open $file.$$:$!\n";
27 push(@out,"/* $file */\n");
28 if (($in[1] !~ /^\/\* Copyright \(C\) [0-9-]+ Eric Young \(eay\@cryptsoft.com\)/))
29 {
30 push(@out,&Copyright);
31 $i=2;
32 @a=grep(/ Copyright \(C\) /,@in);
33 if ($#a >= 0)
34 {
35 while (($i <= $#in) && ($in[$i] ne " */\n"))
36 { $i++; }
37 $i++ if ($in[$i] eq " */\n");
38
39 while (($i <= $#in) && ($in[$i] =~ /^\s*$/))
40 { $i++; }
41
42 push(@out,"\n");
43 for ( ; $i <= $#in; $i++)
44 { push(@out,$in[$i]); }
45 }
46 else
47 { push(@out,@in); }
48 }
49 else
50 {
51 shift(@in);
52 push(@out,@in);
53 }
54 print OUT @out;
55 close(IN);
56 close(OUT);
57 rename("$file","$file.orig") || die "unable to rename $file:$!\n";
58 rename("$file.out",$file) || die "unable to rename $file.out:$!\n";
59 }
60
61
62
63sub Copyright
64 {
65 return <<'EOF';
66/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
67 * All rights reserved.
68 *
69 * This package is an SSL implementation written
70 * by Eric Young (eay@cryptsoft.com).
71 * The implementation was written so as to conform with Netscapes SSL.
72 *
73 * This library is free for commercial and non-commercial use as long as
74 * the following conditions are aheared to. The following conditions
75 * apply to all code found in this distribution, be it the RC4, RSA,
76 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
77 * included with this distribution is covered by the same copyright terms
78 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
79 *
80 * Copyright remains Eric Young's, and as such any Copyright notices in
81 * the code are not to be removed.
82 * If this package is used in a product, Eric Young should be given attribution
83 * as the author of the parts of the library used.
84 * This can be in the form of a textual message at program startup or
85 * in documentation (online or textual) provided with the package.
86 *
87 * Redistribution and use in source and binary forms, with or without
88 * modification, are permitted provided that the following conditions
89 * are met:
90 * 1. Redistributions of source code must retain the copyright
91 * notice, this list of conditions and the following disclaimer.
92 * 2. Redistributions in binary form must reproduce the above copyright
93 * notice, this list of conditions and the following disclaimer in the
94 * documentation and/or other materials provided with the distribution.
95 * 3. All advertising materials mentioning features or use of this software
96 * must display the following acknowledgement:
97 * "This product includes cryptographic software written by
98 * Eric Young (eay@cryptsoft.com)"
99 * The word 'cryptographic' can be left out if the rouines from the library
100 * being used are not cryptographic related :-).
101 * 4. If you include any Windows specific code (or a derivative thereof) from
102 * the apps directory (application code) you must include an acknowledgement:
103 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
104 *
105 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
106 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
107 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
108 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
109 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
110 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
111 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
112 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
113 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
114 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
115 * SUCH DAMAGE.
116 *
117 * The licence and distribution terms for any publically available version or
118 * derivative of this code cannot be changed. i.e. this code cannot simply be
119 * copied and put under another distribution licence
120 * [including the GNU Public Licence.]
121 */
122EOF
123 }
diff --git a/src/lib/libcrypto/util/bat.sh b/src/lib/libcrypto/util/bat.sh
new file mode 100644
index 0000000000..c6f48e8a7b
--- /dev/null
+++ b/src/lib/libcrypto/util/bat.sh
@@ -0,0 +1,132 @@
1#!/usr/local/bin/perl
2
3$infile="/home/eay/ssl/SSLeay/MINFO";
4
5open(IN,"<$infile") || die "unable to open $infile:$!\n";
6$_=<IN>;
7for (;;)
8 {
9 chop;
10
11 ($key,$val)=/^([^=]+)=(.*)/;
12 if ($key eq "RELATIVE_DIRECTORY")
13 {
14 if ($lib ne "")
15 {
16 $uc=$lib;
17 $uc =~ s/^lib(.*)\.a/$1/;
18 $uc =~ tr/a-z/A-Z/;
19 $lib_nam{$uc}=$uc;
20 $lib_obj{$uc}.=$libobj." ";
21 }
22 last if ($val eq "FINISHED");
23 $lib="";
24 $libobj="";
25 $dir=$val;
26 }
27
28 if ($key eq "TEST")
29 { $test.=&var_add($dir,$val); }
30
31 if (($key eq "PROGS") || ($key eq "E_OBJ"))
32 { $e_exe.=&var_add($dir,$val); }
33
34 if ($key eq "LIB")
35 {
36 $lib=$val;
37 $lib =~ s/^.*\/([^\/]+)$/$1/;
38 }
39
40 if ($key eq "EXHEADER")
41 { $exheader.=&var_add($dir,$val); }
42
43 if ($key eq "HEADER")
44 { $header.=&var_add($dir,$val); }
45
46 if ($key eq "LIBSRC")
47 { $libsrc.=&var_add($dir,$val); }
48
49 if (!($_=<IN>))
50 { $_="RELATIVE_DIRECTORY=FINISHED\n"; }
51 }
52close(IN);
53
54@a=split(/\s+/,$libsrc);
55foreach (@a)
56 {
57 print "${_}.c\n";
58 }
59
60sub var_add
61 {
62 local($dir,$val)=@_;
63 local(@a,$_,$ret);
64
65 return("") if $no_idea && $dir =~ /\/idea/;
66 return("") if $no_rc2 && $dir =~ /\/rc2/;
67 return("") if $no_rc4 && $dir =~ /\/rc4/;
68 return("") if $no_rsa && $dir =~ /\/rsa/;
69 return("") if $no_rsa && $dir =~ /^rsaref/;
70 return("") if $no_dsa && $dir =~ /\/dsa/;
71 return("") if $no_dh && $dir =~ /\/dh/;
72 if ($no_des && $dir =~ /\/des/)
73 {
74 if ($val =~ /read_pwd/)
75 { return("$dir/read_pwd "); }
76 else
77 { return(""); }
78 }
79 return("") if $no_mdc2 && $dir =~ /\/mdc2/;
80 return("") if $no_sock && $dir =~ /\/proxy/;
81 return("") if $no_bf && $dir =~ /\/bf/;
82 return("") if $no_cast && $dir =~ /\/cast/;
83
84 $val =~ s/^\s*(.*)\s*$/$1/;
85 @a=split(/\s+/,$val);
86 grep(s/\.[och]$//,@a);
87
88 @a=grep(!/^e_.*_3d$/,@a) if $no_des;
89 @a=grep(!/^e_.*_d$/,@a) if $no_des;
90 @a=grep(!/^e_.*_i$/,@a) if $no_idea;
91 @a=grep(!/^e_.*_r2$/,@a) if $no_rc2;
92 @a=grep(!/^e_.*_bf$/,@a) if $no_bf;
93 @a=grep(!/^e_.*_c$/,@a) if $no_cast;
94 @a=grep(!/^e_rc4$/,@a) if $no_rc4;
95
96 @a=grep(!/(^s2_)|(^s23_)/,@a) if $no_ssl2;
97 @a=grep(!/(^s3_)|(^s23_)/,@a) if $no_ssl3;
98
99 @a=grep(!/(_sock$)|(_acpt$)|(_conn$)|(^pxy_)/,@a) if $no_sock;
100
101 @a=grep(!/(^md2)|(_md2$)/,@a) if $no_md2;
102 @a=grep(!/(^md5)|(_md5$)/,@a) if $no_md5;
103
104 @a=grep(!/(^d2i_r_)|(^i2d_r_)/,@a) if $no_rsa;
105 @a=grep(!/(^p_open$)|(^p_seal$)/,@a) if $no_rsa;
106 @a=grep(!/(^pem_seal$)/,@a) if $no_rsa;
107
108 @a=grep(!/(m_dss$)|(m_dss1$)/,@a) if $no_dsa;
109 @a=grep(!/(^d2i_s_)|(^i2d_s_)|(_dsap$)/,@a) if $no_dsa;
110
111 @a=grep(!/^n_pkey$/,@a) if $no_rsa || $no_rc4;
112
113 @a=grep(!/_dhp$/,@a) if $no_dh;
114
115 @a=grep(!/(^sha[^1])|(_sha$)|(m_dss$)/,@a) if $no_sha;
116 @a=grep(!/(^sha1)|(_sha1$)|(m_dss1$)/,@a) if $no_sha1;
117 @a=grep(!/_mdc2$/,@a) if $no_mdc2;
118
119 @a=grep(!/(^rsa$)|(^genrsa$)|(^req$)|(^ca$)/,@a) if $no_rsa;
120 @a=grep(!/(^dsa$)|(^gendsa$)|(^dsaparam$)/,@a) if $no_dsa;
121 @a=grep(!/^gendsa$/,@a) if $no_sha1;
122 @a=grep(!/(^dh$)|(^gendh$)/,@a) if $no_dh;
123
124 @a=grep(!/(^dh)|(_sha1$)|(m_dss1$)/,@a) if $no_sha1;
125
126 grep($_="$dir/$_",@a);
127 @a=grep(!/(^|\/)s_/,@a) if $no_sock;
128 @a=grep(!/(^|\/)bio_sock/,@a) if $no_sock;
129 $ret=join(' ',@a)." ";
130 return($ret);
131 }
132
diff --git a/src/lib/libcrypto/util/ck_errf.pl b/src/lib/libcrypto/util/ck_errf.pl
new file mode 100644
index 0000000000..c5764e40df
--- /dev/null
+++ b/src/lib/libcrypto/util/ck_errf.pl
@@ -0,0 +1,44 @@
1#!/usr/bin/perl
2#
3# This is just a quick script to scan for cases where the 'error'
4# function name in a XXXerr() macro is wrong.
5#
6# Run in the top level by going
7# perl util/ck_errf.pl */*.c */*/*.c
8#
9
10foreach $file (@ARGV)
11 {
12 open(IN,"<$file") || die "unable to open $file\n";
13 $func="";
14 while (<IN>)
15 {
16 if (/^[a-zA-Z].+[\s*]([A-Za-z_0-9]+)\(.*\)/)
17 {
18 $func=$1;
19 $func =~ tr/A-Z/a-z/;
20 }
21 if (/([A-Z0-9]+)err\(([^,]+)/)
22 {
23 next if ($func eq "");
24 $errlib=$1;
25 $n=$2;
26 if ($n !~ /([^_]+)_F_(.+)$/)
27 {
28 # print "check -$file:$.:$func:$n\n";
29 next;
30 }
31 $lib=$1;
32 $n=$2;
33
34 if ($lib ne $errlib)
35 { print "$file:$.:$func:$n\n"; next; }
36
37 $n =~ tr/A-Z/a-z/;
38 if (($n ne $func) && ($errlib ne "SYS"))
39 { print "$file:$.:$func:$n\n"; next; }
40 # print "$func:$1\n";
41 }
42 }
43 }
44
diff --git a/src/lib/libcrypto/util/deleof.pl b/src/lib/libcrypto/util/deleof.pl
new file mode 100644
index 0000000000..04f30f0e47
--- /dev/null
+++ b/src/lib/libcrypto/util/deleof.pl
@@ -0,0 +1,7 @@
1#!/usr/bin/perl
2
3while (<>)
4 {
5 print
6 last if (/^# DO NOT DELETE THIS LINE/);
7 }
diff --git a/src/lib/libcrypto/util/do_ms.sh b/src/lib/libcrypto/util/do_ms.sh
new file mode 100644
index 0000000000..f498d842b7
--- /dev/null
+++ b/src/lib/libcrypto/util/do_ms.sh
@@ -0,0 +1,17 @@
1#!/bin/sh
2#
3# generate the Microsoft makefiles and .def files
4#
5
6PATH=util:../util:$PATH
7
8# perl util/mk1mf.pl VC-MSDOS no-sock >ms/msdos.mak
9# perl util/mk1mf.pl VC-W31-32 >ms/w31.mak
10perl util/mk1mf.pl VC-WIN16 dll >ms/w31dll.mak
11# perl util/mk1mf.pl VC-WIN32 >ms/nt.mak
12perl util/mk1mf.pl VC-WIN32 dll >ms/ntdll.mak
13
14perl util/mkdef.pl 16 libeay > ms/libeay16.def
15perl util/mkdef.pl 32 libeay > ms/libeay32.def
16perl util/mkdef.pl 16 ssleay > ms/ssleay16.def
17perl util/mkdef.pl 32 ssleay > ms/ssleay32.def
diff --git a/src/lib/libcrypto/util/err-ins.pl b/src/lib/libcrypto/util/err-ins.pl
new file mode 100644
index 0000000000..db1bb48275
--- /dev/null
+++ b/src/lib/libcrypto/util/err-ins.pl
@@ -0,0 +1,33 @@
1#!/usr/bin/perl
2#
3# tack error codes onto the end of a file
4#
5
6open(ERR,$ARGV[0]) || die "unable to open error file '$ARGV[0]':$!\n";
7@err=<ERR>;
8close(ERR);
9
10open(IN,$ARGV[1]) || die "unable to open header file '$ARGV[1]':$!\n";
11
12@out="";
13while (<IN>)
14 {
15 push(@out,$_);
16 last if /BEGIN ERROR CODES/;
17 }
18close(IN);
19
20open(OUT,">$ARGV[1]") || die "unable to open header file '$ARGV[1]':$1\n";
21print OUT @out;
22print OUT @err;
23print OUT <<"EOF";
24
25#ifdef __cplusplus
26}
27#endif
28#endif
29
30EOF
31close(OUT);
32
33
diff --git a/src/lib/libcrypto/util/files.pl b/src/lib/libcrypto/util/files.pl
new file mode 100644
index 0000000000..bf3b7effdc
--- /dev/null
+++ b/src/lib/libcrypto/util/files.pl
@@ -0,0 +1,61 @@
1#!/usr/bin/perl
2#
3# used to generate the file MINFO for use by util/mk1mf.pl
4# It is basically a list of all variables from the passed makefile
5#
6
7$s="";
8while (<>)
9 {
10 chop;
11 s/#.*//;
12 if (/^(\S+)\s*=\s*(.*)$/)
13 {
14 $o="";
15 ($s,$b)=($1,$2);
16 for (;;)
17 {
18 if ($b =~ /\\$/)
19 {
20 chop($b);
21 $o.=$b." ";
22 $b=<>;
23 chop($b);
24 }
25 else
26 {
27 $o.=$b." ";
28 last;
29 }
30 }
31 $o =~ s/^\s+//;
32 $o =~ s/\s+$//;
33 $o =~ s/\s+/ /g;
34
35 $o =~ s/\$[({]([^)}]+)[)}]/$sym{$1}/g;
36 $sym{$s}=$o;
37 }
38 }
39
40$pwd=`pwd`; chop($pwd);
41
42if ($sym{'TOP'} eq ".")
43 {
44 $n=0;
45 $dir=".";
46 }
47else {
48 $n=split(/\//,$sym{'TOP'});
49 @_=split(/\//,$pwd);
50 $z=$#_-$n+1;
51 foreach $i ($z .. $#_) { $dir.=$_[$i]."/"; }
52 chop($dir);
53 }
54
55print "RELATIVE_DIRECTORY=$dir\n";
56
57foreach (sort keys %sym)
58 {
59 print "$_=$sym{$_}\n";
60 }
61print "RELATIVE_DIRECTORY=\n";
diff --git a/src/lib/libcrypto/util/fixNT.sh b/src/lib/libcrypto/util/fixNT.sh
new file mode 100644
index 0000000000..ce4f19299b
--- /dev/null
+++ b/src/lib/libcrypto/util/fixNT.sh
@@ -0,0 +1,14 @@
1#!/bin/sh
2#
3# clean up the mess that NT makes of my source tree
4#
5
6if [ -f makefile.ssl -a ! -f Makefile.ssl ]; then
7 /bin/mv makefile.ssl Makefile.ssl
8fi
9chmod +x Configure util/*
10echo cleaning
11/bin/rm -f `find . -name '*.$$$' -print` 2>/dev/null >/dev/null
12echo 'removing those damn ^M'
13perl -pi -e 's/\015//' `find . -type 'f' -print |grep -v '.obj$' |grep -v '.der$' |grep -v '.gz'`
14make -f Makefile.ssl links
diff --git a/src/lib/libcrypto/util/install.sh b/src/lib/libcrypto/util/install.sh
new file mode 100644
index 0000000000..e1d0c982df
--- /dev/null
+++ b/src/lib/libcrypto/util/install.sh
@@ -0,0 +1,108 @@
1#!/bin/sh
2#
3# install - install a program, script, or datafile
4# This comes from X11R5; it is not part of GNU.
5#
6# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
7#
8# This script is compatible with the BSD install script, but was written
9# from scratch.
10#
11
12
13# set DOITPROG to echo to test this script
14
15doit="${DOITPROG:-}"
16
17
18# put in absolute paths if you don't have them in your path; or use env. vars.
19
20mvprog="${MVPROG:-mv}"
21cpprog="${CPPROG:-cp}"
22chmodprog="${CHMODPROG:-chmod}"
23chownprog="${CHOWNPROG:-chown}"
24chgrpprog="${CHGRPPROG:-chgrp}"
25stripprog="${STRIPPROG:-strip}"
26rmprog="${RMPROG:-rm}"
27
28instcmd="$mvprog"
29chmodcmd=""
30chowncmd=""
31chgrpcmd=""
32stripcmd=""
33rmcmd="$rmprog -f"
34src=""
35dst=""
36
37while [ x"$1" != x ]; do
38 case $1 in
39 -c) instcmd="$cpprog"
40 shift
41 continue;;
42
43 -m) chmodcmd="$chmodprog $2"
44 shift
45 shift
46 continue;;
47
48 -o) chowncmd="$chownprog $2"
49 shift
50 shift
51 continue;;
52
53 -g) chgrpcmd="$chgrpprog $2"
54 shift
55 shift
56 continue;;
57
58 -s) stripcmd="$stripprog"
59 shift
60 continue;;
61
62 *) if [ x"$src" = x ]
63 then
64 src=$1
65 else
66 dst=$1
67 fi
68 shift
69 continue;;
70 esac
71done
72
73if [ x"$src" = x ]
74then
75 echo "install: no input file specified"
76 exit 1
77fi
78
79if [ x"$dst" = x ]
80then
81 echo "install: no destination specified"
82 exit 1
83fi
84
85
86# if destination is a directory, append the input filename; if your system
87# does not like double slashes in filenames, you may need to add some logic
88
89if [ -d $dst ]
90then
91 dst="$dst"/`basename $src`
92fi
93
94
95# get rid of the old one and mode the new one in
96
97$doit $rmcmd $dst
98$doit $instcmd $src $dst
99
100
101# and set any options; do chmod last to preserve setuid bits
102
103if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; fi
104if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; fi
105if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; fi
106if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; fi
107
108exit 0
diff --git a/src/lib/libcrypto/util/libeay.num b/src/lib/libcrypto/util/libeay.num
new file mode 100644
index 0000000000..fcaf254287
--- /dev/null
+++ b/src/lib/libcrypto/util/libeay.num
@@ -0,0 +1,1065 @@
1SSLeay 1
2SSLeay_version 2
3ASN1_BIT_STRING_asn1_meth 3
4ASN1_HEADER_free 4
5ASN1_HEADER_new 5
6ASN1_IA5STRING_asn1_meth 6
7ASN1_INTEGER_get 7
8ASN1_INTEGER_set 8
9ASN1_INTEGER_to_BN 9
10ASN1_OBJECT_create 10
11ASN1_OBJECT_free 11
12ASN1_OBJECT_new 12
13ASN1_PRINTABLE_type 13
14ASN1_STRING_cmp 14
15ASN1_STRING_dup 15
16ASN1_STRING_free 16
17ASN1_STRING_new 17
18ASN1_STRING_print 18
19ASN1_STRING_set 19
20ASN1_STRING_type_new 20
21ASN1_TYPE_free 21
22ASN1_TYPE_new 22
23ASN1_UNIVERSALSTRING_to_string 23
24ASN1_UTCTIME_check 24
25ASN1_UTCTIME_print 25
26ASN1_UTCTIME_set 26
27ASN1_check_infinite_end 27
28ASN1_d2i_bio 28
29ASN1_d2i_fp 29
30ASN1_digest 30
31ASN1_dup 31
32ASN1_get_object 32
33ASN1_i2d_bio 33
34ASN1_i2d_fp 34
35ASN1_object_size 35
36ASN1_parse 36
37ASN1_put_object 37
38ASN1_sign 38
39ASN1_verify 39
40BF_cbc_encrypt 40
41BF_cfb64_encrypt 41
42BF_ecb_encrypt 42
43BF_encrypt 43
44BF_ofb64_encrypt 44
45BF_options 45
46BF_set_key 46
47BIO_CONNECT_free 47
48BIO_CONNECT_new 48
49BIO_accept 51
50BIO_ctrl 52
51BIO_int_ctrl 53
52BIO_debug_callback 54
53BIO_dump 55
54BIO_dup_chain 56
55BIO_f_base64 57
56BIO_f_buffer 58
57BIO_f_cipher 59
58BIO_f_md 60
59BIO_f_null 61
60BIO_f_proxy_server 62
61BIO_fd_non_fatal_error 63
62BIO_fd_should_retry 64
63BIO_find_type 65
64BIO_free 66
65BIO_free_all 67
66BIO_get_accept_socket 69
67BIO_get_filter_bio 70
68BIO_get_host_ip 71
69BIO_get_port 72
70BIO_get_retry_BIO 73
71BIO_get_retry_reason 74
72BIO_gethostbyname 75
73BIO_gets 76
74BIO_new 78
75BIO_new_accept 79
76BIO_new_connect 80
77BIO_new_fd 81
78BIO_new_file 82
79BIO_new_fp 83
80BIO_new_socket 84
81BIO_pop 85
82BIO_printf 86
83BIO_push 87
84BIO_puts 88
85BIO_read 89
86BIO_s_accept 90
87BIO_s_connect 91
88BIO_s_fd 92
89BIO_s_file 93
90BIO_s_mem 95
91BIO_s_null 96
92BIO_s_proxy_client 97
93BIO_s_socket 98
94BIO_set 100
95BIO_set_cipher 101
96BIO_set_tcp_ndelay 102
97BIO_sock_cleanup 103
98BIO_sock_error 104
99BIO_sock_init 105
100BIO_sock_non_fatal_error 106
101BIO_sock_should_retry 107
102BIO_socket_ioctl 108
103BIO_write 109
104BN_CTX_free 110
105BN_CTX_new 111
106BN_MONT_CTX_free 112
107BN_MONT_CTX_new 113
108BN_MONT_CTX_set 114
109BN_add 115
110BN_add_word 116
111BN_hex2bn 117
112BN_bin2bn 118
113BN_bn2hex 119
114BN_bn2bin 120
115BN_clear 121
116BN_clear_bit 122
117BN_clear_free 123
118BN_cmp 124
119BN_copy 125
120BN_div 126
121BN_div_word 127
122BN_dup 128
123BN_free 129
124BN_from_montgomery 130
125BN_gcd 131
126BN_generate_prime 132
127BN_get_word 133
128BN_is_bit_set 134
129BN_is_prime 135
130BN_lshift 136
131BN_lshift1 137
132BN_mask_bits 138
133BN_mod 139
134BN_mod_exp 140
135BN_mod_exp_mont 141
136BN_mod_exp_recp 142
137BN_mod_exp_simple 143
138BN_mod_inverse 144
139BN_mod_mul 145
140BN_mod_mul_montgomery 146
141BN_mod_mul_reciprocal 147
142BN_mod_word 148
143BN_mul 149
144BN_new 150
145BN_num_bits 151
146BN_num_bits_word 152
147BN_options 153
148BN_print 154
149BN_print_fp 155
150BN_rand 156
151BN_reciprocal 157
152BN_rshift 158
153BN_rshift1 159
154BN_set_bit 160
155BN_set_word 161
156BN_sqr 162
157BN_sub 163
158BN_to_ASN1_INTEGER 164
159BN_ucmp 165
160BN_value_one 166
161BUF_MEM_free 167
162BUF_MEM_grow 168
163BUF_MEM_new 169
164BUF_strdup 170
165CONF_free 171
166CONF_get_number 172
167CONF_get_section 173
168CONF_get_string 174
169CONF_load 175
170CRYPTO_add_lock 176
171CRYPTO_dbg_free 177
172CRYPTO_dbg_malloc 178
173CRYPTO_dbg_realloc 179
174CRYPTO_dbg_remalloc 180
175CRYPTO_free 181
176CRYPTO_get_add_lock_callback 182
177CRYPTO_get_id_callback 183
178CRYPTO_get_lock_name 184
179CRYPTO_get_locking_callback 185
180CRYPTO_get_mem_functions 186
181CRYPTO_lock 187
182CRYPTO_malloc 188
183CRYPTO_mem_ctrl 189
184CRYPTO_mem_leaks 190
185CRYPTO_mem_leaks_cb 191
186CRYPTO_mem_leaks_fp 192
187CRYPTO_realloc 193
188CRYPTO_remalloc 194
189CRYPTO_set_add_lock_callback 195
190CRYPTO_set_id_callback 196
191CRYPTO_set_locking_callback 197
192CRYPTO_set_mem_functions 198
193CRYPTO_thread_id 199
194DH_check 200
195DH_compute_key 201
196DH_free 202
197DH_generate_key 203
198DH_generate_parameters 204
199DH_new 205
200DH_size 206
201DHparams_print 207
202DHparams_print_fp 208
203DSA_free 209
204DSA_generate_key 210
205DSA_generate_parameters 211
206DSA_is_prime 212
207DSA_new 213
208DSA_print 214
209DSA_print_fp 215
210DSA_sign 216
211DSA_sign_setup 217
212DSA_size 218
213DSA_verify 219
214DSAparams_print 220
215DSAparams_print_fp 221
216ERR_clear_error 222
217ERR_error_string 223
218ERR_free_strings 224
219ERR_func_error_string 225
220ERR_get_err_state_table 226
221ERR_get_error 227
222ERR_get_error_line 228
223ERR_get_state 229
224ERR_get_string_table 230
225ERR_lib_error_string 231
226ERR_load_ASN1_strings 232
227ERR_load_BIO_strings 233
228ERR_load_BN_strings 234
229ERR_load_BUF_strings 235
230ERR_load_CONF_strings 236
231ERR_load_DH_strings 237
232ERR_load_DSA_strings 238
233ERR_load_ERR_strings 239
234ERR_load_EVP_strings 240
235ERR_load_OBJ_strings 241
236ERR_load_PEM_strings 242
237ERR_load_PROXY_strings 243
238ERR_load_RSA_strings 244
239ERR_load_X509_strings 245
240ERR_load_crypto_strings 246
241ERR_load_strings 247
242ERR_peek_error 248
243ERR_peek_error_line 249
244ERR_print_errors 250
245ERR_print_errors_fp 251
246ERR_put_error 252
247ERR_reason_error_string 253
248ERR_remove_state 254
249EVP_BytesToKey 255
250EVP_CIPHER_CTX_cleanup 256
251EVP_CipherFinal 257
252EVP_CipherInit 258
253EVP_CipherUpdate 259
254EVP_DecodeBlock 260
255EVP_DecodeFinal 261
256EVP_DecodeInit 262
257EVP_DecodeUpdate 263
258EVP_DecryptFinal 264
259EVP_DecryptInit 265
260EVP_DecryptUpdate 266
261EVP_DigestFinal 267
262EVP_DigestInit 268
263EVP_DigestUpdate 269
264EVP_EncodeBlock 270
265EVP_EncodeFinal 271
266EVP_EncodeInit 272
267EVP_EncodeUpdate 273
268EVP_EncryptFinal 274
269EVP_EncryptInit 275
270EVP_EncryptUpdate 276
271EVP_OpenFinal 277
272EVP_OpenInit 278
273EVP_PKEY_assign 279
274EVP_PKEY_copy_parameters 280
275EVP_PKEY_free 281
276EVP_PKEY_missing_parameters 282
277EVP_PKEY_new 283
278EVP_PKEY_save_parameters 284
279EVP_PKEY_size 285
280EVP_PKEY_type 286
281EVP_SealFinal 287
282EVP_SealInit 288
283EVP_SignFinal 289
284EVP_VerifyFinal 290
285EVP_add_alias 291
286EVP_add_cipher 292
287EVP_add_digest 293
288EVP_bf_cbc 294
289EVP_bf_cfb 295
290EVP_bf_ecb 296
291EVP_bf_ofb 297
292EVP_cleanup 298
293EVP_des_cbc 299
294EVP_des_cfb 300
295EVP_des_ecb 301
296EVP_des_ede 302
297EVP_des_ede3 303
298EVP_des_ede3_cbc 304
299EVP_des_ede3_cfb 305
300EVP_des_ede3_ofb 306
301EVP_des_ede_cbc 307
302EVP_des_ede_cfb 308
303EVP_des_ede_ofb 309
304EVP_des_ofb 310
305EVP_desx_cbc 311
306EVP_dss 312
307EVP_dss1 313
308EVP_enc_null 314
309EVP_get_cipherbyname 315
310EVP_get_digestbyname 316
311EVP_get_pw_prompt 317
312EVP_idea_cbc 318
313EVP_idea_cfb 319
314EVP_idea_ecb 320
315EVP_idea_ofb 321
316EVP_md2 322
317EVP_md5 323
318EVP_md_null 324
319EVP_rc2_cbc 325
320EVP_rc2_cfb 326
321EVP_rc2_ecb 327
322EVP_rc2_ofb 328
323EVP_rc4 329
324EVP_read_pw_string 330
325EVP_set_pw_prompt 331
326EVP_sha 332
327EVP_sha1 333
328MD2 334
329MD2_Final 335
330MD2_Init 336
331MD2_Update 337
332MD2_options 338
333MD5 339
334MD5_Final 340
335MD5_Init 341
336MD5_Update 342
337MDC2 343
338MDC2_Final 344
339MDC2_Init 345
340MDC2_Update 346
341NETSCAPE_SPKAC_free 347
342NETSCAPE_SPKAC_new 348
343NETSCAPE_SPKI_free 349
344NETSCAPE_SPKI_new 350
345NETSCAPE_SPKI_sign 351
346NETSCAPE_SPKI_verify 352
347OBJ_add_object 353
348OBJ_bsearch 354
349OBJ_cleanup 355
350OBJ_cmp 356
351OBJ_create 357
352OBJ_dup 358
353OBJ_ln2nid 359
354OBJ_new_nid 360
355OBJ_nid2ln 361
356OBJ_nid2obj 362
357OBJ_nid2sn 363
358OBJ_obj2nid 364
359OBJ_sn2nid 365
360OBJ_txt2nid 366
361PEM_ASN1_read 367
362PEM_ASN1_read_bio 368
363PEM_ASN1_write 369
364PEM_ASN1_write_bio 370
365PEM_SealFinal 371
366PEM_SealInit 372
367PEM_SealUpdate 373
368PEM_SignFinal 374
369PEM_SignInit 375
370PEM_SignUpdate 376
371PEM_X509_INFO_read 377
372PEM_X509_INFO_read_bio 378
373PEM_X509_INFO_write_bio 379
374PEM_dek_info 380
375PEM_do_header 381
376PEM_get_EVP_CIPHER_INFO 382
377PEM_proc_type 383
378PEM_read 384
379PEM_read_DHparams 385
380PEM_read_DSAPrivateKey 386
381PEM_read_DSAparams 387
382PEM_read_PKCS7 388
383PEM_read_PrivateKey 389
384PEM_read_RSAPrivateKey 390
385PEM_read_X509 391
386PEM_read_X509_CRL 392
387PEM_read_X509_REQ 393
388PEM_read_bio 394
389PEM_read_bio_DHparams 395
390PEM_read_bio_DSAPrivateKey 396
391PEM_read_bio_DSAparams 397
392PEM_read_bio_PKCS7 398
393PEM_read_bio_PrivateKey 399
394PEM_read_bio_RSAPrivateKey 400
395PEM_read_bio_X509 401
396PEM_read_bio_X509_CRL 402
397PEM_read_bio_X509_REQ 403
398PEM_write 404
399PEM_write_DHparams 405
400PEM_write_DSAPrivateKey 406
401PEM_write_DSAparams 407
402PEM_write_PKCS7 408
403PEM_write_PrivateKey 409
404PEM_write_RSAPrivateKey 410
405PEM_write_X509 411
406PEM_write_X509_CRL 412
407PEM_write_X509_REQ 413
408PEM_write_bio 414
409PEM_write_bio_DHparams 415
410PEM_write_bio_DSAPrivateKey 416
411PEM_write_bio_DSAparams 417
412PEM_write_bio_PKCS7 418
413PEM_write_bio_PrivateKey 419
414PEM_write_bio_RSAPrivateKey 420
415PEM_write_bio_X509 421
416PEM_write_bio_X509_CRL 422
417PEM_write_bio_X509_REQ 423
418PKCS7_DIGEST_free 424
419PKCS7_DIGEST_new 425
420PKCS7_ENCRYPT_free 426
421PKCS7_ENCRYPT_new 427
422PKCS7_ENC_CONTENT_free 428
423PKCS7_ENC_CONTENT_new 429
424PKCS7_ENVELOPE_free 430
425PKCS7_ENVELOPE_new 431
426PKCS7_ISSUER_AND_SERIAL_digest 432
427PKCS7_ISSUER_AND_SERIAL_free 433
428PKCS7_ISSUER_AND_SERIAL_new 434
429PKCS7_RECIP_INFO_free 435
430PKCS7_RECIP_INFO_new 436
431PKCS7_SIGNED_free 437
432PKCS7_SIGNED_new 438
433PKCS7_SIGNER_INFO_free 439
434PKCS7_SIGNER_INFO_new 440
435PKCS7_SIGN_ENVELOPE_free 441
436PKCS7_SIGN_ENVELOPE_new 442
437PKCS7_dup 443
438PKCS7_free 444
439PKCS7_new 445
440PROXY_ENTRY_add_noproxy 446
441PROXY_ENTRY_clear_noproxy 447
442PROXY_ENTRY_free 448
443PROXY_ENTRY_get_noproxy 449
444PROXY_ENTRY_new 450
445PROXY_ENTRY_set_server 451
446PROXY_add_noproxy 452
447PROXY_add_server 453
448PROXY_check_by_host 454
449PROXY_check_url 455
450PROXY_clear_noproxy 456
451PROXY_free 457
452PROXY_get_noproxy 458
453PROXY_get_proxies 459
454PROXY_get_proxy_entry 460
455PROXY_load_conf 461
456PROXY_new 462
457PROXY_print 463
458RAND_bytes 464
459RAND_cleanup 465
460RAND_file_name 466
461RAND_load_file 467
462RAND_screen 468
463RAND_seed 469
464RAND_write_file 470
465RC2_cbc_encrypt 471
466RC2_cfb64_encrypt 472
467RC2_ecb_encrypt 473
468RC2_encrypt 474
469RC2_ofb64_encrypt 475
470RC2_set_key 476
471RC4 477
472RC4_options 478
473RC4_set_key 479
474RSAPrivateKey_asn1_meth 480
475RSAPrivateKey_dup 481
476RSAPublicKey_dup 482
477RSA_PKCS1_SSLeay 483
478RSA_free 484
479RSA_generate_key 485
480RSA_new 486
481RSA_new_method 487
482RSA_print 488
483RSA_print_fp 489
484RSA_private_decrypt 490
485RSA_private_encrypt 491
486RSA_public_decrypt 492
487RSA_public_encrypt 493
488RSA_set_default_method 494
489RSA_sign 495
490RSA_sign_ASN1_OCTET_STRING 496
491RSA_size 497
492RSA_verify 498
493RSA_verify_ASN1_OCTET_STRING 499
494SHA 500
495SHA1 501
496SHA1_Final 502
497SHA1_Init 503
498SHA1_Update 504
499SHA_Final 505
500SHA_Init 506
501SHA_Update 507
502SSLeay_add_all_algorithms 508
503SSLeay_add_all_ciphers 509
504SSLeay_add_all_digests 510
505TXT_DB_create_index 511
506TXT_DB_free 512
507TXT_DB_get_by_index 513
508TXT_DB_insert 514
509TXT_DB_read 515
510TXT_DB_write 516
511X509_ALGOR_free 517
512X509_ALGOR_new 518
513X509_ATTRIBUTE_free 519
514X509_ATTRIBUTE_new 520
515X509_CINF_free 521
516X509_CINF_new 522
517X509_CRL_INFO_free 523
518X509_CRL_INFO_new 524
519X509_CRL_add_ext 525
520X509_CRL_cmp 526
521X509_CRL_delete_ext 527
522X509_CRL_dup 528
523X509_CRL_free 529
524X509_CRL_get_ext 530
525X509_CRL_get_ext_by_NID 531
526X509_CRL_get_ext_by_OBJ 532
527X509_CRL_get_ext_by_critical 533
528X509_CRL_get_ext_count 534
529X509_CRL_new 535
530X509_CRL_sign 536
531X509_CRL_verify 537
532X509_EXTENSION_create_by_NID 538
533X509_EXTENSION_create_by_OBJ 539
534X509_EXTENSION_dup 540
535X509_EXTENSION_free 541
536X509_EXTENSION_get_critical 542
537X509_EXTENSION_get_data 543
538X509_EXTENSION_get_object 544
539X509_EXTENSION_new 545
540X509_EXTENSION_set_critical 546
541X509_EXTENSION_set_data 547
542X509_EXTENSION_set_object 548
543X509_INFO_free 549
544X509_INFO_new 550
545X509_LOOKUP_by_alias 551
546X509_LOOKUP_by_fingerprint 552
547X509_LOOKUP_by_issuer_serial 553
548X509_LOOKUP_by_subject 554
549X509_LOOKUP_ctrl 555
550X509_LOOKUP_file 556
551X509_LOOKUP_free 557
552X509_LOOKUP_hash_dir 558
553X509_LOOKUP_init 559
554X509_LOOKUP_new 560
555X509_LOOKUP_shutdown 561
556X509_NAME_ENTRY_create_by_NID 562
557X509_NAME_ENTRY_create_by_OBJ 563
558X509_NAME_ENTRY_dup 564
559X509_NAME_ENTRY_free 565
560X509_NAME_ENTRY_get_data 566
561X509_NAME_ENTRY_get_object 567
562X509_NAME_ENTRY_new 568
563X509_NAME_ENTRY_set_data 569
564X509_NAME_ENTRY_set_object 570
565X509_NAME_add_entry 571
566X509_NAME_cmp 572
567X509_NAME_delete_entry 573
568X509_NAME_digest 574
569X509_NAME_dup 575
570X509_NAME_entry_count 576
571X509_NAME_free 577
572X509_NAME_get_entry 578
573X509_NAME_get_index_by_NID 579
574X509_NAME_get_index_by_OBJ 580
575X509_NAME_get_text_by_NID 581
576X509_NAME_get_text_by_OBJ 582
577X509_NAME_hash 583
578X509_NAME_new 584
579X509_NAME_oneline 585
580X509_NAME_print 586
581X509_NAME_set 587
582X509_OBJECT_free_contents 588
583X509_OBJECT_retrive_by_subject 589
584X509_OBJECT_up_ref_count 590
585X509_PKEY_free 591
586X509_PKEY_new 592
587X509_PUBKEY_free 593
588X509_PUBKEY_get 594
589X509_PUBKEY_new 595
590X509_PUBKEY_set 596
591X509_REQ_INFO_free 597
592X509_REQ_INFO_new 598
593X509_REQ_dup 599
594X509_REQ_free 600
595X509_REQ_get_pubkey 601
596X509_REQ_new 602
597X509_REQ_print 603
598X509_REQ_print_fp 604
599X509_REQ_set_pubkey 605
600X509_REQ_set_subject_name 606
601X509_REQ_set_version 607
602X509_REQ_sign 608
603X509_REQ_to_X509 609
604X509_REQ_verify 610
605X509_REVOKED_add_ext 611
606X509_REVOKED_delete_ext 612
607X509_REVOKED_free 613
608X509_REVOKED_get_ext 614
609X509_REVOKED_get_ext_by_NID 615
610X509_REVOKED_get_ext_by_OBJ 616
611X509_REVOKED_get_ext_by_critical 617
612X509_REVOKED_get_ext_count 618
613X509_REVOKED_new 619
614X509_SIG_free 620
615X509_SIG_new 621
616X509_STORE_CTX_cleanup 622
617X509_STORE_CTX_init 623
618X509_STORE_add_cert 624
619X509_STORE_add_lookup 625
620X509_STORE_free 626
621X509_STORE_get_by_subject 627
622X509_STORE_load_locations 628
623X509_STORE_new 629
624X509_STORE_set_default_paths 630
625X509_VAL_free 631
626X509_VAL_new 632
627X509_add_ext 633
628X509_asn1_meth 634
629X509_certificate_type 635
630X509_check_private_key 636
631X509_cmp_current_time 637
632X509_delete_ext 638
633X509_digest 639
634X509_dup 640
635X509_free 641
636X509_get_default_cert_area 642
637X509_get_default_cert_dir 643
638X509_get_default_cert_dir_env 644
639X509_get_default_cert_file 645
640X509_get_default_cert_file_env 646
641X509_get_default_private_dir 647
642X509_get_ext 648
643X509_get_ext_by_NID 649
644X509_get_ext_by_OBJ 650
645X509_get_ext_by_critical 651
646X509_get_ext_count 652
647X509_get_issuer_name 653
648X509_get_pubkey 654
649X509_get_pubkey_parameters 655
650X509_get_serialNumber 656
651X509_get_subject_name 657
652X509_gmtime_adj 658
653X509_issuer_and_serial_cmp 659
654X509_issuer_and_serial_hash 660
655X509_issuer_name_cmp 661
656X509_issuer_name_hash 662
657X509_load_cert_file 663
658X509_new 664
659X509_print 665
660X509_print_fp 666
661X509_set_issuer_name 667
662X509_set_notAfter 668
663X509_set_notBefore 669
664X509_set_pubkey 670
665X509_set_serialNumber 671
666X509_set_subject_name 672
667X509_set_version 673
668X509_sign 674
669X509_subject_name_cmp 675
670X509_subject_name_hash 676
671X509_to_X509_REQ 677
672X509_verify 678
673X509_verify_cert 679
674X509_verify_cert_error_string 680
675X509v3_add_ext 681
676X509v3_add_extension 682
677X509v3_add_netscape_extensions 683
678X509v3_add_standard_extensions 684
679X509v3_cleanup_extensions 685
680X509v3_data_type_by_NID 686
681X509v3_data_type_by_OBJ 687
682X509v3_delete_ext 688
683X509v3_get_ext 689
684X509v3_get_ext_by_NID 690
685X509v3_get_ext_by_OBJ 691
686X509v3_get_ext_by_critical 692
687X509v3_get_ext_count 693
688X509v3_pack_string 694
689X509v3_pack_type_by_NID 695
690X509v3_pack_type_by_OBJ 696
691X509v3_unpack_string 697
692_des_crypt 698
693a2d_ASN1_OBJECT 699
694a2i_ASN1_INTEGER 700
695a2i_ASN1_STRING 701
696asn1_Finish 702
697asn1_GetSequence 703
698bn_div64 704
699bn_expand2 705
700bn_mul_add_words 706
701bn_mul_words 707
702bn_qadd 708
703bn_qsub 709
704bn_sqr_words 710
705crypt 711
706d2i_ASN1_BIT_STRING 712
707d2i_ASN1_BOOLEAN 713
708d2i_ASN1_HEADER 714
709d2i_ASN1_IA5STRING 715
710d2i_ASN1_INTEGER 716
711d2i_ASN1_OBJECT 717
712d2i_ASN1_OCTET_STRING 718
713d2i_ASN1_PRINTABLE 719
714d2i_ASN1_PRINTABLESTRING 720
715d2i_ASN1_SET 721
716d2i_ASN1_T61STRING 722
717d2i_ASN1_TYPE 723
718d2i_ASN1_UTCTIME 724
719d2i_ASN1_bytes 725
720d2i_ASN1_type_bytes 726
721d2i_DHparams 727
722d2i_DSAPrivateKey 728
723d2i_DSAPrivateKey_bio 729
724d2i_DSAPrivateKey_fp 730
725d2i_DSAPublicKey 731
726d2i_DSAparams 732
727d2i_NETSCAPE_SPKAC 733
728d2i_NETSCAPE_SPKI 734
729d2i_Netscape_RSA 735
730d2i_PKCS7 736
731d2i_PKCS7_DIGEST 737
732d2i_PKCS7_ENCRYPT 738
733d2i_PKCS7_ENC_CONTENT 739
734d2i_PKCS7_ENVELOPE 740
735d2i_PKCS7_ISSUER_AND_SERIAL 741
736d2i_PKCS7_RECIP_INFO 742
737d2i_PKCS7_SIGNED 743
738d2i_PKCS7_SIGNER_INFO 744
739d2i_PKCS7_SIGN_ENVELOPE 745
740d2i_PKCS7_bio 746
741d2i_PKCS7_fp 747
742d2i_PrivateKey 748
743d2i_PublicKey 749
744d2i_RSAPrivateKey 750
745d2i_RSAPrivateKey_bio 751
746d2i_RSAPrivateKey_fp 752
747d2i_RSAPublicKey 753
748d2i_X509 754
749d2i_X509_ALGOR 755
750d2i_X509_ATTRIBUTE 756
751d2i_X509_CINF 757
752d2i_X509_CRL 758
753d2i_X509_CRL_INFO 759
754d2i_X509_CRL_bio 760
755d2i_X509_CRL_fp 761
756d2i_X509_EXTENSION 762
757d2i_X509_NAME 763
758d2i_X509_NAME_ENTRY 764
759d2i_X509_PKEY 765
760d2i_X509_PUBKEY 766
761d2i_X509_REQ 767
762d2i_X509_REQ_INFO 768
763d2i_X509_REQ_bio 769
764d2i_X509_REQ_fp 770
765d2i_X509_REVOKED 771
766d2i_X509_SIG 772
767d2i_X509_VAL 773
768d2i_X509_bio 774
769d2i_X509_fp 775
770des_cbc_cksum 777
771des_cbc_encrypt 778
772des_cblock_print_file 779
773des_cfb64_encrypt 780
774des_cfb_encrypt 781
775des_decrypt3 782
776des_ecb3_encrypt 783
777des_ecb_encrypt 784
778des_ede3_cbc_encrypt 785
779des_ede3_cfb64_encrypt 786
780des_ede3_ofb64_encrypt 787
781des_enc_read 788
782des_enc_write 789
783des_encrypt 790
784des_encrypt2 791
785des_encrypt3 792
786des_fcrypt 793
787des_is_weak_key 794
788des_key_sched 795
789des_ncbc_encrypt 796
790des_ofb64_encrypt 797
791des_ofb_encrypt 798
792des_options 799
793des_pcbc_encrypt 800
794des_quad_cksum 801
795des_random_key 802
796des_random_seed 803
797des_read_2passwords 804
798des_read_password 805
799des_read_pw 806
800des_read_pw_string 807
801des_set_key 808
802des_set_odd_parity 809
803des_string_to_2keys 810
804des_string_to_key 811
805des_xcbc_encrypt 812
806des_xwhite_in2out 813
807fcrypt_body 814
808i2a_ASN1_INTEGER 815
809i2a_ASN1_OBJECT 816
810i2a_ASN1_STRING 817
811i2d_ASN1_BIT_STRING 818
812i2d_ASN1_BOOLEAN 819
813i2d_ASN1_HEADER 820
814i2d_ASN1_IA5STRING 821
815i2d_ASN1_INTEGER 822
816i2d_ASN1_OBJECT 823
817i2d_ASN1_OCTET_STRING 824
818i2d_ASN1_PRINTABLE 825
819i2d_ASN1_SET 826
820i2d_ASN1_TYPE 827
821i2d_ASN1_UTCTIME 828
822i2d_ASN1_bytes 829
823i2d_DHparams 830
824i2d_DSAPrivateKey 831
825i2d_DSAPrivateKey_bio 832
826i2d_DSAPrivateKey_fp 833
827i2d_DSAPublicKey 834
828i2d_DSAparams 835
829i2d_NETSCAPE_SPKAC 836
830i2d_NETSCAPE_SPKI 837
831i2d_Netscape_RSA 838
832i2d_PKCS7 839
833i2d_PKCS7_DIGEST 840
834i2d_PKCS7_ENCRYPT 841
835i2d_PKCS7_ENC_CONTENT 842
836i2d_PKCS7_ENVELOPE 843
837i2d_PKCS7_ISSUER_AND_SERIAL 844
838i2d_PKCS7_RECIP_INFO 845
839i2d_PKCS7_SIGNED 846
840i2d_PKCS7_SIGNER_INFO 847
841i2d_PKCS7_SIGN_ENVELOPE 848
842i2d_PKCS7_bio 849
843i2d_PKCS7_fp 850
844i2d_PrivateKey 851
845i2d_PublicKey 852
846i2d_RSAPrivateKey 853
847i2d_RSAPrivateKey_bio 854
848i2d_RSAPrivateKey_fp 855
849i2d_RSAPublicKey 856
850i2d_X509 857
851i2d_X509_ALGOR 858
852i2d_X509_ATTRIBUTE 859
853i2d_X509_CINF 860
854i2d_X509_CRL 861
855i2d_X509_CRL_INFO 862
856i2d_X509_CRL_bio 863
857i2d_X509_CRL_fp 864
858i2d_X509_EXTENSION 865
859i2d_X509_NAME 866
860i2d_X509_NAME_ENTRY 867
861i2d_X509_PKEY 868
862i2d_X509_PUBKEY 869
863i2d_X509_REQ 870
864i2d_X509_REQ_INFO 871
865i2d_X509_REQ_bio 872
866i2d_X509_REQ_fp 873
867i2d_X509_REVOKED 874
868i2d_X509_SIG 875
869i2d_X509_VAL 876
870i2d_X509_bio 877
871i2d_X509_fp 878
872idea_cbc_encrypt 879
873idea_cfb64_encrypt 880
874idea_ecb_encrypt 881
875idea_encrypt 882
876idea_ofb64_encrypt 883
877idea_options 884
878idea_set_decrypt_key 885
879idea_set_encrypt_key 886
880lh_delete 887
881lh_doall 888
882lh_doall_arg 889
883lh_free 890
884lh_insert 891
885lh_new 892
886lh_node_stats 893
887lh_node_stats_bio 894
888lh_node_usage_stats 895
889lh_node_usage_stats_bio 896
890lh_retrieve 897
891lh_stats 898
892lh_stats_bio 899
893lh_strhash 900
894sk_delete 901
895sk_delete_ptr 902
896sk_dup 903
897sk_find 904
898sk_free 905
899sk_insert 906
900sk_new 907
901sk_pop 908
902sk_pop_free 909
903sk_push 910
904sk_set_cmp_func 911
905sk_shift 912
906sk_unshift 913
907sk_zero 914
908BIO_f_nbio_test 915
909ASN1_TYPE_get 916
910ASN1_TYPE_set 917
911PKCS7_content_free 918
912ERR_load_PKCS7_strings 919
913X509_find_by_issuer_and_serial 920
914X509_find_by_subject 921
915PKCS7_ctrl 927
916PKCS7_set_type 928
917PKCS7_set_content 929
918PKCS7_SIGNER_INFO_set 930
919PKCS7_add_signer 931
920PKCS7_add_certificate 932
921PKCS7_add_crl 933
922PKCS7_content_new 934
923PKCS7_dataSign 935
924PKCS7_dataVerify 936
925PKCS7_dataInit 937
926PKCS7_add_signature 938
927PKCS7_cert_from_signer_info 939
928PKCS7_get_signer_info 940
929EVP_delete_alias 941
930EVP_mdc2 942
931PEM_read_bio_RSAPublicKey 943
932PEM_write_bio_RSAPublicKey 944
933d2i_RSAPublicKey_bio 945
934i2d_RSAPublicKey_bio 946
935PEM_read_RSAPublicKey 947
936PEM_write_RSAPublicKey 949
937d2i_RSAPublicKey_fp 952
938i2d_RSAPublicKey_fp 954
939BIO_copy_next_retry 955
940RSA_flags 956
941X509_STORE_add_crl 957
942X509_load_crl_file 958
943EVP_rc2_40_cbc 959
944EVP_rc4_40 960
945EVP_CIPHER_CTX_init 961
946HMAC 962
947HMAC_Init 963
948HMAC_Update 964
949HMAC_Final 965
950ERR_get_next_error_library 966
951EVP_PKEY_cmp_parameters 967
952HMAC_cleanup 968
953BIO_ptr_ctrl 969
954BIO_new_file_internal 970
955BIO_new_fp_internal 971
956BIO_s_file_internal 972
957BN_BLINDING_convert 973
958BN_BLINDING_invert 974
959BN_BLINDING_update 975
960RSA_blinding_on 977
961RSA_blinding_off 978
962i2t_ASN1_OBJECT 979
963BN_BLINDING_new 980
964BN_BLINDING_free 981
965EVP_cast5_cbc 983
966EVP_cast5_cfb 984
967EVP_cast5_ecb 985
968EVP_cast5_ofb 986
969BF_decrypt 987
970CAST_set_key 988
971CAST_encrypt 989
972CAST_decrypt 990
973CAST_ecb_encrypt 991
974CAST_cbc_encrypt 992
975CAST_cfb64_encrypt 993
976CAST_ofb64_encrypt 994
977RC2_decrypt 995
978OBJ_create_objects 997
979BN_exp 998
980BN_mul_word 999
981BN_sub_word 1000
982BN_dec2bn 1001
983BN_bn2dec 1002
984BIO_ghbn_ctrl 1003
985CRYPTO_free_ex_data 1004
986CRYPTO_get_ex_data 1005
987CRYPTO_set_ex_data 1007
988ERR_load_CRYPTO_strings 1009
989ERR_load_CRYPTOlib_strings 1009
990EVP_PKEY_bits 1010
991MD5_Transform 1011
992SHA1_Transform 1012
993SHA_Transform 1013
994X509_STORE_CTX_get_chain 1014
995X509_STORE_CTX_get_current_cert 1015
996X509_STORE_CTX_get_error 1016
997X509_STORE_CTX_get_error_depth 1017
998X509_STORE_CTX_get_ex_data 1018
999X509_STORE_CTX_set_cert 1020
1000X509_STORE_CTX_set_chain 1021
1001X509_STORE_CTX_set_error 1022
1002X509_STORE_CTX_set_ex_data 1023
1003CRYPTO_dup_ex_data 1025
1004CRYPTO_get_new_lockid 1026
1005CRYPTO_new_ex_data 1027
1006RSA_set_ex_data 1028
1007RSA_get_ex_data 1029
1008RSA_get_ex_new_index 1030
1009RSA_padding_add_PKCS1_type_1 1031
1010RSA_padding_add_PKCS1_type_2 1032
1011RSA_padding_add_SSLv23 1033
1012RSA_padding_add_none 1034
1013RSA_padding_check_PKCS1_type_1 1035
1014RSA_padding_check_PKCS1_type_2 1036
1015RSA_padding_check_SSLv23 1037
1016RSA_padding_check_none 1038
1017bn_add_words 1039
1018d2i_Netscape_RSA_2 1040
1019CRYPTO_get_ex_new_index 1041
1020RIPEMD160_Init 1042
1021RIPEMD160_Update 1043
1022RIPEMD160_Final 1044
1023RIPEMD160 1045
1024RIPEMD160_Transform 1046
1025RC5_32_set_key 1047
1026RC5_32_ecb_encrypt 1048
1027RC5_32_encrypt 1049
1028RC5_32_decrypt 1050
1029RC5_32_cbc_encrypt 1051
1030RC5_32_cfb64_encrypt 1052
1031RC5_32_ofb64_encrypt 1053
1032BN_bn2mpi 1058
1033BN_mpi2bn 1059
1034ASN1_BIT_STRING_get_bit 1060
1035ASN1_BIT_STRING_set_bit 1061
1036BIO_get_ex_data 1062
1037BIO_get_ex_new_index 1063
1038BIO_set_ex_data 1064
1039X509_STORE_CTX_get_ex_new_index 1065
1040X509v3_get_key_usage 1066
1041X509v3_set_key_usage 1067
1042a2i_X509v3_key_usage 1068
1043i2a_X509v3_key_usage 1069
1044EVP_PKEY_decrypt 1070
1045EVP_PKEY_encrypt 1071
1046PKCS7_RECIP_INFO_set 1072
1047PKCS7_add_recipient 1073
1048PKCS7_add_recipient_info 1074
1049PKCS7_set_cipher 1075
1050ASN1_TYPE_get_int_octetstring 1076
1051ASN1_TYPE_get_octetstring 1077
1052ASN1_TYPE_set_int_octetstring 1078
1053ASN1_TYPE_set_octetstring 1079
1054ASN1_UTCTIME_set_string 1080
1055ERR_add_error_data 1081
1056ERR_set_error_data 1082
1057EVP_CIPHER_asn1_to_param 1083
1058EVP_CIPHER_param_to_asn1 1084
1059EVP_CIPHER_get_asn1_iv 1085
1060EVP_CIPHER_set_asn1_iv 1086
1061EVP_rc5_32_12_16_cbc 1087
1062EVP_rc5_32_12_16_cfb 1088
1063EVP_rc5_32_12_16_ecb 1089
1064EVP_rc5_32_12_16_ofb 1090
1065asn1_add_error 1091
diff --git a/src/lib/libcrypto/util/mk1mf.pl b/src/lib/libcrypto/util/mk1mf.pl
new file mode 100644
index 0000000000..149a0f4f80
--- /dev/null
+++ b/src/lib/libcrypto/util/mk1mf.pl
@@ -0,0 +1,793 @@
1#!/usr/bin/perl
2# A bit of an evil hack but it post processes the file ../MINFO which
3# is generated by `make files` in the top directory.
4# This script outputs one mega makefile that has no shell stuff or any
5# funny stuff
6#
7
8$INSTALLTOP="/usr/local/ssl";
9
10$ssl_version="0.8.2";
11
12$infile="MINFO";
13
14%ops=(
15 "VC-WIN32", "Microsoft Visual C++ 4.[01] - Windows NT [34].x",
16 "VC-W31-16", "Microsoft Visual C++ 1.52 - Windows 3.1 - 286",
17 "VC-WIN16", "Alias for VC-W31-32",
18 "VC-W31-32", "Microsoft Visual C++ 1.52 - Windows 3.1 - 386+",
19 "VC-MSDOS","Microsoft Visual C++ 1.52 - MSDOS",
20 "BC-NT", "Borland C++ 4.5 - Windows NT - PROBABLY NOT WORKING",
21 "BC-W31", "Borland C++ 4.5 - Windows 3.1 - PROBABLY NOT WORKING",
22 "BC-MSDOS","Borland C++ 4.5 - MSDOS",
23 "linux-elf","Linux elf",
24 "FreeBSD","FreeBSD distribution",
25 "default","cc under unix",
26 );
27
28$type="";
29foreach (@ARGV)
30 {
31 if (/^no-rc2$/) { $no_rc2=1; }
32 elsif (/^no-rc4$/) { $no_rc4=1; }
33 elsif (/^no-rc5$/) { $no_rc5=1; }
34 elsif (/^no-idea$/) { $no_idea=1; }
35 elsif (/^no-des$/) { $no_des=1; }
36 elsif (/^no-bf$/) { $no_bf=1; }
37 elsif (/^no-cast$/) { $no_cast=1; }
38 elsif (/^no-md2$/) { $no_md2=1; }
39 elsif (/^no-md5$/) { $no_md5=1; }
40 elsif (/^no-sha$/) { $no_sha=1; }
41 elsif (/^no-sha1$/) { $no_sha1=1; }
42 elsif (/^no-rmd160$/) { $no_rmd160=1; }
43 elsif (/^no-mdc2$/) { $no_mdc2=1; }
44 elsif (/^no-patents$/) { $no_rc2=$no_rc4=$no_rc5=$no_idea=$no_rsa=1; }
45 elsif (/^no-rsa$/) { $no_rsa=1; }
46 elsif (/^no-dsa$/) { $no_dsa=1; }
47 elsif (/^no-dh$/) { $no_dh=1; }
48 elsif (/^no-asm$/) { $no_asm=1; }
49 elsif (/^no-ssl2$/) { $no_ssl2=1; }
50 elsif (/^no-ssl3$/) { $no_ssl3=1; }
51 elsif (/^no-err$/) { $no_err=1; }
52 elsif (/^no-sock$/) { $no_sock=1; }
53
54 elsif (/^just-ssl$/) { $no_rc2=$no_idea=$no_des=$no_bf=$no_cast=1;
55 $no_md2=$no_sha=$no_mdc2=$no_dsa=$no_dh=1;
56 $no_ssl2=$no_err=1; }
57
58 elsif (/^rsaref$/) { $rsaref=1; }
59 elsif (/^gcc$/) { $gcc=1; }
60 elsif (/^debug$/) { $debug=1; }
61 elsif (/^shlib$/) { $shlib=1; }
62 elsif (/^dll$/) { $shlib=1; }
63 elsif (/^([^=]*)=(.*)$/){ $VARS{$1}=$2; }
64 elsif (/^-[lL].*$/) { $l_flags.="$_ "; }
65 elsif ((!/^-help/) && (!/^-h/) && (!/^-\?/) && /^-.*$/)
66 { $c_flags.="$_ "; }
67 else
68 {
69 if (!defined($ops{$_}))
70 {
71 print STDERR "unknown option - $_\n";
72 print STDERR "usage: perl mk1mf.pl [system] [options]\n";
73 print STDERR "\nwhere [system] can be one of the following\n";
74 foreach $i (sort keys %ops)
75 { printf STDERR "\t%-10s\t%s\n",$i,$ops{$i}; }
76 print STDERR <<"EOF";
77and [options] can be one of
78 no-md2 no-md5 no-sha no-sha1 no-mdc2 no-rmd160 - Skip this digest
79 no-rc2 no-rc4 no-idea no-des no-bf no-cast - Skip this symetric cipher
80 no-rc5
81 no-rsa no-dsa no-dh - Skip this public key cipher
82 no-ssl2 no-ssl3 - Skip this version of SSL
83 just-ssl - remove all non-ssl keys/digest
84 no-asm - No x86 asm
85 no-socks - No socket code
86 no-err - No error strings
87 dll/shlib - Build shared libraries (MS)
88 debug - Debug build
89 gcc - Use Gcc (unix)
90 rsaref - Build to require RSAref
91
92Values that can be set
93TMP=tmpdir OUT=outdir SRC=srcdir BIN=binpath INC=header-outdir CC=C-compiler
94
95-L<ex_lib_path> -l<ex_lib> - extra library flags (unix)
96-<ex_cc_flags> - extra 'cc' flags,
97 added (MS), or replace (unix)
98EOF
99 exit(1);
100 }
101 $type=$_;
102 }
103 }
104
105$no_mdc2=1 if ($no_des);
106
107$no_ssl3=1 if ($no_md5 || $no_sha1);
108$no_ssl3=1 if ($no_rsa && $no_dh);
109
110$no_ssl2=1 if ($no_md5 || $no_rsa);
111$no_ssl2=1 if ($no_rsa);
112
113$out_def="out";
114$inc_def="outinc";
115$tmp_def="tmp";
116
117
118($ssl,$crypto)=("ssl","crypto");
119$RSAglue="RSAglue";
120$ranlib="echo ranlib";
121
122$cc=(defined($VARS{'CC'}))?$VARS{'CC'}:'cc';
123$src_dir=(defined($VARS{'SRC'}))?$VARS{'SRC'}:'.';
124$bin_dir=(defined($VARS{'BIN'}))?$VARS{'BIN'}:'';
125
126# $bin_dir.=$o causes a core dump on my sparc :-(
127
128push(@INC,"util/pl","pl");
129if ($type eq "VC-MSDOS")
130 {
131 $asmbits=16;
132 $msdos=1;
133 require 'VC-16.pl';
134 }
135elsif ($type eq "VC-W31-16")
136 {
137 $asmbits=16;
138 $msdos=1; $win16=1;
139 require 'VC-16.pl';
140 }
141elsif (($type eq "VC-W31-32") || ($type eq "VC-WIN16"))
142 {
143 $asmbits=32;
144 $msdos=1; $win16=1;
145 require 'VC-16.pl';
146 }
147elsif (($type eq "VC-WIN32") || ($type eq "VC-NT"))
148 {
149 require 'VC-32.pl';
150 }
151elsif ($type eq "BC-NT")
152 {
153 $bc=1;
154 require 'BC-32.pl';
155 }
156elsif ($type eq "BC-W31")
157 {
158 $bc=1;
159 $msdos=1; $w16=1;
160 require 'BC-16.pl';
161 }
162elsif ($type eq "BC-Q16")
163 {
164 $msdos=1; $w16=1; $shlib=0; $qw=1;
165 require 'BC-16.pl';
166 }
167elsif ($type eq "BC-MSDOS")
168 {
169 $asmbits=16;
170 $msdos=1;
171 require 'BC-16.pl';
172 }
173elsif ($type eq "FreeBSD")
174 {
175 require 'unix.pl';
176 $cflags='-DTERMIO -D_ANSI_SOURCE -O2 -fomit-frame-pointer';
177 }
178elsif ($type eq "linux-elf")
179 {
180 require "unix.pl";
181 require "linux.pl";
182 $unix=1;
183 }
184else
185 {
186 require "unix.pl";
187
188 $unix=1;
189 $cflags.=' -DTERMIO';
190 }
191
192$out_dir=(defined($VARS{'OUT'}))?$VARS{'OUT'}:$out_def.($debug?".dbg":"");
193$tmp_dir=(defined($VARS{'TMP'}))?$VARS{'TMP'}:$tmp_def.($debug?".dbg":"");
194$inc_dir=(defined($VARS{'INC'}))?$VARS{'INC'}:$inc_def;
195
196$bin_dir=$bin_dir.$o unless ((substr($bin_dir,-1,1) eq $o) || ($bin_dir eq ''));
197
198$cflags.=" -DNO_IDEA" if $no_idea;
199$cflags.=" -DNO_RC2" if $no_rc2;
200$cflags.=" -DNO_RC4" if $no_rc4;
201$cflags.=" -DNO_RC5" if $no_rc5;
202$cflags.=" -DNO_MD2" if $no_md2;
203$cflags.=" -DNO_MD5" if $no_md5;
204$cflags.=" -DNO_SHA" if $no_sha;
205$cflags.=" -DNO_SHA1" if $no_sha1;
206$cflags.=" -DNO_RMD160" if $no_rmd160;
207$cflags.=" -DNO_MDC2" if $no_mdc2;
208$cflags.=" -DNO_BLOWFISH" if $no_bf;
209$cflags.=" -DNO_CAST" if $no_cast;
210$cflags.=" -DNO_DES" if $no_des;
211$cflags.=" -DNO_RSA" if $no_rsa;
212$cflags.=" -DNO_DSA" if $no_dsa;
213$cflags.=" -DNO_DH" if $no_dh;
214$cflags.=" -DNO_SOCK" if $no_sock;
215$cflags.=" -DNO_SSL2" if $no_ssl2;
216$cflags.=" -DNO_SSL3" if $no_ssl3;
217$cflags.=" -DNO_ERR" if $no_err;
218$cflags.=" -DRSAref" if $rsaref ne "";
219
220if ($unix)
221 { $cflags="$c_flags" if ($c_flags ne ""); }
222else { $cflags="$c_flags$cflags" if ($c_flags ne ""); }
223
224$ex_libs="$l_flags$ex_libs" if ($l_flags ne "");
225
226if ($ranlib ne "")
227 {
228 $ranlib="\$(SRC_D)$o$ranlib";
229 }
230
231if ($msdos)
232 {
233 $banner ="\t\@echo Make sure you have run 'perl Configure $type' in the\n";
234 $banner.="\t\@echo top level directory, if you don't have perl, you will\n";
235 $banner.="\t\@echo need to probably edit crypto/bn/bn.h, check the\n";
236 $banner.="\t\@echo documentation for details.\n";
237 }
238
239# have to do this to allow $(CC) under unix
240$link="$bin_dir$link" if ($link !~ /^\$/);
241
242$INSTALLTOP =~ s|/|$o|g;
243
244$defs= <<"EOF";
245# This makefile has been automatically generated from the SSLeay distribution.
246# This single makefile will build the complete SSLeay distribution and
247# by default leave the 'intertesting' output files in .${o}out and the stuff
248# that needs deleting in .${o}tmp.
249# The file was generated by running 'make makefile.one', which
250# does a 'make files', which writes all the environment variables from all
251# the makefiles to the file call MINFO. This file is used by
252# util${o}mk1mf.pl to generate makefile.one.
253# The 'makefile per directory' system suites me when developing this
254# library and also so I can 'distribute' indervidual library sections.
255# The one monster makefile better suits building in non-unix
256# environments.
257
258INSTALLTOP=$INSTALLTOP
259
260# Set your compiler options
261CC=$bin_dir${cc}
262CFLAG=$cflags
263APP_CFLAG=$app_cflag
264LIB_CFLAG=$lib_cflag
265SHLIB_CFLAG=$shl_cflag
266APP_EX_OBJ=$app_ex_obj
267SHLIB_EX_OBJ=$shlib_ex_obj
268# add extra libraries to this define, for solaris -lsocket -lnsl would
269# be added
270EX_LIBS=$ex_libs
271
272# The SSLeay directory
273SRC_D=$src_dir
274
275LINK=$link
276LFLAGS=$lflags
277
278BN_MULW_OBJ=$bn_mulw_obj
279BN_MULW_SRC=$bn_mulw_src
280DES_ENC_OBJ=$des_enc_obj
281DES_ENC_SRC=$des_enc_src
282DES_CRYPT_OBJ=$des_crypt_obj
283DES_CRYPT_SRC=$des_crypt_src
284BF_ENC_OBJ=$bf_enc_obj
285BF_ENC_SRC=$bf_enc_src
286CAST_ENC_OBJ=$cast_enc_obj
287CAST_ENC_SRC=$cast_enc_src
288RC4_ENC_OBJ=$rc4_enc_obj
289RC4_ENC_SRC=$rc4_enc_src
290RC5_ENC_OBJ=$rc5_enc_obj
291RC5_ENC_SRC=$rc5_enc_src
292MD5_ASM_OBJ=$md5_asm_obj
293MD5_ASM_SRC=$md5_asm_src
294SHA1_ASM_OBJ=$sha1_asm_obj
295SHA1_ASM_SRC=$sha1_asm_src
296RMD160_ASM_OBJ=$rmd160_asm_obj
297RMD160_ASM_SRC=$rmd160_asm_src
298
299# The output directory for everything intersting
300OUT_D=$out_dir
301# The output directory for all the temporary muck
302TMP_D=$tmp_dir
303# The output directory for the header files
304INC_D=$inc_dir
305
306CP=$cp
307RM=$rm
308RANLIB=$ranlib
309MKDIR=mkdir
310MKLIB=$bin_dir$mklib
311MLFLAGS=$mlflags
312ASM=$bin_dir$asm
313
314######################################################
315# You should not need to touch anything below this point
316######################################################
317
318E_EXE=ssleay
319SSL=$ssl
320CRYPTO=$crypto
321RSAGLUE=$RSAglue
322
323# BIN_D - Binary output directory
324# TEST_D - Binary test file output directory
325# LIB_D - library output directory
326BIN_D=\$(OUT_D)
327TEST_D=\$(OUT_D)
328LIB_D=\$(OUT_D)
329
330# INCL_D - local library directory
331# OBJ_D - temp object file directory
332OBJ_D=\$(TMP_D)
333INCL_D=\$(TMP_D)
334
335O_SSL= \$(LIB_D)$o$plib\$(SSL)$shlibp
336O_CRYPTO= \$(LIB_D)$o$plib\$(CRYPTO)$shlibp
337O_RSAGLUE= \$(LIB_D)$o$plib\$(RSAGLUE)$libp
338SO_SSL= $plib\$(SSL)$so_shlibp
339SO_CRYPTO= $plib\$(CRYPTO)$so_shlibp
340L_SSL= \$(LIB_D)$o\$(SSL)$libp
341L_CRYPTO= \$(LIB_D)$o\$(CRYPTO)$libp
342
343L_LIBS= \$(L_SSL) \$(L_CRYPTO)
344#L_LIBS= \$(O_SSL) \$(O_RSAGLUE) -lrsaref \$(O_CRYPTO)
345
346######################################################
347# Don't touch anything below this point
348######################################################
349
350INC=-I\$(INC_D) -I\$(INCL_D)
351APP_CFLAGS=\$(INC) \$(CFLAG) \$(APP_CFLAG)
352LIB_CFLAGS=\$(INC) \$(CFLAG) \$(LIB_CFLAG)
353SHLIB_CFLAGS=\$(INC) \$(CFLAG) \$(LIB_CFLAG) \$(SHLIB_CFLAG)
354LIBS_DEP=\$(O_CRYPTO) \$(O_RSAGLUE) \$(O_SSL)
355
356#############################################
357EOF
358
359$rules=<<"EOF";
360all: banner \$(TMP_D) \$(BIN_D) \$(TEST_D) \$(LIB_D) \$(INC_D) headers lib exe
361
362banner:
363$banner
364
365\$(TMP_D):
366 \$(MKDIR) \$(TMP_D)
367
368\$(BIN_D):
369 \$(MKDIR) \$(BIN_D)
370
371\$(TEST_D):
372 \$(MKDIR) \$(TEST_D)
373
374\$(LIB_D):
375 \$(MKDIR) \$(LIB_D)
376
377\$(INC_D):
378 \$(MKDIR) \$(INC_D)
379
380headers: \$(HEADER) \$(EXHEADER)
381
382lib: \$(LIBS_DEP)
383
384exe: \$(T_EXE) \$(BIN_D)$o\$(E_EXE)$exep
385
386install:
387 \$(MKDIR) \$(INSTALLTOP)
388 \$(MKDIR) \$(INSTALLTOP)${o}bin
389 \$(MKDIR) \$(INSTALLTOP)${o}include
390 \$(MKDIR) \$(INSTALLTOP)${o}lib
391 \$(CP) \$(INC_D)${o}*.\[ch\] \$(INSTALLTOP)${o}include
392 \$(CP) \$(BIN_D)$o\$(E_EXE)$exep \$(INSTALLTOP)${o}bin
393 \$(CP) \$(O_SSL) \$(INSTALLTOP)${o}lib
394 \$(CP) \$(O_CRYPTO) \$(INSTALLTOP)${o}lib
395
396clean:
397 \$(RM) \$(TMP_D)$o*.*
398
399vclean:
400 \$(RM) \$(TMP_D)$o*.*
401 \$(RM) \$(OUT_D)$o*.*
402
403EOF
404
405#############################################
406# We parse in input file and 'store' info for later printing.
407open(IN,"<$infile") || die "unable to open $infile:$!\n";
408$_=<IN>;
409for (;;)
410 {
411 chop;
412
413 ($key,$val)=/^([^=]+)=(.*)/;
414 if ($key eq "RELATIVE_DIRECTORY")
415 {
416 if ($lib ne "")
417 {
418 $uc=$lib;
419 $uc =~ s/^lib(.*)\.a/$1/;
420 $uc =~ tr/a-z/A-Z/;
421 $lib_nam{$uc}=$uc;
422 $lib_obj{$uc}.=$libobj." ";
423 }
424 last if ($val eq "FINISHED");
425 $lib="";
426 $libobj="";
427 $dir=$val;
428 }
429
430 if ($key eq "TEST")
431 { $test.=&var_add($dir,$val); }
432
433 if (($key eq "PROGS") || ($key eq "E_OBJ"))
434 { $e_exe.=&var_add($dir,$val); }
435
436 if ($key eq "LIB")
437 {
438 $lib=$val;
439 $lib =~ s/^.*\/([^\/]+)$/$1/;
440 }
441
442 if ($key eq "EXHEADER")
443 { $exheader.=&var_add($dir,$val); }
444
445 if ($key eq "HEADER")
446 { $header.=&var_add($dir,$val); }
447
448 if ($key eq "LIBOBJ")
449 { $libobj=&var_add($dir,$val); }
450
451 if (!($_=<IN>))
452 { $_="RELATIVE_DIRECTORY=FINISHED\n"; }
453 }
454close(IN);
455
456# Strip of trailing ' '
457foreach (keys %lib_obj) { $lib_obj{$_}=&clean_up_ws($lib_obj{$_}); }
458$test=&clean_up_ws($test);
459$e_exe=&clean_up_ws($e_exe);
460$exheader=&clean_up_ws($exheader);
461$header=&clean_up_ws($header);
462
463# First we strip the exheaders from the headers list
464foreach (split(/\s+/,$exheader)){ $h{$_}=1; }
465foreach (split(/\s+/,$header)) { $h.=$_." " unless $h{$_}; }
466chop($h); $header=$h;
467
468$defs.=&do_defs("HEADER",$header,"\$(INCL_D)",".h");
469$rules.=&do_copy_rule("\$(INCL_D)",$header,".h");
470
471$defs.=&do_defs("EXHEADER",$exheader,"\$(INC_D)",".h");
472$rules.=&do_copy_rule("\$(INC_D)",$exheader,".h");
473
474$defs.=&do_defs("T_OBJ",$test,"\$(OBJ_D)",$obj);
475$rules.=&do_compile_rule("\$(OBJ_D)",$test,"\$(APP_CFLAGS)");
476
477$defs.=&do_defs("E_OBJ",$e_exe,"\$(OBJ_D)",$obj);
478$rules.=&do_compile_rule("\$(OBJ_D)",$e_exe,'-DMONOLITH $(APP_CFLAGS)');
479
480foreach (values %lib_nam)
481 {
482 $lib_obj=$lib_obj{$_};
483 local($slib)=$shlib;
484
485 $slib=0 if ($_ eq "RSAGLUE");
486
487 if (($_ eq "SSL") && $no_ssl2 && $no_ssl3)
488 {
489 $rules.="\$(O_SSL):\n\n";
490 next;
491 }
492
493 if (($_ eq "RSAGLUE") && $no_rsa)
494 {
495 $rules.="\$(O_RSAGLUE):\n\n";
496 next;
497 }
498
499 if (($bn_mulw_obj ne "") && ($_ eq "CRYPTO"))
500 {
501 $lib_obj =~ s/\s\S*\/bn_mulw\S*/ \$(BN_MULW_OBJ)/;
502 $rules.=&do_asm_rule($bn_mulw_obj,$bn_mulw_src);
503 }
504 if (($des_enc_obj ne "") && ($_ eq "CRYPTO"))
505 {
506 $lib_obj =~ s/\s\S*des_enc\S*/ \$(DES_ENC_OBJ)/;
507 $lib_obj =~ s/\s\S*\/fcrypt_b\S*\s*/ /;
508 $rules.=&do_asm_rule($des_enc_obj,$des_enc_src);
509 }
510 if (($bf_enc_obj ne "") && ($_ eq "CRYPTO"))
511 {
512 $lib_obj =~ s/\s\S*\/bf_enc\S*/ \$(BF_ENC_OBJ)/;
513 $rules.=&do_asm_rule($bf_enc_obj,$bf_enc_src);
514 }
515 if (($cast_enc_obj ne "") && ($_ eq "CRYPTO"))
516 {
517 $lib_obj =~ s/(\s\S*\/c_enc\S*)/ \$(CAST_ENC_OBJ)/;
518 $rules.=&do_asm_rule($cast_enc_obj,$cast_enc_src);
519 }
520 if (($rc4_enc_obj ne "") && ($_ eq "CRYPTO"))
521 {
522 $lib_obj =~ s/\s\S*\/rc4_enc\S*/ \$(RC4_ENC_OBJ)/;
523 $rules.=&do_asm_rule($rc4_enc_obj,$rc4_enc_src);
524 }
525 if (($rc5_enc_obj ne "") && ($_ eq "CRYPTO"))
526 {
527 $lib_obj =~ s/\s\S*\/rc5_enc\S*/ \$(RC5_ENC_OBJ)/;
528 $rules.=&do_asm_rule($rc5_enc_obj,$rc5_enc_src);
529 }
530 if (($md5_asm_obj ne "") && ($_ eq "CRYPTO"))
531 {
532 $lib_obj =~ s/\s(\S*\/md5_dgst\S*)/ $1 \$(MD5_ASM_OBJ)/;
533 $rules.=&do_asm_rule($md5_asm_obj,$md5_asm_src);
534 }
535 if (($sha1_asm_obj ne "") && ($_ eq "CRYPTO"))
536 {
537 $lib_obj =~ s/\s(\S*\/sha1dgst\S*)/ $1 \$(SHA1_ASM_OBJ)/;
538 $rules.=&do_asm_rule($sha1_asm_obj,$sha1_asm_src);
539 }
540 if (($rmd160_asm_obj ne "") && ($_ eq "CRYPTO"))
541 {
542 $lib_obj =~ s/\s(\S*\/rmd_dgst\S*)/ $1 \$(RMD160_ASM_OBJ)/;
543 $rules.=&do_asm_rule($rmd160_asm_obj,$rmd160_asm_src);
544 }
545 $defs.=&do_defs(${_}."OBJ",$lib_obj,"\$(OBJ_D)",$obj);
546 $lib=($slib)?" \$(SHLIB_CFLAGS)":" \$(LIB_CFLAGS)";
547 $rules.=&do_compile_rule("\$(OBJ_D)",$lib_obj{$_},$lib);
548 }
549
550$defs.=&do_defs("T_EXE",$test,"\$(TEST_D)",$exep);
551foreach (split(/\s+/,$test))
552 {
553 $t=&bname($_);
554 $tt="\$(OBJ_D)${o}$t${obj}";
555 $rules.=&do_link_rule("\$(TEST_D)$o$t$exep",$tt,"\$(LIBS_DEP)","\$(L_LIBS) \$(EX_LIBS)");
556 }
557
558$rules.= &do_lib_rule("\$(SSLOBJ)","\$(O_SSL)",$ssl,$shlib,"\$(SO_SSL)");
559$rules.= &do_lib_rule("\$(RSAGLUEOBJ)","\$(O_RSAGLUE)",$RSAglue,0,"")
560 unless $no_rsa;
561$rules.= &do_lib_rule("\$(CRYPTOOBJ)","\$(O_CRYPTO)",$crypto,$shlib,"\$(SO_CRYPTO)");
562
563$rules.=&do_link_rule("\$(BIN_D)$o\$(E_EXE)$exep","\$(E_OBJ)","\$(LIBS_DEP)","\$(L_LIBS) \$(EX_LIBS)");
564
565print $defs;
566print "###################################################################\n";
567print $rules;
568
569###############################################
570# strip off any trailing .[och] and append the relative directory
571# also remembering to do nothing if we are in one of the dropped
572# directories
573sub var_add
574 {
575 local($dir,$val)=@_;
576 local(@a,$_,$ret);
577
578 return("") if $no_idea && $dir =~ /\/idea/;
579 return("") if $no_rc2 && $dir =~ /\/rc2/;
580 return("") if $no_rc4 && $dir =~ /\/rc4/;
581 return("") if $no_rc5 && $dir =~ /\/rc5/;
582 return("") if $no_rsa && $dir =~ /\/rsa/;
583 return("") if $no_rsa && $dir =~ /^rsaref/;
584 return("") if $no_dsa && $dir =~ /\/dsa/;
585 return("") if $no_dh && $dir =~ /\/dh/;
586 if ($no_des && $dir =~ /\/des/)
587 {
588 if ($val =~ /read_pwd/)
589 { return("$dir/read_pwd "); }
590 else
591 { return(""); }
592 }
593 return("") if $no_mdc2 && $dir =~ /\/mdc2/;
594 return("") if $no_sock && $dir =~ /\/proxy/;
595 return("") if $no_bf && $dir =~ /\/bf/;
596 return("") if $no_cast && $dir =~ /\/cast/;
597
598 $val =~ s/^\s*(.*)\s*$/$1/;
599 @a=split(/\s+/,$val);
600 grep(s/\.[och]$//,@a);
601
602 @a=grep(!/^e_.*_3d$/,@a) if $no_des;
603 @a=grep(!/^e_.*_d$/,@a) if $no_des;
604 @a=grep(!/^e_.*_i$/,@a) if $no_idea;
605 @a=grep(!/^e_.*_r2$/,@a) if $no_rc2;
606 @a=grep(!/^e_.*_r5$/,@a) if $no_rc5;
607 @a=grep(!/^e_.*_bf$/,@a) if $no_bf;
608 @a=grep(!/^e_.*_c$/,@a) if $no_cast;
609 @a=grep(!/^e_rc4$/,@a) if $no_rc4;
610
611 @a=grep(!/(^s2_)|(^s23_)/,@a) if $no_ssl2;
612 @a=grep(!/(^s3_)|(^s23_)/,@a) if $no_ssl3;
613
614 @a=grep(!/(_sock$)|(_acpt$)|(_conn$)|(^pxy_)/,@a) if $no_sock;
615
616 @a=grep(!/(^md2)|(_md2$)/,@a) if $no_md2;
617 @a=grep(!/(^md5)|(_md5$)/,@a) if $no_md5;
618
619 @a=grep(!/(^d2i_r_)|(^i2d_r_)/,@a) if $no_rsa;
620 @a=grep(!/(^p_open$)|(^p_seal$)/,@a) if $no_rsa;
621 @a=grep(!/(^pem_seal$)/,@a) if $no_rsa;
622
623 @a=grep(!/(m_dss$)|(m_dss1$)/,@a) if $no_dsa;
624 @a=grep(!/(^d2i_s_)|(^i2d_s_)|(_dsap$)/,@a) if $no_dsa;
625
626 @a=grep(!/^n_pkey$/,@a) if $no_rsa || $no_rc4;
627
628 @a=grep(!/_dhp$/,@a) if $no_dh;
629
630 @a=grep(!/(^sha[^1])|(_sha$)|(m_dss$)/,@a) if $no_sha;
631 @a=grep(!/(^sha1)|(_sha1$)|(m_dss1$)/,@a) if $no_sha1;
632 @a=grep(!/_mdc2$/,@a) if $no_mdc2;
633
634 @a=grep(!/(^rsa$)|(^genrsa$)|(^req$)|(^ca$)/,@a) if $no_rsa;
635 @a=grep(!/(^dsa$)|(^gendsa$)|(^dsaparam$)/,@a) if $no_dsa;
636 @a=grep(!/^gendsa$/,@a) if $no_sha1;
637 @a=grep(!/(^dh$)|(^gendh$)/,@a) if $no_dh;
638
639 @a=grep(!/(^dh)|(_sha1$)|(m_dss1$)/,@a) if $no_sha1;
640
641 grep($_="$dir/$_",@a);
642 @a=grep(!/(^|\/)s_/,@a) if $no_sock;
643 @a=grep(!/(^|\/)bio_sock/,@a) if $no_sock;
644 $ret=join(' ',@a)." ";
645 return($ret);
646 }
647
648# change things so that each 'token' is only separated by one space
649sub clean_up_ws
650 {
651 local($w)=@_;
652
653 $w =~ s/^\s*(.*)\s*$/$1/;
654 $w =~ s/\s+/ /g;
655 return($w);
656 }
657
658sub do_defs
659 {
660 local($var,$files,$location,$postfix)=@_;
661 local($_,$ret,$pf);
662 local(*OUT,$tmp,$t);
663
664 $files =~ s/\//$o/g if $o ne '/';
665 $ret="$var=";
666 $n=1;
667 $Vars{$var}.="";
668 foreach (split(/ /,$files))
669 {
670 $orig=$_;
671 $_=&bname($_) unless /^\$/;
672 if ($n++ == 2)
673 {
674 $n=0;
675 $ret.="\\\n\t";
676 }
677 if (($_ =~ /bss_file/) && ($postfix eq ".h"))
678 { $pf=".c"; }
679 else { $pf=$postfix; }
680 if ($_ =~ /BN_MULW/) { $t="$_ "; }
681 elsif ($_ =~ /DES_ENC/) { $t="$_ "; }
682 elsif ($_ =~ /BF_ENC/) { $t="$_ "; }
683 elsif ($_ =~ /CAST_ENC/){ $t="$_ "; }
684 elsif ($_ =~ /RC4_ENC/) { $t="$_ "; }
685 elsif ($_ =~ /RC5_ENC/) { $t="$_ "; }
686 elsif ($_ =~ /MD5_ASM/) { $t="$_ "; }
687 elsif ($_ =~ /SHA1_ASM/){ $t="$_ "; }
688 elsif ($_ =~ /RMD160_ASM/){ $t="$_ "; }
689 else { $t="$location${o}$_$pf "; }
690
691 $Vars{$var}.="$t ";
692 $ret.=$t;
693 }
694 chop($ret);
695 $ret.="\n\n";
696 return($ret);
697 }
698
699# return the name with the leading path removed
700sub bname
701 {
702 local($ret)=@_;
703 $ret =~ s/^.*[\\\/]([^\\\/]+)$/$1/;
704 return($ret);
705 }
706
707# do a rule for each file that says 'copy' to new direcory on change
708sub do_copy_rule
709 {
710 local($to,$files,$p)=@_;
711 local($ret,$_,$n,$pp);
712
713 $files =~ s/\//$o/g if $o ne '/';
714 foreach (split(/\s+/,$files))
715 {
716 $n=&bname($_);
717 if ($n =~ /bss_file/)
718 { $pp=".c"; }
719 else { $pp=$p; }
720 $ret.="$to${o}$n$pp: \$(SRC_D)$o$_$pp\n\t\$(CP) \$(SRC_D)$o$_$pp $to${o}$n$pp\n\n";
721 }
722 return($ret);
723 }
724
725##############################################################
726# do a rule for each file that says 'compile' to new direcory
727# compile the files in '$files' into $to
728sub do_compile_rule
729 {
730 local($to,$files,$ex)=@_;
731 local($ret,$_,$n);
732
733 $files =~ s/\//$o/g if $o ne '/';
734 foreach (split(/\s+/,$files))
735 {
736 $n=&bname($_);
737 $ret.=&cc_compile_target("$to${o}$n$obj","${_}.c",$ex)
738 }
739 return($ret);
740 }
741
742##############################################################
743# do a rule for each file that says 'compile' to new direcory
744sub cc_compile_target
745 {
746 local($target,$source,$ex_flags)=@_;
747 local($ret);
748
749 # EAY EAY
750 $ex_flags.=' -DCFLAGS="\"$(CC) $(CFLAG)\""' if ($source =~ /cversion/);
751 $target =~ s/\//$o/g if $o ne "/";
752 $source =~ s/\//$o/g if $o ne "/";
753 $ret ="$target: \$(SRC_D)$o$source\n\t";
754 $ret.="\$(CC) ${ofile}$target $ex_flags -c \$(SRC_D)$o$source\n\n";
755 return($ret);
756 }
757
758##############################################################
759sub do_asm_rule
760 {
761 local($target,$src)=@_;
762 local($ret,@s,@t,$i);
763
764 $target =~ s/\//$o/g if $o ne "/";
765 $src =~ s/\//$o/g if $o ne "/";
766
767 @s=split(/\s+/,$src);
768 @t=split(/\s+/,$target);
769
770 for ($i=0; $i<=$#s; $i++)
771 {
772 $ret.="$t[$i]: $s[$i]\n";
773 $ret.="\t\$(ASM) $afile$t[$i] \$(SRC_D)$o$s[$i]\n\n";
774 }
775 return($ret);
776 }
777
778sub do_shlib_rule
779 {
780 local($n,$def)=@_;
781 local($ret,$nn);
782 local($t);
783
784 ($nn=$n) =~ tr/a-z/A-Z/;
785 $ret.="$n.dll: \$(${nn}OBJ)\n";
786 if ($vc && $w32)
787 {
788 $ret.="\t\$(MKSHLIB) $efile$n.dll $def @<<\n \$(${nn}OBJ_F)\n<<\n";
789 }
790 $ret.="\n";
791 return($ret);
792 }
793
diff --git a/src/lib/libcrypto/util/mkcerts.sh b/src/lib/libcrypto/util/mkcerts.sh
new file mode 100644
index 0000000000..5f8a1dae73
--- /dev/null
+++ b/src/lib/libcrypto/util/mkcerts.sh
@@ -0,0 +1,220 @@
1#!bin/sh
2
3# This script will re-make all the required certs.
4# cd apps
5# sh ../util/mkcerts.sh
6# mv ca-cert.pem pca-cert.pem ../certs
7# cd ..
8# cat certs/*.pem >>apps/server.pem
9# cat certs/*.pem >>apps/server2.pem
10# SSLEAY=`pwd`/apps/ssleay; export SSLEAY
11# sh tools/c_rehash certs
12#
13
14CAbits=1024
15SSLEAY="../apps/ssleay"
16CONF="-config ../apps/ssleay.cnf"
17
18# create pca request.
19echo creating $CAbits bit PCA cert request
20$SSLEAY req $CONF \
21 -new -md5 -newkey $CAbits \
22 -keyout pca-key.pem \
23 -out pca-req.pem -nodes >/dev/null <<EOF
24AU
25Queensland
26.
27CryptSoft Pty Ltd
28.
29Test PCA (1024 bit)
30
31
32
33EOF
34
35if [ $? != 0 ]; then
36 echo problems generating PCA request
37 exit 1
38fi
39
40#sign it.
41echo
42echo self signing PCA
43$SSLEAY x509 -md5 -days 1461 \
44 -req -signkey pca-key.pem \
45 -CAcreateserial -CAserial pca-cert.srl \
46 -in pca-req.pem -out pca-cert.pem
47
48if [ $? != 0 ]; then
49 echo problems self signing PCA cert
50 exit 1
51fi
52echo
53
54# create ca request.
55echo creating $CAbits bit CA cert request
56$SSLEAY req $CONF \
57 -new -md5 -newkey $CAbits \
58 -keyout ca-key.pem \
59 -out ca-req.pem -nodes >/dev/null <<EOF
60AU
61Queensland
62.
63CryptSoft Pty Ltd
64.
65Test CA (1024 bit)
66
67
68
69EOF
70
71if [ $? != 0 ]; then
72 echo problems generating CA request
73 exit 1
74fi
75
76#sign it.
77echo
78echo signing CA
79$SSLEAY x509 -md5 -days 1461 \
80 -req \
81 -CAcreateserial -CAserial pca-cert.srl \
82 -CA pca-cert.pem -CAkey pca-key.pem \
83 -in ca-req.pem -out ca-cert.pem
84
85if [ $? != 0 ]; then
86 echo problems signing CA cert
87 exit 1
88fi
89echo
90
91# create server request.
92echo creating 512 bit server cert request
93$SSLEAY req $CONF \
94 -new -md5 -newkey 512 \
95 -keyout s512-key.pem \
96 -out s512-req.pem -nodes >/dev/null <<EOF
97AU
98Queensland
99.
100CryptSoft Pty Ltd
101.
102Server test cert (512 bit)
103
104
105
106EOF
107
108if [ $? != 0 ]; then
109 echo problems generating 512 bit server cert request
110 exit 1
111fi
112
113#sign it.
114echo
115echo signing 512 bit server cert
116$SSLEAY x509 -md5 -days 365 \
117 -req \
118 -CAcreateserial -CAserial ca-cert.srl \
119 -CA ca-cert.pem -CAkey ca-key.pem \
120 -in s512-req.pem -out server.pem
121
122if [ $? != 0 ]; then
123 echo problems signing 512 bit server cert
124 exit 1
125fi
126echo
127
128# create 1024 bit server request.
129echo creating 1024 bit server cert request
130$SSLEAY req $CONF \
131 -new -md5 -newkey 1024 \
132 -keyout s1024key.pem \
133 -out s1024req.pem -nodes >/dev/null <<EOF
134AU
135Queensland
136.
137CryptSoft Pty Ltd
138.
139Server test cert (1024 bit)
140
141
142
143EOF
144
145if [ $? != 0 ]; then
146 echo problems generating 1024 bit server cert request
147 exit 1
148fi
149
150#sign it.
151echo
152echo signing 1024 bit server cert
153$SSLEAY x509 -md5 -days 365 \
154 -req \
155 -CAcreateserial -CAserial ca-cert.srl \
156 -CA ca-cert.pem -CAkey ca-key.pem \
157 -in s1024req.pem -out server2.pem
158
159if [ $? != 0 ]; then
160 echo problems signing 1024 bit server cert
161 exit 1
162fi
163echo
164
165# create 512 bit client request.
166echo creating 512 bit client cert request
167$SSLEAY req $CONF \
168 -new -md5 -newkey 512 \
169 -keyout c512-key.pem \
170 -out c512-req.pem -nodes >/dev/null <<EOF
171AU
172Queensland
173.
174CryptSoft Pty Ltd
175.
176Client test cert (512 bit)
177
178
179
180EOF
181
182if [ $? != 0 ]; then
183 echo problems generating 512 bit client cert request
184 exit 1
185fi
186
187#sign it.
188echo
189echo signing 512 bit client cert
190$SSLEAY x509 -md5 -days 365 \
191 -req \
192 -CAcreateserial -CAserial ca-cert.srl \
193 -CA ca-cert.pem -CAkey ca-key.pem \
194 -in c512-req.pem -out client.pem
195
196if [ $? != 0 ]; then
197 echo problems signing 512 bit client cert
198 exit 1
199fi
200
201echo cleanup
202
203cat pca-key.pem >> pca-cert.pem
204cat ca-key.pem >> ca-cert.pem
205cat s512-key.pem >> server.pem
206cat s1024key.pem >> server2.pem
207cat c512-key.pem >> client.pem
208
209for i in pca-cert.pem ca-cert.pem server.pem server2.pem client.pem
210do
211$SSLEAY x509 -issuer -subject -in $i -noout >$$
212cat $$
213/bin/cat $i >>$$
214/bin/mv $$ $i
215done
216
217#/bin/rm -f *key.pem *req.pem *.srl
218
219echo Finished
220
diff --git a/src/lib/libcrypto/util/mkdef.pl b/src/lib/libcrypto/util/mkdef.pl
new file mode 100644
index 0000000000..8124f11292
--- /dev/null
+++ b/src/lib/libcrypto/util/mkdef.pl
@@ -0,0 +1,292 @@
1#!/usr/bin/perl
2#
3# generate a .def file
4#
5# It does this by parsing the header files and looking for the
6# non-prototyped functions.
7#
8
9$crypto_num="util/libeay.num";
10$ssl_num= "util/ssleay.num";
11
12$NT=1;
13foreach (@ARGV)
14 {
15 $NT=1 if $_ eq "32";
16 $NT=0 if $_ eq "16";
17 $do_ssl=1 if $_ eq "ssleay";
18 $do_crypto=1 if $_ eq "libeay";
19 }
20
21if (!$do_ssl && !$do_crypto)
22 {
23 print STDERR "usage: $0 ( ssl | crypto ) [ 16 | 32 ]\n";
24 exit(1);
25 }
26
27%ssl_list=&load_numbers($ssl_num);
28%crypto_list=&load_numbers($crypto_num);
29
30$ssl="ssl/ssl.h";
31
32$crypto ="crypto/crypto.h";
33$crypto.=" crypto/des/des.h";
34$crypto.=" crypto/idea/idea.h";
35$crypto.=" crypto/rc4/rc4.h";
36$crypto.=" crypto/rc5/rc5.h";
37$crypto.=" crypto/rc2/rc2.h";
38$crypto.=" crypto/bf/blowfish.h";
39$crypto.=" crypto/cast/cast.h";
40$crypto.=" crypto/md2/md2.h";
41$crypto.=" crypto/md5/md5.h";
42$crypto.=" crypto/mdc2/mdc2.h";
43$crypto.=" crypto/sha/sha.h";
44$crypto.=" crypto/ripemd/ripemd.h";
45
46$crypto.=" crypto/bn/bn.h";
47$crypto.=" crypto/rsa/rsa.h";
48$crypto.=" crypto/dsa/dsa.h";
49$crypto.=" crypto/dh/dh.h";
50
51$crypto.=" crypto/stack/stack.h";
52$crypto.=" crypto/buffer/buffer.h";
53$crypto.=" crypto/bio/bio.h";
54$crypto.=" crypto/lhash/lhash.h";
55$crypto.=" crypto/conf/conf.h";
56$crypto.=" crypto/txt_db/txt_db.h";
57
58$crypto.=" crypto/evp/evp.h";
59$crypto.=" crypto/objects/objects.h";
60$crypto.=" crypto/pem/pem.h";
61#$crypto.=" crypto/meth/meth.h";
62$crypto.=" crypto/asn1/asn1.h";
63$crypto.=" crypto/asn1/asn1_mac.h";
64$crypto.=" crypto/err/err.h";
65$crypto.=" crypto/pkcs7/pkcs7.h";
66$crypto.=" crypto/x509/x509.h";
67$crypto.=" crypto/x509/x509_vfy.h";
68$crypto.=" crypto/rand/rand.h";
69$crypto.=" crypto/hmac/hmac.h";
70
71$match{'NOPROTO'}=1;
72$match2{'PERL5'}=1;
73
74&print_def_file(*STDOUT,"SSLEAY",*ssl_list,&do_defs("SSLEAY",$ssl))
75 if $do_ssl == 1;
76
77&print_def_file(*STDOUT,"LIBEAY",*crypto_list,&do_defs("LIBEAY",$crypto))
78 if $do_crypto == 1;
79
80sub do_defs
81 {
82 local($name,$files)=@_;
83 local(@ret);
84
85 $off=-1;
86 foreach $file (split(/\s+/,$files))
87 {
88# print STDERR "reading $file\n";
89 open(IN,"<$file") || die "unable to open $file:$!\n";
90 $depth=0;
91 $pr=-1;
92 @np="";
93 $/=undef;
94 $a=<IN>;
95 while (($i=index($a,"/*")) >= 0)
96 {
97 $j=index($a,"*/");
98 break unless ($j >= 0);
99 $a=substr($a,0,$i).substr($a,$j+2);
100 # print "$i $j\n";
101 }
102 foreach (split("\n",$a))
103 {
104 if (/^\#\s*ifndef (.*)/)
105 {
106 push(@tag,$1);
107 $tag{$1}=-1;
108 next;
109 }
110 elsif (/^\#\s*if !defined\(([^\)]+)\)/)
111 {
112 push(@tag,$1);
113 $tag{$1}=-1;
114 next;
115 }
116 elsif (/^\#\s*ifdef (.*)/)
117 {
118 push(@tag,$1);
119 $tag{$1}=1;
120 next;
121 }
122 elsif (/^\#\s*if defined(.*)/)
123 {
124 push(@tag,$1);
125 $tag{$1}=1;
126 next;
127 }
128 elsif (/^\#\s*endif/)
129 {
130 $tag{$tag[$#tag]}=0;
131 pop(@tag);
132 next;
133 }
134 elsif (/^\#\s*else/)
135 {
136 $t=$tag[$#tag];
137 $tag{$t}= -$tag{$t};
138 next;
139 }
140#printf STDERR "$_\n%2d %2d %2d %2d %2d $NT\n",
141#$tag{'NOPROTO'},$tag{'FreeBSD'},$tag{'WIN16'},$tag{'PERL5'},$tag{'NO_FP_API'};
142
143 $t=undef;
144 if (/^extern .*;$/)
145 { $t=&do_extern($name,$_); }
146 elsif ( ($tag{'NOPROTO'} == 1) &&
147 ($tag{'FreeBSD'} != 1) &&
148 (($NT && ($tag{'WIN16'} != 1)) ||
149 (!$NT && ($tag{'WIN16'} != -1))) &&
150 ($tag{'PERL5'} != 1) &&
151# ($tag{'_WINDLL'} != -1) &&
152 ((!$NT && $tag{'_WINDLL'} != -1) ||
153 ($NT && $tag{'_WINDLL'} != 1)) &&
154 ((($tag{'NO_FP_API'} != 1) && $NT) ||
155 (($tag{'NO_FP_API'} != -1) && !$NT)))
156 { $t=&do_line($name,$_); }
157 else
158 { $t=undef; }
159 if (($t ne undef) && (!$done{$name,$t}))
160 {
161 $done{$name,$t}++;
162 push(@ret,$t);
163#printf STDERR "one:$t\n" if $t =~ /BIO_/;
164 }
165 }
166 close(IN);
167 }
168 return(@ret);
169 }
170
171sub do_line
172 {
173 local($file,$_)=@_;
174 local($n);
175
176 return(undef) if /^$/;
177 return(undef) if /^\s/;
178#printf STDERR "two:$_\n" if $_ =~ /BIO_/;
179 if (/(CRYPTO_get_locking_callback)/)
180 { return($1); }
181 elsif (/(CRYPTO_get_id_callback)/)
182 { return($1); }
183 elsif (/(CRYPTO_get_add_lock_callback)/)
184 { return($1); }
185 elsif (/(SSL_CTX_get_verify_callback)/)
186 { return($1); }
187 elsif (/(SSL_get_info_callback)/)
188 { return($1); }
189 elsif ((!$NT) && /(ERR_load_CRYPTO_strings)/)
190 { return("ERR_load_CRYPTOlib_strings"); }
191 elsif (!$NT && /BIO_s_file/)
192 { return(undef); }
193 elsif (!$NT && /BIO_new_file/)
194 { return(undef); }
195 elsif (!$NT && /BIO_new_fp/)
196 { return(undef); }
197 elsif ($NT && /BIO_s_file_internal/)
198 { return(undef); }
199 elsif ($NT && /BIO_new_file_internal/)
200 { return(undef); }
201 elsif ($NT && /BIO_new_fp_internal/)
202 { return(undef); }
203 else
204 {
205 /\s\**(\S+)\s*\(/;
206 return($1);
207 }
208 }
209
210sub do_extern
211 {
212 local($file,$_)=@_;
213 local($n);
214
215 /\s\**(\S+);$/;
216 return($1);
217 }
218
219sub print_def_file
220 {
221 local(*OUT,$name,*nums,@functions)=@_;
222 local($n)=1;
223
224 if ($NT)
225 { $name.="32"; }
226 else
227 { $name.="16"; }
228
229 print OUT <<"EOF";
230;
231; Definition file for the DDL version of the $name library from SSLeay
232;
233
234LIBRARY $name
235
236DESCRIPTION 'SSLeay $name - eay\@cryptsoft.com'
237
238EOF
239
240 if (!$NT)
241 {
242 print <<"EOF";
243CODE PRELOAD MOVEABLE
244DATA PRELOAD MOVEABLE SINGLE
245
246EXETYPE WINDOWS
247
248HEAPSIZE 4096
249STACKSIZE 8192
250
251EOF
252 }
253
254 print "EXPORTS\n";
255
256
257 (@e)=grep(/^SSLeay/,@functions);
258 (@r)=grep(!/^SSLeay/,@functions);
259 @functions=((sort @e),(sort @r));
260
261 foreach $func (@functions)
262 {
263 if (!defined($nums{$func}))
264 {
265 printf STDERR "$func does not have a number assigned\n";
266 }
267 else
268 {
269 $n=$nums{$func};
270 printf OUT " %s%-35s@%d\n",($NT)?"":"_",$func,$n;
271 }
272 }
273 printf OUT "\n";
274 }
275
276sub load_numbers
277 {
278 local($name)=@_;
279 local($j,@a,%ret);
280
281 open(IN,"<$name") || die "unable to open $name:$!\n";
282 while (<IN>)
283 {
284 chop;
285 s/#.*$//;
286 next if /^\s*$/;
287 @a=split;
288 $ret{$a[0]}=$a[1];
289 }
290 close(IN);
291 return(%ret);
292 }
diff --git a/src/lib/libcrypto/util/perlpath.pl b/src/lib/libcrypto/util/perlpath.pl
new file mode 100644
index 0000000000..9e57e10ad4
--- /dev/null
+++ b/src/lib/libcrypto/util/perlpath.pl
@@ -0,0 +1,30 @@
1#!/usr/bin/perl
2#
3# modify the '#!/usr/local/bin/perl'
4# line in all scripts that rely on perl.
5#
6
7require "find.pl";
8
9$#ARGV == 0 || print STDERR "usage: perlpath newpath (eg /usr/bin)\n";
10&find(".");
11
12sub wanted
13 {
14 return unless /\.pl$/ || /^[Cc]onfigur/;
15
16 open(IN,"<$_") || die "unable to open $dir/$_:$!\n";
17 @a=<IN>;
18 close(IN);
19
20 $a[0]="#!$ARGV[0]/perl\n";
21
22 # Playing it safe...
23 $new="$_.new";
24 open(OUT,">$new") || die "unable to open $dir/$new:$!\n";
25 print OUT @a;
26 close(OUT);
27
28 rename($new,$_) || die "unable to rename $dir/$new:$!\n";
29 chmod(0755,$_) || die "unable to chmod $dir/$new:$!\n";
30 }
diff --git a/src/lib/libcrypto/util/pl/BC-16.pl b/src/lib/libcrypto/util/pl/BC-16.pl
new file mode 100644
index 0000000000..7c3fdb68f4
--- /dev/null
+++ b/src/lib/libcrypto/util/pl/BC-16.pl
@@ -0,0 +1,146 @@
1#!/usr/bin/perl
2# VCw16lib.pl - the file for Visual C++ 1.52b for windows, static libraries
3#
4
5$o='\\';
6$cp='copy';
7$rm='del';
8
9# C compiler stuff
10$cc='bcc';
11
12if ($debug)
13 { $op="-v "; }
14else { $op="-O "; }
15
16$cflags="-d -ml $op -DL_ENDIAN";
17# I add the stack opt
18$base_lflags="/c /C";
19$lflags="$base_lflags";
20
21if ($win16)
22 {
23 $shlib=1;
24 $cflags.=" -DWINDOWS -DWIN16";
25 $app_cflag="-W";
26 $lib_cflag="-WD";
27 $lflags.="/Twe";
28 }
29else
30 {
31 $cflags.=" -DMSDOS";
32 $lflags.=" /Tde";
33 }
34
35if ($shlib)
36 {
37 $mlflags=" /Twd $base_lflags"; # stack if defined in .def file
38 $libs="libw ldllcew";
39 $no_asm=1;
40 }
41else
42 { $mlflags=''; }
43
44$obj='.obj';
45$ofile="-o";
46
47# EXE linking stuff
48$link="tlink";
49$efile="";
50$exep='.exe';
51$ex_libs="CL";
52$ex_libs.=$no_sock?"":" winsock.lib";
53
54$app_ex_obj="C0L.obj ";
55$shlib_ex_obj="" if ($shlib);
56
57# static library stuff
58$mklib='tlib';
59$ranlib='echo no ranlib';
60$plib="";
61$libp=".lib";
62$shlibp=($shlib)?".dll":".lib";
63$lfile='';
64
65$asm='bcc -c -B -Tml';
66$afile='/o';
67if ($no_asm)
68 {
69 $bn_mulw_obj='';
70 $bn_mulw_src='';
71 }
72elsif ($asmbits == 32)
73 {
74 $bn_mulw_obj='crypto\bn\asm\x86w32.obj';
75 $bn_mulw_src='crypto\bn\asm\x86w32.asm';
76 }
77else
78 {
79 $bn_mulw_obj='crypto\bn\asm\x86w16.obj';
80 $bn_mulw_src='crypto\bn\asm\x86w16.asm';
81 }
82
83sub do_lib_rule
84 {
85 local($target,$name,$shlib)=@_;
86 local($ret,$Name);
87
88 $taget =~ s/\//$o/g if $o ne '/';
89 ($Name=$name) =~ tr/a-z/A-Z/;
90
91 $ret.="$target: \$(${Name}OBJ)\n";
92 $ret.="\t\$(RM) \$(O_$Name)\n";
93
94 # Due to a pathetic line length limit, I unwrap the args.
95 local($lib_names)="";
96 local($dll_names)="";
97 foreach $_ (sort split(/\s+/,$Vars{"${Name}OBJ"}))
98 {
99 $lib_names.=" +$_ &\n";
100 $dll_names.=" $_\n";
101 }
102
103 if (!$shlib)
104 {
105 $ret.="\t\$(MKLIB) $target & <<|\n$lib_names\n,\n|\n";
106 }
107 else
108 {
109 local($ex)=($Name eq "SSL")?' $(L_CRYPTO) winsock':"";
110 $ret.="\t\$(LINK) \$(MLFLAGS) @&&|\n";
111 $ret.=$dll_names;
112 $ret.="\n $target\n\n $ex $libs\nms$o${name}16.def;\n|\n";
113 ($out_lib=$target) =~ s/O_/L_/;
114 $ret.="\timplib /nowep $out_lib $target\n\n";
115 }
116 $ret.="\n";
117 return($ret);
118 }
119
120sub do_link_rule
121 {
122 local($target,$files,$dep_libs,$libs)=@_;
123 local($ret,$f,$_,@f);
124
125 $file =~ s/\//$o/g if $o ne '/';
126 $n=&bname($targer);
127 $ret.="$target: $files $dep_libs\n";
128 $ret.=" \$(LINK) @&&|";
129
130 # Due to a pathetic line length limit, I have to unwrap the args.
131 $ret.=" \$(LFLAGS) ";
132 if ($files =~ /\(([^)]*)\)$/)
133 {
134 $ret.=" \$(APP_EX_OBJ)";
135 foreach $_ (sort split(/\s+/,$Vars{$1}))
136 { $ret.="\n $r $_ +"; }
137 chop($ret);
138 $ret.="\n";
139 }
140 else
141 { $ret.="\n $r \$(APP_EX_OBJ) $files\n"; }
142 $ret.=" $target\n\n $libs\n\n|\n\n";
143 return($ret);
144 }
145
1461;
diff --git a/src/lib/libcrypto/util/pl/BC-32.pl b/src/lib/libcrypto/util/pl/BC-32.pl
new file mode 100644
index 0000000000..3898d16f61
--- /dev/null
+++ b/src/lib/libcrypto/util/pl/BC-32.pl
@@ -0,0 +1,135 @@
1#!/usr/bin/perl
2# VCw16lib.pl - the file for Visual C++ 1.52b for windows, static libraries
3#
4
5$o='\\';
6$cp='copy';
7$rm='del';
8
9# C compiler stuff
10$cc='bcc32';
11
12if ($debug)
13 { $op="-v "; }
14else { $op="-O "; }
15
16$cflags="-d $op -DL_ENDIAN ";
17# I add the stack opt
18$base_lflags="-c";
19$lflags="$base_lflags";
20
21$cflags.=" -DWINDOWS -DWIN32";
22$app_cflag="-WC";
23$lib_cflag="-WC";
24$lflags.=" -Tpe";
25
26if ($shlib)
27 {
28 $mlflags="$base_lflags -Tpe"; # stack if defined in .def file
29 $libs="libw ldllcew";
30 }
31else
32 { $mlflags=''; }
33
34$obj='.obj';
35$ofile="-o";
36
37# EXE linking stuff
38$link="tlink32";
39$efile="";
40$exep='.exe';
41$ex_libs="CW32.LIB IMPORT32.LIB";
42$ex_libs.=$no_sock?"":" wsock32.lib";
43$shlib_ex_obj="" if $shlib;
44$app_ex_obj="C0X32.OBJ";
45
46# static library stuff
47$mklib='tlib';
48$ranlib='';
49$plib="";
50$libp=".lib";
51$shlibp=($shlib)?".dll":".lib";
52$lfile='';
53
54$asm='ml /Cp /c /Cx';
55$afile='/Fo';
56if ($noasm)
57 {
58 $bn_mulw_obj='';
59 $bn_mulw_src='';
60 }
61else
62 {
63 $bn_mulw_obj='crypto\bn\asm\x86b32.obj';
64 $bn_mulw_src='crypto\bn\asm\x86m32.asm';
65 }
66
67sub do_lib_rule
68 {
69 local($target,$name,$shlib)=@_;
70 local($ret,$Name);
71
72 $taget =~ s/\//$o/g if $o ne '/';
73 ($Name=$name) =~ tr/a-z/A-Z/;
74
75 $ret.="$target: \$(${Name}OBJ)\n";
76 $ret.="\t\$(RM) \$(O_$Name)\n";
77
78 # Due to a pathetic line length limit, I unwrap the args.
79 local($lib_names)="";
80 local($dll_names)="";
81 foreach $_ (sort split(/\s+/,$Vars{"${Name}OBJ"}))
82 {
83 $lib_names.=" +$_ &\n";
84 $dll_names.=" $_\n";
85 }
86
87 if (!$shlib)
88 {
89 $ret.="\t\$(MKLIB) $target & <<|\n$lib_names\n,\n|\n";
90 }
91 else
92 {
93 # $(SHLIB_EX_OBJ)
94 local($ex)=($Name eq "SSL")?' $(L_CRYPTO) winsock':"";
95 $ret.="\t\$(LINK) \$(MLFLAGS) @&&|\n";
96 $ret.=$dll_names;
97 $ret.="\n $target\n\n $ex $libs\nms$o${name}16.def;\n|\n";
98 ($out_lib=$target) =~ s/O_/L_/;
99 $ret.="\timplib /nowep $out_lib $target\n\n";
100 }
101 $ret.="\n";
102 return($ret);
103 }
104
105sub do_link_rule
106 {
107 local($target,$files,$dep_libs,$libs)=@_;
108 local($ret,$f,$_,@f);
109
110 $file =~ s/\//$o/g if $o ne '/';
111 $n=&bname($targer);
112 $ret.="$target: $files $dep_libs\n";
113 $ret.=" \$(LINK) @&&|";
114
115 # Due to a pathetic line length limit, I have to unwrap the args.
116 $r=" \$(LFLAGS) ";
117 if ($files =~ /\(([^)]*)\)$/)
118 {
119 @a=('$(APP_EX_OBJ)');
120 push(@a,sort split(/\s+/,$Vars{$1}));
121 foreach $_ (@a)
122 {
123 $ret.="\n $r $_ +";
124 $r="";
125 }
126 chop($ret);
127 $ret.="\n";
128 }
129 else
130 { $ret.="\n $r \$(APP_EX_OBJ) $files\n"; }
131 $ret.=" $target\n\n $libs\n\n|\n\n";
132 return($ret);
133 }
134
1351;
diff --git a/src/lib/libcrypto/util/pl/VC-16.pl b/src/lib/libcrypto/util/pl/VC-16.pl
new file mode 100644
index 0000000000..a6e6c0241c
--- /dev/null
+++ b/src/lib/libcrypto/util/pl/VC-16.pl
@@ -0,0 +1,173 @@
1#!/usr/bin/perl
2# VCw16lib.pl - the file for Visual C++ 1.52b for windows, static libraries
3#
4
5$ssl= "ssleay16";
6$crypto="libeay16";
7$RSAref="RSAref16";
8
9$o='\\';
10$cp='copy';
11$rm='del';
12
13# C compiler stuff
14$cc='cl';
15
16$out_def="out16";
17$tmp_def="tmp16";
18$inc_def="inc16";
19
20if ($debug)
21 {
22 $op="/Od /Zi /Zd";
23 $base_lflags="/CO";
24 }
25else {
26 $op="/G2 /f- /Ocgnotb2";
27 }
28$base_lflags.=" /FARCALL /NOLOGO /NOD /SEG:1024 /ONERROR:NOEXE /NOE /PACKC:60000";
29if ($win16) { $base_lflags.=" /PACKD:60000"; }
30
31$cflags="/ALw /Gx- /Gt256 /Gf $op /W3 /WX -DL_ENDIAN /nologo";
32# I add the stack opt
33$lflags="$base_lflags /STACK:20000";
34
35if ($win16)
36 {
37 $cflags.=" -DWINDOWS -DWIN16";
38 $app_cflag="/Gw /FPi87";
39 $lib_cflag="/Gw";
40 $lib_cflag.=" -D_WINDLL -D_DLL" if $shlib;
41 $lib_cflag.=" -DWIN16TTY" if !$shlib;
42 $lflags.=" /ALIGN:256";
43 $ex_libs.="oldnames llibcewq libw";
44 }
45else
46 {
47 $no_sock=1;
48 $cflags.=" -DMSDOS";
49 $lflags.=" /EXEPACK";
50 $ex_libs.="oldnames.lib llibce.lib";
51 }
52
53if ($shlib)
54 {
55 $mlflags="$base_lflags";
56 $libs="oldnames ldllcew libw";
57 $shlib_ex_obj="";
58# $no_asm=1;
59 $out_def="out16dll";
60 $tmp_def="tmp16dll";
61 }
62else
63 { $mlflags=''; }
64
65$app_ex_obj="setargv.obj";
66
67$obj='.obj';
68$ofile="/Fo";
69
70# EXE linking stuff
71$link="link";
72$efile="";
73$exep='.exe';
74$ex_libs.=$no_sock?"":" winsock";
75
76# static library stuff
77$mklib='lib /PAGESIZE:1024';
78$ranlib='';
79$plib="";
80$libp=".lib";
81$shlibp=($shlib)?".dll":".lib";
82$lfile='';
83
84$asm='ml /Cp /c /Cx';
85$afile='/Fo';
86
87$bn_mulw_obj='';
88$bn_mulw_src='';
89$des_enc_obj='';
90$des_enc_src='';
91$bf_enc_obj='';
92$bf_enc_src='';
93
94if (!$no_asm)
95 {
96 if ($asmbits == 32)
97 {
98 $bn_mulw_obj='crypto\bn\asm\x86w32.obj';
99 $bn_mulw_src='crypto\bn\asm\x86w32.asm';
100 }
101 else
102 {
103 $bn_mulw_obj='crypto\bn\asm\x86w16.obj';
104 $bn_mulw_src='crypto\bn\asm\x86w16.asm';
105 }
106 }
107
108sub do_lib_rule
109 {
110 local($objs,$target,$name,$shlib)=@_;
111 local($ret,$Name);
112
113 $taget =~ s/\//$o/g if $o ne '/';
114 ($Name=$name) =~ tr/a-z/A-Z/;
115
116# $target="\$(LIB_D)$o$target";
117 $ret.="$target: $objs\n";
118# $ret.="\t\$(RM) \$(O_$Name)\n";
119
120 # Due to a pathetic line length limit, I unwrap the args.
121 local($lib_names)="";
122 local($dll_names)=" \$(SHLIB_EX_OBJ) +\n";
123 ($obj)= ($objs =~ /\((.*)\)/);
124 foreach $_ (sort split(/\s+/,$Vars{$obj}))
125 {
126 $lib_names.="+$_ &\n";
127 $dll_names.=" $_ +\n";
128 }
129
130 if (!$shlib)
131 {
132 $ret.="\tdel $target\n";
133 $ret.="\t\$(MKLIB) @<<\n$target\ny\n$lib_names\n\n<<\n";
134 }
135 else
136 {
137 local($ex)=($target =~ /O_SSL/)?'$(L_CRYPTO)':"";
138 $ex.=' winsock';
139 $ret.="\t\$(LINK) \$(MLFLAGS) @<<\n";
140 $ret.=$dll_names;
141 $ret.="\n $target\n\n $ex $libs\nms$o${name}.def;\n<<\n";
142 ($out_lib=$target) =~ s/O_/L_/;
143 $ret.="\timplib /noignorecase /nowep $out_lib $target\n";
144 }
145 $ret.="\n";
146 return($ret);
147 }
148
149sub do_link_rule
150 {
151 local($target,$files,$dep_libs,$libs)=@_;
152 local($ret,$f,$_,@f);
153
154 $file =~ s/\//$o/g if $o ne '/';
155 $n=&bname($targer);
156 $ret.="$target: $files $dep_libs\n";
157 $ret.=" \$(LINK) \$(LFLAGS) @<<\n";
158
159 # Due to a pathetic line length limit, I have to unwrap the args.
160 if ($files =~ /\(([^)]*)\)$/)
161 {
162 @a=('$(APP_EX_OBJ)');
163 push(@a,sort split(/\s+/,$Vars{$1}));
164 for $_ (@a)
165 { $ret.=" $_ +\n"; }
166 }
167 else
168 { $ret.=" \$(APP_EX_OBJ) $files"; }
169 $ret.="\n $target\n\n $libs\n\n<<\n\n";
170 return($ret);
171 }
172
1731;
diff --git a/src/lib/libcrypto/util/pl/VC-32.pl b/src/lib/libcrypto/util/pl/VC-32.pl
new file mode 100644
index 0000000000..701e282c33
--- /dev/null
+++ b/src/lib/libcrypto/util/pl/VC-32.pl
@@ -0,0 +1,133 @@
1#!/usr/bin/perl
2# VCw32lib.pl - the file for Visual C++ 4.[01] for windows NT, static libraries
3#
4
5$ssl= "ssleay32";
6$crypto="libeay32";
7$RSAref="RSAref32";
8
9$o='\\';
10$cp='copy';
11$rm='del';
12
13# C compiler stuff
14$cc='cl';
15$cflags=' /MD /W3 /WX /G5 /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -DWIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN';
16$lflags="/nologo /subsystem:console /machine:I386 /opt:ref";
17$mlflags='';
18
19$out_def="out32";
20$tmp_def="tmp32";
21$inc_def="inc32";
22
23if ($debug)
24 {
25 $cflags=" /MDd /W3 /WX /Zi /Yd /Od /nologo -DWINDOWS -DWIN32 -D_DEBUG -DL_ENDIAN";
26 $lflags.=" /debug";
27 $mlflags.=' /debug';
28 }
29
30$obj='.obj';
31$ofile="/Fo";
32
33# EXE linking stuff
34$link="link";
35$efile="/out:";
36$exep='.exe';
37if ($no_sock)
38 { $ex_libs=""; }
39else { $ex_libs="wsock32.lib user32.lib gdi32.lib"; }
40
41# static library stuff
42$mklib='lib';
43$ranlib='';
44$plib="";
45$libp=".lib";
46$shlibp=($shlib)?".dll":".lib";
47$lfile='/out:';
48
49$shlib_ex_obj="";
50$app_ex_obj="setargv.obj";
51
52$asm='ml /Cp /coff /c /Cx';
53$asm.=" /Zi" if $debug;
54$afile='/Fo';
55
56$bn_mulw_obj='';
57$bn_mulw_src='';
58$des_enc_obj='';
59$des_enc_src='';
60$bf_enc_obj='';
61$bf_enc_src='';
62
63if (!$no_asm)
64 {
65 $bn_mulw_obj='crypto\bn\asm\bn-win32.obj';
66 $bn_mulw_src='crypto\bn\asm\bn-win32.asm';
67 $des_enc_obj='crypto\des\asm\d-win32.obj crypto\des\asm\y-win32.obj';
68 $des_enc_src='crypto\des\asm\d-win32.asm crypto\des\asm\y-win32.asm';
69 $bf_enc_obj='crypto\bf\asm\b-win32.obj';
70 $bf_enc_src='crypto\bf\asm\b-win32.asm';
71 $cast_enc_obj='crypto\cast\asm\c-win32.obj';
72 $cast_enc_src='crypto\cast\asm\c-win32.asm';
73 $rc4_enc_obj='crypto\rc4\asm\r4-win32.obj';
74 $rc4_enc_src='crypto\rc4\asm\r4-win32.asm';
75 $rc5_enc_obj='crypto\rc5\asm\r5-win32.obj';
76 $rc5_enc_src='crypto\rc5\asm\r5-win32.asm';
77 $md5_asm_obj='crypto\md5\asm\m5-win32.obj';
78 $md5_asm_src='crypto\md5\asm\m5-win32.asm';
79 $sha1_asm_obj='crypto\sha\asm\s1-win32.obj';
80 $sha1_asm_src='crypto\sha\asm\s1-win32.asm';
81 $rmd160_asm_obj='crypto\ripemd\asm\rm-win32.obj';
82 $rmd160_asm_src='crypto\ripemd\asm\rm-win32.asm';
83 $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DRMD160_ASM";
84 }
85
86if ($shlib)
87 {
88 $mlflags.=" $lflags /dll";
89# $cflags =~ s| /MD| /MT|;
90 $lib_cflag=" /GD -D_WINDLL -D_DLL";
91 $out_def="out32dll";
92 $tmp_def="tmp32dll";
93 }
94
95sub do_lib_rule
96 {
97 local($objs,$target,$name,$shlib)=@_;
98 local($ret,$Name);
99
100 $taget =~ s/\//$o/g if $o ne '/';
101 ($Name=$name) =~ tr/a-z/A-Z/;
102
103# $target="\$(LIB_D)$o$target";
104 $ret.="$target: $objs\n";
105 if (!$shlib)
106 {
107# $ret.="\t\$(RM) \$(O_$Name)\n";
108 $ret.="\t\$(MKLIB) $lfile$target @<<\n $objs\n<<\n";
109 }
110 else
111 {
112 local($ex)=($target =~ /O_SSL/)?' $(L_CRYPTO)':'';
113 $ex.=' wsock32.lib gdi32.lib';
114 $ret.="\t\$(LINK) \$(MLFLAGS) $efile$target /def:ms/${Name}.def @<<\n \$(SHLIB_EX_OBJ) $objs $ex\n<<\n";
115 }
116 $ret.="\n";
117 return($ret);
118 }
119
120sub do_link_rule
121 {
122 local($target,$files,$dep_libs,$libs)=@_;
123 local($ret,$_);
124
125 $file =~ s/\//$o/g if $o ne '/';
126 $n=&bname($targer);
127 $ret.="$target: $files $dep_libs\n";
128 $ret.=" \$(LINK) \$(LFLAGS) $efile$target @<<\n";
129 $ret.=" \$(APP_EX_OBJ) $files $libs\n<<\n\n";
130 return($ret);
131 }
132
1331;
diff --git a/src/lib/libcrypto/util/pl/linux.pl b/src/lib/libcrypto/util/pl/linux.pl
new file mode 100644
index 0000000000..2b13da1bfc
--- /dev/null
+++ b/src/lib/libcrypto/util/pl/linux.pl
@@ -0,0 +1,96 @@
1#!/usr/bin/perl
2#
3# linux.pl - the standard unix makefile stuff.
4#
5
6$o='/';
7$cp='/bin/cp';
8$rm='/bin/rm -f';
9
10# C compiler stuff
11
12$cc='gcc';
13if ($debug)
14 { $cflags="-g2 -ggdb -DREF_CHECK -DCRYPTO_MDEBUG"; }
15else
16 { $cflags="-O3 -fomit-frame-pointer"; }
17
18if (!$no_asm)
19 {
20 $bn_mulw_obj='$(OBJ_D)/bn86-elf.o';
21 $bn_mulw_src='crypto/bn/asm/bn86unix.cpp';
22 $des_enc_obj='$(OBJ_D)/dx86-elf.o $(OBJ_D)/yx86-elf.o';
23 $des_enc_src='crypto/des/asm/dx86unix.cpp crypto/des/asm/yx86unix.cpp';
24 $bf_enc_obj='$(OBJ_D)/bx86-elf.o';
25 $bf_enc_src='crypto/bf/asm/bx86unix.cpp';
26 $cast_enc_obj='$(OBJ_D)/cx86-elf.o';
27 $cast_enc_src='crypto/cast/asm/cx86unix.cpp';
28 $rc4_enc_obj='$(OBJ_D)/rx86-elf.o';
29 $rc4_enc_src='crypto/rc4/asm/rx86unix.cpp';
30 $md5_asm_obj='$(OBJ_D)/mx86-elf.o';
31 $md5_asm_src='crypto/md5/asm/mx86unix.cpp';
32 $sha1_asm_obj='$(OBJ_D)/sx86-elf.o';
33 $sha1_asm_src='crypto/sha/asm/sx86unix.cpp';
34 $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM";
35 }
36
37$cflags.=" -DTERMIO -DL_ENDIAN -m486 -Wall";
38
39if ($shlib)
40 {
41 $shl_cflag=" -DPIC -fpic";
42 $shlibp=".so.$ssl_version";
43 $so_shlibp=".so";
44 }
45
46sub do_shlib_rule
47 {
48 local($obj,$target,$name,$shlib,$so_name)=@_;
49 local($ret,$_,$Name);
50
51 $target =~ s/\//$o/g if $o ne '/';
52 ($Name=$name) =~ tr/a-z/A-Z/;
53
54 $ret.="\$(LIB_D)$o$target: \$(${Name}OBJ)\n";
55 $ret.="\t\$(RM) \$(LIB_D)$o$target\n";
56 $ret.="\tgcc \${CFLAGS} -shared -Wl,-soname,$target -o \$(LIB_D)$o$target \$(${Name}OBJ)\n";
57 ($t=$target) =~ s/(^.*)\/[^\/]*$/$1/;
58 if ($so_name ne "")
59 {
60 $ret.="\t\$(RM) \$(LIB_D)$o$so_name\n";
61 $ret.="\tln -s $target \$(LIB_D)$o$so_name\n\n";
62 }
63 }
64
65sub do_link_rule
66 {
67 local($target,$files,$dep_libs,$libs)=@_;
68 local($ret,$_);
69
70 $file =~ s/\//$o/g if $o ne '/';
71 $n=&bname($target);
72 $ret.="$target: $files $dep_libs\n";
73 $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n";
74 return($ret);
75 }
76
77sub do_asm_rule
78 {
79 local($target,$src)=@_;
80 local($ret,@s,@t,$i);
81
82 $target =~ s/\//$o/g if $o ne "/";
83 $src =~ s/\//$o/g if $o ne "/";
84
85 @s=split(/\s+/,$src);
86 @t=split(/\s+/,$target);
87
88 for ($i=0; $i<=$#s; $i++)
89 {
90 $ret.="$t[$i]: $s[$i]\n";
91 $ret.="\tgcc -E -DELF \$(SRC_D)$o$s[$i]|\$(AS) $afile$t[$i]\n\n";
92 }
93 return($ret);
94 }
95
961;
diff --git a/src/lib/libcrypto/util/pl/unix.pl b/src/lib/libcrypto/util/pl/unix.pl
new file mode 100644
index 0000000000..ab4978fd20
--- /dev/null
+++ b/src/lib/libcrypto/util/pl/unix.pl
@@ -0,0 +1,83 @@
1#!/usr/bin/perl
2#
3# unix.pl - the standard unix makefile stuff.
4#
5
6$o='/';
7$cp='/bin/cp';
8$rm='/bin/rm -f';
9
10# C compiler stuff
11
12if ($gcc)
13 {
14 $cc='gcc';
15 if ($debug)
16 { $cflags="-g2 -ggdb"; }
17 else
18 { $cflags="-O3 -fomit-frame-pointer"; }
19 }
20else
21 {
22 $cc='cc';
23 if ($debug)
24 { $cflags="-g"; }
25 else
26 { $cflags="-O"; }
27 }
28$obj='.o';
29$ofile='-o ';
30
31# EXE linking stuff
32$link='${CC}';
33$lflags='${CFLAGS}';
34$efile='-o ';
35$exep='';
36$ex_libs="";
37
38# static library stuff
39$mklib='ar r';
40$mlflags='';
41$ranlib='util/ranlib.sh';
42$plib='lib';
43$libp=".a";
44$shlibp=".a";
45$lfile='';
46
47$asm='as';
48$afile='-o ';
49$bn_mulw_obj="";
50$bn_mulw_src="";
51$des_enc_obj="";
52$des_enc_src="";
53$bf_enc_obj="";
54$bf_enc_src="";
55
56sub do_lib_rule
57 {
58 local($obj,$target,$name,$shlib)=@_;
59 local($ret,$_,$Name);
60
61 $target =~ s/\//$o/g if $o ne '/';
62 $target="\$(LIB_D)$o$target";
63 ($Name=$name) =~ tr/a-z/A-Z/;
64
65 $ret.="$target: \$(${Name}OBJ)\n";
66 $ret.="\t\$(RM) $target\n";
67 $ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n";
68 $ret.="\t\$(RANLIB) $target\n\n";
69 }
70
71sub do_link_rule
72 {
73 local($target,$files,$dep_libs,$libs)=@_;
74 local($ret,$_);
75
76 $file =~ s/\//$o/g if $o ne '/';
77 $n=&bname($target);
78 $ret.="$target: $files $dep_libs\n";
79 $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n";
80 return($ret);
81 }
82
831;
diff --git a/src/lib/libcrypto/util/point.sh b/src/lib/libcrypto/util/point.sh
new file mode 100644
index 0000000000..92c12e8282
--- /dev/null
+++ b/src/lib/libcrypto/util/point.sh
@@ -0,0 +1,4 @@
1#!/bin/sh
2
3/bin/rm -f $2
4ln -s $1 $2
diff --git a/src/lib/libcrypto/util/sp-diff.pl b/src/lib/libcrypto/util/sp-diff.pl
new file mode 100644
index 0000000000..2c88336858
--- /dev/null
+++ b/src/lib/libcrypto/util/sp-diff.pl
@@ -0,0 +1,80 @@
1#!/usr/bin/perl
2#
3# This file takes as input, the files that have been output from
4# ssleay speed.
5# It prints a table of the relative differences with %100 being 'no difference'
6#
7
8($#ARGV == 1) || die "$0 speedout1 speedout2\n";
9
10%one=&loadfile($ARGV[0]);
11%two=&loadfile($ARGV[1]);
12
13$line=0;
14foreach $a ("md2","md5","sha","sha1","rc4","des cfb","des cbc","des ede3",
15 "idea cfb","idea cbc","rc2 cfb","rc2 cbc","blowfish cbc","cast cbc")
16 {
17 if (defined($one{$a,8}) && defined($two{$a,8}))
18 {
19 print "type 8 byte% 64 byte% 256 byte% 1024 byte% 8192 byte%\n"
20 unless $line;
21 $line++;
22 printf "%-12s ",$a;
23 foreach $b (8,64,256,1024,8192)
24 {
25 $r=$two{$a,$b}/$one{$a,$b}*100;
26 printf "%12.2f",$r;
27 }
28 print "\n";
29 }
30 }
31
32foreach $a (
33 "rsa 512","rsa 1024","rsa 2048","rsa 4096",
34 "dsa 512","dsa 1024","dsa 2048",
35 )
36 {
37 if (defined($one{$a,1}) && defined($two{$a,1}))
38 {
39 $r1=($one{$a,1}/$two{$a,1})*100;
40 $r2=($one{$a,2}/$two{$a,2})*100;
41 printf "$a bits %% %6.2f %% %6.2f\n",$r1,$r2;
42 }
43 }
44
45sub loadfile
46 {
47 local($file)=@_;
48 local($_,%ret);
49
50 open(IN,"<$file") || die "unable to open '$file' for input\n";
51 $header=1;
52 while (<IN>)
53 {
54 $header=0 if /^[dr]sa/;
55 if (/^type/) { $header=0; next; }
56 next if $header;
57 chop;
58 @a=split;
59 if ($a[0] =~ /^[dr]sa$/)
60 {
61 ($n,$t1,$t2)=($_ =~ /^([dr]sa\s+\d+)\s+bits\s+([.\d]+)s\s+([.\d]+)/);
62 $ret{$n,1}=$t1;
63 $ret{$n,2}=$t2;
64 }
65 else
66 {
67 $n=join(' ',grep(/[^k]$/,@a));
68 @k=grep(s/k$//,@a);
69
70 $ret{$n, 8}=$k[0];
71 $ret{$n, 64}=$k[1];
72 $ret{$n, 256}=$k[2];
73 $ret{$n,1024}=$k[3];
74 $ret{$n,8192}=$k[4];
75 }
76 }
77 close(IN);
78 return(%ret);
79 }
80
diff --git a/src/lib/libcrypto/util/speed.sh b/src/lib/libcrypto/util/speed.sh
new file mode 100644
index 0000000000..f489706197
--- /dev/null
+++ b/src/lib/libcrypto/util/speed.sh
@@ -0,0 +1,39 @@
1#!/bin/sh
2
3#
4# This is a ugly script use, in conjuction with editing the 'b'
5# configuration in the $(TOP)/Configure script which will
6# output when finished a file called speed.log which is the
7# timings of SSLeay with various options turned on or off.
8#
9# from the $(TOP) directory
10# Edit Configure, modifying things to do with the b/bl-4c-2c etc
11# configurations.
12#
13
14make clean
15perl Configure b
16make
17apps/ssleay version -v -b -f >speed.1
18apps/ssleay speed >speed.1l
19
20perl Configure bl-4c-2c
21/bin/rm -f crypto/rc4/*.o crypto/bn/bn*.o crypto/md2/md2_dgst.o
22make
23apps/ssleay speed rc4 rsa md2 >speed.2l
24
25perl Configure bl-4c-ri
26/bin/rm -f crypto/rc4/rc4*.o
27make
28apps/ssleay speed rc4 >speed.3l
29
30perl Configure b2-is-ri-dp
31/bin/rm -f crypto/idea/i_*.o crypto/rc4/*.o crypto/des/ecb_enc.o crypto/bn/bn*.o
32apps/ssleay speed rsa rc4 idea des >speed.4l
33
34cat speed.1 >speed.log
35cat speed.1l >>speed.log
36perl util/sp-diff.pl speed.1l speed.2l >>speed.log
37perl util/sp-diff.pl speed.1l speed.3l >>speed.log
38perl util/sp-diff.pl speed.1l speed.4l >>speed.log
39
diff --git a/src/lib/libcrypto/util/src-dep.pl b/src/lib/libcrypto/util/src-dep.pl
new file mode 100644
index 0000000000..91242f7bb6
--- /dev/null
+++ b/src/lib/libcrypto/util/src-dep.pl
@@ -0,0 +1,147 @@
1#!/usr/bin/perl
2
3# we make up an array of
4# $file{function_name}=filename;
5# $unres{filename}="func1 func2 ...."
6$debug=1;
7#$nm_func="parse_linux";
8$nm_func="parse_solaris";
9
10foreach (@ARGV)
11 {
12 &$nm_func($_);
13 }
14
15foreach $file (sort keys %unres)
16 {
17 @a=split(/\s+/,$unres{$file});
18 %ff=();
19 foreach $func (@a)
20 {
21 $f=$file{$func};
22 $ff{$f}=1 if $f ne "";
23 }
24
25 foreach $a (keys %ff)
26 { $we_need{$file}.="$a "; }
27 }
28
29foreach $file (sort keys %we_need)
30 {
31# print " $file $we_need{$file}\n";
32 foreach $bit (split(/\s+/,$we_need{$file}))
33 { push(@final,&walk($bit)); }
34
35 foreach (@final) { $fin{$_}=1; }
36 @final="";
37 foreach (sort keys %fin)
38 { push(@final,$_); }
39
40 print "$file: @final\n";
41 }
42
43sub walk
44 {
45 local($f)=@_;
46 local(@a,%seen,@ret,$r);
47
48 @ret="";
49 $f =~ s/^\s+//;
50 $f =~ s/\s+$//;
51 return "" if ($f =~ "^\s*$");
52
53 return(split(/\s/,$done{$f})) if defined ($done{$f});
54
55 return if $in{$f} > 0;
56 $in{$f}++;
57 push(@ret,$f);
58 foreach $r (split(/\s+/,$we_need{$f}))
59 {
60 push(@ret,&walk($r));
61 }
62 $in{$f}--;
63 $done{$f}=join(" ",@ret);
64 return(@ret);
65 }
66
67sub parse_linux
68 {
69 local($name)=@_;
70
71 open(IN,"nm $name|") || die "unable to run 'nn $name':$!\n";
72 while (<IN>)
73 {
74 chop;
75 next if /^\s*$/;
76 if (/^[^[](.*):$/)
77 {
78 $file=$1;
79 $file="$1.c" if /\[(.*).o\]/;
80 print STDERR "$file\n";
81 $we_need{$file}=" ";
82 next;
83 }
84
85 @a=split(/\s*\|\s*/);
86 next unless $#a == 7;
87 next unless $a[4] eq "GLOB";
88 if ($a[6] eq "UNDEF")
89 {
90 $unres{$file}.=$a[7]." ";
91 }
92 else
93 {
94 if ($file{$a[7]} ne "")
95 {
96 print STDERR "duplicate definition of $a[7],\n$file{$a[7]} and $file \n";
97 }
98 else
99 {
100 $file{$a[7]}=$file;
101 }
102 }
103 }
104 close(IN);
105 }
106
107sub parse_solaris
108 {
109 local($name)=@_;
110
111 open(IN,"nm $name|") || die "unable to run 'nn $name':$!\n";
112 while (<IN>)
113 {
114 chop;
115 next if /^\s*$/;
116 if (/^(\S+):$/)
117 {
118 $file=$1;
119 #$file="$1.c" if $file =~ /^(.*).o$/;
120 print STDERR "$file\n";
121 $we_need{$file}=" ";
122 next;
123 }
124 @a=split(/\s*\|\s*/);
125 next unless $#a == 7;
126 next unless $a[4] eq "GLOB";
127 if ($a[6] eq "UNDEF")
128 {
129 $unres{$file}.=$a[7]." ";
130 print STDERR "$file needs $a[7]\n" if $debug;
131 }
132 else
133 {
134 if ($file{$a[7]} ne "")
135 {
136 print STDERR "duplicate definition of $a[7],\n$file{$a[7]} and $file \n";
137 }
138 else
139 {
140 $file{$a[7]}=$file;
141 print STDERR "$file has $a[7]\n" if $debug;
142 }
143 }
144 }
145 close(IN);
146 }
147
diff --git a/src/lib/libcrypto/util/ssleay.num b/src/lib/libcrypto/util/ssleay.num
new file mode 100644
index 0000000000..359fa15df1
--- /dev/null
+++ b/src/lib/libcrypto/util/ssleay.num
@@ -0,0 +1,156 @@
1ERR_load_SSL_strings 1
2SSL_CIPHER_description 2
3SSL_CTX_add_client_CA 3
4SSL_CTX_add_session 4
5SSL_CTX_check_private_key 5
6SSL_CTX_ctrl 6
7SSL_CTX_flush_sessions 7
8SSL_CTX_free 8
9SSL_CTX_get_client_CA_list 9
10SSL_CTX_get_verify_callback 10
11SSL_CTX_get_verify_mode 11
12SSL_CTX_new 12
13SSL_CTX_remove_session 13
14SSL_CTX_set_cert_verify_cb 14
15SSL_CTX_set_cipher_list 15
16SSL_CTX_set_client_CA_list 16
17SSL_CTX_set_default_passwd_cb 17
18SSL_CTX_set_ssl_version 19
19SSL_CTX_set_verify 21
20SSL_CTX_use_PrivateKey 22
21SSL_CTX_use_PrivateKey_ASN1 23
22SSL_CTX_use_PrivateKey_file 24
23SSL_CTX_use_RSAPrivateKey 25
24SSL_CTX_use_RSAPrivateKey_ASN1 26
25SSL_CTX_use_RSAPrivateKey_file 27
26SSL_CTX_use_certificate 28
27SSL_CTX_use_certificate_ASN1 29
28SSL_CTX_use_certificate_file 30
29SSL_SESSION_free 31
30SSL_SESSION_new 32
31SSL_SESSION_print 33
32SSL_SESSION_print_fp 34
33SSL_accept 35
34SSL_add_client_CA 36
35SSL_alert_desc_string 37
36SSL_alert_desc_string_long 38
37SSL_alert_type_string 39
38SSL_alert_type_string_long 40
39SSL_check_private_key 41
40SSL_clear 42
41SSL_connect 43
42SSL_copy_session_id 44
43SSL_ctrl 45
44SSL_dup 46
45SSL_dup_CA_list 47
46SSL_free 48
47SSL_get_certificate 49
48SSL_get_cipher_list 52
49SSL_get_ciphers 55
50SSL_get_client_CA_list 56
51SSL_get_default_timeout 57
52SSL_get_error 58
53SSL_get_fd 59
54SSL_get_peer_cert_chain 60
55SSL_get_peer_certificate 61
56SSL_get_rbio 63
57SSL_get_read_ahead 64
58SSL_get_shared_ciphers 65
59SSL_get_ssl_method 66
60SSL_get_verify_callback 69
61SSL_get_verify_mode 70
62SSL_get_version 71
63SSL_get_wbio 72
64SSL_load_client_CA_file 73
65SSL_load_error_strings 74
66SSL_new 75
67SSL_peek 76
68SSL_pending 77
69SSL_read 78
70SSL_renegotiate 79
71SSL_rstate_string 80
72SSL_rstate_string_long 81
73SSL_set_accept_state 82
74SSL_set_bio 83
75SSL_set_cipher_list 84
76SSL_set_client_CA_list 85
77SSL_set_connect_state 86
78SSL_set_fd 87
79SSL_set_read_ahead 88
80SSL_set_rfd 89
81SSL_set_session 90
82SSL_set_ssl_method 91
83SSL_set_verify 94
84SSL_set_wfd 95
85SSL_shutdown 96
86SSL_state_string 97
87SSL_state_string_long 98
88SSL_use_PrivateKey 99
89SSL_use_PrivateKey_ASN1 100
90SSL_use_PrivateKey_file 101
91SSL_use_RSAPrivateKey 102
92SSL_use_RSAPrivateKey_ASN1 103
93SSL_use_RSAPrivateKey_file 104
94SSL_use_certificate 105
95SSL_use_certificate_ASN1 106
96SSL_use_certificate_file 107
97SSL_write 108
98SSLeay_add_ssl_algorithms 109
99SSLv23_client_method 110
100SSLv23_method 111
101SSLv23_server_method 112
102SSLv2_client_method 113
103SSLv2_method 114
104SSLv2_server_method 115
105SSLv3_client_method 116
106SSLv3_method 117
107SSLv3_server_method 118
108d2i_SSL_SESSION 119
109i2d_SSL_SESSION 120
110BIO_f_ssl 121
111BIO_new_ssl 122
112BIO_proxy_ssl_copy_session_id 123
113BIO_ssl_copy_session_id 124
114SSL_do_handshake 125
115SSL_get_privatekey 126
116SSL_get_current_cipher 127
117SSL_CIPHER_get_bits 128
118SSL_CIPHER_get_version 129
119SSL_CIPHER_get_name 130
120BIO_ssl_shutdown 131
121SSL_SESSION_cmp 132
122SSL_SESSION_hash 133
123SSL_SESSION_get_time 134
124SSL_SESSION_set_time 135
125SSL_SESSION_get_timeout 136
126SSL_SESSION_set_timeout 137
127SSL_CTX_get_ex_data 138
128SSL_CTX_get_quiet_shutdown 140
129SSL_CTX_load_verify_locations 141
130SSL_CTX_set_default_verify_paths 142
131SSL_CTX_set_ex_data 143
132SSL_CTX_set_quiet_shutdown 145
133SSL_SESSION_get_ex_data 146
134SSL_SESSION_set_ex_data 148
135SSL_get_SSL_CTX 150
136SSL_get_ex_data 151
137SSL_get_quiet_shutdown 153
138SSL_get_session 154
139SSL_get_shutdown 155
140SSL_get_verify_result 157
141SSL_set_ex_data 158
142SSL_set_info_callback 160
143SSL_set_quiet_shutdown 161
144SSL_set_shutdown 162
145SSL_set_verify_result 163
146SSL_version 164
147SSL_get_info_callback 165
148SSL_state 166
149SSL_CTX_get_ex_new_index 167
150SSL_SESSION_get_ex_new_index 168
151SSL_get_ex_new_index 169
152TLSv1_method 170
153TLSv1_server_method 171
154TLSv1_client_method 172
155BIO_new_buffer_ssl_connect 173
156BIO_new_ssl_connect 174
diff --git a/src/lib/libcrypto/util/tab_num.pl b/src/lib/libcrypto/util/tab_num.pl
new file mode 100644
index 0000000000..77b591d92f
--- /dev/null
+++ b/src/lib/libcrypto/util/tab_num.pl
@@ -0,0 +1,17 @@
1#!/usr/bin/perl
2
3$num=1;
4$width=40;
5
6while (<>)
7 {
8 chop;
9
10 $i=length($_);
11
12 $n=$width-$i;
13 $i=int(($n+7)/8);
14 print $_.("\t" x $i).$num."\n";
15 $num++;
16 }
17
diff --git a/src/lib/libcrypto/util/x86asm.sh b/src/lib/libcrypto/util/x86asm.sh
new file mode 100644
index 0000000000..81d3289860
--- /dev/null
+++ b/src/lib/libcrypto/util/x86asm.sh
@@ -0,0 +1,42 @@
1#!/bin/sh
2
3echo Generating x86 assember
4echo Bignum
5(cd crypto/bn/asm; perl bn-586.pl cpp > bn86unix.cpp)
6(cd crypto/bn/asm; perl bn-586.pl win32 > bn-win32.asm)
7
8echo DES
9(cd crypto/des/asm; perl des-586.pl cpp > dx86unix.cpp)
10(cd crypto/des/asm; perl des-586.pl win32 > d-win32.asm)
11
12echo "crypt(3)"
13(cd crypto/des/asm; perl crypt586.pl cpp > yx86unix.cpp)
14(cd crypto/des/asm; perl crypt586.pl win32 > y-win32.asm)
15
16echo Blowfish
17(cd crypto/bf/asm; perl bf-586.pl cpp > bx86unix.cpp)
18(cd crypto/bf/asm; perl bf-586.pl win32 > b-win32.asm)
19
20echo CAST5
21(cd crypto/cast/asm; perl cast-586.pl cpp > cx86unix.cpp)
22(cd crypto/cast/asm; perl cast-586.pl win32 > c-win32.asm)
23
24echo RC4
25(cd crypto/rc4/asm; perl rc4-586.pl cpp > rx86unix.cpp)
26(cd crypto/rc4/asm; perl rc4-586.pl win32 > r4-win32.asm)
27
28echo MD5
29(cd crypto/md5/asm; perl md5-586.pl cpp > mx86unix.cpp)
30(cd crypto/md5/asm; perl md5-586.pl win32 > m5-win32.asm)
31
32echo SHA1
33(cd crypto/sha/asm; perl sha1-586.pl cpp > sx86unix.cpp)
34(cd crypto/sha/asm; perl sha1-586.pl win32 > s1-win32.asm)
35
36echo RIPEMD160
37(cd crypto/ripemd/asm; perl rmd-586.pl cpp > rm86unix.cpp)
38(cd crypto/ripemd/asm; perl rmd-586.pl win32 > rm-win32.asm)
39
40echo RC5/32
41(cd crypto/rc5/asm; perl rc5-586.pl cpp > r586unix.cpp)
42(cd crypto/rc5/asm; perl rc5-586.pl win32 > r5-win32.asm)