Commit fb8bfa81 authored by nimrod's avatar nimrod
Browse files

- Complete test case!

- Found first bug (and fixed).
parent 904e6de8
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -10,6 +10,18 @@ clean:
test: clean
	./ssl-ca init
	./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
	./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
	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"
+0 −1
Original line number Diff line number Diff line
@@ -81,4 +81,3 @@ TODO
----

- Add checks and failure messages to each action.
- Verify that the fqdn is correct.
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ init () {

sign_key () {
    csr="$(mktemp -t ssl-ca)"
    export domain="$1.$domain"
    export domain="$1.$(basename $PWD)"
    openssl req \
        -key keys/$1 \
        -new \