diff options
author | Brent Cook <busterb@gmail.com> | 2015-05-06 22:37:41 -0500 |
---|---|---|
committer | Brent Cook <busterb@gmail.com> | 2015-05-06 22:39:32 -0500 |
commit | 51bfd4921a18552b72ecc15f282e52116c136554 (patch) | |
tree | cab13bb683a36f9d20f0b4d7f7b924c92cc88c53 /tests/testdsa.sh | |
parent | 91f01629b9b1492b2a7447ef7e746f6135a6edbf (diff) | |
download | portable-51bfd4921a18552b72ecc15f282e52116c136554.tar.gz portable-51bfd4921a18552b72ecc15f282e52116c136554.tar.bz2 portable-51bfd4921a18552b72ecc15f282e52116c136554.zip |
add app tests from regress/usr.bin/openssl
These are added directly rather than imported by update.sh since they
require local modifications and its not worth breaking everyone's git
forks yet to import them through cvs2git.
Diffstat (limited to 'tests/testdsa.sh')
-rwxr-xr-x | tests/testdsa.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/testdsa.sh b/tests/testdsa.sh new file mode 100755 index 0000000..413323e --- /dev/null +++ b/tests/testdsa.sh | |||
@@ -0,0 +1,35 @@ | |||
1 | #!/bin/sh | ||
2 | # $OpenBSD: testdsa.sh,v 1.1 2014/08/26 17:50:07 jsing Exp $ | ||
3 | |||
4 | |||
5 | #Test DSA certificate generation of openssl | ||
6 | |||
7 | cmd=../apps/openssl | ||
8 | |||
9 | if [ -z $srcdir ]; then | ||
10 | srcdir=. | ||
11 | fi | ||
12 | |||
13 | # Generate DSA paramter set | ||
14 | $cmd dsaparam 512 -out dsa512.pem | ||
15 | if [ $? != 0 ]; then | ||
16 | exit 1; | ||
17 | fi | ||
18 | |||
19 | |||
20 | # Denerate a DSA certificate | ||
21 | $cmd req -config $srcdir/openssl.cnf -x509 -newkey dsa:dsa512.pem -out testdsa.pem -keyout testdsa.key | ||
22 | if [ $? != 0 ]; then | ||
23 | exit 1; | ||
24 | fi | ||
25 | |||
26 | |||
27 | # Now check the certificate | ||
28 | $cmd x509 -text -in testdsa.pem | ||
29 | if [ $? != 0 ]; then | ||
30 | exit 1; | ||
31 | fi | ||
32 | |||
33 | rm testdsa.key | ||
34 | |||
35 | exit 0 | ||