summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/util
diff options
context:
space:
mode:
authordjm <>2009-01-09 12:14:09 +0000
committerdjm <>2009-01-09 12:14:09 +0000
commitd895739bce8a14b03d66ef79acb062db0e1d7b41 (patch)
treef7bce8e25320f56d0561cf9c041d4a9426952468 /src/lib/libcrypto/util
parent6b54ca90c9c20fe7a1bad7bdd709e44e88384cee (diff)
parent76dd4d55fdccad54d20608e7caf577b9d67b216f (diff)
downloadopenbsd-d895739bce8a14b03d66ef79acb062db0e1d7b41.tar.gz
openbsd-d895739bce8a14b03d66ef79acb062db0e1d7b41.tar.bz2
openbsd-d895739bce8a14b03d66ef79acb062db0e1d7b41.zip
This commit was generated by cvs2git to track changes on a CVS vendor
branch.
Diffstat (limited to 'src/lib/libcrypto/util')
-rw-r--r--src/lib/libcrypto/util/arx.pl15
-rw-r--r--src/lib/libcrypto/util/fipslink.pl2
-rw-r--r--src/lib/libcrypto/util/mksdef.pl87
3 files changed, 103 insertions, 1 deletions
diff --git a/src/lib/libcrypto/util/arx.pl b/src/lib/libcrypto/util/arx.pl
new file mode 100644
index 0000000000..ce62625c33
--- /dev/null
+++ b/src/lib/libcrypto/util/arx.pl
@@ -0,0 +1,15 @@
1#!/bin/perl
2
3# Simple perl script to wrap round "ar" program and exclude any
4# object files in the environment variable EXCL_OBJ
5
6map { s/^.*\/([^\/]*)$/$1/ ; $EXCL{$_} = 1} split(' ', $ENV{EXCL_OBJ});
7
8#my @ks = keys %EXCL;
9#print STDERR "Excluding: @ks \n";
10
11my @ARGS = grep { !exists $EXCL{$_} } @ARGV;
12
13system @ARGS;
14
15exit $? >> 8;
diff --git a/src/lib/libcrypto/util/fipslink.pl b/src/lib/libcrypto/util/fipslink.pl
index a893833c5c..3597bc1740 100644
--- a/src/lib/libcrypto/util/fipslink.pl
+++ b/src/lib/libcrypto/util/fipslink.pl
@@ -28,7 +28,7 @@ if (exists $ENV{"PREMAIN_DSO_EXE"})
28 } 28 }
29 29
30check_hash($sha1_exe, "fips_premain.c"); 30check_hash($sha1_exe, "fips_premain.c");
31check_hash($sha1_exe, "fipscanister.o"); 31check_hash($sha1_exe, "fipscanister.lib");
32 32
33 33
34print "Integrity check OK\n"; 34print "Integrity check OK\n";
diff --git a/src/lib/libcrypto/util/mksdef.pl b/src/lib/libcrypto/util/mksdef.pl
new file mode 100644
index 0000000000..065dc675f1
--- /dev/null
+++ b/src/lib/libcrypto/util/mksdef.pl
@@ -0,0 +1,87 @@
1
2# Perl script to split libeay32.def into two distinct DEF files for use in
3# fipdso mode. It works out symbols in each case by running "link" command and
4# parsing the output to find the list of missing symbols then splitting
5# libeay32.def based on the result.
6
7
8# Get list of unknown symbols
9
10my @deferr = `link @ARGV`;
11
12my $preamble = "";
13my @fipsdll;
14my @fipsrest;
15my %nosym;
16
17# Add symbols to a hash for easy lookup
18
19foreach (@deferr)
20 {
21 if (/^.*symbol (\S+)$/)
22 {
23 $nosym{$1} = 1;
24 }
25 }
26
27open (IN, "ms/libeay32.def") || die "Can't Open DEF file for spliting";
28
29my $started = 0;
30
31# Parse libeay32.def into two arrays depending on whether the symbol matches
32# the missing list.
33
34
35foreach (<IN>)
36 {
37 if (/^\s*(\S+)\s*(\@\S+)\s*$/)
38 {
39 $started = 1;
40 if (exists $nosym{$1})
41 {
42 push @fipsrest, $_;
43 }
44 else
45 {
46 my $imptmp = sprintf " %-39s %s\n",
47 "$1=libosslfips.$1", $2;
48 push @fipsrest, $imptmp;
49 push @fipsdll, "\t$1\n";
50 }
51 }
52 $preamble .= $_ unless $started;
53 }
54
55close IN;
56
57# Hack! Add some additional exports needed for libcryptofips.dll
58#
59
60push @fipsdll, "\tOPENSSL_showfatal\n";
61push @fipsdll, "\tOPENSSL_cpuid_setup\n";
62
63# Write out DEF files for each array
64
65write_def("ms/libosslfips.def", "LIBOSSLFIPS", $preamble, \@fipsdll);
66write_def("ms/libeayfips.def", "", $preamble, \@fipsrest);
67
68
69sub write_def
70 {
71 my ($fnam, $defname, $preamble, $rdefs) = @_;
72 open (OUT, ">$fnam") || die "Can't Open DEF file $fnam for Writing\n";
73
74 if ($defname ne "")
75 {
76 $preamble =~ s/LIBEAY32/$defname/g;
77 $preamble =~ s/LIBEAY/$defname/g;
78 }
79 print OUT $preamble;
80 foreach (@$rdefs)
81 {
82 print OUT $_;
83 }
84 close OUT;
85 }
86
87