diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2006-11-07 16:21:16 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2006-11-07 16:21:16 +0000 |
commit | cf32ad7fe3410316568ae74c5275574cd5222179 (patch) | |
tree | e160d838844408dc28999171b7fd9757b4aa6b03 /test/testtsa | |
parent | ad0e439604abf22dcf9e9b7ffd0618c7f3489e02 (diff) |
Make TSA tests use the noprompt mode of utilities rather than piping
the result into interative utilities.
Diffstat (limited to 'test/testtsa')
-rw-r--r-- | test/testtsa | 47 |
1 files changed, 20 insertions, 27 deletions
diff --git a/test/testtsa b/test/testtsa index b7113949f2..e403d9ee31 100644 --- a/test/testtsa +++ b/test/testtsa @@ -39,36 +39,29 @@ clean_up_dir () { create_ca () { echo "Creating a new CA for the TSA tests..." - /bin/rm -fr demoCA - $SH ../../apps/CA.sh -newca <<EOF - -HU -Budapest -Budapest -Gov-CA Ltd. -ca1 -EOF + TSDNSECT=ts_ca_dn + export TSDNSECT + ../../util/shlib_wrap.sh ../../apps/openssl req -new -x509 -nodes \ + -out tsaca.pem -keyout tsacakey.pem test $? != 0 && error } create_tsa_cert () { INDEX=$1 + export INDEX EXT=$2 - ../../util/shlib_wrap.sh ../../apps/openssl req -new -out tsa_req${INDEX}.pem -keyout tsa_key${INDEX}.pem <<EOF -HU -Budapest -Buda -Hun-TSA Ltd. -tsa${INDEX} -EOF - test $? != 0 && error + TSDNSECT=ts_cert_dn + export TSDNSECT - ../../util/shlib_wrap.sh ../../apps/openssl ca -in tsa_req${INDEX}.pem -out tsa_cert${INDEX}.pem \ - -extensions $EXT <<EOF -y -y -EOF + ../../util/shlib_wrap.sh ../../apps/openssl req -new \ + -out tsa_req${INDEX}.pem -keyout tsa_key${INDEX}.pem + test $? != 0 && error +echo Using extension $EXT + ../../util/shlib_wrap.sh ../../apps/openssl x509 -req \ + -in tsa_req${INDEX}.pem -out tsa_cert${INDEX}.pem \ + -CA tsaca.pem -CAkey tsacakey.pem -CAcreateserial \ + -extfile $OPENSSL_CONF -extensions $EXT test $? != 0 && error } @@ -128,10 +121,10 @@ time_stamp_response_token_test () { verify_time_stamp_response () { - ../../util/shlib_wrap.sh ../../apps/openssl ts -verify -queryfile $1 -in $2 -CAfile demoCA/cacert.pem \ + ../../util/shlib_wrap.sh ../../apps/openssl ts -verify -queryfile $1 -in $2 -CAfile tsaca.pem \ -untrusted tsa_cert1.pem test $? != 0 && error - ../../util/shlib_wrap.sh ../../apps/openssl ts -verify -data $3 -in $2 -CAfile demoCA/cacert.pem \ + ../../util/shlib_wrap.sh ../../apps/openssl ts -verify -data $3 -in $2 -CAfile tsaca.pem \ -untrusted tsa_cert1.pem test $? != 0 && error } @@ -142,16 +135,16 @@ verify_time_stamp_token () { ../../util/shlib_wrap.sh ../../apps/openssl ts -reply -in $2 -out $2.token -token_out test $? != 0 && error ../../util/shlib_wrap.sh ../../apps/openssl ts -verify -queryfile $1 -in $2.token -token_in \ - -CAfile demoCA/cacert.pem -untrusted tsa_cert1.pem + -CAfile tsaca.pem -untrusted tsa_cert1.pem test $? != 0 && error ../../util/shlib_wrap.sh ../../apps/openssl ts -verify -data $3 -in $2.token -token_in \ - -CAfile demoCA/cacert.pem -untrusted tsa_cert1.pem + -CAfile tsaca.pem -untrusted tsa_cert1.pem test $? != 0 && error } verify_time_stamp_response_fail () { - ../../util/shlib_wrap.sh ../../apps/openssl ts -verify -queryfile $1 -in $2 -CAfile demoCA/cacert.pem \ + ../../util/shlib_wrap.sh ../../apps/openssl ts -verify -queryfile $1 -in $2 -CAfile tsaca.pem \ -untrusted tsa_cert1.pem # Checks if the verification failed, as it should have. test $? = 0 && error |