summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rwxr-xr-xutil/add_cr.pl2
-rwxr-xr-xutil/bat.sh132
-rwxr-xr-xutil/do_ms.sh2
-rwxr-xr-xutil/fixNT.sh2
-rwxr-xr-xutil/libeay.num154
-rwxr-xr-xutil/mk1mf.pl181
-rwxr-xr-xutil/mkdef.pl50
-rw-r--r--util/pl/BC-16.pl2
-rw-r--r--util/pl/BC-32.pl2
-rw-r--r--util/pl/VC-16.pl14
-rw-r--r--util/pl/VC-32.pl42
-rw-r--r--util/pl/linux.pl96
-rw-r--r--util/pl/unix.pl1
-rwxr-xr-xutil/sep_lib.sh37
-rwxr-xr-xutil/sp-diff.pl2
-rwxr-xr-xutil/speed.sh2
-rwxr-xr-xutil/ssleay.num47
-rwxr-xr-xutil/up_ver.pl17
-rwxr-xr-xutil/x86asm.sh42
19 files changed, 721 insertions, 106 deletions
diff --git a/util/add_cr.pl b/util/add_cr.pl
index 04d002677c..c7b62c11ec 100755
--- a/util/add_cr.pl
+++ b/util/add_cr.pl
@@ -63,7 +63,7 @@ sub dofile
sub Copyright
{
return <<'EOF';
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
diff --git a/util/bat.sh b/util/bat.sh
new file mode 100755
index 0000000000..c6f48e8a7b
--- /dev/null
+++ b/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/util/do_ms.sh b/util/do_ms.sh
index 03e349df6c..f498d842b7 100755
--- a/util/do_ms.sh
+++ b/util/do_ms.sh
@@ -7,7 +7,7 @@ PATH=util:../util:$PATH
# perl util/mk1mf.pl VC-MSDOS no-sock >ms/msdos.mak
# perl util/mk1mf.pl VC-W31-32 >ms/w31.mak
-perl util/mk1mf.pl VC-W31-32 dll >ms/w31dll.mak
+perl util/mk1mf.pl VC-WIN16 dll >ms/w31dll.mak
# perl util/mk1mf.pl VC-WIN32 >ms/nt.mak
perl util/mk1mf.pl VC-WIN32 dll >ms/ntdll.mak
diff --git a/util/fixNT.sh b/util/fixNT.sh
index a4eee1b7f3..ce4f19299b 100755
--- a/util/fixNT.sh
+++ b/util/fixNT.sh
@@ -10,5 +10,5 @@ chmod +x Configure util/*
echo cleaning
/bin/rm -f `find . -name '*.$$$' -print` 2>/dev/null >/dev/null
echo 'removing those damn ^M'
-perl -pi -e 's/\015//' * */* */*/* 2>/dev/null >/dev/null
+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/util/libeay.num b/util/libeay.num
index 04ad69c6a1..fcaf254287 100755
--- a/util/libeay.num
+++ b/util/libeay.num
@@ -46,11 +46,9 @@ BF_options 45
BF_set_key 46
BIO_CONNECT_free 47
BIO_CONNECT_new 48
-BIO_PROXY_free 49
-BIO_PROXY_new 50
BIO_accept 51
BIO_ctrl 52
-BIO_ctrl_int 53
+BIO_int_ctrl 53
BIO_debug_callback 54
BIO_dump 55
BIO_dup_chain 56
@@ -65,7 +63,6 @@ BIO_fd_should_retry 64
BIO_find_type 65
BIO_free 66
BIO_free_all 67
-BIO_get_accept 68
BIO_get_accept_socket 69
BIO_get_filter_bio 70
BIO_get_host_ip 71
@@ -74,7 +71,6 @@ BIO_get_retry_BIO 73
BIO_get_retry_reason 74
BIO_gethostbyname 75
BIO_gets 76
-BIO_nbio_sock_error 77
BIO_new 78
BIO_new_accept 79
BIO_new_connect 80
@@ -91,12 +87,10 @@ BIO_s_accept 90
BIO_s_connect 91
BIO_s_fd 92
BIO_s_file 93
-BIO_s_file_internal_w16 94
BIO_s_mem 95
BIO_s_null 96
BIO_s_proxy_client 97
BIO_s_socket 98
-BIO_s_socket 99
BIO_set 100
BIO_set_cipher 101
BIO_set_tcp_ndelay 102
@@ -114,9 +108,9 @@ BN_MONT_CTX_new 113
BN_MONT_CTX_set 114
BN_add 115
BN_add_word 116
-BN_ascii2bn 117
+BN_hex2bn 117
BN_bin2bn 118
-BN_bn2ascii 119
+BN_bn2hex 119
BN_bn2bin 120
BN_clear 121
BN_clear_bit 122
@@ -354,7 +348,7 @@ OBJ_add_object 353
OBJ_bsearch 354
OBJ_cleanup 355
OBJ_cmp 356
-OBJ_create_and_add_object 357
+OBJ_create 357
OBJ_dup 358
OBJ_ln2nid 359
OBJ_new_nid 360
@@ -703,8 +697,8 @@ asn1_Finish 702
asn1_GetSequence 703
bn_div64 704
bn_expand2 705
-bn_mul_add_word 706
-bn_mul_word 707
+bn_mul_add_words 706
+bn_mul_words 707
bn_qadd 708
bn_qsub 709
bn_sqr_words 710
@@ -773,7 +767,6 @@ d2i_X509_SIG 772
d2i_X509_VAL 773
d2i_X509_bio 774
d2i_X509_fp 775
-des_3cbc_encrypt 776
des_cbc_cksum 777
des_cbc_encrypt 778
des_cblock_print_file 779
@@ -919,11 +912,6 @@ PKCS7_content_free 918
ERR_load_PKCS7_strings 919
X509_find_by_issuer_and_serial 920
X509_find_by_subject 921
-d2i_PKCS7_fp 922
-i2d_PKCS7_fp 923
-PKCS7_dup 924
-d2i_PKCS7_bio 925
-i2d_PKCS7_bio 926
PKCS7_ctrl 927
PKCS7_set_type 928
PKCS7_set_content 929
@@ -945,11 +933,133 @@ PEM_write_bio_RSAPublicKey 944
d2i_RSAPublicKey_bio 945
i2d_RSAPublicKey_bio 946
PEM_read_RSAPublicKey 947
-PEM_read_bio_RSAPublicKey 948
PEM_write_RSAPublicKey 949
-PEM_write_bio_RSAPublicKey 950
-d2i_RSAPublicKey_bio 951
d2i_RSAPublicKey_fp 952
-i2d_RSAPublicKey_bio 953
i2d_RSAPublicKey_fp 954
BIO_copy_next_retry 955
+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/util/mk1mf.pl b/util/mk1mf.pl
index ef07692890..6f0881a299 100755
--- a/util/mk1mf.pl
+++ b/util/mk1mf.pl
@@ -7,6 +7,8 @@
$INSTALLTOP="/usr/local/ssl";
+$ssl_version="0.8.2";
+
$infile="MINFO";
%ops=(
@@ -18,6 +20,7 @@ $infile="MINFO";
"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",
);
@@ -27,15 +30,18 @@ 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_idea=$no_sha1=$no_rsa=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; }
@@ -45,6 +51,10 @@ foreach (@ARGV)
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; }
@@ -65,8 +75,9 @@ foreach (@ARGV)
{ printf STDERR "\t%-10s\t%s\n",$i,$ops{$i}; }
print STDERR <<"EOF";
and [options] can be one of
- no-md2 no-md5 no-sha no-sha1 no-mdc2 - Skip this digest
- no-rc2 no-rc4 no-idea no-des no-bf - Skip this symetriccipher
+ no-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
@@ -79,7 +90,7 @@ and [options] can be one of
rsaref - Build to require RSAref
Values that can be set
-TMP=tmpdir OUT=outdir SRC=srcdir BIN=binpath CC=C-compiler
+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,
@@ -99,16 +110,21 @@ $no_ssl3=1 if ($no_rsa && $no_dh);
$no_ssl2=1 if ($no_md5 || $no_rsa);
$no_ssl2=1 if ($no_rsa);
-$cc=(defined($VARS{'CC'}))?$VARS{'CC'}:'cc';
-$src_dir=(defined($VARS{'SRC'}))?$VARS{'SRC'}:'.';
-$out_dir=(defined($VARS{'OUT'}))?$VARS{'OUT'}:'out';
-$tmp_dir=(defined($VARS{'TMP'}))?$VARS{'TMP'}:'tmp';
-$bin_dir=(defined($VARS{'BIN'}))?$VARS{'BIN'}:'';
+$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")
{
@@ -159,6 +175,12 @@ 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";
@@ -167,18 +189,24 @@ else
$cflags.=' -DTERMIO';
}
-# $bin_dir.=$o causes a core dump on my sparc :-(
+$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;
@@ -234,6 +262,7 @@ 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
@@ -254,11 +283,25 @@ 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
@@ -280,11 +323,9 @@ RSAGLUE=$RSAglue
# BIN_D - Binary output directory
# TEST_D - Binary test file output directory
# LIB_D - library output directory
-# INC_D - include directory
BIN_D=\$(OUT_D)
TEST_D=\$(OUT_D)
LIB_D=\$(OUT_D)
-INC_D=\$(OUT_D)
# INCL_D - local library directory
# OBJ_D - temp object file directory
@@ -294,8 +335,10 @@ INCL_D=\$(TMP_D)
O_SSL= \$(LIB_D)$o$plib\$(SSL)$shlibp
O_CRYPTO= \$(LIB_D)$o$plib\$(CRYPTO)$shlibp
O_RSAGLUE= \$(LIB_D)$o$plib\$(RSAGLUE)$libp
-L_SSL= \$(LIB_D)$o$plib\$(SSL)$libp
-L_CRYPTO= \$(LIB_D)$o$plib\$(CRYPTO)$libp
+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)
@@ -304,26 +347,36 @@ L_LIBS= \$(L_SSL) \$(L_CRYPTO)
# Don't touch anything below this point
######################################################
-INC=-DFLAT_INC -I\$(INC_D) -I\$(INCL_D)
+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 \$(OUT_D) \$(TMP_D) headers lib exe
+all: banner \$(TMP_D) \$(BIN_D) \$(TEST_D) \$(LIB_D) \$(INC_D) headers lib exe
banner:
$banner
-\$(OUT_D):
- \$(MKDIR) \$(OUT_D)
-
\$(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)
@@ -335,10 +388,10 @@ install:
\$(MKDIR) \$(INSTALLTOP)${o}bin
\$(MKDIR) \$(INSTALLTOP)${o}include
\$(MKDIR) \$(INSTALLTOP)${o}lib
- \$(CP) \$(INC_D)${o}*.h \$(INSTALLTOP)${o}include
+ \$(CP) \$(INC_D)${o}*.\[ch\] \$(INSTALLTOP)${o}include
\$(CP) \$(BIN_D)$o\$(E_EXE)$exep \$(INSTALLTOP)${o}bin
- \$(CP) \$(LIB_D)$o\$(O_SSL) \$(INSTALLTOP)${o}lib
- \$(CP) \$(LIB_D)$o\$(O_CRYPTO) \$(INSTALLTOP)${o}lib
+ \$(CP) \$(O_SSL) \$(INSTALLTOP)${o}lib
+ \$(CP) \$(O_CRYPTO) \$(INSTALLTOP)${o}lib
clean:
\$(RM) \$(TMP_D)$o*.*
@@ -427,6 +480,9 @@ $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)
{
@@ -442,22 +498,53 @@ foreach (values %lib_nam)
if (($bn_mulw_obj ne "") && ($_ eq "CRYPTO"))
{
- $lib_obj =~ s/\S*bn_mulw\S*/\$(BN_MULW_OBJ)/;
+ $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*des_enc\S*/\$(DES_ENC_OBJ)/;
- $lib_obj =~ s/\S*fcrypt_b\S*\s*//;
+ $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*bf_enc\S*/\$(BF_ENC_OBJ)/;
+ $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);
- $rules.=&do_compile_rule("\$(OBJ_D)",$lib_obj{$_},"\$(LIB_CFLAGS)");
+ $lib=($slib)?" \$(SHLIB_CFLAGS)":" \$(LIB_CFLAGS)";
+ $rules.=&do_compile_rule("\$(OBJ_D)",$lib_obj{$_},$lib);
}
$defs.=&do_defs("T_EXE",$test,"\$(TEST_D)",$exep);
@@ -468,10 +555,10 @@ foreach (split(/\s+/,$test))
$rules.=&do_link_rule("\$(TEST_D)$o$t$exep",$tt,"\$(LIBS_DEP)","\$(L_LIBS) \$(EX_LIBS)");
}
-$rules.= &do_lib_rule("\$(SSLOBJ)","\$(O_SSL)",$ssl,$shlib);
-$rules.= &do_lib_rule("\$(RSAGLUEOBJ)","\$(O_RSAGLUE)",$RSAglue,0)
+$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);
+$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)");
@@ -491,6 +578,7 @@ sub var_add
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/;
@@ -505,6 +593,7 @@ sub var_add
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);
@@ -514,7 +603,9 @@ sub var_add
@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;
@@ -567,7 +658,7 @@ sub clean_up_ws
sub do_defs
{
local($var,$files,$location,$postfix)=@_;
- local($_,$ret);
+ local($_,$ret,$pf);
local(*OUT,$tmp,$t);
$files =~ s/\//$o/g if $o ne '/';
@@ -576,19 +667,26 @@ sub do_defs
$Vars{$var}.="";
foreach (split(/ /,$files))
{
+ $orig=$_;
$_=&bname($_) unless /^\$/;
if ($n++ == 2)
{
$n=0;
$ret.="\\\n\t";
}
- if ($_ =~ /BN_MULW/)
- { $t="$_ "; }
- elsif ($_ =~ /DES_ENC/)
- { $t="$_ "; }
- elsif ($_ =~ /BF_ENC/)
- { $t="$_ "; }
- else { $t="$location${o}$_$postfix "; }
+ 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;
@@ -610,13 +708,16 @@ sub bname
sub do_copy_rule
{
local($to,$files,$p)=@_;
- local($ret,$_,$n);
+ local($ret,$_,$n,$pp);
$files =~ s/\//$o/g if $o ne '/';
foreach (split(/\s+/,$files))
{
$n=&bname($_);
- $ret.="$to${o}$n$p: \$(SRC_D)$o$_$p\n\t\$(CP) \$(SRC_D)$o$_$p $to${o}$n$p\n\n";
+ 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);
}
diff --git a/util/mkdef.pl b/util/mkdef.pl
index fa683330e8..b8e99f012d 100755
--- a/util/mkdef.pl
+++ b/util/mkdef.pl
@@ -33,12 +33,15 @@ $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/md/md2.h";
-$crypto.=" crypto/md/md5.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";
@@ -63,6 +66,7 @@ $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;
@@ -97,42 +101,45 @@ sub do_defs
}
foreach (split("\n",$a))
{
- if (/^\#ifndef (.*)/)
+ if (/^\#\s*ifndef (.*)/)
{
push(@tag,$1);
$tag{$1}=-1;
next;
}
- elsif (/^\#if !defined\(([^\)]+)\)/)
+ elsif (/^\#\s*if !defined\(([^\)]+)\)/)
{
push(@tag,$1);
$tag{$1}=-1;
next;
}
- elsif (/^\#ifdef (.*)/)
+ elsif (/^\#\s*ifdef (.*)/)
{
push(@tag,$1);
$tag{$1}=1;
next;
}
- elsif (/^\#if (.*)/)
+ elsif (/^\#\s*if defined(.*)/)
{
push(@tag,$1);
$tag{$1}=1;
next;
}
- elsif (/^\#endif/)
+ elsif (/^\#\s*endif/)
{
$tag{$tag[$#tag]}=0;
pop(@tag);
next;
}
- elsif (/^\#else/)
+ 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,$_); }
@@ -140,12 +147,20 @@ sub do_defs
($tag{'FreeBSD'} != 1) &&
(($NT && ($tag{'WIN16'} != 1)) ||
(!$NT && ($tag{'WIN16'} != -1))) &&
- ($tag{'PERL5'} != 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);
@@ -160,6 +175,7 @@ sub do_line
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)/)
@@ -168,6 +184,22 @@ sub do_line
{ 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*\(/;
diff --git a/util/pl/BC-16.pl b/util/pl/BC-16.pl
index 133fe7fdfe..99128809c0 100644
--- a/util/pl/BC-16.pl
+++ b/util/pl/BC-16.pl
@@ -21,7 +21,7 @@ $lflags="$base_lflags";
if ($win16)
{
$shlib=1;
- $cflags.=" -DWIN16";
+ $cflags.=" -DWINDOWS -DWIN16";
$app_cflag="-W";
$lib_cflag="-WD";
$lflags.="/Twe";
diff --git a/util/pl/BC-32.pl b/util/pl/BC-32.pl
index 84262a8953..988512175a 100644
--- a/util/pl/BC-32.pl
+++ b/util/pl/BC-32.pl
@@ -18,7 +18,7 @@ $cflags="-d $op -DL_ENDIAN ";
$base_lflags="-c";
$lflags="$base_lflags";
-$cflags.=" -DWIN32";
+$cflags.=" -DWINDOWS -DWIN32";
$app_cflag="-WC";
$lib_cflag="-WC";
$lflags.=" -Tpe";
diff --git a/util/pl/VC-16.pl b/util/pl/VC-16.pl
index ea3e5932f5..8119f50c2c 100644
--- a/util/pl/VC-16.pl
+++ b/util/pl/VC-16.pl
@@ -13,6 +13,10 @@ $rm='del';
# C compiler stuff
$cc='cl';
+$out_def="out16";
+$tmp_def="tmp16";
+$inc_def="inc16";
+
if ($debug)
{
$op="/Od /Zi /Zd";
@@ -30,11 +34,12 @@ $lflags="$base_lflags /STACK:20000";
if ($win16)
{
- $cflags.=" -DWIN16";
+ $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:16";
+ $lflags.=" /ALIGN:256";
$ex_libs.="oldnames llibcewq libw";
}
else
@@ -51,6 +56,8 @@ if ($shlib)
$libs="oldnames ldllcew libw";
$shlib_ex_obj="";
# $no_asm=1;
+ $out_def="out16dll";
+ $tmp_def="tmp16dll";
}
else
{ $mlflags=''; }
@@ -106,6 +113,7 @@ sub do_lib_rule
$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";
@@ -126,7 +134,7 @@ sub do_lib_rule
}
else
{
- local($ex)=($target eq '$(O_SSL)')?'$(L_CRYPTO)':"";
+ local($ex)=($target =~ /O_SSL/)?'$(L_CRYPTO)':"";
$ex.=' winsock';
$ret.="\t\$(LINK) \$(MLFLAGS) @<<\n";
$ret.=$dll_names;
diff --git a/util/pl/VC-32.pl b/util/pl/VC-32.pl
index 12bc58e514..4e369f6f1d 100644
--- a/util/pl/VC-32.pl
+++ b/util/pl/VC-32.pl
@@ -12,15 +12,21 @@ $rm='del';
# C compiler stuff
$cc='cl';
-$cflags='/W3 /WX /G5 /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -DWIN32 -DL_ENDIAN';
+$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="/W3 /WX /Zi /Yd /Od /nologo -DWIN32 -D_DEBUG -DL_ENDIAN";
+ $cflags=" /MDd /W3 /WX /Zi /Yd /Od /nologo -DWINDOWS -DWIN32 -D_DEBUG -DL_ENDIAN";
$lflags.=" /debug";
$mlflags.=' /debug';
}
+
$obj='.obj';
$ofile="/Fo";
@@ -44,6 +50,7 @@ $shlib_ex_obj="";
$app_ex_obj="setargv.obj";
$asm='ml /Cp /coff /c /Cx';
+$asm.=" /Zi" if $debug;
$afile='/Fo';
$bn_mulw_obj='';
@@ -55,20 +62,34 @@ $bf_enc_src='';
if (!$no_asm)
{
- $bn_mulw_obj='crypto\bn\asm\x86nt32.obj';
- $bn_mulw_src='crypto\bn\asm\x86nt32.asm';
- $des_enc_obj='crypto\des\asm\d-win32.obj crypto\des\asm\c-win32.obj';
- $des_enc_src='crypto\des\asm\d-win32.asm crypto\des\asm\c-win32.asm';
+ $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.=" /MD";
- $cflags.="d" if ($debug);
- $lib_cflag=" /GD";
+# $cflags =~ s| /MD| /MT|;
+ $lib_cflag=" /GD -D_WINDLL -D_DLL";
+ $out_def="out32dll";
+ $tmp_def="tmp32dll";
}
sub do_lib_rule
@@ -79,6 +100,7 @@ sub do_lib_rule
$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)
{
@@ -87,7 +109,7 @@ sub do_lib_rule
}
else
{
- local($ex)=($target eq '$(O_SSL)')?' $(L_CRYPTO)':'';
+ 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";
}
diff --git a/util/pl/linux.pl b/util/pl/linux.pl
new file mode 100644
index 0000000000..d87a6634d1
--- /dev/null
+++ b/util/pl/linux.pl
@@ -0,0 +1,96 @@
+#!/usr/local/bin/perl
+#
+# linux.pl - the standard unix makefile stuff.
+#
+
+$o='/';
+$cp='/bin/cp';
+$rm='/bin/rm -f';
+
+# C compiler stuff
+
+$cc='gcc';
+if ($debug)
+ { $cflags="-g2 -ggdb -DREF_CHECK -DCRYPTO_MDEBUG"; }
+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/util/pl/unix.pl b/util/pl/unix.pl
index 4c0c91a674..36311711c6 100644
--- a/util/pl/unix.pl
+++ b/util/pl/unix.pl
@@ -59,6 +59,7 @@ sub do_lib_rule
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";
diff --git a/util/sep_lib.sh b/util/sep_lib.sh
new file mode 100755
index 0000000000..2348db874e
--- /dev/null
+++ b/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/util/sp-diff.pl b/util/sp-diff.pl
index fbea9717ec..f81e50201b 100755
--- a/util/sp-diff.pl
+++ b/util/sp-diff.pl
@@ -12,7 +12,7 @@
$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")
+ "idea cfb","idea cbc","rc2 cfb","rc2 cbc","blowfish cbc","cast cbc")
{
if (defined($one{$a,8}) && defined($two{$a,8}))
{
diff --git a/util/speed.sh b/util/speed.sh
index e44f20c8a9..f489706197 100755
--- a/util/speed.sh
+++ b/util/speed.sh
@@ -18,7 +18,7 @@ apps/ssleay version -v -b -f >speed.1
apps/ssleay speed >speed.1l
perl Configure bl-4c-2c
-/bin/rm -f crypto/rc4/*.o crypto/bn/bn*.o crypto/md/md2_dgst.o
+/bin/rm -f crypto/rc4/*.o crypto/bn/bn*.o crypto/md2/md2_dgst.o
make
apps/ssleay speed rc4 rsa md2 >speed.2l
diff --git a/util/ssleay.num b/util/ssleay.num
index 592de9bb0e..359fa15df1 100755
--- a/util/ssleay.num
+++ b/util/ssleay.num
@@ -15,9 +15,7 @@ SSL_CTX_set_cert_verify_cb 14
SSL_CTX_set_cipher_list 15
SSL_CTX_set_client_CA_list 16
SSL_CTX_set_default_passwd_cb 17
-SSL_CTX_set_dh_params 18
SSL_CTX_set_ssl_version 19
-SSL_CTX_set_tmp_rsa 20
SSL_CTX_set_verify 21
SSL_CTX_use_PrivateKey 22
SSL_CTX_use_PrivateKey_ASN1 23
@@ -47,11 +45,7 @@ SSL_dup 46
SSL_dup_CA_list 47
SSL_free 48
SSL_get_certificate 49
-#SSL_get_cipher 50
-#SSL_get_cipher_bits 51
SSL_get_cipher_list 52
-#SSL_get_cipher_name 53
-#SSL_get_cipher_version 54
SSL_get_ciphers 55
SSL_get_client_CA_list 56
SSL_get_default_timeout 57
@@ -59,13 +53,10 @@ SSL_get_error 58
SSL_get_fd 59
SSL_get_peer_cert_chain 60
SSL_get_peer_certificate 61
-SSL_get_privatekey 62
SSL_get_rbio 63
SSL_get_read_ahead 64
SSL_get_shared_ciphers 65
SSL_get_ssl_method 66
-SSL_get_time 67
-SSL_get_timeout 68
SSL_get_verify_callback 69
SSL_get_verify_mode 70
SSL_get_version 71
@@ -89,8 +80,6 @@ SSL_set_read_ahead 88
SSL_set_rfd 89
SSL_set_session 90
SSL_set_ssl_method 91
-SSL_set_time 92
-SSL_set_timeout 93
SSL_set_verify 94
SSL_set_wfd 95
SSL_shutdown 96
@@ -129,3 +118,39 @@ 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/util/up_ver.pl b/util/up_ver.pl
index c2fc7c313b..e4a13bf098 100755
--- a/util/up_ver.pl
+++ b/util/up_ver.pl
@@ -4,18 +4,22 @@
#
@files=(
+ "crypto/crypto.h",
"crypto/des/ecb_enc.c",
"crypto/idea/i_ecb.c",
"crypto/lhash/lhash.c",
"crypto/conf/conf.c",
- "crypto/md/md2_dgst.c",
- "crypto/md/md5_dgst.c",
+ "crypto/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/rc4/rc4_enc.org",
"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",
@@ -30,6 +34,7 @@
"ssl/ssl_lib.c",
"ssl/s2_lib.c",
"ssl/s3_lib.c",
+ "ssl/t1_lib.c",
"README",
);
@@ -40,6 +45,9 @@ $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)
{
@@ -51,7 +59,8 @@ foreach $file (@files)
while (<IN>)
{
- if (s/SSLeay \d\.\d.\d[^"]*(\"|\s)/SSLeay $ver $time\1/)
+ 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++;
diff --git a/util/x86asm.sh b/util/x86asm.sh
new file mode 100755
index 0000000000..81d3289860
--- /dev/null
+++ b/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)