X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=tools%2Fc_rehash;h=cc3b65871f06a8987e9509ebe32de9244bd4221a;hp=99ab7ebaa18777d81cea29d7034382dad2712067;hb=6b691a5c85ddc4e407e32781841fee5c029506cd;hpb=31b8d8684441e6cd5138832bb1b2ddb10acd6ba6 diff --git a/tools/c_rehash b/tools/c_rehash index 99ab7ebaa1..cc3b65871f 100644 --- a/tools/c_rehash +++ b/tools/c_rehash @@ -4,13 +4,27 @@ # on the command line. # -if [ "$SSLEAY"x = "x" -o ! -x "$SSLEAY" ]; then - SSLEAY='ssleay' - export SSLEAY +if [ "$OPENSSL"x = "x" -o ! -x "$OPENSSL" ]; then + OPENSSL='openssl' + export OPENSSL fi DIR=/usr/local/ssl PATH=$DIR/bin:$PATH +if [ ! -f "$OPENSSL" ]; then + found=0 + for dir in . `echo $PATH | sed -e 's/:/ /g'`; do + if [ -f "$dir/$OPENSSL" ]; then + found=1 + break + fi + done + if [ $found = 0 ]; then + echo "c_rehash: rehashing skipped ('openssl' program not available)" 1>&2 + exit 0 + fi +fi + SSL_DIR=$DIR/certs if [ "$*" = "" ]; then @@ -30,7 +44,7 @@ do for i in *.pem do if [ $i != '*.pem' ]; then - h=`$SSLEAY x509 -hash -noout -in $i` + h=`$OPENSSL x509 -hash -noout -in $i` if [ "x$h" = "x" ]; then echo $i does not contain a certificate else