diff options
| author | cvs2svn <admin@example.com> | 1998-10-19 21:47:12 +0000 |
|---|---|---|
| committer | cvs2svn <admin@example.com> | 1998-10-19 21:47:12 +0000 |
| commit | 5170039cf1df2194faa85741f0733977525cd5c0 (patch) | |
| tree | c667406046ddb1efca5ed4316b02e43494241660 /src/lib/libcrypto/util | |
| parent | 536c76cbb863bab152f19842ab88772c01e922c7 (diff) | |
| download | openbsd-OPENBSD_2_4_BASE.tar.gz openbsd-OPENBSD_2_4_BASE.tar.bz2 openbsd-OPENBSD_2_4_BASE.zip | |
This commit was manufactured by cvs2git to create tag 'OPENBSD_2_4_BASE'.OPENBSD_2_4_BASE
Diffstat (limited to 'src/lib/libcrypto/util')
| -rw-r--r-- | src/lib/libcrypto/util/mklink.sh | 35 | ||||
| -rw-r--r-- | src/lib/libcrypto/util/ranlib.sh | 23 | ||||
| -rw-r--r-- | src/lib/libcrypto/util/sep_lib.sh | 37 | ||||
| -rw-r--r-- | src/lib/libcrypto/util/ssldir.pl | 52 | ||||
| -rw-r--r-- | src/lib/libcrypto/util/up_ver.pl | 79 |
5 files changed, 226 insertions, 0 deletions
diff --git a/src/lib/libcrypto/util/mklink.sh b/src/lib/libcrypto/util/mklink.sh new file mode 100644 index 0000000000..1e052ed6ee --- /dev/null +++ b/src/lib/libcrypto/util/mklink.sh | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | # A bit of an ugly shell script used to actually 'link' files. | ||
| 4 | # Used by 'make links' | ||
| 5 | # | ||
| 6 | |||
| 7 | PATH=$PATH:.:util:../util:../../util | ||
| 8 | export PATH | ||
| 9 | |||
| 10 | from=$1 | ||
| 11 | shift | ||
| 12 | |||
| 13 | here=`pwd` | ||
| 14 | tmp=`dirname $from` | ||
| 15 | while [ "$tmp"x != "x" -a "$tmp"x != ".x" ] | ||
| 16 | do | ||
| 17 | t=`basename $here` | ||
| 18 | here=`dirname $here` | ||
| 19 | to="/$t$to" | ||
| 20 | tmp=`dirname $tmp` | ||
| 21 | done | ||
| 22 | to=..$to | ||
| 23 | |||
| 24 | #echo from=$from | ||
| 25 | #echo to =$to | ||
| 26 | #exit 1 | ||
| 27 | |||
| 28 | if [ "$*"x != "x" ]; then | ||
| 29 | for i in $* | ||
| 30 | do | ||
| 31 | /bin/rm -f $from/$i | ||
| 32 | point.sh $to/$i $from/$i | ||
| 33 | done | ||
| 34 | fi | ||
| 35 | exit 0; | ||
diff --git a/src/lib/libcrypto/util/ranlib.sh b/src/lib/libcrypto/util/ranlib.sh new file mode 100644 index 0000000000..543f712c6b --- /dev/null +++ b/src/lib/libcrypto/util/ranlib.sh | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | cwd=`pwd` | ||
| 4 | cd /tmp | ||
| 5 | |||
| 6 | if [ -s /bin/ranlib ] ; then | ||
| 7 | RL=/bin/ranlib | ||
| 8 | else if [ -s /usr/bin/ranlib ] ; then | ||
| 9 | RL=/usr/bin/ranlib | ||
| 10 | fi | ||
| 11 | fi | ||
| 12 | |||
| 13 | if [ "x$RL" != "x" ] | ||
| 14 | then | ||
| 15 | case "$1" in | ||
| 16 | /*) | ||
| 17 | $RL "$1" | ||
| 18 | ;; | ||
| 19 | *) | ||
| 20 | $RL "$cwd/$1" | ||
| 21 | ;; | ||
| 22 | esac | ||
| 23 | fi | ||
diff --git a/src/lib/libcrypto/util/sep_lib.sh b/src/lib/libcrypto/util/sep_lib.sh new file mode 100644 index 0000000000..2348db874e --- /dev/null +++ b/src/lib/libcrypto/util/sep_lib.sh | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | cwd=`pwd` | ||
| 4 | /bin/rm -fr tmp/* | ||
| 5 | |||
| 6 | cd crypto/des | ||
| 7 | make -f Makefile.uni tar | ||
| 8 | make -f Makefile.uni tar_lit | ||
| 9 | /bin/mv libdes.tgz $cwd/tmp | ||
| 10 | /bin/mv libdes-l.tgz $cwd/tmp | ||
| 11 | cd $cwd | ||
| 12 | |||
| 13 | for name in md5 sha cast bf idea rc4 rc2 | ||
| 14 | do | ||
| 15 | echo doing $name | ||
| 16 | (cd crypto; tar cfh - $name)|(cd tmp; tar xf -) | ||
| 17 | cd tmp/$name | ||
| 18 | /bin/rm -f Makefile | ||
| 19 | /bin/rm -f Makefile.ssl | ||
| 20 | /bin/rm -f Makefile.ssl.orig | ||
| 21 | /bin/rm -f *.old | ||
| 22 | /bin/mv Makefile.uni Makefile | ||
| 23 | |||
| 24 | cp $cwd/util/ranlib.sh . | ||
| 25 | chmod +x ranlib.sh | ||
| 26 | |||
| 27 | if [ -d asm ]; then | ||
| 28 | mkdir asm/perlasm | ||
| 29 | cp $cwd/crypto/perlasm/*.pl asm/perlasm | ||
| 30 | fi | ||
| 31 | cd .. | ||
| 32 | tar cf - $name|gzip >$name.tgz | ||
| 33 | # /bin/rm -fr $name | ||
| 34 | cd $cwd | ||
| 35 | done | ||
| 36 | |||
| 37 | |||
diff --git a/src/lib/libcrypto/util/ssldir.pl b/src/lib/libcrypto/util/ssldir.pl new file mode 100644 index 0000000000..10584686da --- /dev/null +++ b/src/lib/libcrypto/util/ssldir.pl | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | #!/usr/bin/perl | ||
| 2 | |||
| 3 | $#ARGV == 0 || die "usage: ssldir.pl /new/path\n"; | ||
| 4 | @files=('crypto/cryptlib.h', | ||
| 5 | 'Makefile.ssl', | ||
| 6 | 'tools/c_rehash', | ||
| 7 | 'util/mk1mf.pl', | ||
| 8 | ); | ||
| 9 | |||
| 10 | %cryptlib=( | ||
| 11 | '\sX509_CERT_AREA\s',"#define X509_CERT_AREA\t\t".'"%s"', | ||
| 12 | '\sX509_CERT_DIR\s', "#define X509_CERT_DIR\t\t".'"%s/certs"', | ||
| 13 | '\sX509_CERT_FILE\s', "#define X509_CERT_FILE\t\t".'"%s/cert.pem"', | ||
| 14 | '\sX509_PRIVATE_DIR\s',"#define X509_PRIVATE_DIR\t".'"%s/private"', | ||
| 15 | ); | ||
| 16 | |||
| 17 | %Makefile_ssl=( | ||
| 18 | '^INSTALLTOP=','INSTALLTOP=%s', | ||
| 19 | ); | ||
| 20 | |||
| 21 | %c_rehash=( | ||
| 22 | '^DIR=', 'DIR=%s', | ||
| 23 | ); | ||
| 24 | |||
| 25 | %mk1mf=( | ||
| 26 | '^$INSTALLTOP=','$INSTALLTOP="%s";', | ||
| 27 | ); | ||
| 28 | |||
| 29 | &dofile("crypto/cryptlib.h",$ARGV[0],%cryptlib); | ||
| 30 | &dofile("Makefile.ssl",$ARGV[0],%Makefile_ssl); | ||
| 31 | &dofile("tools/c_rehash",$ARGV[0],%c_rehash); | ||
| 32 | &dofile("util/mk1mf.pl",$ARGV[0],%mk1mf); | ||
| 33 | |||
| 34 | sub dofile | ||
| 35 | { | ||
| 36 | ($f,$p,%m)=@_; | ||
| 37 | |||
| 38 | open(IN,"<$f") || die "unable to open $f:$!\n"; | ||
| 39 | @a=<IN>; | ||
| 40 | close(IN); | ||
| 41 | foreach $k (keys %m) | ||
| 42 | { | ||
| 43 | grep(/$k/ && ($_=sprintf($m{$k}."\n",$p)),@a); | ||
| 44 | } | ||
| 45 | ($ff=$f) =~ s/\..*$//; | ||
| 46 | open(OUT,">$ff.new") || die "unable to open $f:$!\n"; | ||
| 47 | print OUT @a; | ||
| 48 | close(OUT); | ||
| 49 | rename($f,"$ff.old") || die "unable to rename $f\n"; | ||
| 50 | rename("$ff.new",$f) || die "unable to rename $ff.new\n"; | ||
| 51 | } | ||
| 52 | |||
diff --git a/src/lib/libcrypto/util/up_ver.pl b/src/lib/libcrypto/util/up_ver.pl new file mode 100644 index 0000000000..32c086b2aa --- /dev/null +++ b/src/lib/libcrypto/util/up_ver.pl | |||
| @@ -0,0 +1,79 @@ | |||
| 1 | #!/usr/bin/perl | ||
| 2 | # | ||
| 3 | # Up the version numbers in the files. | ||
| 4 | # | ||
| 5 | |||
| 6 | @files=( | ||
| 7 | "crypto/crypto.h", | ||
| 8 | "crypto/des/ecb_enc.c", | ||
| 9 | "crypto/idea/i_ecb.c", | ||
| 10 | "crypto/lhash/lhash.c", | ||
| 11 | "crypto/conf/conf.c", | ||
| 12 | "crypto/md2/md2_dgst.c", | ||
| 13 | "crypto/md5/md5_dgst.c", | ||
| 14 | "crypto/ripemd/rmd_dgst.c", | ||
| 15 | "crypto/pem/pem_lib.c", | ||
| 16 | "crypto/bn/bn_lib.c", | ||
| 17 | "crypto/dh/dh_lib.c", | ||
| 18 | "crypto/rc2/rc2_ecb.c", | ||
| 19 | "crypto/rc4/rc4_skey.c", | ||
| 20 | "crypto/rc5/rc5_ecb.c", | ||
| 21 | "crypto/bf/bf_ecb.c", | ||
| 22 | "crypto/cast/c_ecb.c", | ||
| 23 | "crypto/rsa/rsa_lib.c", | ||
| 24 | "crypto/dsa/dsa_lib.c", | ||
| 25 | "crypto/sha/sha1dgst.c", | ||
| 26 | "crypto/sha/sha_dgst.c", | ||
| 27 | "crypto/asn1/asn1_lib.c", | ||
| 28 | "crypto/x509/x509_vfy.c", | ||
| 29 | "crypto/evp/evp_enc.c", | ||
| 30 | "crypto/rand/md_rand.c", | ||
| 31 | "crypto/stack/stack.c", | ||
| 32 | "crypto/txt_db/txt_db.c", | ||
| 33 | "crypto/cversion.c", | ||
| 34 | "ssl/ssl_lib.c", | ||
| 35 | "ssl/s2_lib.c", | ||
| 36 | "ssl/s3_lib.c", | ||
| 37 | "ssl/t1_lib.c", | ||
| 38 | "README", | ||
| 39 | ); | ||
| 40 | |||
| 41 | @month=('Jan','Feb','Mar','Apr','May','Jun', | ||
| 42 | 'Jul','Aug','Sep','Oct','Nov','Dec'); | ||
| 43 | @a=localtime(time()); | ||
| 44 | $time=sprintf("%02d-%s-%04d",$a[3],$month[$a[4]],$a[5]+1900); | ||
| 45 | |||
| 46 | $ver=$ARGV[0]; | ||
| 47 | ($ver ne "") || die "no version number specified\n"; | ||
| 48 | ($a,$b,$c,$d)=unpack('axaxac',$ver); | ||
| 49 | $d=defined($d)?$d-96:0; | ||
| 50 | $xver=sprintf("%x%x%x%x",$a,$b,$c,$d); | ||
| 51 | |||
| 52 | foreach $file (@files) | ||
| 53 | { | ||
| 54 | open(IN,"<$file") || die "unable to open $file:$!\n"; | ||
| 55 | open(OUT,">$file.new") || die "unable to open $file.new:$!\n"; | ||
| 56 | $found=0; | ||
| 57 | |||
| 58 | print STDERR "$file:"; | ||
| 59 | |||
| 60 | while (<IN>) | ||
| 61 | { | ||
| 62 | if ((s/SSLeay \d\.\d.\d[^"]*(\"|\s)/SSLeay $ver $time\1/) || | ||
| 63 | s/^(\#define\s+SSLEAY_VERSION_NUMBER\s+0x)[0-9a-zA-Z]+(.*)$/$1$xver$2/) | ||
| 64 | { | ||
| 65 | print STDERR " Done"; | ||
| 66 | $found++; | ||
| 67 | print OUT; | ||
| 68 | while (<IN>) { print OUT; } | ||
| 69 | last; | ||
| 70 | } | ||
| 71 | print OUT; | ||
| 72 | } | ||
| 73 | print STDERR "\n"; | ||
| 74 | close(IN); | ||
| 75 | close(OUT); | ||
| 76 | (!$found) && die "unable to update the version number in $file\n"; | ||
| 77 | rename($file,"$file.old") || die "unable to rename $file:$!\n"; | ||
| 78 | rename("$file.new",$file) || die "unable to rename $file.new:$!\n"; | ||
| 79 | } | ||
