X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=tools%2Fc_rehash;h=739a2de5507dd71c928dcc5f3f6060a9ea88173f;hp=007600152c5a78a5476f75bdb2bd1c7ae8b12061;hb=3a1daca9efa22c3d9e38f40c84b48388fa57585d;hpb=d02b48c63a58ea4367a0e905979f140b7d090f86 diff --git a/tools/c_rehash b/tools/c_rehash index 007600152c..739a2de550 100644 --- a/tools/c_rehash +++ b/tools/c_rehash @@ -4,12 +4,26 @@ # on the command line. # -if [ "$SSLEAY"x = "x" ]; 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 +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 still not available)" 1>&2 + exit 0 + fi +fi SSL_DIR=$DIR/certs @@ -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