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