From: Todd O. <to...@us...> - 2014-12-09 21:35:44
|
Update of /cvsroot/yassl/yassl/testsuite In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1873/testsuite Modified Files: test.hpp Added Files: cipher-test.sh Log Message: add cipher-test.sh to bundle, tests all cipher suites Index: test.hpp =================================================================== RCS file: /cvsroot/yassl/yassl/testsuite/test.hpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** test.hpp 25 Nov 2014 22:15:59 -0000 1.25 --- test.hpp 9 Dec 2014 21:35:41 -0000 1.26 *************** *** 162,172 **** // server dsa const char* const dsaCert = "../certs/dsa-cert.pem"; ! const char* const dsaKey = "../certs/dsa512.der"; const char* const dsaCert2 = "../../certs/dsa-cert.pem"; ! const char* const dsaKey2 = "../../certs/dsa512.der"; const char* const dsaCert3 = "../../../certs/dsa-cert.pem"; ! const char* const dsaKey3 = "../../../certs/dsa512.der"; --- 162,172 ---- // server dsa const char* const dsaCert = "../certs/dsa-cert.pem"; ! const char* const dsaKey = "../certs/dsa1024.der"; const char* const dsaCert2 = "../../certs/dsa-cert.pem"; ! const char* const dsaKey2 = "../../certs/dsa1024.der"; const char* const dsaCert3 = "../../../certs/dsa-cert.pem"; ! const char* const dsaKey3 = "../../../certs/dsa1024.der"; *************** *** 207,210 **** --- 207,217 ---- if (SSL_CTX_load_verify_locations(ctx, certDebug,0) != SSL_SUCCESS) err_sys("failed to use certificate: certs/client-cert.pem"); + + // DSA cert + if (SSL_CTX_load_verify_locations(ctx, dsaCert, 0) != SSL_SUCCESS) + if (SSL_CTX_load_verify_locations(ctx, dsaCert2, 0) != SSL_SUCCESS) + if (SSL_CTX_load_verify_locations(ctx, dsaCert3, 0) != SSL_SUCCESS) + err_sys("failed to use certificate: certs/dsa-cert.pem"); + } *************** *** 283,287 **** if (SSL_CTX_use_PrivateKey_file(ctx, dsaKey3,SSL_FILETYPE_ASN1) != SSL_SUCCESS) ! err_sys("failed to use key file: certs/dsa512.der"); } --- 290,294 ---- if (SSL_CTX_use_PrivateKey_file(ctx, dsaKey3,SSL_FILETYPE_ASN1) != SSL_SUCCESS) ! err_sys("failed to use key file: certs/dsa1024.der"); } --- NEW FILE: cipher-test.sh --- #!/bin/bash # test all yassl cipher suties # server_pid=$no_pid do_cleanup() { echo "in cleanup" if [[ $server_pid != $no_pid ]] then echo "killing server" kill -9 $server_pid fi } do_trap() { echo "got trap" do_cleanup exit -1 } trap do_trap INT TERM # non DSA suites for suite in {"DHE-RSA-AES256-SHA","AES256-SHA","DHE-RSA-AES128-SHA","AES128-SHA","AES256-RMD","AES128-RMD","DES-CBC3-RMD","DHE-RSA-AES256-RMD","DHE-RSA-AES128-RMD","DHE-RSA-DES-CBC3-RMD","RC4-SHA","RC4-MD5","DES-CBC3-SHA","DES-CBC-SHA","EDH-RSA-DES-CBC3-SHA","EDH-RSA-DES-CBC-SHA"} do for client_auth in {y,n} do echo "Trying $suite client auth = $client_auth ...\n" if test -e server_ready; then echo -e "removing exisitng server_ready file" rm server_ready fi ../examples/server/server $client_auth & server_pid=$! while [ ! -s server_ready ]; do echo -e "waiting for server_ready file..." sleep 0.1 done ../examples/client/client $suite client_result=$? wait $server_pid server_result=$? server_pid=$no_pid if [[ $client_result != 0 ]] then echo "Client Error" exit $client_result fi if [[ $server_result != 0 ]] then echo "Server Error" exit $server_result fi done # end client auth loop done # end non dsa suite list echo -e "Non DSA Loop SUCCESS" # DSA suites for suite in {"DHE-DSS-AES256-SHA","DHE-DSS-AES128-SHA","DHE-DSS-AES256-RMD","DHE-DSS-AES128-RMD","DHE-DSS-DES-CBC3-RMD","EDH-DSS-DES-CBC3-SHA","EDH-DSS-DES-CBC-SHA"} do for client_auth in {y,n} do echo "Trying $suite client auth = $client_auth ...\n" if test -e server_ready; then echo -e "removing exisitng server_ready file" rm server_ready fi # d signifies DSA ../examples/server/server $client_auth d & server_pid=$! while [ ! -s server_ready ]; do echo -e "waiting for server_ready file..." sleep 0.1 done ../examples/client/client $suite client_result=$? wait $server_pid server_result=$? server_pid=$no_pid if [[ $client_result != 0 ]] then echo "Client Error" exit $client_result fi if [[ $server_result != 0 ]] then echo "Server Error" exit $server_result fi done # end client auth loop done # end dsa suite list echo -e "DSA Loop SUCCESS" exit 0 |