Skip to content
Snippets Groups Projects
Commit fb8bfa81 authored by nimrod's avatar nimrod
Browse files

- Complete test case!

- Found first bug (and fixed).
parent 904e6de8
Branches
No related tags found
No related merge requests found
...@@ -10,6 +10,18 @@ clean: ...@@ -10,6 +10,18 @@ clean:
test: clean test: clean
./ssl-ca init ./ssl-ca init
./ssl-ca gen www ./ssl-ca gen www
openssl verify -CAfile CA.crt certs/www
test "$$(openssl x509 -in certs/www -issuer -noout)" == "issuer= /CN=*.*.ssl-ca"
test "$$(openssl x509 -in certs/www -subject -noout)" == "subject= /CN=*.*.www.ssl-ca"
openssl genrsa -out keys/smtp openssl genrsa -out keys/smtp
./ssl-ca sign ./ssl-ca sign
openssl verify -CAfile CA.crt certs/smtp
test "$$(openssl x509 -in certs/smtp -issuer -noout)" == "issuer= /CN=*.*.ssl-ca"
test "$$(openssl x509 -in certs/smtp -subject -noout)" == "subject= /CN=*.*.smtp.ssl-ca"
./ssl-ca resign ./ssl-ca resign
openssl verify -CAfile CA.crt certs/www
openssl verify -CAfile CA.crt certs/smtp
test "$$(openssl x509 -in certs/www -issuer -noout)" == "issuer= /CN=*.*.ssl-ca"
test "$$(openssl x509 -in certs/www -subject -noout)" == "subject= /CN=*.*.www.ssl-ca"
test "$$(openssl x509 -in certs/smtp -issuer -noout)" == "issuer= /CN=*.*.ssl-ca"
test "$$(openssl x509 -in certs/smtp -subject -noout)" == "subject= /CN=*.*.smtp.ssl-ca"
...@@ -81,4 +81,3 @@ TODO ...@@ -81,4 +81,3 @@ TODO
---- ----
- Add checks and failure messages to each action. - Add checks and failure messages to each action.
- Verify that the fqdn is correct.
...@@ -53,7 +53,7 @@ init () { ...@@ -53,7 +53,7 @@ init () {
sign_key () { sign_key () {
csr="$(mktemp -t ssl-ca)" csr="$(mktemp -t ssl-ca)"
export domain="$1.$domain" export domain="$1.$(basename $PWD)"
openssl req \ openssl req \
-key keys/$1 \ -key keys/$1 \
-new \ -new \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment