switch to use new hash instead of old one
authorJoni Hahkala <joni.hahkala@cern.ch>
Mon, 14 May 2012 23:47:10 +0000 (23:47 +0000)
committerJoni Hahkala <joni.hahkala@cern.ch>
Mon, 14 May 2012 23:47:10 +0000 (23:47 +0000)
bin/generate-test-certificates.sh

index e5e7bfc..4fb5617 100755 (executable)
@@ -517,7 +517,9 @@ function add_ca_grid_sec {
     if [ x"`openssl version`" \< x"OpenSSL 1.0.0" ]; then
         hash=$(openssl x509 -hash -noout -in $1-ca/$1.cert)
     else
-        hash=$(openssl x509 -subject_hash_old -noout -in $1-ca/$1.cert)
+       if [ ${USENEWHASH} == 'no' ]; then
+            hash=$(openssl x509 -subject_hash_old -noout -in $1-ca/$1.cert)
+       fi
     fi
     cp $1-ca/$1.cert grid-security/certificates/${hash}.0
     cp $1-ca/$1.crl grid-security/certificates/${hash}.r0
@@ -1173,6 +1175,7 @@ EXTRACERTS=${EXTRACERTS:-5}
 VOMS='no'
 # if we only show environmental settings
 ONLYENV='no'
+USENEWHASH='no'
 
 while true; do
     case "$1" in
@@ -1187,6 +1190,10 @@ while true; do
             CATYPES='trusted'
             shift
             ;;
+        -n|--new)
+            USENEWHASH='true'
+            shift
+            ;;
         -e|--extra)
             shift
             EXTRACERTS=$1