summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rwxr-xr-xutil/copy-if-different.pl78
-rwxr-xr-xutil/files.pl8
-rwxr-xr-xutil/libeay.num102
-rwxr-xr-xutil/mk1mf.pl132
-rwxr-xr-xutil/mkdef.pl9
-rw-r--r--util/mkerr.pl5
-rwxr-xr-xutil/mkstack.pl4
-rw-r--r--util/pl/BC-32.pl2
-rw-r--r--util/pl/VC-32.pl34
-rw-r--r--util/pl/unix.pl350
-rwxr-xr-xutil/ssleay.num49
11 files changed, 730 insertions, 43 deletions
diff --git a/util/copy-if-different.pl b/util/copy-if-different.pl
new file mode 100755
index 0000000000000..ec99e084b56a9
--- /dev/null
+++ b/util/copy-if-different.pl
@@ -0,0 +1,78 @@
+#!/usr/local/bin/perl
+
+use strict;
+
+use Fcntl;
+
+# copy-if-different.pl
+
+# Copy to the destination if the source is not the same as it.
+
+my @filelist;
+
+foreach my $arg (@ARGV) {
+ $arg =~ s|\\|/|g; # compensate for bug/feature in cygwin glob...
+ foreach (glob $arg)
+ {
+ push @filelist, $_;
+ }
+}
+
+my $fnum = @filelist;
+
+if ($fnum <= 1)
+ {
+ die "Need at least two filenames";
+ }
+
+my $dest = pop @filelist;
+
+if ($fnum > 2 && ! -d $dest)
+ {
+ die "Destination must be a directory";
+ }
+
+foreach (@filelist)
+ {
+ my $dfile;
+ if (-d $dest)
+ {
+ $dfile = $_;
+ $dfile =~ s|^.*[/\\]([^/\\]*)$|$1|;
+ $dfile = "$dest/$dfile";
+ }
+ else
+ {
+ $dfile = $dest;
+ }
+
+ my $buf;
+ if (-f $dfile)
+ {
+ sysopen(IN, $_, O_RDONLY|O_BINARY) || die "Can't Open $_";
+ sysopen(OUT, $dfile, O_RDONLY|O_BINARY)
+ || die "Can't Open $dfile";
+ while (sysread IN, $buf, 10240)
+ {
+ my $b2;
+ goto copy if !sysread(OUT, $b2, 10240) || $buf ne $b2;
+ }
+ goto copy if sysread(OUT, $buf, 1);
+ close(IN);
+ close(OUT);
+ print "NOT copying: $_ to $dfile\n";
+ next;
+ }
+ copy:
+ sysopen(IN, $_, O_RDONLY|O_BINARY) || die "Can't Open $_";
+ sysopen(OUT, $dfile, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY)
+ || die "Can't Open $dfile";
+ while (sysread IN, $buf, 10240)
+ {
+ syswrite(OUT, $buf, length($buf));
+ }
+ close(IN);
+ close(OUT);
+ print "Copying: $_ to $dfile\n";
+ }
+
diff --git a/util/files.pl b/util/files.pl
index 41f033e3b9aa4..b15407f0c9056 100755
--- a/util/files.pl
+++ b/util/files.pl
@@ -4,6 +4,12 @@
# It is basically a list of all variables from the passed makefile
#
+while ($ARGV[0] =~ /^(\S+)\s*=(.*)$/)
+ {
+ $sym{$1} = $2;
+ shift;
+ }
+
$s="";
while (<>)
{
@@ -33,7 +39,7 @@ while (<>)
$o =~ s/\s+/ /g;
$o =~ s/\$[({]([^)}]+)[)}]/$sym{$1}/g;
- $sym{$s}=$o;
+ $sym{$s}=$o if !exists $sym{$s};
}
}
diff --git a/util/libeay.num b/util/libeay.num
index b594caf2cf792..7f7487df50442 100755
--- a/util/libeay.num
+++ b/util/libeay.num
@@ -4282,7 +4282,7 @@ CRYPTO_ccm128_decrypt 4648 EXIST::FUNCTION:
CRYPTO_ccm128_aad 4649 EXIST::FUNCTION:
CRYPTO_gcm128_init 4650 EXIST::FUNCTION:
CRYPTO_gcm128_decrypt 4651 EXIST::FUNCTION:
-ENGINE_load_rsax 4652 EXIST::FUNCTION:ENGINE
+ENGINE_load_rsax 4652 NOEXIST::FUNCTION:
CRYPTO_gcm128_decrypt_ctr32 4653 EXIST::FUNCTION:
CRYPTO_gcm128_encrypt_ctr32 4654 EXIST::FUNCTION:
CRYPTO_gcm128_finish 4655 EXIST::FUNCTION:
@@ -4314,3 +4314,103 @@ BIO_dgram_sctp_wait_for_dry 4679 EXIST::FUNCTION:SCTP
BIO_s_datagram_sctp 4680 EXIST::FUNCTION:DGRAM,SCTP
BIO_dgram_is_sctp 4681 EXIST::FUNCTION:SCTP
BIO_dgram_sctp_notification_cb 4682 EXIST::FUNCTION:SCTP
+i2d_DHxparams 4683 EXIST::FUNCTION:DH
+EC_curve_nist2nid 4684 EXIST::FUNCTION:EC
+DH_get_1024_160 4685 EXIST::FUNCTION:DH
+PEM_write_DHxparams 4686 EXIST:!WIN16:FUNCTION:DH
+d2i_DHxparams 4687 EXIST::FUNCTION:DH
+EC_curve_nid2nist 4688 EXIST::FUNCTION:EC
+DH_get_2048_256 4689 EXIST::FUNCTION:DH
+PEM_write_bio_DHxparams 4690 EXIST::FUNCTION:DH
+DH_get_2048_224 4691 EXIST::FUNCTION:DH
+X509_chain_check_suiteb 4692 EXIST::FUNCTION:
+X509_chain_up_ref 4693 EXIST::FUNCTION:
+X509_VERIFY_PARAM_set1_ip_asc 4694 EXIST::FUNCTION:
+X509_CRL_check_suiteb 4695 EXIST::FUNCTION:
+X509_VERIFY_PARAM_set1_email 4696 EXIST::FUNCTION:
+X509_check_email 4697 EXIST::FUNCTION:
+X509_check_host 4698 EXIST::FUNCTION:
+X509_check_ip_asc 4699 EXIST::FUNCTION:
+X509_get0_signature 4700 EXIST::FUNCTION:
+X509_get_signature_nid 4701 EXIST::FUNCTION:
+X509_VERIFY_PARAM_set1_host 4702 EXIST::FUNCTION:
+X509_VERIFY_PARAM_set1_ip 4703 EXIST::FUNCTION:
+X509_check_ip 4704 EXIST::FUNCTION:
+X509_STORE_set_lookup_crls_cb 4705 EXIST::FUNCTION:
+X509_CRL_diff 4706 EXIST::FUNCTION:
+X509_CRL_http_nbio 4707 EXIST::FUNCTION:EVP
+OCSP_REQ_CTX_i2d 4708 EXIST::FUNCTION:
+OCSP_REQ_CTX_get0_mem_bio 4709 EXIST::FUNCTION:
+X509_STORE_CTX_get0_store 4710 EXIST::FUNCTION:
+X509_REVOKED_dup 4711 EXIST::FUNCTION:
+CMS_RecipientInfo_encrypt 4712 EXIST::FUNCTION:CMS
+OCSP_REQ_CTX_http 4713 EXIST::FUNCTION:
+OCSP_REQ_CTX_nbio 4714 EXIST::FUNCTION:
+X509_http_nbio 4715 EXIST::FUNCTION:EVP
+OCSP_set_max_response_length 4716 EXIST::FUNCTION:
+OCSP_REQ_CTX_new 4717 EXIST::FUNCTION:
+OCSP_REQ_CTX_nbio_d2i 4718 EXIST::FUNCTION:
+EVP_aes_256_wrap 4719 EXIST::FUNCTION:AES
+CRYPTO_128_wrap 4720 EXIST::FUNCTION:
+RSA_OAEP_PARAMS_new 4721 EXIST::FUNCTION:RSA
+CRYPTO_128_unwrap 4722 EXIST::FUNCTION:
+ECDSA_METHOD_set_name 4723 EXIST::FUNCTION:ECDSA
+CMS_RecipientInfo_kari_decrypt 4724 EXIST::FUNCTION:CMS
+CMS_SignerInfo_get0_pkey_ctx 4725 EXIST::FUNCTION:CMS
+ECDSA_METHOD_set_flags 4726 EXIST::FUNCTION:ECDSA
+ECDSA_METHOD_set_sign_setup 4727 EXIST::FUNCTION:ECDSA
+CMS_RecipientInfo_kari_orig_id_cmp 4728 EXIST:!VMS:FUNCTION:CMS
+CMS_RecipInfo_kari_orig_id_cmp 4728 EXIST:VMS:FUNCTION:CMS
+CMS_RecipientInfo_kari_get0_alg 4729 EXIST::FUNCTION:CMS
+EVP_aes_192_wrap 4730 EXIST::FUNCTION:AES
+EVP_aes_128_cbc_hmac_sha256 4731 EXIST::FUNCTION:AES,SHA256
+DH_compute_key_padded 4732 EXIST::FUNCTION:DH
+ECDSA_METHOD_set_sign 4733 EXIST::FUNCTION:ECDSA
+CMS_RecipientEncryptedKey_cert_cmp 4734 EXIST:!VMS:FUNCTION:CMS
+CMS_RecipEncryptedKey_cert_cmp 4734 EXIST:VMS:FUNCTION:CMS
+DH_KDF_X9_42 4735 EXIST::FUNCTION:DH
+RSA_OAEP_PARAMS_free 4736 EXIST::FUNCTION:RSA
+EVP_des_ede3_wrap 4737 EXIST::FUNCTION:DES
+RSA_OAEP_PARAMS_it 4738 EXIST:!EXPORT_VAR_AS_FUNCTION:VARIABLE:RSA
+RSA_OAEP_PARAMS_it 4738 EXIST:EXPORT_VAR_AS_FUNCTION:FUNCTION:RSA
+ASN1_TIME_diff 4739 EXIST::FUNCTION:
+EVP_aes_256_cbc_hmac_sha256 4740 EXIST::FUNCTION:AES,SHA256
+CMS_SignerInfo_get0_signature 4741 EXIST::FUNCTION:CMS
+CMS_RecipientInfo_kari_get0_reks 4742 EXIST:!VMS:FUNCTION:CMS
+CMS_RecipInfo_kari_get0_reks 4742 EXIST:VMS:FUNCTION:CMS
+EVP_aes_128_wrap 4743 EXIST::FUNCTION:AES
+CMS_SignerInfo_get0_md_ctx 4744 EXIST::FUNCTION:CMS
+OPENSSL_gmtime_diff 4745 EXIST::FUNCTION:
+CMS_RecipientInfo_kari_set0_pkey 4746 EXIST:!VMS:FUNCTION:CMS
+CMS_RecipInfo_kari_set0_pkey 4746 EXIST:VMS:FUNCTION:CMS
+i2d_RSA_OAEP_PARAMS 4747 EXIST::FUNCTION:RSA
+d2i_RSA_OAEP_PARAMS 4748 EXIST::FUNCTION:RSA
+ECDH_KDF_X9_62 4749 EXIST::FUNCTION:ECDH
+CMS_RecipientInfo_kari_get0_ctx 4750 EXIST::FUNCTION:CMS
+ECDSA_METHOD_new 4751 EXIST::FUNCTION:ECDSA
+CMS_RecipientInfo_get0_pkey_ctx 4752 EXIST::FUNCTION:CMS
+CMS_RecipientEncryptedKey_get0_id 4753 EXIST:!VMS:FUNCTION:CMS
+CMS_RecipEncryptedKey_get0_id 4753 EXIST:VMS:FUNCTION:CMS
+RSA_padding_check_PKCS1_OAEP_mgf1 4754 EXIST:!VMS:FUNCTION:RSA
+RSA_pad_check_PKCS1_OAEP_mgf1 4754 EXIST:VMS:FUNCTION:RSA
+ECDSA_METHOD_set_verify 4755 EXIST::FUNCTION:ECDSA
+CMS_SharedInfo_encode 4756 EXIST::FUNCTION:CMS
+RSA_padding_add_PKCS1_OAEP_mgf1 4757 EXIST::FUNCTION:RSA
+CMS_RecipientInfo_kari_get0_orig_id 4758 EXIST:!VMS:FUNCTION:CMS
+CMS_RecipInfo_kari_get0_orig_id 4758 EXIST:VMS:FUNCTION:CMS
+ECDSA_METHOD_free 4759 EXIST::FUNCTION:ECDSA
+X509_VERIFY_PARAM_get_count 4760 EXIST::FUNCTION:
+X509_VERIFY_PARAM_get0_name 4761 EXIST::FUNCTION:
+X509_VERIFY_PARAM_get0 4762 EXIST::FUNCTION:
+X509V3_EXT_free 4763 EXIST::FUNCTION:
+BIO_hex_string 4764 EXIST::FUNCTION:
+X509_VERIFY_PARAM_set_hostflags 4765 EXIST::FUNCTION:
+BUF_strnlen 4766 EXIST::FUNCTION:
+X509_VERIFY_PARAM_get0_peername 4767 EXIST::FUNCTION:
+ECDSA_METHOD_set_app_data 4768 EXIST::FUNCTION:ECDSA
+sk_deep_copy 4769 EXIST::FUNCTION:
+ECDSA_METHOD_get_app_data 4770 EXIST::FUNCTION:ECDSA
+X509_VERIFY_PARAM_add1_host 4771 EXIST::FUNCTION:
+EC_GROUP_get_mont_data 4772 EXIST::FUNCTION:EC
+i2d_re_X509_tbs 4773 EXIST::FUNCTION:
+EVP_PKEY_asn1_set_item 4774 EXIST::FUNCTION:
diff --git a/util/mk1mf.pl b/util/mk1mf.pl
index 1eee7aa349e26..9b8abc0cf115f 100755
--- a/util/mk1mf.pl
+++ b/util/mk1mf.pl
@@ -2,8 +2,12 @@
# 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
-#
+# funny stuff (if the target is not "copy").
+# If the target is "copy", then it tries to create a makefile that can be
+# safely used with the -j flag and that is compatible with the top-level
+# Makefile, in the sense that it uses the same options and assembler files etc.
+
+use Cwd;
$INSTALLTOP="/usr/local/ssl";
$OPENSSLDIR="/usr/local/ssl";
@@ -28,6 +32,7 @@ my %mf_import = (
INSTALLTOP => \$INSTALLTOP,
OPENSSLDIR => \$OPENSSLDIR,
PLATFORM => \$mf_platform,
+ CC => \$mf_cc,
CFLAG => \$mf_cflag,
DEPFLAG => \$mf_depflag,
CPUID_OBJ => \$mf_cpuid_asm,
@@ -43,16 +48,18 @@ my %mf_import = (
RMD160_ASM_OBJ => \$mf_rmd_asm,
WP_ASM_OBJ => \$mf_wp_asm,
CMLL_ENC => \$mf_cm_asm,
+ MODES_ASM_OBJ => \$mf_modes_asm,
+ ENGINES_ASM_OBJ=> \$mf_engines_asm,
BASEADDR => \$baseaddr,
FIPSDIR => \$fipsdir,
+ EC_ASM => \$mf_ec_asm,
);
-
open(IN,"<Makefile") || die "unable to open Makefile!\n";
while(<IN>) {
my ($mf_opt, $mf_ref);
while (($mf_opt, $mf_ref) = each %mf_import) {
- if (/^$mf_opt\s*=\s*(.*)$/) {
+ if (/^$mf_opt\s*=\s*(.*)$/ && !defined($$mfref)) {
$$mf_ref = $1;
}
}
@@ -83,7 +90,8 @@ $infile="MINFO";
"netware-libc", "CodeWarrior for NetWare - LibC - with WinSock Sockets",
"netware-libc-bsdsock", "CodeWarrior for NetWare - LibC - with BSD Sockets",
"default","cc under unix",
- "auto", "auto detect from top level Makefile"
+ "auto", "auto detect from top level Makefile",
+ "copy", "copy from top level Makefile"
);
$platform="";
@@ -162,7 +170,7 @@ $mkdir="-mkdir" unless defined $mkdir;
$ranlib="echo ranlib";
$cc=(defined($VARS{'CC'}))?$VARS{'CC'}:'cc';
-$src_dir=(defined($VARS{'SRC'}))?$VARS{'SRC'}:'.';
+$src_dir=(defined($VARS{'SRC'}))?$VARS{'SRC'}: $platform eq 'copy' ? getcwd() : '.';
$bin_dir=(defined($VARS{'BIN'}))?$VARS{'BIN'}:'';
# $bin_dir.=$o causes a core dump on my sparc :-(
@@ -172,7 +180,8 @@ $NT=0;
push(@INC,"util/pl","pl");
-if ($platform eq "auto") {
+if ($platform eq "auto" || $platform eq 'copy') {
+ $orig_platform = $platform;
$platform = $mf_platform;
print STDERR "Imported platform $mf_platform\n";
}
@@ -300,6 +309,11 @@ else
##else
{ $cflags="$c_flags$cflags" if ($c_flags ne ""); }
+if ($orig_platform eq 'copy') {
+ $cflags = $mf_cflag;
+ $cc = $mf_cc;
+}
+
$ex_libs="$l_flags$ex_libs" if ($l_flags ne "");
@@ -391,6 +405,14 @@ for (;;)
}
close(IN);
+if ($orig_platform eq 'copy')
+ {
+ # Remove opensslconf.h so it doesn't get updated if we configure a
+ # different branch.
+ $exheader =~ s/[^ ]+\/opensslconf.h//;
+ $header =~ s/[^ ]+\/opensslconf.h//;
+ }
+
if ($shlib)
{
$extra_install= <<"EOF";
@@ -422,6 +444,7 @@ EOF
}
$defs= <<"EOF";
+# N.B. You MUST use -j on FreeBSD.
# This makefile has been automatically generated from the OpenSSL distribution.
# This single makefile will build the complete OpenSSL distribution and
# by default leave the 'intertesting' output files in .${o}out and the stuff
@@ -463,7 +486,7 @@ LINK=$link
LFLAGS=$lflags
RSC=$rsc
-# The output directory for everything intersting
+# The output directory for everything interesting
OUT_D=$out_dir
# The output directory for all the temporary muck
TMP_D=$tmp_dir
@@ -482,13 +505,14 @@ ASM=$bin_dir$asm
# FIPS validated module and support file locations
+E_PREMAIN_DSO=fips_premain_dso
+
FIPSDIR=$fipsdir
BASEADDR=$baseaddr
FIPSLIB_D=\$(FIPSDIR)${o}lib
FIPS_PREMAIN_SRC=\$(FIPSLIB_D)${o}fips_premain.c
O_FIPSCANISTER=\$(FIPSLIB_D)${o}fipscanister.lib
FIPS_SHA1_EXE=\$(FIPSDIR)${o}bin${o}fips_standalone_sha1${exep}
-E_PREMAIN_DSO=fips_premain_dso
PREMAIN_DSO_EXE=\$(BIN_D)${o}fips_premain_dso$exep
FIPSLINK=\$(PERL) \$(FIPSDIR)${o}bin${o}fipslink.pl
@@ -563,8 +587,12 @@ $banner
\$(INC_D):
\$(MKDIR) \"\$(INC_D)\"
+# This needs to be invoked once, when the makefile is first constructed, or
+# after cleaning.
+init: \$(TMP_D) \$(LIB_D) \$(INC_D) \$(INCO_D) \$(BIN_D) \$(TEST_D) headers
+ \$(PERL) \$(SRC_D)/util/copy-if-different.pl "\$(SRC_D)/crypto/opensslconf.h" "\$(INCO_D)/opensslconf.h"
+
headers: \$(HEADER) \$(EXHEADER)
- @
lib: \$(LIBS_DEP) \$(E_SHLIB)
@@ -582,11 +610,6 @@ install: all
\$(CP) apps${o}openssl.cnf \"\$(OPENSSLDIR)\"
$extra_install
-
-test: \$(T_EXE)
- cd \$(BIN_D)
- ..${o}ms${o}test
-
clean:
\$(RM) \$(TMP_D)$o*.*
@@ -594,8 +617,25 @@ vclean:
\$(RM) \$(TMP_D)$o*.*
\$(RM) \$(OUT_D)$o*.*
+reallyclean:
+ \$(RM) -rf \$(TMP_D)
+ \$(RM) -rf \$(BIN_D)
+ \$(RM) -rf \$(TEST_D)
+ \$(RM) -rf \$(LIB_D)
+ \$(RM) -rf \$(INC_D)
+
+EOF
+
+if ($orig_platform ne 'copy')
+ {
+ $rules .= <<"EOF";
+test: \$(T_EXE)
+ cd \$(BIN_D)
+ ..${o}ms${o}test
+
EOF
-
+ }
+
my $platform_cpp_symbol = "MK1MF_PLATFORM_$platform";
$platform_cpp_symbol =~ s/-/_/g;
if (open(IN,"crypto/buildinf.h"))
@@ -632,7 +672,7 @@ printf OUT " #define DATE \"%s\"\n", scalar gmtime();
printf OUT "#endif\n";
close(OUT);
-# Strip of trailing ' '
+# Strip off trailing ' '
foreach (keys %lib_obj) { $lib_obj{$_}=&clean_up_ws($lib_obj{$_}); }
$test=&clean_up_ws($test);
$e_exe=&clean_up_ws($e_exe);
@@ -662,10 +702,38 @@ if ($fips)
{
$rules.=&cc_compile_target("\$(OBJ_D)${o}\$(E_PREMAIN_DSO)$obj",
"\$(FIPS_PREMAIN_SRC)",
- "-DFINGERPRINT_PREMAIN_DSO_LOAD \$(SHLIB_CFLAGS)", "");
+ "-DFINGERPRINT_PREMAIN_DSO_LOAD \$(APP_CFLAGS)", "");
$rules.=&do_link_rule("\$(PREMAIN_DSO_EXE)","\$(OBJ_D)${o}\$(E_PREMAIN_DSO)$obj \$(CRYPTOOBJ) \$(O_FIPSCANISTER)","","\$(EX_LIBS)", 1);
}
+sub fix_asm
+ {
+ my($asm, $dir) = @_;
+
+ return '' if $asm eq '';
+
+ $asm = " $asm";
+ $asm =~ s/\s+/ $dir\//g;
+ $asm =~ s/\.o//g;
+ $asm =~ s/^ //;
+
+ return $asm . ' ';
+ }
+
+if ($orig_platform eq 'copy') {
+ $lib_obj{CRYPTO} .= fix_asm($mf_md5_asm, 'crypto/md5');
+ $lib_obj{CRYPTO} .= fix_asm($mf_bn_asm, 'crypto/bn');
+ # cpuid is included by the crypto dir
+ #$lib_obj{CRYPTO} .= fix_asm($mf_cpuid_asm, 'crypto');
+ # AES asm files DON'T end up included by the aes dir itself
+ $lib_obj{CRYPTO} .= fix_asm($mf_aes_asm, 'crypto/aes');
+ $lib_obj{CRYPTO} .= fix_asm($mf_sha_asm, 'crypto/sha');
+ $lib_obj{CRYPTO} .= fix_asm($mf_engines_asm, 'engines');
+ $lib_obj{CRYPTO} .= fix_asm($mf_rc4_asm, 'crypto/rc4');
+ $lib_obj{CRYPTO} .= fix_asm($mf_modes_asm, 'crypto/modes');
+ $lib_obj{CRYPTO} .= fix_asm($mf_ec_asm, 'crypto/ec');
+}
+
foreach (values %lib_nam)
{
$lib_obj=$lib_obj{$_};
@@ -741,6 +809,8 @@ foreach (split(" ",$otherlibs))
$rules.=&do_link_rule("\$(BIN_D)$o\$(E_EXE)$exep","\$(E_OBJ)","\$(LIBS_DEP)","\$(L_LIBS) \$(EX_LIBS)", ($fips && !$shlib) ? 2 : 0);
+$rules .= get_tests('test/Makefile') if $orig_platform eq 'copy';
+
print $defs;
if ($platform eq "linux-elf") {
@@ -958,6 +1028,11 @@ sub do_compile_rule
{
$ret.=&Sasm_compile_target("$to${o}$n$obj",$s,$n);
}
+ elsif (defined &special_compile_target and
+ ($s=special_compile_target($_)))
+ {
+ $ret.=$s;
+ }
else { die "no rule for $_"; }
}
return($ret);
@@ -968,6 +1043,10 @@ sub do_compile_rule
sub perlasm_compile_target
{
my($target,$source,$bname)=@_;
+
+ return platform_perlasm_compile_target($target, $source, $bname)
+ if defined &platform_perlasm_compile_target;
+
my($ret);
$bname =~ s/(.*)\.[^\.]$/$1/;
@@ -999,9 +1078,13 @@ sub cc_compile_target
$ex_flags.=" -DMK1MF_BUILD -D$platform_cpp_symbol" if ($source =~ /cversion/);
$target =~ s/\//$o/g if $o ne "/";
$source =~ s/\//$o/g if $o ne "/";
- $srcd = "\$(SRC_D)$o" unless defined $srcd;
+ $srcd = "\$(SRC_D)$o" unless defined $srcd && $platform ne 'copy';
$ret ="$target: $srcd$source\n\t";
- $ret.="\$(CC) ${ofile}$target $ex_flags -c $srcd$source\n\n";
+ $ret.="\$(CC)";
+ $ret.= " -MMD" if $orig_platform eq "copy";
+ $ret.= " ${ofile}$target $ex_flags -c $srcd$source\n\n";
+ $target =~ s/\.o$/.d/;
+ $ret.=".sinclude \"$target\"\n\n" if $orig_platform eq "copy";
return($ret);
}
@@ -1066,7 +1149,7 @@ sub do_copy_rule
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";
+ $ret.="$to${o}$n$pp: \$(SRC_D)$o$_$pp\n\t\$(PERL) \$(SRC_D)${o}util${o}copy-if-different.pl \"\$(SRC_D)$o$_$pp\" \"$to${o}$n$pp\"\n\n";
}
return($ret);
}
@@ -1119,8 +1202,8 @@ sub read_options
"no-tlsext" => \$no_tlsext,
"no-srp" => \$no_srp,
"no-cms" => \$no_cms,
- "no-ec2m" => \$no_ec2m,
"no-jpake" => \$no_jpake,
+ "no-ec2m" => \$no_ec2m,
"no-ec_nistp_64_gcc_128" => 0,
"no-err" => \$no_err,
"no-sock" => \$no_sock,
@@ -1151,9 +1234,12 @@ sub read_options
"no-montasm" => 0,
"no-shared" => 0,
"no-store" => 0,
- "no-unit-test" => 0,
"no-zlib" => 0,
"no-zlib-dynamic" => 0,
+ "no-ssl-trace" => 0,
+ "no-unit-test" => 0,
+ "no-libunbound" => 0,
+ "no-multiblock" => 0,
"fips" => \$fips
);
diff --git a/util/mkdef.pl b/util/mkdef.pl
index 894f0529fc475..c57c7f748eda4 100755
--- a/util/mkdef.pl
+++ b/util/mkdef.pl
@@ -121,8 +121,10 @@ my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF",
"SCTP",
# SRTP
"SRTP",
+ # SSL TRACE
+ "SSL_TRACE",
# Unit testing
- "UNIT_TEST");
+ "UNIT_TEST");
my $options="";
open(IN,"<Makefile") || die "unable to open Makefile!\n";
@@ -142,7 +144,7 @@ my $no_ec; my $no_ecdsa; my $no_ecdh; my $no_engine; my $no_hw;
my $no_fp_api; my $no_static_engine=1; my $no_gmp; my $no_deprecated;
my $no_rfc3779; my $no_psk; my $no_tlsext; my $no_cms; my $no_capieng;
my $no_jpake; my $no_srp; my $no_ssl2; my $no_ec2m; my $no_nistp_gcc;
-my $no_nextprotoneg; my $no_sctp; my $no_srtp;
+my $no_nextprotoneg; my $no_sctp; my $no_srtp; my $no_ssl_trace;
my $no_unit_test; my $no_ssl3_method;
my $fips;
@@ -239,6 +241,7 @@ foreach (@ARGV, split(/ /, $options))
elsif (/^no-nextprotoneg$/) { $no_nextprotoneg=1; }
elsif (/^no-ssl2$/) { $no_ssl2=1; }
elsif (/^no-ssl3-method$/) { $no_ssl3_method=1; }
+ elsif (/^no-ssl-trace$/) { $no_ssl_trace=1; }
elsif (/^no-capieng$/) { $no_capieng=1; }
elsif (/^no-jpake$/) { $no_jpake=1; }
elsif (/^no-srp$/) { $no_srp=1; }
@@ -842,6 +845,7 @@ sub do_defs
$def .= "int PEM_write_bio_$1(void);";
next;
} elsif (/^DECLARE_PEM_write\s*\(\s*(\w*)\s*,/ ||
+ /^DECLARE_PEM_write_const\s*\(\s*(\w*)\s*,/ ||
/^DECLARE_PEM_write_cb\s*\(\s*(\w*)\s*,/ ) {
# Things not in Win16
$def .=
@@ -1212,6 +1216,7 @@ sub is_valid
{ return 0; }
if ($keyword eq "SSL2" && $no_ssl2) { return 0; }
if ($keyword eq "SSL3_METHOD" && $no_ssl3_method) { return 0; }
+ if ($keyword eq "SSL_TRACE" && $no_ssl_trace) { return 0; }
if ($keyword eq "CAPIENG" && $no_capieng) { return 0; }
if ($keyword eq "JPAKE" && $no_jpake) { return 0; }
if ($keyword eq "SRP" && $no_srp) { return 0; }
diff --git a/util/mkerr.pl b/util/mkerr.pl
index d87c4fd22cd26..09ebebef9b52c 100644
--- a/util/mkerr.pl
+++ b/util/mkerr.pl
@@ -14,6 +14,7 @@ my $pack_errcode;
my $load_errcode;
my $errcount;
+my $year = (localtime)[5] + 1900;
while (@ARGV) {
my $arg = $ARGV[0];
@@ -391,7 +392,7 @@ foreach $lib (keys %csrc)
} else {
push @out,
"/* ====================================================================\n",
-" * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved.\n",
+" * Copyright (c) 2001-$year The OpenSSL Project. All rights reserved.\n",
" *\n",
" * Redistribution and use in source and binary forms, with or without\n",
" * modification, are permitted provided that the following conditions\n",
@@ -584,7 +585,7 @@ EOF
print OUT <<"EOF";
/* $cfile */
/* ====================================================================
- * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved.
+ * Copyright (c) 1999-$year The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/util/mkstack.pl b/util/mkstack.pl
index f708610a7888d..2bd96cd0c1ea8 100755
--- a/util/mkstack.pl
+++ b/util/mkstack.pl
@@ -90,6 +90,7 @@ while(<IN>) {
#define sk_${type_thing}_set_cmp_func(st, cmp) SKM_sk_set_cmp_func($type_thing, (st), (cmp))
#define sk_${type_thing}_dup(st) SKM_sk_dup($type_thing, st)
#define sk_${type_thing}_pop_free(st, free_func) SKM_sk_pop_free($type_thing, (st), (free_func))
+#define sk_${type_thing}_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy($type_thing, (st), (copy_func), (free_func))
#define sk_${type_thing}_shift(st) SKM_sk_shift($type_thing, (st))
#define sk_${type_thing}_pop(st) SKM_sk_pop($type_thing, (st))
#define sk_${type_thing}_sort(st) SKM_sk_sort($type_thing, (st))
@@ -108,7 +109,8 @@ EOF
#define sk_${t1}_find(st, val) sk_find(CHECKED_STACK_OF($t1, st), CHECKED_PTR_OF($t2, val))
#define sk_${t1}_value(st, i) (($t1)sk_value(CHECKED_STACK_OF($t1, st), i))
#define sk_${t1}_num(st) SKM_sk_num($t1, st)
-#define sk_${t1}_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF($t1, st), CHECKED_SK_FREE_FUNC2($t1, free_func))
+#define sk_${t1}_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF($t1, st), CHECKED_SK_FREE_FUNC($t2, free_func))
+#define sk_${t1}_deep_copy(st, copy_func, free_func) ((STACK_OF($t1) *)sk_deep_copy(CHECKED_STACK_OF($t1, st), CHECKED_SK_COPY_FUNC($t2, copy_func), CHECKED_SK_FREE_FUNC($t2, free_func)))
#define sk_${t1}_insert(st, val, i) sk_insert(CHECKED_STACK_OF($t1, st), CHECKED_PTR_OF($t2, val), i)
#define sk_${t1}_free(st) SKM_sk_free(${t1}, st)
#define sk_${t1}_set(st, i, val) sk_set(CHECKED_STACK_OF($t1, st), i, CHECKED_PTR_OF($t2, val))
diff --git a/util/pl/BC-32.pl b/util/pl/BC-32.pl
index 6d036644de74f..f7161d7bfe2d5 100644
--- a/util/pl/BC-32.pl
+++ b/util/pl/BC-32.pl
@@ -18,7 +18,7 @@ $out_def="out32";
$tmp_def="tmp32";
$inc_def="inc32";
#enable max error messages, disable most common warnings
-$cflags="-DWIN32_LEAN_AND_MEAN -q -w-ccc -w-rch -w-pia -w-aus -w-par -w-inl -c -tWC -tWM -DOPENSSL_SYSNAME_WIN32 -DL_ENDIAN -DDSO_WIN32 -D_stricmp=stricmp -D_strnicmp=strnicmp -D_timeb=timeb -D_ftime=ftime ";
+$cflags="-DWIN32_LEAN_AND_MEAN -q -w-ccc -w-rch -w-pia -w-aus -w-par -w-inl -c -tWC -tWM -DOPENSSL_SYSNAME_WIN32 -DL_ENDIAN -DDSO_WIN32 -D_stricmp=stricmp -D_strnicmp=strnicmp ";
if ($debug)
{
$cflags.="-Od -y -v -vi- -D_DEBUG";
diff --git a/util/pl/VC-32.pl b/util/pl/VC-32.pl
index b597998515272..da05e9dff810e 100644
--- a/util/pl/VC-32.pl
+++ b/util/pl/VC-32.pl
@@ -46,7 +46,6 @@ if ($FLAVOR =~ /WIN64/)
#
$base_cflags= " $mf_cflag";
my $f = $shlib || $fips ?' /MD':' /MT';
- $lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib
$opt_cflags=$f.' /Ox';
$dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG';
$lflags="/nologo /subsystem:console /opt:ref";
@@ -89,7 +88,7 @@ elsif ($FLAVOR =~ /CE/)
$wcetgt = $ENV{'TARGETCPU'}; # just shorter name...
SWITCH: for($wcetgt) {
/^X86/ && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_";
- $wcelflag.=" /machine:IX86"; last; };
+ $wcelflag.=" /machine:X86"; last; };
/^ARMV4[IT]/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
$wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/);
$wcecdefs.=" -QRarch4T -QRinterwork-return";
@@ -114,25 +113,30 @@ elsif ($FLAVOR =~ /CE/)
$wcelflag.=" /machine:$wcetgt"; last; };
}
- $cc='$(CC)';
+ $cc=($ENV{CC} or "cl");
$base_cflags=' /W3 /WX /GF /Gy /nologo -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -DOPENSSL_SMALL_FOOTPRINT';
$base_cflags.=" $wcecdefs";
$base_cflags.=' -I$(WCECOMPAT)/include' if (defined($ENV{'WCECOMPAT'}));
$base_cflags.=' -I$(PORTSDK_LIBPATH)/../../include' if (defined($ENV{'PORTSDK_LIBPATH'}));
- $opt_cflags=' /MC /O1i'; # optimize for space, but with intrinsics...
- $dbg_cflags=' /MC /Od -DDEBUG -D_DEBUG';
+ if (`$cc 2>&1` =~ /Version ([0-9]+)\./ && $1>=14) {
+ $base_cflags.=$shlib?' /MD':' /MT';
+ } else {
+ $base_cflags.=' /MC';
+ }
+ $opt_cflags=' /O1i'; # optimize for space, but with intrinsics...
+ $dbg_cflags=' /Od -DDEBUG -D_DEBUG';
$lflags="/nologo /opt:ref $wcelflag";
}
else # Win32
{
$base_cflags= " $mf_cflag";
my $f = $shlib || $fips ?' /MD':' /MT';
- $lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib
$ff = "/fixed";
$opt_cflags=$f.' /Ox /O2 /Ob2';
$dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG';
$lflags="/nologo /subsystem:console /opt:ref";
}
+$lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib
$mlflags='';
$out_def ="out32"; $out_def.="dll" if ($shlib);
@@ -165,14 +169,26 @@ $rsc="rc";
$efile="/out:";
$exep='.exe';
if ($no_sock) { $ex_libs=''; }
-elsif ($FLAVOR =~ /CE/) { $ex_libs='winsock.lib'; }
+elsif ($FLAVOR =~ /CE/) { $ex_libs='ws2.lib'; }
else { $ex_libs='ws2_32.lib'; }
if ($FLAVOR =~ /CE/)
{
- $ex_libs.=' $(WCECOMPAT)/lib/wcecompatex.lib' if (defined($ENV{'WCECOMPAT'}));
+ $ex_libs.=' crypt32.lib'; # for e_capi.c
+ if (defined($ENV{WCECOMPAT}))
+ {
+ $ex_libs.= ' $(WCECOMPAT)/lib';
+ if (-f "$ENV{WCECOMPAT}/lib/$ENV{TARGETCPU}/wcecompatex.lib")
+ {
+ $ex_libs.='/$(TARGETCPU)/wcecompatex.lib';
+ }
+ else
+ {
+ $ex_libs.='/wcecompatex.lib';
+ }
+ }
$ex_libs.=' $(PORTSDK_LIBPATH)/portlib.lib' if (defined($ENV{'PORTSDK_LIBPATH'}));
- $ex_libs.=' /nodefaultlib:oldnames.lib coredll.lib corelibc.lib' if ($ENV{'TARGETCPU'} eq "X86");
+ $ex_libs.=' /nodefaultlib coredll.lib corelibc.lib' if ($ENV{'TARGETCPU'} eq "X86");
}
else
{
diff --git a/util/pl/unix.pl b/util/pl/unix.pl
index 146611ad99586..1d4e9dc5df190 100644
--- a/util/pl/unix.pl
+++ b/util/pl/unix.pl
@@ -26,11 +26,12 @@ else
{ $cflags="-O"; }
}
$obj='.o';
+$asm_suffix='.s';
$ofile='-o ';
# EXE linking stuff
$link='${CC}';
-$lflags='${CFLAGS}';
+$lflags='${CFLAG}';
$efile='-o ';
$exep='';
$ex_libs="";
@@ -53,6 +54,93 @@ $des_enc_src="";
$bf_enc_obj="";
$bf_enc_src="";
+%perl1 = (
+ 'md5-x86_64' => 'crypto/md5',
+ 'x86_64-mont' => 'crypto/bn',
+ 'x86_64-mont5' => 'crypto/bn',
+ 'x86_64-gf2m' => 'crypto/bn',
+ 'aes-x86_64' => 'crypto/aes',
+ 'vpaes-x86_64' => 'crypto/aes',
+ 'bsaes-x86_64' => 'crypto/aes',
+ 'aesni-x86_64' => 'crypto/aes',
+ 'aesni-sha1-x86_64' => 'crypto/aes',
+ 'sha1-x86_64' => 'crypto/sha',
+ 'e_padlock-x86_64' => 'engines',
+ 'rc4-x86_64' => 'crypto/rc4',
+ 'rc4-md5-x86_64' => 'crypto/rc4',
+ 'ghash-x86_64' => 'crypto/modes',
+ 'aesni-gcm-x86_64' => 'crypto/modes',
+ 'aesni-sha256-x86_64' => 'crypto/aes',
+ 'rsaz-x86_64' => 'crypto/bn',
+ 'rsaz-avx2' => 'crypto/bn',
+ 'aesni-mb-x86_64' => 'crypto/aes',
+ 'sha1-mb-x86_64' => 'crypto/sha',
+ 'sha256-mb-x86_64' => 'crypto/sha',
+ 'ecp_nistz256-x86_64' => 'crypto/ec',
+ );
+
+# If I were feeling more clever, these could probably be extracted
+# from makefiles.
+sub platform_perlasm_compile_target
+ {
+ local($target, $source, $bname) = @_;
+
+ for $p (keys %perl1)
+ {
+ if ($target eq "\$(OBJ_D)/$p.o")
+ {
+ return << "EOF";
+\$(TMP_D)/$p.s: $perl1{$p}/asm/$p.pl
+ \$(PERL) $perl1{$p}/asm/$p.pl \$(PERLASM_SCHEME) > \$@
+EOF
+ }
+ }
+ if ($target eq '$(OBJ_D)/x86_64cpuid.o')
+ {
+ return << 'EOF';
+$(TMP_D)/x86_64cpuid.s: crypto/x86_64cpuid.pl
+ $(PERL) crypto/x86_64cpuid.pl $(PERLASM_SCHEME) > $@
+EOF
+ }
+ elsif ($target eq '$(OBJ_D)/sha256-x86_64.o')
+ {
+ return << 'EOF';
+$(TMP_D)/sha256-x86_64.s: crypto/sha/asm/sha512-x86_64.pl
+ $(PERL) crypto/sha/asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@
+EOF
+ }
+ elsif ($target eq '$(OBJ_D)/sha512-x86_64.o')
+ {
+ return << 'EOF';
+$(TMP_D)/sha512-x86_64.s: crypto/sha/asm/sha512-x86_64.pl
+ $(PERL) crypto/sha/asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@
+EOF
+ }
+ elsif ($target eq '$(OBJ_D)/sha512-x86_64.o')
+ {
+ return << 'EOF';
+$(TMP_D)/sha512-x86_64.s: crypto/sha/asm/sha512-x86_64.pl
+ $(PERL) crypto/sha/asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@
+EOF
+ }
+
+ die $target;
+ }
+
+sub special_compile_target
+ {
+ local($target) = @_;
+
+ if ($target eq 'crypto/bn/x86_64-gcc')
+ {
+ return << "EOF";
+\$(TMP_D)/x86_64-gcc.o: crypto/bn/asm/x86_64-gcc.c
+ \$(CC) \$(CFLAGS) -c -o \$@ crypto/bn/asm/x86_64-gcc.c
+EOF
+ }
+ return undef;
+ }
+
sub do_lib_rule
{
local($obj,$target,$name,$shlib)=@_;
@@ -72,7 +160,7 @@ 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";
@@ -93,4 +181,262 @@ sub which
}
}
+sub fixtests
+ {
+ my ($str, $tests) = @_;
+
+ foreach my $t (keys %$tests)
+ {
+ $str =~ s/(\.\/)?\$\($t\)/\$(TEST_D)\/$tests->{$t}/g;
+ }
+
+ return $str;
+ }
+
+sub fixdeps
+ {
+ my ($str, $fakes) = @_;
+
+ my @t = split(/\s+/, $str);
+ $str = '';
+ foreach my $t (@t)
+ {
+ $str .= ' ' if $str ne '';
+ if (exists($fakes->{$t}))
+ {
+ $str .= $fakes->{$t};
+ next;
+ }
+ if ($t =~ /^[^\/]+$/)
+ {
+ $str .= '$(TEST_D)/' . $t;
+ }
+ else
+ {
+ $str .= $t;
+ }
+ }
+
+ return $str;
+ }
+
+sub fixrules
+ {
+ my ($str) = @_;
+
+ # Compatible with -j...
+ $str =~ s/^(\s+@?)/$1cd \$(TEST_D) && /;
+ return $str;
+
+ # Compatible with not -j.
+ my @t = split("\n", $str);
+ $str = '';
+ my $prev;
+ foreach my $t (@t)
+ {
+ $t =~ s/^\s+//;
+ if (!$prev)
+ {
+ if ($t =~ /^@/)
+ {
+ $t =~ s/^@/\@cd \$(TEST_D) && /;
+ }
+ elsif ($t !~ /^\s*#/)
+ {
+ $t = 'cd $(TEST_D) && ' . $t;
+ }
+ }
+ $str .= "\t$t\n";
+ $prev = $t =~/\\$/;
+ }
+ return $str;
+}
+
+sub copy_scripts
+ {
+ my ($sed, $src, @targets) = @_;
+
+ my $s = '';
+ foreach my $t (@targets)
+ {
+ # Copy first so we get file modes...
+ $s .= "\$(TEST_D)/$t: \$(SRC_D)/$src/$t\n\tcp \$(SRC_D)/$src/$t \$(TEST_D)/$t\n";
+ $s .= "\tsed -e 's/\\.\\.\\/apps/..\\/\$(OUT_D)/' -e 's/\\.\\.\\/util/..\\/\$(TEST_D)/' < \$(SRC_D)/$src/$t > \$(TEST_D)/$t\n" if $sed;
+ $s .= "\n";
+ }
+ return $s;
+ }
+
+sub get_tests
+ {
+ my ($makefile) = @_;
+
+ open(M, $makefile) || die "Can't open $makefile: $!";
+ my %targets;
+ my %deps;
+ my %tests;
+ my %alltests;
+ my %fakes;
+ while (my $line = <M>)
+ {
+ chomp $line;
+ while ($line =~ /^(.*)\\$/)
+ {
+ $line = $1 . <M>;
+ }
+
+ if ($line =~ /^alltests:(.*)$/)
+ {
+ my @t = split(/\s+/, $1);
+ foreach my $t (@t)
+ {
+ $targets{$t} = '';
+ $alltests{$t} = undef;
+ }
+ }
+
+ if (($line =~ /^(?<t>\S+):(?<d>.*)$/ && exists $targets{$1})
+ || $line =~ /^(?<t>test_(ss|gen) .*):(?<d>.*)/)
+ {
+ my $t = $+{t};
+ my $d = $+{d};
+ # If there are multiple targets stupid FreeBSD make runs the
+ # rules once for each dependency that matches one of the
+ # targets. Running the same rule twice concurrently causes
+ # breakage, so replace with a fake target.
+ if ($t =~ /\s/)
+ {
+ ++$fake;
+ my @targets = split /\s+/, $t;
+ $t = "_fake$fake";
+ foreach my $f (@targets)
+ {
+ $fakes{$f} = $t;
+ }
+ }
+ $deps{$t} = $d;
+ $deps{$t} =~ s/#.*$//;
+ for (;;)
+ {
+ $line = <M>;
+ chomp $line;
+ last if $line eq '';
+ $targets{$t} .= "$line\n";
+ }
+ next;
+ }
+
+ if ($line =~ /^(\S+TEST)=\s*(\S+)$/)
+ {
+ $tests{$1} = $2;
+ next;
+ }
+ }
+
+ delete $alltests{test_jpake} if $no_jpake;
+ delete $targets{test_ige} if $no_ige;
+ delete $alltests{test_md2} if $no_md2;
+ delete $alltests{test_rc5} if $no_rc5;
+
+ my $tests;
+ foreach my $t (keys %tests)
+ {
+ $tests .= "$t = $tests{$t}\n";
+ }
+
+ my $each;
+ foreach my $t (keys %targets)
+ {
+ next if $t eq '';
+
+ my $d = $deps{$t};
+ $d =~ s/\.\.\/apps/\$(BIN_D)/g;
+ $d =~ s/\.\.\/util/\$(TEST_D)/g;
+ $d = fixtests($d, \%tests);
+ $d = fixdeps($d, \%fakes);
+
+ my $r = $targets{$t};
+ $r =~ s/\.\.\/apps/..\/\$(BIN_D)/g;
+ $r =~ s/\.\.\/util/..\/\$(TEST_D)/g;
+ $r =~ s/\.\.\/(\S+)/\$(SRC_D)\/$1/g;
+ $r = fixrules($r);
+
+ next if $r eq '';
+
+ $t =~ s/\s+/ \$(TEST_D)\//g;
+
+ $each .= "$t: test_scripts $d\n\t\@echo '$t test started'\n$r\t\@echo '$t test done'\n\n";
+ }
+
+ # FIXME: Might be a clever way to figure out what needs copying
+ my @copies = ( 'bctest',
+ 'testgen',
+ 'cms-test.pl',
+ 'tx509',
+ 'test.cnf',
+ 'testenc',
+ 'tocsp',
+ 'testca',
+ 'CAss.cnf',
+ 'testtsa',
+ 'CAtsa.cnf',
+ 'Uss.cnf',
+ 'P1ss.cnf',
+ 'P2ss.cnf',
+ 'tcrl',
+ 'tsid',
+ 'treq',
+ 'tpkcs7',
+ 'tpkcs7d',
+ 'testcrl.pem',
+ 'testx509.pem',
+ 'v3-cert1.pem',
+ 'v3-cert2.pem',
+ 'testreq2.pem',
+ 'testp7.pem',
+ 'pkcs7-1.pem',
+ 'trsa',
+ 'testrsa.pem',
+ 'testsid.pem',
+ 'testss',
+ 'testssl',
+ 'testsslproxy',
+ 'serverinfo.pem',
+ );
+ my $copies = copy_scripts(1, 'test', @copies);
+ $copies .= copy_scripts(0, 'test', ('smcont.txt'));
+
+ my @utils = ( 'shlib_wrap.sh',
+ 'opensslwrap.sh',
+ );
+ $copies .= copy_scripts(1, 'util', @utils);
+
+ my @apps = ( 'CA.sh',
+ 'openssl.cnf',
+ 'server2.pem',
+ );
+ $copies .= copy_scripts(1, 'apps', @apps);
+
+ $copies .= copy_scripts(1, 'crypto/evp', ('evptests.txt'));
+
+ $scripts = "test_scripts: \$(TEST_D)/CA.sh \$(TEST_D)/opensslwrap.sh \$(TEST_D)/openssl.cnf \$(TEST_D)/shlib_wrap.sh ocsp smime\n";
+ $scripts .= "\nocsp:\n\tcp -R test/ocsp-tests \$(TEST_D)\n";
+ $scripts .= "\smime:\n\tcp -R test/smime-certs \$(TEST_D)\n";
+
+ my $all = 'test:';
+ foreach my $t (keys %alltests)
+ {
+ if (exists($fakes{$t}))
+ {
+ $all .= " $fakes{$t}";
+ }
+ else
+ {
+ $all .= " $t";
+ }
+ }
+
+ return "$scripts\n$copies\n$tests\n$all\n\n$each";
+ }
+
1;
diff --git a/util/ssleay.num b/util/ssleay.num
index dd1c5e88239e3..5a8991350c50f 100755
--- a/util/ssleay.num
+++ b/util/ssleay.num
@@ -316,8 +316,55 @@ SSL_CTX_set_next_protos_adv_cb 355 EXIST:VMS:FUNCTION:NEXTPROTONEG
SSL_get0_next_proto_negotiated 356 EXIST::FUNCTION:NEXTPROTONEG
SSL_get_selected_srtp_profile 357 EXIST::FUNCTION:SRTP
SSL_CTX_set_tlsext_use_srtp 358 EXIST::FUNCTION:SRTP
-SSL_select_next_proto 359 EXIST::FUNCTION:NEXTPROTONEG
+SSL_select_next_proto 359 EXIST::FUNCTION:TLSEXT
SSL_get_srtp_profiles 360 EXIST::FUNCTION:SRTP
SSL_CTX_set_next_proto_select_cb 361 EXIST:!VMS:FUNCTION:NEXTPROTONEG
SSL_CTX_set_next_proto_sel_cb 361 EXIST:VMS:FUNCTION:NEXTPROTONEG
SSL_SESSION_get_compress_id 362 EXIST::FUNCTION:
+SSL_get0_param 363 EXIST::FUNCTION:
+SSL_CTX_get0_privatekey 364 EXIST::FUNCTION:
+SSL_get_shared_sigalgs 365 EXIST::FUNCTION:TLSEXT
+SSL_CONF_CTX_finish 366 EXIST::FUNCTION:
+DTLS_method 367 EXIST::FUNCTION:
+DTLS_client_method 368 EXIST::FUNCTION:
+SSL_CIPHER_standard_name 369 EXIST::FUNCTION:SSL_TRACE
+SSL_set_alpn_protos 370 EXIST::FUNCTION:
+SSL_CTX_set_srv_supp_data 371 NOEXIST::FUNCTION:
+SSL_CONF_cmd_argv 372 EXIST::FUNCTION:
+DTLSv1_2_server_method 373 EXIST::FUNCTION:
+SSL_COMP_set0_compression_methods 374 EXIST:!VMS:FUNCTION:COMP
+SSL_COMP_set0_compress_methods 374 EXIST:VMS:FUNCTION:COMP
+SSL_CTX_set_cert_cb 375 EXIST::FUNCTION:
+SSL_CTX_add_client_custom_ext 376 EXIST::FUNCTION:TLSEXT
+SSL_is_server 377 EXIST::FUNCTION:
+SSL_CTX_get0_param 378 EXIST::FUNCTION:
+SSL_CONF_cmd 379 EXIST::FUNCTION:
+SSL_CTX_get_ssl_method 380 EXIST::FUNCTION:
+SSL_CONF_CTX_set_ssl_ctx 381 EXIST::FUNCTION:
+SSL_CIPHER_find 382 EXIST::FUNCTION:
+SSL_CTX_use_serverinfo 383 EXIST::FUNCTION:TLSEXT
+DTLSv1_2_client_method 384 EXIST::FUNCTION:
+SSL_get0_alpn_selected 385 EXIST::FUNCTION:
+SSL_CONF_CTX_clear_flags 386 EXIST::FUNCTION:
+SSL_CTX_set_alpn_protos 387 EXIST::FUNCTION:
+SSL_CTX_add_server_custom_ext 389 EXIST::FUNCTION:TLSEXT
+SSL_CTX_get0_certificate 390 EXIST::FUNCTION:
+SSL_CTX_set_alpn_select_cb 391 EXIST::FUNCTION:
+SSL_CONF_cmd_value_type 392 EXIST::FUNCTION:
+SSL_set_cert_cb 393 EXIST::FUNCTION:
+SSL_get_sigalgs 394 EXIST::FUNCTION:TLSEXT
+SSL_CONF_CTX_set1_prefix 395 EXIST::FUNCTION:
+SSL_CONF_CTX_new 396 EXIST::FUNCTION:
+SSL_CONF_CTX_set_flags 397 EXIST::FUNCTION:
+SSL_CONF_CTX_set_ssl 398 EXIST::FUNCTION:
+SSL_check_chain 399 EXIST::FUNCTION:TLSEXT
+SSL_certs_clear 400 EXIST::FUNCTION:
+SSL_CONF_CTX_free 401 EXIST::FUNCTION:
+SSL_trace 402 EXIST::FUNCTION:SSL_TRACE
+SSL_CTX_set_cli_supp_data 403 NOEXIST::FUNCTION:
+DTLSv1_2_method 404 EXIST::FUNCTION:
+DTLS_server_method 405 EXIST::FUNCTION:
+SSL_CTX_use_serverinfo_file 406 EXIST::FUNCTION:STDIO,TLSEXT
+SSL_COMP_free_compression_methods 407 EXIST:!VMS:FUNCTION:COMP
+SSL_COMP_free_compress_methods 407 EXIST:VMS:FUNCTION:COMP
+SSL_extension_supported 409 EXIST::FUNCTION:TLSEXT