diff options
author | Robert Griebl <robert.griebl@pelagicore.com> | 2016-12-02 01:11:22 +0100 |
---|---|---|
committer | Robert Griebl <robert.griebl@pelagicore.com> | 2016-12-06 13:14:51 +0000 |
commit | 656ec980e963438567778ee1c2f7038acabce5d3 (patch) | |
tree | eeeeac460c218d8836d13440c240f8f9f00e0500 /tests/data | |
parent | c932d79eda7f881d5421fcedcc00163d610c01d2 (diff) |
Fixed auto-tests on Windows
Some tests need Unix tools in the path and they are now able to make use of
a Cygwin environment, if it is available.
Also fixed the test certificate generation, since it produced invalid p12s
that somehow did work with OpenSSL/SecurityFramework.
Change-Id: Id5c942b8d4532dc70872b434b49e0fee9f4f0c65
Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
Diffstat (limited to 'tests/data')
-rwxr-xr-x | tests/data/certificates/create-test-certificates.sh | 12 | ||||
-rw-r--r-- | tests/data/certificates/openssl-other-ca.cnf (renamed from tests/data/certificates/openssl-other.cnf) | 8 |
2 files changed, 14 insertions, 6 deletions
diff --git a/tests/data/certificates/create-test-certificates.sh b/tests/data/certificates/create-test-certificates.sh index 30afe9dc..1705ce67 100755 --- a/tests/data/certificates/create-test-certificates.sh +++ b/tests/data/certificates/create-test-certificates.sh @@ -36,6 +36,10 @@ rm -f store.csr store.crt store-priv.key store.p12 rm -f devca.csr devca.crt devca-priv.key rm -f dev1.csr dev1.crt dev1-priv.key dev1.p12 rm -f dev2.csr dev2.crt dev2-priv.key dev2.p12 +rm -f 01.pem 02.pem +rm -f other-index.txt* other-serial.txt* +rm -f other-ca-priv.key other-ca.crt +rm -f other.csr other.crt other-priv.key other.p12 runSSL() { @@ -89,8 +93,12 @@ info "Generating the \"other\" CA" # generate self-signed CA cert # the -days parameter is needed due to an openssl bug: having -x509 on the # command-line makes it ignore the the default_days option in the config -runSSL req -config openssl-other.cnf -x509 -days 3650 -new -newkey rsa:2048 -nodes -keyout other-priv.key -out other.crt -runSSL pkcs12 -export -password pass:password -out other.p12 -inkey other-priv.key -nodes -in other.crt -name "Other Company" +runSSL req -config openssl-other-ca.cnf -x509 -days 3650 -new -newkey rsa:2048 -nodes -keyout other-ca-priv.key -out other-ca.crt +touch other-index.txt +echo '01' > other-serial.txt +runSSL req -batch -subj '/C=DE/ST=Foo/L=Bar/CN=www.other.com' -newkey rsa:2048 -nodes -keyout other-priv.key -out other.csr +runSSL ca -batch -config openssl-other-ca.cnf -policy signing_policy -extensions signing_req -out other.crt -infiles other.csr +runSSL pkcs12 -export -out other.p12 -password pass:password -inkey other-priv.key -nodes -certfile other-ca.crt -in other.crt -name "Other Certificate" echo -e "$G All test certificated have been created successfully$W" echo diff --git a/tests/data/certificates/openssl-other.cnf b/tests/data/certificates/openssl-other-ca.cnf index 5ec61914..fb919c08 100644 --- a/tests/data/certificates/openssl-other.cnf +++ b/tests/data/certificates/openssl-other-ca.cnf @@ -18,11 +18,11 @@ email_in_dn = no # Don't concat the email in the DN copy_extensions = copy # Required to copy SANs from CSR to cert base_dir = . -certificate = $base_dir/ca.crt # The CA certifcate -private_key = $base_dir/ca-priv.key # The CA private key +certificate = $base_dir/other-ca.crt # The CA certifcate +private_key = $base_dir/other-ca-priv.key # The CA private key new_certs_dir = $base_dir # Location for new certs after signing -database = $base_dir/index.txt # Database index file -serial = $base_dir/serial.txt # The current serial number +database = $base_dir/other-index.txt # Database index file +serial = $base_dir/other-serial.txt # The current serial number unique_subject = yes # Set to 'no' to allow creation of # several certificates with same subject. |