diff options
Diffstat (limited to 'src/regress/usr.bin/openssl/testrsa.sh')
-rw-r--r-- | src/regress/usr.bin/openssl/testrsa.sh | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/regress/usr.bin/openssl/testrsa.sh b/src/regress/usr.bin/openssl/testrsa.sh index a9a00f295e..36f5e639e8 100644 --- a/src/regress/usr.bin/openssl/testrsa.sh +++ b/src/regress/usr.bin/openssl/testrsa.sh | |||
@@ -1,27 +1,28 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # $OpenBSD: testrsa.sh,v 1.1 2014/08/26 17:50:07 jsing Exp $ | 2 | # $OpenBSD: testrsa.sh,v 1.2 2018/02/06 02:31:13 tb Exp $ |
3 | 3 | ||
4 | 4 | ||
5 | #Test RSA certificate generation of openssl | 5 | #Test RSA certificate generation of openssl |
6 | 6 | ||
7 | cd $1 | 7 | cd $1 |
8 | openssl_bin=${OPENSSL:-/usr/bin/openssl} | ||
8 | 9 | ||
9 | # Generate RSA private key | 10 | # Generate RSA private key |
10 | openssl genrsa -out rsakey.pem | 11 | $openssl_bin genrsa -out rsakey.pem |
11 | if [ $? != 0 ]; then | 12 | if [ $? != 0 ]; then |
12 | exit 1; | 13 | exit 1; |
13 | fi | 14 | fi |
14 | 15 | ||
15 | 16 | ||
16 | # Generate an RSA certificate | 17 | # Generate an RSA certificate |
17 | openssl req -config $2/openssl.cnf -key rsakey.pem -new -x509 -days 365 -out rsacert.pem | 18 | $openssl_bin req -config $2/openssl.cnf -key rsakey.pem -new -x509 -days 365 -out rsacert.pem |
18 | if [ $? != 0 ]; then | 19 | if [ $? != 0 ]; then |
19 | exit 1; | 20 | exit 1; |
20 | fi | 21 | fi |
21 | 22 | ||
22 | 23 | ||
23 | # Now check the certificate | 24 | # Now check the certificate |
24 | openssl x509 -text -in rsacert.pem | 25 | $openssl_bin x509 -text -in rsacert.pem |
25 | if [ $? != 0 ]; then | 26 | if [ $? != 0 ]; then |
26 | exit 1; | 27 | exit 1; |
27 | fi | 28 | fi |