Generating an invalid VOMS certificate -- i.e. the issuer certificate is missing...
authorAkos Frohner <akos.frohner@cern.ch>
Tue, 29 Aug 2006 16:04:31 +0000 (16:04 +0000)
committerAkos Frohner <akos.frohner@cern.ch>
Tue, 29 Aug 2006 16:04:31 +0000 (16:04 +0000)
bin/generate-test-certificates.sh

index 4bc202b..8e2f2fe 100755 (executable)
@@ -349,7 +349,12 @@ function create_some {
     # generate extra client certificates
     if [ -n "$EXTRACERTS" ]; then
         echo "Generating '$EXTRACERTS' extra certs"
-        for i in $(seq -f '%02g' 1 $EXTRACERTS); do
+        extra_ids=$(seq -f '%02g' 1 $EXTRACERTS)
+        if [ "$VOMS" = 'yes' ]; then
+            # 'wv' stands for Wrong Voms certificate
+            extra_ids="$extra_ids wv"
+        fi
+        for i in $extra_ids; do
             create_cert $CERT_DIR/${catype}_client$i "$LOGNAME client$i" client $DAYS
         done
     fi
@@ -392,7 +397,7 @@ EOF
     # copy extra certificates
     if [ -n "$EXTRACERTS" ]; then
         echo "Copying '$EXTRACERTS' extra certs"
-        for i in $(seq -f '%02g' 1 $EXTRACERTS); do
+        for i in $extra_ids; do
             cp -f $CERT_DIR/${catype}_client$i.cert home/usercert$i.pem
             cp -f $CERT_DIR/${catype}_client$i.priv home/userkey$i.pem
             # set the correct permissions for globus...
@@ -412,11 +417,16 @@ EOF
         # and some basics for the extra certs
         if [ -n "$EXTRACERTS" ]; then
             echo "Generating '$EXTRACERTS' vomsified extra certs"
-            for i in $(seq -f '%02g' 1 $EXTRACERTS); do
+            for i in $extra_ids; do
                 create_voms home/voms$i-acme.pem \
                     -cert home/usercert$i.pem -key home/userkey$i.pem \
                     /org.acme
             done
+            
+            # There is an extra certificate, with supposed to be wrong
+            # VOMS attributes: we need to remove the issuer certificate
+            # from vomsdir to make it happen.
+            rm grid-security/vomsdir/usercertwv.pem
         fi
     fi