]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
avoid common files
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 7 Jun 2013 18:48:06 +0000 (20:48 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 7 Jun 2013 18:48:06 +0000 (20:48 +0200)
tests/sha2/sha2
tests/sha2/sha2-dsa

index 7b5da51544c76176da5ae20e1f81aa5ad9743b24..7dcd36ad7a674c0828b230dbd5784c5aadf0a2af 100755 (executable)
 srcdir=${srcdir:-.}
 CERTTOOL=${CERTTOOL:-../../src/certtool$EXEEXT}
 
-echo ca > template
-echo cn = "SHA 512 CA" >> template
+echo ca > template-sha2
+echo cn = "SHA 512 CA" >> template-sha2
 
-$CERTTOOL -d 2 --generate-self-signed --template template \
+$CERTTOOL -d 2 --generate-self-signed --template template-sha2 \
     --load-privkey $srcdir/key-ca.pem \
     --outfile new-ca.pem \
     --hash sha512 >out 2>&1
@@ -38,10 +38,10 @@ if [ $? != 0 ];then
        exit 1
 fi
 
-echo ca > template
-echo cn = "SHA 384 sub-CA" >> template
+echo ca > template-sha2
+echo cn = "SHA 384 sub-CA" >> template-sha2
 
-$CERTTOOL -d 2 --generate-certificate --template template \
+$CERTTOOL -d 2 --generate-certificate --template template-sha2 \
     --load-ca-privkey $srcdir/key-ca.pem \
     --load-ca-certificate new-ca.pem \
     --load-privkey $srcdir/key-subca.pem \
@@ -53,10 +53,10 @@ if [ $? != 0 ];then
        exit 1
 fi
 
-echo ca > template
-echo cn = "SHA 256 sub-sub-CA" >> template
+echo ca > template-sha2
+echo cn = "SHA 256 sub-sub-CA" >> template-sha2
 
-$CERTTOOL -d 2 --generate-certificate --template template \
+$CERTTOOL -d 2 --generate-certificate --template template-sha2 \
     --load-ca-privkey $srcdir/key-subca.pem \
     --load-ca-certificate new-subca.pem \
     --load-privkey $srcdir/key-subsubca.pem \
@@ -68,9 +68,9 @@ if [ $? != 0 ];then
        exit 1
 fi
 
-echo cn = "End-user" > template
+echo cn = "End-user" > template-sha2
 
-$CERTTOOL -d 2 --generate-certificate --template template \
+$CERTTOOL -d 2 --generate-certificate --template template-sha2 \
     --load-ca-privkey $srcdir/key-subsubca.pem \
     --load-ca-certificate new-subsubca.pem \
     --load-privkey $srcdir/key-user.pem \
@@ -81,7 +81,7 @@ if [ $? != 0 ];then
        exit 1
 fi
 
-num=`cat new-user.pem new-subsubca.pem new-subca.pem new-ca.pem | $CERTTOOL --verify-chain | tee verify | grep -c Verified`
+num=`cat new-user.pem new-subsubca.pem new-subca.pem new-ca.pem | $CERTTOOL --verify-chain | tee verify-sha2 | grep -c Verified`
 #cat verify
 
 if test "$num" != "4"; then
@@ -89,6 +89,6 @@ if test "$num" != "4"; then
     exit 1
 fi
 
-rm -f verify new-user.pem new-subsubca.pem new-subca.pem new-ca.pem template
+rm -f verify-sha2 new-user.pem new-subsubca.pem new-subca.pem new-ca.pem template-sha2
 
 exit 0
index 2eaee5799a893a867b958f9d9553d393f52f5d48..68b8432e8bcf51f888865ec28c2df7e913283b32 100755 (executable)
 srcdir=${srcdir:-.}
 CERTTOOL=${CERTTOOL:-../../src/certtool$EXEEXT}
 
-echo ca > template
-echo cn = "SHA 256 CA" >> template
+echo ca > template-dsa
+echo cn = "SHA 256 CA" >> template-dsa
 
-$CERTTOOL -d 2 --generate-self-signed --template template \
+$CERTTOOL -d 2 --generate-self-signed --template template-dsa \
     --load-privkey $srcdir/key-ca-dsa.pem \
     --outfile new-ca-dsa.pem \
-    --hash sha256 >out 2>&1
+    --hash sha256 >out-dsa 2>&1
 
 if [ $? != 0 ];then
-       cat out
+       cat out-dsa
        exit 1
 fi
 
-echo ca > template
-echo cn = "SHA 224 Mid CA" >> template
+echo ca > template-dsa
+echo cn = "SHA 224 Mid CA" >> template-dsa
 
-$CERTTOOL -d 2 --generate-certificate --template template \
+$CERTTOOL -d 2 --generate-certificate --template template-dsa \
     --load-ca-privkey $srcdir/key-ca-dsa.pem \
     --load-ca-certificate new-ca-dsa.pem \
     --load-privkey $srcdir/key-subca-dsa.pem \
     --outfile new-subca-dsa.pem \
-    --hash sha224 >out 2>&1
+    --hash sha224 >out-dsa 2>&1
 
 if [ $? != 0 ];then
-       cat out
+       cat out-dsa
        exit 1
 fi
 
-echo cn = "End-user" > template
+echo cn = "End-user" > template-dsa
 
-$CERTTOOL -d 2 --generate-certificate --template template \
+$CERTTOOL -d 2 --generate-certificate --template template-dsa \
     --load-ca-privkey $srcdir/key-subca-dsa.pem \
     --load-ca-certificate new-subca-dsa.pem \
     --load-privkey $srcdir/key-dsa.pem \
-    --outfile new-user.pem >out 2>&1
+    --outfile new-user-dsa.pem >out-dsa 2>&1
 
 if [ $? != 0 ];then
-       cat out
+       cat out-dsa
        exit 1
 fi
 
-cat new-user.pem new-subca-dsa.pem new-ca-dsa.pem > out
-$CERTTOOL --verify-chain <out > verify
+cat new-user-dsa.pem new-subca-dsa.pem new-ca-dsa.pem > out-dsa
+$CERTTOOL --verify-chain <out-dsa > verify-dsa
 
 if [ $? != 0 ];then
-       cat verify
+       cat verify-dsa
        exit 1
 fi
 
-rm -f verify new-user.pem new-ca-dsa.pem new-subca-dsa.pem template out
+rm -f verify-dsa new-user-dsa.pem new-ca-dsa.pem new-subca-dsa.pem template-dsa out-dsa
 
 exit 0