stamp_enums is shipped to avoid regenerating parts of doc
[gnutls.git] / tests / sha2 / sha2-dsa
blob2eaee5799a893a867b958f9d9553d393f52f5d48
1 #!/bin/sh
3 # Copyright (C) 2006-2008, 2010, 2012 Free Software Foundation, Inc.
5 # Author: Simon Josefsson
7 # This file is part of GnuTLS.
9 # GnuTLS is free software; you can redistribute it and/or modify it
10 # under the terms of the GNU General Public License as published by the
11 # Free Software Foundation; either version 3 of the License, or (at
12 # your option) any later version.
14 # GnuTLS is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with GnuTLS; if not, write to the Free Software Foundation,
21 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #set -e
25 srcdir=${srcdir:-.}
26 CERTTOOL=${CERTTOOL:-../../src/certtool$EXEEXT}
28 echo ca > template
29 echo cn = "SHA 256 CA" >> template
31 $CERTTOOL -d 2 --generate-self-signed --template template \
32 --load-privkey $srcdir/key-ca-dsa.pem \
33 --outfile new-ca-dsa.pem \
34 --hash sha256 >out 2>&1
36 if [ $? != 0 ];then
37 cat out
38 exit 1
41 echo ca > template
42 echo cn = "SHA 224 Mid CA" >> template
44 $CERTTOOL -d 2 --generate-certificate --template template \
45 --load-ca-privkey $srcdir/key-ca-dsa.pem \
46 --load-ca-certificate new-ca-dsa.pem \
47 --load-privkey $srcdir/key-subca-dsa.pem \
48 --outfile new-subca-dsa.pem \
49 --hash sha224 >out 2>&1
51 if [ $? != 0 ];then
52 cat out
53 exit 1
56 echo cn = "End-user" > template
58 $CERTTOOL -d 2 --generate-certificate --template template \
59 --load-ca-privkey $srcdir/key-subca-dsa.pem \
60 --load-ca-certificate new-subca-dsa.pem \
61 --load-privkey $srcdir/key-dsa.pem \
62 --outfile new-user.pem >out 2>&1
64 if [ $? != 0 ];then
65 cat out
66 exit 1
69 cat new-user.pem new-subca-dsa.pem new-ca-dsa.pem > out
70 $CERTTOOL --verify-chain <out > verify
72 if [ $? != 0 ];then
73 cat verify
74 exit 1
77 rm -f verify new-user.pem new-ca-dsa.pem new-subca-dsa.pem template out
79 exit 0