diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/Makefile.ssl | 54 | ||||
-rw-r--r-- | tools/c_hash | 9 | ||||
-rw-r--r-- | tools/c_info | 12 | ||||
-rw-r--r-- | tools/c_issuer | 10 | ||||
-rw-r--r-- | tools/c_name | 10 | ||||
-rw-r--r-- | tools/c_rehash | 47 |
6 files changed, 142 insertions, 0 deletions
diff --git a/tools/Makefile.ssl b/tools/Makefile.ssl new file mode 100644 index 0000000000..537e97d268 --- /dev/null +++ b/tools/Makefile.ssl @@ -0,0 +1,54 @@ +# +# SSLeay/tools/Makefile +# + +DIR= tools +TOP= .. +CC= cc +INCLUDES= -I.. -I../../include +CFLAG=-g +INSTALLTOP=/usr/local/ssl +MAKE= make -f Makefile.ssl +MAKEDEPEND= makedepend -f Makefile.ssl +MAKEFILE= Makefile.ssl + +CFLAGS= $(INCLUDES) $(CFLAG) + +GENERAL=Makefile.ssl +TEST= +APPS= c_hash c_info c_issuer c_name c_rehash + +all: + +install: + @for i in $(APPS) ; \ + do \ + (cp $$i $(INSTALLTOP)/bin/$$i; \ + chmod 755 $(INSTALLTOP)/bin/$$i ); \ + done; + +files: + perl $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO + +links: + /bin/rm -f Makefile + $(TOP)/util/point.sh Makefile.ssl Makefile ; + +lint: + +tags: + +errors: + +depend: + +dclean: + perl -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new + mv -f Makefile.new $(MAKEFILE) + +clean: + /bin/rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff + +errors: + +# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/tools/c_hash b/tools/c_hash new file mode 100644 index 0000000000..54ff9d2cac --- /dev/null +++ b/tools/c_hash @@ -0,0 +1,9 @@ +#!/bin/sh +# print out the hash values +# + +for i in $* +do + h=`ssleay x509 -hash -noout -in $i` + echo "$h.0 => $i" +done diff --git a/tools/c_info b/tools/c_info new file mode 100644 index 0000000000..5dd960b3a1 --- /dev/null +++ b/tools/c_info @@ -0,0 +1,12 @@ +#!/bin/sh +# +# print the subject +# + +for i in $* +do + n=`ssleay x509 -subject -issuer -enddate -noout -in $i` + echo "$i" + echo "$n" + echo "--------" +done diff --git a/tools/c_issuer b/tools/c_issuer new file mode 100644 index 0000000000..a885b24b7b --- /dev/null +++ b/tools/c_issuer @@ -0,0 +1,10 @@ +#!/bin/sh +# +# print out the issuer +# + +for i in $* +do + n=`ssleay x509 -issuer -noout -in $i` + echo "$i\t$n" +done diff --git a/tools/c_name b/tools/c_name new file mode 100644 index 0000000000..4b33e68c59 --- /dev/null +++ b/tools/c_name @@ -0,0 +1,10 @@ +#!/bin/sh +# +# print the subject +# + +for i in $* +do + n=`ssleay x509 -subject -noout -in $i` + echo "$i $n" +done diff --git a/tools/c_rehash b/tools/c_rehash new file mode 100644 index 0000000000..cd4e26a49b --- /dev/null +++ b/tools/c_rehash @@ -0,0 +1,47 @@ +#!/bin/sh +# +# redo the hashes for the certificates in your cert path or the ones passed +# on the command line. +# + +if [ "$SSLEAY"x = "x" -o ! -x $SSLEAY ]; then + SSLEAY='ssleay' + export SSLEAY +fi +DIR=/usr/local/ssl +PATH=$DIR/bin:$PATH + +SSL_DIR=$DIR/certs + +if [ "$*" = "" ]; then + CERTS=${*:-${SSL_CERT_DIR:-$SSL_DIR}} +else + CERTS=$* +fi + +IFS=': ' +for i in $CERTS +do + ( + IFS=' ' + if [ -d $i -a -w $i ]; then + cd $i + echo "Doing $i" + for i in *.pem + do + if [ $i != '*.pem' ]; then + h=`$SSLEAY x509 -hash -noout -in $i` + if [ "x$h" = "x" ]; then + echo $i does not contain a certificate + else + if [ -f $h.0 ]; then + /bin/rm -f $h.0 + fi + echo "$i => $h.0" + ln -s $i $h.0 + fi + fi + done + fi + ) +done |