diff options
author | ryker <ryker@cvs.openbsd.org> | 1998-10-05 20:13:15 +0000 |
---|---|---|
committer | ryker <ryker@cvs.openbsd.org> | 1998-10-05 20:13:15 +0000 |
commit | bff052ec2da81e414902f18d26192a16c8447863 (patch) | |
tree | 2f0c8beaf0cb7121398669e4313cb1a712609c78 /lib/libcrypto/util | |
parent | 19903f9a5985cbd8ddc4123aff9263f1b9dd7e1b (diff) |
Import of SSLeay-0.9.0b with RSA and IDEA stubbed + OpenBSD build
functionality for shared libs.
Note that routines such as sslv2_init and friends that use RSA will
not work due to lack of RSA in this library.
Needs documentation and help from ports for easy upgrade to full
functionality where legally possible.
Diffstat (limited to 'lib/libcrypto/util')
33 files changed, 4422 insertions, 0 deletions
diff --git a/lib/libcrypto/util/FreeBSD.sh b/lib/libcrypto/util/FreeBSD.sh new file mode 100644 index 00000000000..db8edfc6aa2 --- /dev/null +++ b/lib/libcrypto/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/lib/libcrypto/util/add_cr.pl b/lib/libcrypto/util/add_cr.pl new file mode 100644 index 00000000000..ddd6d61e2d4 --- /dev/null +++ b/lib/libcrypto/util/add_cr.pl @@ -0,0 +1,123 @@ +#!/usr/bin/perl +# +# This adds a copyright message to a souce code file. +# It also gets the file name correct. +# +# perl util/add_cr.pl *.[ch] */*.[ch] */*/*.[ch] +# + +foreach (@ARGV) + { + &dofile($_); + } + +sub dofile + { + local($file)=@_; + + open(IN,"<$file") || die "unable to open $file:$!\n"; + + print STDERR "doing $file\n"; + @in=<IN>; + + return(1) if ($in[0] =~ / NOCW /); + + @out=(); + open(OUT,">$file.out") || die "unable to open $file.$$:$!\n"; + push(@out,"/* $file */\n"); + if (($in[1] !~ /^\/\* Copyright \(C\) [0-9-]+ Eric Young \(eay\@cryptsoft.com\)/)) + { + push(@out,&Copyright); + $i=2; + @a=grep(/ Copyright \(C\) /,@in); + if ($#a >= 0) + { + while (($i <= $#in) && ($in[$i] ne " */\n")) + { $i++; } + $i++ if ($in[$i] eq " */\n"); + + while (($i <= $#in) && ($in[$i] =~ /^\s*$/)) + { $i++; } + + push(@out,"\n"); + for ( ; $i <= $#in; $i++) + { push(@out,$in[$i]); } + } + else + { push(@out,@in); } + } + else + { + shift(@in); + push(@out,@in); + } + print OUT @out; + close(IN); + close(OUT); + rename("$file","$file.orig") || die "unable to rename $file:$!\n"; + rename("$file.out",$file) || die "unable to rename $file.out:$!\n"; + } + + + +sub Copyright + { + return <<'EOF'; +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +EOF + } diff --git a/lib/libcrypto/util/bat.sh b/lib/libcrypto/util/bat.sh new file mode 100644 index 00000000000..c6f48e8a7b1 --- /dev/null +++ b/lib/libcrypto/util/bat.sh @@ -0,0 +1,132 @@ +#!/usr/local/bin/perl + +$infile="/home/eay/ssl/SSLeay/MINFO"; + +open(IN,"<$infile") || die "unable to open $infile:$!\n"; +$_=<IN>; +for (;;) + { + chop; + + ($key,$val)=/^([^=]+)=(.*)/; + if ($key eq "RELATIVE_DIRECTORY") + { + if ($lib ne "") + { + $uc=$lib; + $uc =~ s/^lib(.*)\.a/$1/; + $uc =~ tr/a-z/A-Z/; + $lib_nam{$uc}=$uc; + $lib_obj{$uc}.=$libobj." "; + } + last if ($val eq "FINISHED"); + $lib=""; + $libobj=""; + $dir=$val; + } + + if ($key eq "TEST") + { $test.=&var_add($dir,$val); } + + if (($key eq "PROGS") || ($key eq "E_OBJ")) + { $e_exe.=&var_add($dir,$val); } + + if ($key eq "LIB") + { + $lib=$val; + $lib =~ s/^.*\/([^\/]+)$/$1/; + } + + if ($key eq "EXHEADER") + { $exheader.=&var_add($dir,$val); } + + if ($key eq "HEADER") + { $header.=&var_add($dir,$val); } + + if ($key eq "LIBSRC") + { $libsrc.=&var_add($dir,$val); } + + if (!($_=<IN>)) + { $_="RELATIVE_DIRECTORY=FINISHED\n"; } + } +close(IN); + +@a=split(/\s+/,$libsrc); +foreach (@a) + { + print "${_}.c\n"; + } + +sub var_add + { + local($dir,$val)=@_; + local(@a,$_,$ret); + + return("") if $no_idea && $dir =~ /\/idea/; + return("") if $no_rc2 && $dir =~ /\/rc2/; + return("") if $no_rc4 && $dir =~ /\/rc4/; + return("") if $no_rsa && $dir =~ /\/rsa/; + return("") if $no_rsa && $dir =~ /^rsaref/; + return("") if $no_dsa && $dir =~ /\/dsa/; + return("") if $no_dh && $dir =~ /\/dh/; + if ($no_des && $dir =~ /\/des/) + { + if ($val =~ /read_pwd/) + { return("$dir/read_pwd "); } + else + { return(""); } + } + return("") if $no_mdc2 && $dir =~ /\/mdc2/; + return("") if $no_sock && $dir =~ /\/proxy/; + return("") if $no_bf && $dir =~ /\/bf/; + return("") if $no_cast && $dir =~ /\/cast/; + + $val =~ s/^\s*(.*)\s*$/$1/; + @a=split(/\s+/,$val); + grep(s/\.[och]$//,@a); + + @a=grep(!/^e_.*_3d$/,@a) if $no_des; + @a=grep(!/^e_.*_d$/,@a) if $no_des; + @a=grep(!/^e_.*_i$/,@a) if $no_idea; + @a=grep(!/^e_.*_r2$/,@a) if $no_rc2; + @a=grep(!/^e_.*_bf$/,@a) if $no_bf; + @a=grep(!/^e_.*_c$/,@a) if $no_cast; + @a=grep(!/^e_rc4$/,@a) if $no_rc4; + + @a=grep(!/(^s2_)|(^s23_)/,@a) if $no_ssl2; + @a=grep(!/(^s3_)|(^s23_)/,@a) if $no_ssl3; + + @a=grep(!/(_sock$)|(_acpt$)|(_conn$)|(^pxy_)/,@a) if $no_sock; + + @a=grep(!/(^md2)|(_md2$)/,@a) if $no_md2; + @a=grep(!/(^md5)|(_md5$)/,@a) if $no_md5; + + @a=grep(!/(^d2i_r_)|(^i2d_r_)/,@a) if $no_rsa; + @a=grep(!/(^p_open$)|(^p_seal$)/,@a) if $no_rsa; + @a=grep(!/(^pem_seal$)/,@a) if $no_rsa; + + @a=grep(!/(m_dss$)|(m_dss1$)/,@a) if $no_dsa; + @a=grep(!/(^d2i_s_)|(^i2d_s_)|(_dsap$)/,@a) if $no_dsa; + + @a=grep(!/^n_pkey$/,@a) if $no_rsa || $no_rc4; + + @a=grep(!/_dhp$/,@a) if $no_dh; + + @a=grep(!/(^sha[^1])|(_sha$)|(m_dss$)/,@a) if $no_sha; + @a=grep(!/(^sha1)|(_sha1$)|(m_dss1$)/,@a) if $no_sha1; + @a=grep(!/_mdc2$/,@a) if $no_mdc2; + + @a=grep(!/(^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); + } + diff --git a/lib/libcrypto/util/ck_errf.pl b/lib/libcrypto/util/ck_errf.pl new file mode 100644 index 00000000000..c5764e40dfe --- /dev/null +++ b/lib/libcrypto/util/ck_errf.pl @@ -0,0 +1,44 @@ +#!/usr/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/lib/libcrypto/util/deleof.pl b/lib/libcrypto/util/deleof.pl new file mode 100644 index 00000000000..04f30f0e476 --- /dev/null +++ b/lib/libcrypto/util/deleof.pl @@ -0,0 +1,7 @@ +#!/usr/bin/perl + +while (<>) + { + print + last if (/^# DO NOT DELETE THIS LINE/); + } diff --git a/lib/libcrypto/util/do_ms.sh b/lib/libcrypto/util/do_ms.sh new file mode 100644 index 00000000000..f498d842b75 --- /dev/null +++ b/lib/libcrypto/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-WIN16 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/lib/libcrypto/util/err-ins.pl b/lib/libcrypto/util/err-ins.pl new file mode 100644 index 00000000000..db1bb482756 --- /dev/null +++ b/lib/libcrypto/util/err-ins.pl @@ -0,0 +1,33 @@ +#!/usr/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/lib/libcrypto/util/files.pl b/lib/libcrypto/util/files.pl new file mode 100644 index 00000000000..bf3b7effdcc --- /dev/null +++ b/lib/libcrypto/util/files.pl @@ -0,0 +1,61 @@ +#!/usr/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/lib/libcrypto/util/fixNT.sh b/lib/libcrypto/util/fixNT.sh new file mode 100644 index 00000000000..ce4f19299ba --- /dev/null +++ b/lib/libcrypto/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//' `find . -type 'f' -print |grep -v '.obj$' |grep -v '.der$' |grep -v '.gz'` +make -f Makefile.ssl links diff --git a/lib/libcrypto/util/install.sh b/lib/libcrypto/util/install.sh new file mode 100644 index 00000000000..e1d0c982df5 --- /dev/null +++ b/lib/libcrypto/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/lib/libcrypto/util/libeay.num b/lib/libcrypto/util/libeay.num new file mode 100644 index 00000000000..fcaf2542872 --- /dev/null +++ b/lib/libcrypto/util/libeay.num @@ -0,0 +1,1065 @@ +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_accept 51 +BIO_ctrl 52 +BIO_int_ctrl 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_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_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_mem 95 +BIO_s_null 96 +BIO_s_proxy_client 97 +BIO_s_socket 98 +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_hex2bn 117 +BN_bin2bn 118 +BN_bn2hex 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 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_words 706 +bn_mul_words 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_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 +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_write_RSAPublicKey 949 +d2i_RSAPublicKey_fp 952 +i2d_RSAPublicKey_fp 954 +BIO_copy_next_retry 955 +RSA_flags 956 +X509_STORE_add_crl 957 +X509_load_crl_file 958 +EVP_rc2_40_cbc 959 +EVP_rc4_40 960 +EVP_CIPHER_CTX_init 961 +HMAC 962 +HMAC_Init 963 +HMAC_Update 964 +HMAC_Final 965 +ERR_get_next_error_library 966 +EVP_PKEY_cmp_parameters 967 +HMAC_cleanup 968 +BIO_ptr_ctrl 969 +BIO_new_file_internal 970 +BIO_new_fp_internal 971 +BIO_s_file_internal 972 +BN_BLINDING_convert 973 +BN_BLINDING_invert 974 +BN_BLINDING_update 975 +RSA_blinding_on 977 +RSA_blinding_off 978 +i2t_ASN1_OBJECT 979 +BN_BLINDING_new 980 +BN_BLINDING_free 981 +EVP_cast5_cbc 983 +EVP_cast5_cfb 984 +EVP_cast5_ecb 985 +EVP_cast5_ofb 986 +BF_decrypt 987 +CAST_set_key 988 +CAST_encrypt 989 +CAST_decrypt 990 +CAST_ecb_encrypt 991 +CAST_cbc_encrypt 992 +CAST_cfb64_encrypt 993 +CAST_ofb64_encrypt 994 +RC2_decrypt 995 +OBJ_create_objects 997 +BN_exp 998 +BN_mul_word 999 +BN_sub_word 1000 +BN_dec2bn 1001 +BN_bn2dec 1002 +BIO_ghbn_ctrl 1003 +CRYPTO_free_ex_data 1004 +CRYPTO_get_ex_data 1005 +CRYPTO_set_ex_data 1007 +ERR_load_CRYPTO_strings 1009 +ERR_load_CRYPTOlib_strings 1009 +EVP_PKEY_bits 1010 +MD5_Transform 1011 +SHA1_Transform 1012 +SHA_Transform 1013 +X509_STORE_CTX_get_chain 1014 +X509_STORE_CTX_get_current_cert 1015 +X509_STORE_CTX_get_error 1016 +X509_STORE_CTX_get_error_depth 1017 +X509_STORE_CTX_get_ex_data 1018 +X509_STORE_CTX_set_cert 1020 +X509_STORE_CTX_set_chain 1021 +X509_STORE_CTX_set_error 1022 +X509_STORE_CTX_set_ex_data 1023 +CRYPTO_dup_ex_data 1025 +CRYPTO_get_new_lockid 1026 +CRYPTO_new_ex_data 1027 +RSA_set_ex_data 1028 +RSA_get_ex_data 1029 +RSA_get_ex_new_index 1030 +RSA_padding_add_PKCS1_type_1 1031 +RSA_padding_add_PKCS1_type_2 1032 +RSA_padding_add_SSLv23 1033 +RSA_padding_add_none 1034 +RSA_padding_check_PKCS1_type_1 1035 +RSA_padding_check_PKCS1_type_2 1036 +RSA_padding_check_SSLv23 1037 +RSA_padding_check_none 1038 +bn_add_words 1039 +d2i_Netscape_RSA_2 1040 +CRYPTO_get_ex_new_index 1041 +RIPEMD160_Init 1042 +RIPEMD160_Update 1043 +RIPEMD160_Final 1044 +RIPEMD160 1045 +RIPEMD160_Transform 1046 +RC5_32_set_key 1047 +RC5_32_ecb_encrypt 1048 +RC5_32_encrypt 1049 +RC5_32_decrypt 1050 +RC5_32_cbc_encrypt 1051 +RC5_32_cfb64_encrypt 1052 +RC5_32_ofb64_encrypt 1053 +BN_bn2mpi 1058 +BN_mpi2bn 1059 +ASN1_BIT_STRING_get_bit 1060 +ASN1_BIT_STRING_set_bit 1061 +BIO_get_ex_data 1062 +BIO_get_ex_new_index 1063 +BIO_set_ex_data 1064 +X509_STORE_CTX_get_ex_new_index 1065 +X509v3_get_key_usage 1066 +X509v3_set_key_usage 1067 +a2i_X509v3_key_usage 1068 +i2a_X509v3_key_usage 1069 +EVP_PKEY_decrypt 1070 +EVP_PKEY_encrypt 1071 +PKCS7_RECIP_INFO_set 1072 +PKCS7_add_recipient 1073 +PKCS7_add_recipient_info 1074 +PKCS7_set_cipher 1075 +ASN1_TYPE_get_int_octetstring 1076 +ASN1_TYPE_get_octetstring 1077 +ASN1_TYPE_set_int_octetstring 1078 +ASN1_TYPE_set_octetstring 1079 +ASN1_UTCTIME_set_string 1080 +ERR_add_error_data 1081 +ERR_set_error_data 1082 +EVP_CIPHER_asn1_to_param 1083 +EVP_CIPHER_param_to_asn1 1084 +EVP_CIPHER_get_asn1_iv 1085 +EVP_CIPHER_set_asn1_iv 1086 +EVP_rc5_32_12_16_cbc 1087 +EVP_rc5_32_12_16_cfb 1088 +EVP_rc5_32_12_16_ecb 1089 +EVP_rc5_32_12_16_ofb 1090 +asn1_add_error 1091 diff --git a/lib/libcrypto/util/mk1mf.pl b/lib/libcrypto/util/mk1mf.pl new file mode 100644 index 00000000000..149a0f4f80e --- /dev/null +++ b/lib/libcrypto/util/mk1mf.pl @@ -0,0 +1,793 @@ +#!/usr/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"; + +$ssl_version="0.8.2"; + +$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", + "linux-elf","Linux elf", + "FreeBSD","FreeBSD distribution", + "default","cc under unix", + ); + +$type=""; +foreach (@ARGV) + { + if (/^no-rc2$/) { $no_rc2=1; } + elsif (/^no-rc4$/) { $no_rc4=1; } + elsif (/^no-rc5$/) { $no_rc5=1; } + elsif (/^no-idea$/) { $no_idea=1; } + elsif (/^no-des$/) { $no_des=1; } + elsif (/^no-bf$/) { $no_bf=1; } + elsif (/^no-cast$/) { $no_cast=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-rmd160$/) { $no_rmd160=1; } + elsif (/^no-mdc2$/) { $no_mdc2=1; } + elsif (/^no-patents$/) { $no_rc2=$no_rc4=$no_rc5=$no_idea=$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 (/^just-ssl$/) { $no_rc2=$no_idea=$no_des=$no_bf=$no_cast=1; + $no_md2=$no_sha=$no_mdc2=$no_dsa=$no_dh=1; + $no_ssl2=$no_err=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 no-rmd160 - Skip this digest + no-rc2 no-rc4 no-idea no-des no-bf no-cast - Skip this symetric cipher + no-rc5 + 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 INC=header-outdir 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); + +$out_def="out"; +$inc_def="outinc"; +$tmp_def="tmp"; + + +($ssl,$crypto)=("ssl","crypto"); +$RSAglue="RSAglue"; +$ranlib="echo ranlib"; + +$cc=(defined($VARS{'CC'}))?$VARS{'CC'}:'cc'; +$src_dir=(defined($VARS{'SRC'}))?$VARS{'SRC'}:'.'; +$bin_dir=(defined($VARS{'BIN'}))?$VARS{'BIN'}:''; + +# $bin_dir.=$o causes a core dump on my sparc :-( + +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'; + } +elsif ($type eq "linux-elf") + { + require "unix.pl"; + require "linux.pl"; + $unix=1; + } +else + { + require "unix.pl"; + + $unix=1; + $cflags.=' -DTERMIO'; + } + +$out_dir=(defined($VARS{'OUT'}))?$VARS{'OUT'}:$out_def.($debug?".dbg":""); +$tmp_dir=(defined($VARS{'TMP'}))?$VARS{'TMP'}:$tmp_def.($debug?".dbg":""); +$inc_dir=(defined($VARS{'INC'}))?$VARS{'INC'}:$inc_def; + +$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_RC5" if $no_rc5; +$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_RMD160" if $no_rmd160; +$cflags.=" -DNO_MDC2" if $no_mdc2; +$cflags.=" -DNO_BLOWFISH" if $no_bf; +$cflags.=" -DNO_CAST" if $no_cast; +$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 +SHLIB_CFLAG=$shl_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 +CAST_ENC_OBJ=$cast_enc_obj +CAST_ENC_SRC=$cast_enc_src +RC4_ENC_OBJ=$rc4_enc_obj +RC4_ENC_SRC=$rc4_enc_src +RC5_ENC_OBJ=$rc5_enc_obj +RC5_ENC_SRC=$rc5_enc_src +MD5_ASM_OBJ=$md5_asm_obj +MD5_ASM_SRC=$md5_asm_src +SHA1_ASM_OBJ=$sha1_asm_obj +SHA1_ASM_SRC=$sha1_asm_src +RMD160_ASM_OBJ=$rmd160_asm_obj +RMD160_ASM_SRC=$rmd160_asm_src + +# The output directory for everything intersting +OUT_D=$out_dir +# The output directory for all the temporary muck +TMP_D=$tmp_dir +# The output directory for the header files +INC_D=$inc_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 +BIN_D=\$(OUT_D) +TEST_D=\$(OUT_D) +LIB_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 +SO_SSL= $plib\$(SSL)$so_shlibp +SO_CRYPTO= $plib\$(CRYPTO)$so_shlibp +L_SSL= \$(LIB_D)$o\$(SSL)$libp +L_CRYPTO= \$(LIB_D)$o\$(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=-I\$(INC_D) -I\$(INCL_D) +APP_CFLAGS=\$(INC) \$(CFLAG) \$(APP_CFLAG) +LIB_CFLAGS=\$(INC) \$(CFLAG) \$(LIB_CFLAG) +SHLIB_CFLAGS=\$(INC) \$(CFLAG) \$(LIB_CFLAG) \$(SHLIB_CFLAG) +LIBS_DEP=\$(O_CRYPTO) \$(O_RSAGLUE) \$(O_SSL) + +############################################# +EOF + +$rules=<<"EOF"; +all: banner \$(TMP_D) \$(BIN_D) \$(TEST_D) \$(LIB_D) \$(INC_D) headers lib exe + +banner: +$banner + +\$(TMP_D): + \$(MKDIR) \$(TMP_D) + +\$(BIN_D): + \$(MKDIR) \$(BIN_D) + +\$(TEST_D): + \$(MKDIR) \$(TEST_D) + +\$(LIB_D): + \$(MKDIR) \$(LIB_D) + +\$(INC_D): + \$(MKDIR) \$(INC_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}*.\[ch\] \$(INSTALLTOP)${o}include + \$(CP) \$(BIN_D)$o\$(E_EXE)$exep \$(INSTALLTOP)${o}bin + \$(CP) \$(O_SSL) \$(INSTALLTOP)${o}lib + \$(CP) \$(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{$_}; + local($slib)=$shlib; + + $slib=0 if ($_ eq "RSAGLUE"); + + 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\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\S*des_enc\S*/ \$(DES_ENC_OBJ)/; + $lib_obj =~ s/\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\S*\/bf_enc\S*/ \$(BF_ENC_OBJ)/; + $rules.=&do_asm_rule($bf_enc_obj,$bf_enc_src); + } + if (($cast_enc_obj ne "") && ($_ eq "CRYPTO")) + { + $lib_obj =~ s/(\s\S*\/c_enc\S*)/ \$(CAST_ENC_OBJ)/; + $rules.=&do_asm_rule($cast_enc_obj,$cast_enc_src); + } + if (($rc4_enc_obj ne "") && ($_ eq "CRYPTO")) + { + $lib_obj =~ s/\s\S*\/rc4_enc\S*/ \$(RC4_ENC_OBJ)/; + $rules.=&do_asm_rule($rc4_enc_obj,$rc4_enc_src); + } + if (($rc5_enc_obj ne "") && ($_ eq "CRYPTO")) + { + $lib_obj =~ s/\s\S*\/rc5_enc\S*/ \$(RC5_ENC_OBJ)/; + $rules.=&do_asm_rule($rc5_enc_obj,$rc5_enc_src); + } + if (($md5_asm_obj ne "") && ($_ eq "CRYPTO")) + { + $lib_obj =~ s/\s(\S*\/md5_dgst\S*)/ $1 \$(MD5_ASM_OBJ)/; + $rules.=&do_asm_rule($md5_asm_obj,$md5_asm_src); + } + if (($sha1_asm_obj ne "") && ($_ eq "CRYPTO")) + { + $lib_obj =~ s/\s(\S*\/sha1dgst\S*)/ $1 \$(SHA1_ASM_OBJ)/; + $rules.=&do_asm_rule($sha1_asm_obj,$sha1_asm_src); + } + if (($rmd160_asm_obj ne "") && ($_ eq "CRYPTO")) + { + $lib_obj =~ s/\s(\S*\/rmd_dgst\S*)/ $1 \$(RMD160_ASM_OBJ)/; + $rules.=&do_asm_rule($rmd160_asm_obj,$rmd160_asm_src); + } + $defs.=&do_defs(${_}."OBJ",$lib_obj,"\$(OBJ_D)",$obj); + $lib=($slib)?" \$(SHLIB_CFLAGS)":" \$(LIB_CFLAGS)"; + $rules.=&do_compile_rule("\$(OBJ_D)",$lib_obj{$_},$lib); + } + +$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,"\$(SO_SSL)"); +$rules.= &do_lib_rule("\$(RSAGLUEOBJ)","\$(O_RSAGLUE)",$RSAglue,0,"") + unless $no_rsa; +$rules.= &do_lib_rule("\$(CRYPTOOBJ)","\$(O_CRYPTO)",$crypto,$shlib,"\$(SO_CRYPTO)"); + +$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_rc5 && $dir =~ /\/rc5/; + return("") if $no_rsa && $dir =~ /\/rsa/; + return("") if $no_rsa && $dir =~ /^rsaref/; + return("") if $no_dsa && $dir =~ /\/dsa/; + return("") if $no_dh && $dir =~ /\/dh/; + if ($no_des && $dir =~ /\/des/) + { + if ($val =~ /read_pwd/) + { return("$dir/read_pwd "); } + else + { return(""); } + } + return("") if $no_mdc2 && $dir =~ /\/mdc2/; + return("") if $no_sock && $dir =~ /\/proxy/; + return("") if $no_bf && $dir =~ /\/bf/; + return("") if $no_cast && $dir =~ /\/cast/; + + $val =~ s/^\s*(.*)\s*$/$1/; + @a=split(/\s+/,$val); + grep(s/\.[och]$//,@a); + + @a=grep(!/^e_.*_3d$/,@a) if $no_des; + @a=grep(!/^e_.*_d$/,@a) if $no_des; + @a=grep(!/^e_.*_i$/,@a) if $no_idea; + @a=grep(!/^e_.*_r2$/,@a) if $no_rc2; + @a=grep(!/^e_.*_r5$/,@a) if $no_rc5; + @a=grep(!/^e_.*_bf$/,@a) if $no_bf; + @a=grep(!/^e_.*_c$/,@a) if $no_cast; + @a=grep(!/^e_rc4$/,@a) if $no_rc4; + + @a=grep(!/(^s2_)|(^s23_)/,@a) if $no_ssl2; + @a=grep(!/(^s3_)|(^s23_)/,@a) if $no_ssl3; + + @a=grep(!/(_sock$)|(_acpt$)|(_conn$)|(^pxy_)/,@a) if $no_sock; + + @a=grep(!/(^md2)|(_md2$)/,@a) if $no_md2; + @a=grep(!/(^md5)|(_md5$)/,@a) if $no_md5; + + @a=grep(!/(^d2i_r_)|(^i2d_r_)/,@a) if $no_rsa; + @a=grep(!/(^p_open$)|(^p_seal$)/,@a) if $no_rsa; + @a=grep(!/(^pem_seal$)/,@a) if $no_rsa; + + @a=grep(!/(m_dss$)|(m_dss1$)/,@a) if $no_dsa; + @a=grep(!/(^d2i_s_)|(^i2d_s_)|(_dsap$)/,@a) if $no_dsa; + + @a=grep(!/^n_pkey$/,@a) if $no_rsa || $no_rc4; + + @a=grep(!/_dhp$/,@a) if $no_dh; + + @a=grep(!/(^sha[^1])|(_sha$)|(m_dss$)/,@a) if $no_sha; + @a=grep(!/(^sha1)|(_sha1$)|(m_dss1$)/,@a) if $no_sha1; + @a=grep(!/_mdc2$/,@a) if $no_mdc2; + + @a=grep(!/(^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,$pf); + local(*OUT,$tmp,$t); + + $files =~ s/\//$o/g if $o ne '/'; + $ret="$var="; + $n=1; + $Vars{$var}.=""; + foreach (split(/ /,$files)) + { + $orig=$_; + $_=&bname($_) unless /^\$/; + if ($n++ == 2) + { + $n=0; + $ret.="\\\n\t"; + } + if (($_ =~ /bss_file/) && ($postfix eq ".h")) + { $pf=".c"; } + else { $pf=$postfix; } + if ($_ =~ /BN_MULW/) { $t="$_ "; } + elsif ($_ =~ /DES_ENC/) { $t="$_ "; } + elsif ($_ =~ /BF_ENC/) { $t="$_ "; } + elsif ($_ =~ /CAST_ENC/){ $t="$_ "; } + elsif ($_ =~ /RC4_ENC/) { $t="$_ "; } + elsif ($_ =~ /RC5_ENC/) { $t="$_ "; } + elsif ($_ =~ /MD5_ASM/) { $t="$_ "; } + elsif ($_ =~ /SHA1_ASM/){ $t="$_ "; } + elsif ($_ =~ /RMD160_ASM/){ $t="$_ "; } + else { $t="$location${o}$_$pf "; } + + $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,$pp); + + $files =~ s/\//$o/g if $o ne '/'; + foreach (split(/\s+/,$files)) + { + $n=&bname($_); + if ($n =~ /bss_file/) + { $pp=".c"; } + else { $pp=$p; } + $ret.="$to${o}$n$pp: \$(SRC_D)$o$_$pp\n\t\$(CP) \$(SRC_D)$o$_$pp $to${o}$n$pp\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/lib/libcrypto/util/mkcerts.sh b/lib/libcrypto/util/mkcerts.sh new file mode 100644 index 00000000000..5f8a1dae739 --- /dev/null +++ b/lib/libcrypto/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/lib/libcrypto/util/mkdef.pl b/lib/libcrypto/util/mkdef.pl new file mode 100644 index 00000000000..8124f11292d --- /dev/null +++ b/lib/libcrypto/util/mkdef.pl @@ -0,0 +1,292 @@ +#!/usr/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/rc5/rc5.h"; +$crypto.=" crypto/rc2/rc2.h"; +$crypto.=" crypto/bf/blowfish.h"; +$crypto.=" crypto/cast/cast.h"; +$crypto.=" crypto/md2/md2.h"; +$crypto.=" crypto/md5/md5.h"; +$crypto.=" crypto/mdc2/mdc2.h"; +$crypto.=" crypto/sha/sha.h"; +$crypto.=" crypto/ripemd/ripemd.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"; +$crypto.=" crypto/hmac/hmac.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 (/^\#\s*ifndef (.*)/) + { + push(@tag,$1); + $tag{$1}=-1; + next; + } + elsif (/^\#\s*if !defined\(([^\)]+)\)/) + { + push(@tag,$1); + $tag{$1}=-1; + next; + } + elsif (/^\#\s*ifdef (.*)/) + { + push(@tag,$1); + $tag{$1}=1; + next; + } + elsif (/^\#\s*if defined(.*)/) + { + push(@tag,$1); + $tag{$1}=1; + next; + } + elsif (/^\#\s*endif/) + { + $tag{$tag[$#tag]}=0; + pop(@tag); + next; + } + elsif (/^\#\s*else/) + { + $t=$tag[$#tag]; + $tag{$t}= -$tag{$t}; + next; + } +#printf STDERR "$_\n%2d %2d %2d %2d %2d $NT\n", +#$tag{'NOPROTO'},$tag{'FreeBSD'},$tag{'WIN16'},$tag{'PERL5'},$tag{'NO_FP_API'}; + + $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) && +# ($tag{'_WINDLL'} != -1) && + ((!$NT && $tag{'_WINDLL'} != -1) || + ($NT && $tag{'_WINDLL'} != 1)) && + ((($tag{'NO_FP_API'} != 1) && $NT) || + (($tag{'NO_FP_API'} != -1) && !$NT))) + { $t=&do_line($name,$_); } + else + { $t=undef; } + if (($t ne undef) && (!$done{$name,$t})) + { + $done{$name,$t}++; + push(@ret,$t); +#printf STDERR "one:$t\n" if $t =~ /BIO_/; + } + } + close(IN); + } + return(@ret); + } + +sub do_line + { + local($file,$_)=@_; + local($n); + + return(undef) if /^$/; + return(undef) if /^\s/; +#printf STDERR "two:$_\n" if $_ =~ /BIO_/; + 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); } + elsif (/(SSL_get_info_callback)/) + { return($1); } + elsif ((!$NT) && /(ERR_load_CRYPTO_strings)/) + { return("ERR_load_CRYPTOlib_strings"); } + elsif (!$NT && /BIO_s_file/) + { return(undef); } + elsif (!$NT && /BIO_new_file/) + { return(undef); } + elsif (!$NT && /BIO_new_fp/) + { return(undef); } + elsif ($NT && /BIO_s_file_internal/) + { return(undef); } + elsif ($NT && /BIO_new_file_internal/) + { return(undef); } + elsif ($NT && /BIO_new_fp_internal/) + { return(undef); } + 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/lib/libcrypto/util/mklink.sh b/lib/libcrypto/util/mklink.sh new file mode 100644 index 00000000000..1e052ed6ee7 --- /dev/null +++ b/lib/libcrypto/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/lib/libcrypto/util/perlpath.pl b/lib/libcrypto/util/perlpath.pl new file mode 100644 index 00000000000..9e57e10ad4d --- /dev/null +++ b/lib/libcrypto/util/perlpath.pl @@ -0,0 +1,30 @@ +#!/usr/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/lib/libcrypto/util/pl/BC-16.pl b/lib/libcrypto/util/pl/BC-16.pl new file mode 100644 index 00000000000..7c3fdb68f4d --- /dev/null +++ b/lib/libcrypto/util/pl/BC-16.pl @@ -0,0 +1,146 @@ +#!/usr/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.=" -DWINDOWS -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/lib/libcrypto/util/pl/BC-32.pl b/lib/libcrypto/util/pl/BC-32.pl new file mode 100644 index 00000000000..3898d16f614 --- /dev/null +++ b/lib/libcrypto/util/pl/BC-32.pl @@ -0,0 +1,135 @@ +#!/usr/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.=" -DWINDOWS -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/lib/libcrypto/util/pl/VC-16.pl b/lib/libcrypto/util/pl/VC-16.pl new file mode 100644 index 00000000000..a6e6c0241c5 --- /dev/null +++ b/lib/libcrypto/util/pl/VC-16.pl @@ -0,0 +1,173 @@ +#!/usr/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'; + +$out_def="out16"; +$tmp_def="tmp16"; +$inc_def="inc16"; + +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.=" -DWINDOWS -DWIN16"; + $app_cflag="/Gw /FPi87"; + $lib_cflag="/Gw"; + $lib_cflag.=" -D_WINDLL -D_DLL" if $shlib; + $lib_cflag.=" -DWIN16TTY" if !$shlib; + $lflags.=" /ALIGN:256"; + $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; + $out_def="out16dll"; + $tmp_def="tmp16dll"; + } +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/; + +# $target="\$(LIB_D)$o$target"; + $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 =~ /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/lib/libcrypto/util/pl/VC-32.pl b/lib/libcrypto/util/pl/VC-32.pl new file mode 100644 index 00000000000..701e282c335 --- /dev/null +++ b/lib/libcrypto/util/pl/VC-32.pl @@ -0,0 +1,133 @@ +#!/usr/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=' /MD /W3 /WX /G5 /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -DWIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN'; +$lflags="/nologo /subsystem:console /machine:I386 /opt:ref"; +$mlflags=''; + +$out_def="out32"; +$tmp_def="tmp32"; +$inc_def="inc32"; + +if ($debug) + { + $cflags=" /MDd /W3 /WX /Zi /Yd /Od /nologo -DWINDOWS -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'; +$asm.=" /Zi" if $debug; +$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\bn-win32.obj'; + $bn_mulw_src='crypto\bn\asm\bn-win32.asm'; + $des_enc_obj='crypto\des\asm\d-win32.obj crypto\des\asm\y-win32.obj'; + $des_enc_src='crypto\des\asm\d-win32.asm crypto\des\asm\y-win32.asm'; + $bf_enc_obj='crypto\bf\asm\b-win32.obj'; + $bf_enc_src='crypto\bf\asm\b-win32.asm'; + $cast_enc_obj='crypto\cast\asm\c-win32.obj'; + $cast_enc_src='crypto\cast\asm\c-win32.asm'; + $rc4_enc_obj='crypto\rc4\asm\r4-win32.obj'; + $rc4_enc_src='crypto\rc4\asm\r4-win32.asm'; + $rc5_enc_obj='crypto\rc5\asm\r5-win32.obj'; + $rc5_enc_src='crypto\rc5\asm\r5-win32.asm'; + $md5_asm_obj='crypto\md5\asm\m5-win32.obj'; + $md5_asm_src='crypto\md5\asm\m5-win32.asm'; + $sha1_asm_obj='crypto\sha\asm\s1-win32.obj'; + $sha1_asm_src='crypto\sha\asm\s1-win32.asm'; + $rmd160_asm_obj='crypto\ripemd\asm\rm-win32.obj'; + $rmd160_asm_src='crypto\ripemd\asm\rm-win32.asm'; + $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DRMD160_ASM"; + } + +if ($shlib) + { + $mlflags.=" $lflags /dll"; +# $cflags =~ s| /MD| /MT|; + $lib_cflag=" /GD -D_WINDLL -D_DLL"; + $out_def="out32dll"; + $tmp_def="tmp32dll"; + } + +sub do_lib_rule + { + local($objs,$target,$name,$shlib)=@_; + local($ret,$Name); + + $taget =~ s/\//$o/g if $o ne '/'; + ($Name=$name) =~ tr/a-z/A-Z/; + +# $target="\$(LIB_D)$o$target"; + $ret.="$target: $objs\n"; + if (!$shlib) + { +# $ret.="\t\$(RM) \$(O_$Name)\n"; + $ret.="\t\$(MKLIB) $lfile$target @<<\n $objs\n<<\n"; + } + else + { + local($ex)=($target =~ /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/lib/libcrypto/util/pl/linux.pl b/lib/libcrypto/util/pl/linux.pl new file mode 100644 index 00000000000..2b13da1bfc4 --- /dev/null +++ b/lib/libcrypto/util/pl/linux.pl @@ -0,0 +1,96 @@ +#!/usr/bin/perl +# +# linux.pl - the standard unix makefile stuff. +# + +$o='/'; +$cp='/bin/cp'; +$rm='/bin/rm -f'; + +# C compiler stuff + +$cc='gcc'; +if ($debug) + { $cflags="-g2 -ggdb -DREF_CHECK -DCRYPTO_MDEBUG"; } +else + { $cflags="-O3 -fomit-frame-pointer"; } + +if (!$no_asm) + { + $bn_mulw_obj='$(OBJ_D)/bn86-elf.o'; + $bn_mulw_src='crypto/bn/asm/bn86unix.cpp'; + $des_enc_obj='$(OBJ_D)/dx86-elf.o $(OBJ_D)/yx86-elf.o'; + $des_enc_src='crypto/des/asm/dx86unix.cpp crypto/des/asm/yx86unix.cpp'; + $bf_enc_obj='$(OBJ_D)/bx86-elf.o'; + $bf_enc_src='crypto/bf/asm/bx86unix.cpp'; + $cast_enc_obj='$(OBJ_D)/cx86-elf.o'; + $cast_enc_src='crypto/cast/asm/cx86unix.cpp'; + $rc4_enc_obj='$(OBJ_D)/rx86-elf.o'; + $rc4_enc_src='crypto/rc4/asm/rx86unix.cpp'; + $md5_asm_obj='$(OBJ_D)/mx86-elf.o'; + $md5_asm_src='crypto/md5/asm/mx86unix.cpp'; + $sha1_asm_obj='$(OBJ_D)/sx86-elf.o'; + $sha1_asm_src='crypto/sha/asm/sx86unix.cpp'; + $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM"; + } + +$cflags.=" -DTERMIO -DL_ENDIAN -m486 -Wall"; + +if ($shlib) + { + $shl_cflag=" -DPIC -fpic"; + $shlibp=".so.$ssl_version"; + $so_shlibp=".so"; + } + +sub do_shlib_rule + { + local($obj,$target,$name,$shlib,$so_name)=@_; + local($ret,$_,$Name); + + $target =~ s/\//$o/g if $o ne '/'; + ($Name=$name) =~ tr/a-z/A-Z/; + + $ret.="\$(LIB_D)$o$target: \$(${Name}OBJ)\n"; + $ret.="\t\$(RM) \$(LIB_D)$o$target\n"; + $ret.="\tgcc \${CFLAGS} -shared -Wl,-soname,$target -o \$(LIB_D)$o$target \$(${Name}OBJ)\n"; + ($t=$target) =~ s/(^.*)\/[^\/]*$/$1/; + if ($so_name ne "") + { + $ret.="\t\$(RM) \$(LIB_D)$o$so_name\n"; + $ret.="\tln -s $target \$(LIB_D)$o$so_name\n\n"; + } + } + +sub do_link_rule + { + local($target,$files,$dep_libs,$libs)=@_; + local($ret,$_); + + $file =~ s/\//$o/g if $o ne '/'; + $n=&bname($target); + $ret.="$target: $files $dep_libs\n"; + $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n"; + return($ret); + } + +sub do_asm_rule + { + local($target,$src)=@_; + local($ret,@s,@t,$i); + + $target =~ s/\//$o/g if $o ne "/"; + $src =~ s/\//$o/g if $o ne "/"; + + @s=split(/\s+/,$src); + @t=split(/\s+/,$target); + + for ($i=0; $i<=$#s; $i++) + { + $ret.="$t[$i]: $s[$i]\n"; + $ret.="\tgcc -E -DELF \$(SRC_D)$o$s[$i]|\$(AS) $afile$t[$i]\n\n"; + } + return($ret); + } + +1; diff --git a/lib/libcrypto/util/pl/unix.pl b/lib/libcrypto/util/pl/unix.pl new file mode 100644 index 00000000000..ab4978fd201 --- /dev/null +++ b/lib/libcrypto/util/pl/unix.pl @@ -0,0 +1,83 @@ +#!/usr/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 '/'; + $target="\$(LIB_D)$o$target"; + ($Name=$name) =~ tr/a-z/A-Z/; + + $ret.="$target: \$(${Name}OBJ)\n"; + $ret.="\t\$(RM) $target\n"; + $ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n"; + $ret.="\t\$(RANLIB) $target\n\n"; + } + +sub do_link_rule + { + local($target,$files,$dep_libs,$libs)=@_; + local($ret,$_); + + $file =~ s/\//$o/g if $o ne '/'; + $n=&bname($target); + $ret.="$target: $files $dep_libs\n"; + $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n"; + return($ret); + } + +1; diff --git a/lib/libcrypto/util/point.sh b/lib/libcrypto/util/point.sh new file mode 100644 index 00000000000..92c12e82829 --- /dev/null +++ b/lib/libcrypto/util/point.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +/bin/rm -f $2 +ln -s $1 $2 diff --git a/lib/libcrypto/util/ranlib.sh b/lib/libcrypto/util/ranlib.sh new file mode 100644 index 00000000000..543f712c6ba --- /dev/null +++ b/lib/libcrypto/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/lib/libcrypto/util/sep_lib.sh b/lib/libcrypto/util/sep_lib.sh new file mode 100644 index 00000000000..2348db874e7 --- /dev/null +++ b/lib/libcrypto/util/sep_lib.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +cwd=`pwd` +/bin/rm -fr tmp/* + +cd crypto/des +make -f Makefile.uni tar +make -f Makefile.uni tar_lit +/bin/mv libdes.tgz $cwd/tmp +/bin/mv libdes-l.tgz $cwd/tmp +cd $cwd + +for name in md5 sha cast bf idea rc4 rc2 +do + echo doing $name + (cd crypto; tar cfh - $name)|(cd tmp; tar xf -) + cd tmp/$name + /bin/rm -f Makefile + /bin/rm -f Makefile.ssl + /bin/rm -f Makefile.ssl.orig + /bin/rm -f *.old + /bin/mv Makefile.uni Makefile + + cp $cwd/util/ranlib.sh . + chmod +x ranlib.sh + + if [ -d asm ]; then + mkdir asm/perlasm + cp $cwd/crypto/perlasm/*.pl asm/perlasm + fi + cd .. + tar cf - $name|gzip >$name.tgz +# /bin/rm -fr $name + cd $cwd +done + + diff --git a/lib/libcrypto/util/sp-diff.pl b/lib/libcrypto/util/sp-diff.pl new file mode 100644 index 00000000000..2c883368581 --- /dev/null +++ b/lib/libcrypto/util/sp-diff.pl @@ -0,0 +1,80 @@ +#!/usr/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","cast cbc") + { + if (defined($one{$a,8}) && defined($two{$a,8})) + { + print "type 8 byte% 64 byte% 256 byte% 1024 byte% 8192 byte%\n" + unless $line; + $line++; + printf "%-12s ",$a; + foreach $b (8,64,256,1024,8192) + { + $r=$two{$a,$b}/$one{$a,$b}*100; + printf "%12.2f",$r; + } + print "\n"; + } + } + +foreach $a ( + "rsa 512","rsa 1024","rsa 2048","rsa 4096", + "dsa 512","dsa 1024","dsa 2048", + ) + { + if (defined($one{$a,1}) && defined($two{$a,1})) + { + $r1=($one{$a,1}/$two{$a,1})*100; + $r2=($one{$a,2}/$two{$a,2})*100; + printf "$a bits %% %6.2f %% %6.2f\n",$r1,$r2; + } + } + +sub loadfile + { + local($file)=@_; + local($_,%ret); + + open(IN,"<$file") || die "unable to open '$file' for input\n"; + $header=1; + while (<IN>) + { + $header=0 if /^[dr]sa/; + if (/^type/) { $header=0; next; } + next if $header; + chop; + @a=split; + if ($a[0] =~ /^[dr]sa$/) + { + ($n,$t1,$t2)=($_ =~ /^([dr]sa\s+\d+)\s+bits\s+([.\d]+)s\s+([.\d]+)/); + $ret{$n,1}=$t1; + $ret{$n,2}=$t2; + } + else + { + $n=join(' ',grep(/[^k]$/,@a)); + @k=grep(s/k$//,@a); + + $ret{$n, 8}=$k[0]; + $ret{$n, 64}=$k[1]; + $ret{$n, 256}=$k[2]; + $ret{$n,1024}=$k[3]; + $ret{$n,8192}=$k[4]; + } + } + close(IN); + return(%ret); + } + diff --git a/lib/libcrypto/util/speed.sh b/lib/libcrypto/util/speed.sh new file mode 100644 index 00000000000..f489706197b --- /dev/null +++ b/lib/libcrypto/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/md2/md2_dgst.o +make +apps/ssleay speed rc4 rsa md2 >speed.2l + +perl Configure bl-4c-ri +/bin/rm -f crypto/rc4/rc4*.o +make +apps/ssleay speed rc4 >speed.3l + +perl Configure b2-is-ri-dp +/bin/rm -f crypto/idea/i_*.o crypto/rc4/*.o crypto/des/ecb_enc.o crypto/bn/bn*.o +apps/ssleay speed rsa rc4 idea des >speed.4l + +cat speed.1 >speed.log +cat speed.1l >>speed.log +perl util/sp-diff.pl speed.1l speed.2l >>speed.log +perl util/sp-diff.pl speed.1l speed.3l >>speed.log +perl util/sp-diff.pl speed.1l speed.4l >>speed.log + diff --git a/lib/libcrypto/util/src-dep.pl b/lib/libcrypto/util/src-dep.pl new file mode 100644 index 00000000000..91242f7bb6b --- /dev/null +++ b/lib/libcrypto/util/src-dep.pl @@ -0,0 +1,147 @@ +#!/usr/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/lib/libcrypto/util/ssldir.pl b/lib/libcrypto/util/ssldir.pl new file mode 100644 index 00000000000..10584686da5 --- /dev/null +++ b/lib/libcrypto/util/ssldir.pl @@ -0,0 +1,52 @@ +#!/usr/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/lib/libcrypto/util/ssleay.num b/lib/libcrypto/util/ssleay.num new file mode 100644 index 00000000000..359fa15df1a --- /dev/null +++ b/lib/libcrypto/util/ssleay.num @@ -0,0 +1,156 @@ +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_ssl_version 19 +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_list 52 +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_rbio 63 +SSL_get_read_ahead 64 +SSL_get_shared_ciphers 65 +SSL_get_ssl_method 66 +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_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 +SSL_SESSION_cmp 132 +SSL_SESSION_hash 133 +SSL_SESSION_get_time 134 +SSL_SESSION_set_time 135 +SSL_SESSION_get_timeout 136 +SSL_SESSION_set_timeout 137 +SSL_CTX_get_ex_data 138 +SSL_CTX_get_quiet_shutdown 140 +SSL_CTX_load_verify_locations 141 +SSL_CTX_set_default_verify_paths 142 +SSL_CTX_set_ex_data 143 +SSL_CTX_set_quiet_shutdown 145 +SSL_SESSION_get_ex_data 146 +SSL_SESSION_set_ex_data 148 +SSL_get_SSL_CTX 150 +SSL_get_ex_data 151 +SSL_get_quiet_shutdown 153 +SSL_get_session 154 +SSL_get_shutdown 155 +SSL_get_verify_result 157 +SSL_set_ex_data 158 +SSL_set_info_callback 160 +SSL_set_quiet_shutdown 161 +SSL_set_shutdown 162 +SSL_set_verify_result 163 +SSL_version 164 +SSL_get_info_callback 165 +SSL_state 166 +SSL_CTX_get_ex_new_index 167 +SSL_SESSION_get_ex_new_index 168 +SSL_get_ex_new_index 169 +TLSv1_method 170 +TLSv1_server_method 171 +TLSv1_client_method 172 +BIO_new_buffer_ssl_connect 173 +BIO_new_ssl_connect 174 diff --git a/lib/libcrypto/util/tab_num.pl b/lib/libcrypto/util/tab_num.pl new file mode 100644 index 00000000000..77b591d92fd --- /dev/null +++ b/lib/libcrypto/util/tab_num.pl @@ -0,0 +1,17 @@ +#!/usr/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/lib/libcrypto/util/up_ver.pl b/lib/libcrypto/util/up_ver.pl new file mode 100644 index 00000000000..32c086b2aa2 --- /dev/null +++ b/lib/libcrypto/util/up_ver.pl @@ -0,0 +1,79 @@ +#!/usr/bin/perl +# +# Up the version numbers in the files. +# + +@files=( + "crypto/crypto.h", + "crypto/des/ecb_enc.c", + "crypto/idea/i_ecb.c", + "crypto/lhash/lhash.c", + "crypto/conf/conf.c", + "crypto/md2/md2_dgst.c", + "crypto/md5/md5_dgst.c", + "crypto/ripemd/rmd_dgst.c", + "crypto/pem/pem_lib.c", + "crypto/bn/bn_lib.c", + "crypto/dh/dh_lib.c", + "crypto/rc2/rc2_ecb.c", + "crypto/rc4/rc4_skey.c", + "crypto/rc5/rc5_ecb.c", + "crypto/bf/bf_ecb.c", + "crypto/cast/c_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", + "ssl/t1_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"; +($a,$b,$c,$d)=unpack('axaxac',$ver); +$d=defined($d)?$d-96:0; +$xver=sprintf("%x%x%x%x",$a,$b,$c,$d); + +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/) || + s/^(\#define\s+SSLEAY_VERSION_NUMBER\s+0x)[0-9a-zA-Z]+(.*)$/$1$xver$2/) + { + 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"; + } diff --git a/lib/libcrypto/util/x86asm.sh b/lib/libcrypto/util/x86asm.sh new file mode 100644 index 00000000000..81d32898606 --- /dev/null +++ b/lib/libcrypto/util/x86asm.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +echo Generating x86 assember +echo Bignum +(cd crypto/bn/asm; perl bn-586.pl cpp > bn86unix.cpp) +(cd crypto/bn/asm; perl bn-586.pl win32 > bn-win32.asm) + +echo DES +(cd crypto/des/asm; perl des-586.pl cpp > dx86unix.cpp) +(cd crypto/des/asm; perl des-586.pl win32 > d-win32.asm) + +echo "crypt(3)" +(cd crypto/des/asm; perl crypt586.pl cpp > yx86unix.cpp) +(cd crypto/des/asm; perl crypt586.pl win32 > y-win32.asm) + +echo Blowfish +(cd crypto/bf/asm; perl bf-586.pl cpp > bx86unix.cpp) +(cd crypto/bf/asm; perl bf-586.pl win32 > b-win32.asm) + +echo CAST5 +(cd crypto/cast/asm; perl cast-586.pl cpp > cx86unix.cpp) +(cd crypto/cast/asm; perl cast-586.pl win32 > c-win32.asm) + +echo RC4 +(cd crypto/rc4/asm; perl rc4-586.pl cpp > rx86unix.cpp) +(cd crypto/rc4/asm; perl rc4-586.pl win32 > r4-win32.asm) + +echo MD5 +(cd crypto/md5/asm; perl md5-586.pl cpp > mx86unix.cpp) +(cd crypto/md5/asm; perl md5-586.pl win32 > m5-win32.asm) + +echo SHA1 +(cd crypto/sha/asm; perl sha1-586.pl cpp > sx86unix.cpp) +(cd crypto/sha/asm; perl sha1-586.pl win32 > s1-win32.asm) + +echo RIPEMD160 +(cd crypto/ripemd/asm; perl rmd-586.pl cpp > rm86unix.cpp) +(cd crypto/ripemd/asm; perl rmd-586.pl win32 > rm-win32.asm) + +echo RC5/32 +(cd crypto/rc5/asm; perl rc5-586.pl cpp > r586unix.cpp) +(cd crypto/rc5/asm; perl rc5-586.pl win32 > r5-win32.asm) |