diff options
| author | Don <don.j.olmstead@gmail.com> | 2018-03-20 15:55:41 -0700 |
|---|---|---|
| committer | Don <don.j.olmstead@gmail.com> | 2018-03-20 16:44:41 -0700 |
| commit | 644c1097a8402d170603f5a0ff17efb37360dac7 (patch) | |
| tree | 473b3aae687b1aa1a30bd68559035162bc0600cc | |
| parent | 0263e69a9346e2a3c3bcbbed8f12a9749da63900 (diff) | |
| download | portable-644c1097a8402d170603f5a0ff17efb37360dac7.tar.gz portable-644c1097a8402d170603f5a0ff17efb37360dac7.tar.bz2 portable-644c1097a8402d170603f5a0ff17efb37360dac7.zip | |
Fix Windows tests within CMake
| -rw-r--r-- | tests/CMakeLists.txt | 48 | ||||
| -rw-r--r-- | tests/ocsptest.bat | 11 | ||||
| -rw-r--r-- | tests/pq_test.bat | 7 | ||||
| -rw-r--r-- | tests/servertest.bat | 7 | ||||
| -rw-r--r-- | tests/ssltest.bat | 10 | ||||
| -rw-r--r-- | tests/testdsa.bat | 15 | ||||
| -rw-r--r-- | tests/testenc.bat | 22 | ||||
| -rw-r--r-- | tests/testrsa.bat | 15 | ||||
| -rw-r--r-- | tests/tlstest.bat | 7 |
9 files changed, 66 insertions, 76 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4cc55d8..4942e0a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt | |||
| @@ -24,6 +24,8 @@ foreach(lib IN LISTS OPENSSL_LIBS) | |||
| 24 | endif() | 24 | endif() |
| 25 | endforeach() | 25 | endforeach() |
| 26 | 26 | ||
| 27 | file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} TEST_SOURCE_DIR) | ||
| 28 | |||
| 27 | # aeadtest | 29 | # aeadtest |
| 28 | add_executable(aeadtest aeadtest.c) | 30 | add_executable(aeadtest aeadtest.c) |
| 29 | target_link_libraries(aeadtest ${TESTS_LIBS}) | 31 | target_link_libraries(aeadtest ${TESTS_LIBS}) |
| @@ -242,9 +244,9 @@ if(ENABLE_EXTRATESTS) | |||
| 242 | add_executable(ocsp_test ocsp_test.c) | 244 | add_executable(ocsp_test ocsp_test.c) |
| 243 | target_link_libraries(ocsp_test ${TESTS_LIBS}) | 245 | target_link_libraries(ocsp_test ${TESTS_LIBS}) |
| 244 | if(NOT MSVC) | 246 | if(NOT MSVC) |
| 245 | add_test(ocsptest ${CMAKE_CURRENT_SOURCE_DIR}/ocsptest.sh) | 247 | add_test(NAME ocsptest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/ocsptest.sh) |
| 246 | else() | 248 | else() |
| 247 | add_test(ocsptest ${CMAKE_CURRENT_SOURCE_DIR}/ocsptest.bat) | 249 | add_test(NAME ocsptest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/ocsptest.bat $<TARGET_FILE:ocsp_test>) |
| 248 | endif() | 250 | endif() |
| 249 | endif() | 251 | endif() |
| 250 | 252 | ||
| @@ -281,11 +283,11 @@ add_test(poly1305test poly1305test) | |||
| 281 | add_executable(pq_test pq_test.c) | 283 | add_executable(pq_test pq_test.c) |
| 282 | target_link_libraries(pq_test ${TESTS_LIBS}) | 284 | target_link_libraries(pq_test ${TESTS_LIBS}) |
| 283 | if(NOT MSVC) | 285 | if(NOT MSVC) |
| 284 | add_test(pq_test ${CMAKE_CURRENT_SOURCE_DIR}/pq_test.sh) | 286 | add_test(NAME pq_test COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/pq_test.sh) |
| 285 | else() | 287 | else() |
| 286 | add_test(pq_test ${CMAKE_CURRENT_SOURCE_DIR}/pq_test.bat) | 288 | add_test(NAME pq_test COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/pq_test.bat $<TARGET_FILE:pq_test>) |
| 287 | endif() | 289 | endif() |
| 288 | set_tests_properties(pq_test PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") | 290 | set_tests_properties(pq_test PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") |
| 289 | 291 | ||
| 290 | # randtest | 292 | # randtest |
| 291 | add_executable(randtest randtest.c) | 293 | add_executable(randtest randtest.c) |
| @@ -325,11 +327,11 @@ add_test(rsa_test rsa_test) | |||
| 325 | add_executable(servertest servertest.c) | 327 | add_executable(servertest servertest.c) |
| 326 | target_link_libraries(servertest ${TESTS_LIBS}) | 328 | target_link_libraries(servertest ${TESTS_LIBS}) |
| 327 | if(NOT MSVC) | 329 | if(NOT MSVC) |
| 328 | add_test(servertest ${CMAKE_CURRENT_SOURCE_DIR}/servertest.sh) | 330 | add_test(NAME servertest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/servertest.sh) |
| 329 | else() | 331 | else() |
| 330 | add_test(servertest ${CMAKE_CURRENT_SOURCE_DIR}/servertest.bat) | 332 | add_test(NAME servertest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/servertest.bat $<TARGET_FILE:servertest>) |
| 331 | endif() | 333 | endif() |
| 332 | set_tests_properties(servertest PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") | 334 | set_tests_properties(servertest PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") |
| 333 | 335 | ||
| 334 | # sha1test | 336 | # sha1test |
| 335 | add_executable(sha1test sha1test.c) | 337 | add_executable(sha1test sha1test.c) |
| @@ -355,35 +357,35 @@ add_test(ssl_versions ssl_versions) | |||
| 355 | add_executable(ssltest ssltest.c) | 357 | add_executable(ssltest ssltest.c) |
| 356 | target_link_libraries(ssltest ${TESTS_LIBS}) | 358 | target_link_libraries(ssltest ${TESTS_LIBS}) |
| 357 | if(NOT MSVC) | 359 | if(NOT MSVC) |
| 358 | add_test(ssltest ${CMAKE_CURRENT_SOURCE_DIR}/ssltest.sh) | 360 | add_test(NAME ssltest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/ssltest.sh) |
| 359 | else() | 361 | else() |
| 360 | add_test(ssltest ${CMAKE_CURRENT_SOURCE_DIR}/ssltest.bat) | 362 | add_test(NAME ssltest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/ssltest.bat $<TARGET_FILE:ssltest> $<TARGET_FILE:openssl>) |
| 361 | endif() | 363 | endif() |
| 362 | set_tests_properties(ssltest PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") | 364 | set_tests_properties(ssltest PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") |
| 363 | 365 | ||
| 364 | # testdsa | 366 | # testdsa |
| 365 | if(NOT MSVC) | 367 | if(NOT MSVC) |
| 366 | add_test(testdsa ${CMAKE_CURRENT_SOURCE_DIR}/testdsa.sh) | 368 | add_test(NAME testdsa COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/testdsa.sh) |
| 367 | else() | 369 | else() |
| 368 | add_test(testdsa ${CMAKE_CURRENT_SOURCE_DIR}/testdsa.bat) | 370 | add_test(NAME testdsa COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/testdsa.bat $<TARGET_FILE:openssl>) |
| 369 | endif() | 371 | endif() |
| 370 | set_tests_properties(testdsa PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") | 372 | set_tests_properties(testdsa PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") |
| 371 | 373 | ||
| 372 | # testenc | 374 | # testenc |
| 373 | if(NOT MSVC) | 375 | if(NOT MSVC) |
| 374 | add_test(testenc ${CMAKE_CURRENT_SOURCE_DIR}/testenc.sh) | 376 | add_test(NAME testenc COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/testenc.sh) |
| 375 | else() | 377 | else() |
| 376 | add_test(testenc ${CMAKE_CURRENT_SOURCE_DIR}/testenc.bat) | 378 | add_test(NAME testenc COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/testenc.bat $<TARGET_FILE:openssl>) |
| 377 | endif() | 379 | endif() |
| 378 | set_tests_properties(testenc PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") | 380 | set_tests_properties(testenc PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") |
| 379 | 381 | ||
| 380 | # testrsa | 382 | # testrsa |
| 381 | if(NOT MSVC) | 383 | if(NOT MSVC) |
| 382 | add_test(testrsa ${CMAKE_CURRENT_SOURCE_DIR}/testrsa.sh) | 384 | add_test(NAME testrsa COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/testrsa.sh) |
| 383 | else() | 385 | else() |
| 384 | add_test(testrsa ${CMAKE_CURRENT_SOURCE_DIR}/testrsa.bat) | 386 | add_test(NAME testrsa COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/testrsa.bat $<TARGET_FILE:openssl>) |
| 385 | endif() | 387 | endif() |
| 386 | set_tests_properties(testrsa PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") | 388 | set_tests_properties(testrsa PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") |
| 387 | 389 | ||
| 388 | # timingsafe | 390 | # timingsafe |
| 389 | add_executable(timingsafe timingsafe.c) | 391 | add_executable(timingsafe timingsafe.c) |
| @@ -407,11 +409,11 @@ endif() | |||
| 407 | add_executable(tlstest ${TLSTEST_SRC}) | 409 | add_executable(tlstest ${TLSTEST_SRC}) |
| 408 | target_link_libraries(tlstest ${TESTS_LIBS}) | 410 | target_link_libraries(tlstest ${TESTS_LIBS}) |
| 409 | if(NOT MSVC) | 411 | if(NOT MSVC) |
| 410 | add_test(tlstest ${CMAKE_CURRENT_SOURCE_DIR}/tlstest.sh) | 412 | add_test(NAME tlstest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tlstest.sh) |
| 411 | else() | 413 | else() |
| 412 | add_test(tlstest ${CMAKE_CURRENT_SOURCE_DIR}/tlstest.bat) | 414 | add_test(NAME tlstest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tlstest.bat $<TARGET_FILE:tlstest>) |
| 413 | endif() | 415 | endif() |
| 414 | set_tests_properties(tlstest PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") | 416 | set_tests_properties(tlstest PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") |
| 415 | 417 | ||
| 416 | # tls_ext_alpn | 418 | # tls_ext_alpn |
| 417 | add_executable(tls_ext_alpn tls_ext_alpn.c) | 419 | add_executable(tls_ext_alpn tls_ext_alpn.c) |
diff --git a/tests/ocsptest.bat b/tests/ocsptest.bat index fa0ae42..2b6b66b 100644 --- a/tests/ocsptest.bat +++ b/tests/ocsptest.bat | |||
| @@ -1,11 +1,12 @@ | |||
| 1 | @echo off | 1 | @echo off |
| 2 | setlocal enabledelayedexpansion | 2 | setlocal enabledelayedexpansion |
| 3 | REM ocsptest.bat | 3 | REM ocspocsp_test_bin.bat |
| 4 | 4 | ||
| 5 | set TEST=Debug\ocsp_test.exe | 5 | set ocsp_test_bin=%1 |
| 6 | if not exist %TEST% exit /b 1 | 6 | set ocsp_test_bin=%ocsp_test_bin:/=\% |
| 7 | if not exist %ocsp_test_bin% exit /b 1 | ||
| 7 | 8 | ||
| 8 | %TEST% www.amazon.com 443 & if !errorlevel! neq 0 exit /b 1 | 9 | %ocsp_test_bin% www.amazon.com 443 & if !errorlevel! neq 0 exit /b 1 |
| 9 | %TEST% cloudflare.com 443 & if !errorlevel! neq 0 exit /b 1 | 10 | %ocsp_test_bin% cloudflare.com 443 & if !errorlevel! neq 0 exit /b 1 |
| 10 | 11 | ||
| 11 | endlocal | 12 | endlocal |
diff --git a/tests/pq_test.bat b/tests/pq_test.bat index b665874..084f06d 100644 --- a/tests/pq_test.bat +++ b/tests/pq_test.bat | |||
| @@ -2,13 +2,14 @@ | |||
| 2 | setlocal enabledelayedexpansion | 2 | setlocal enabledelayedexpansion |
| 3 | REM pq_test.bat | 3 | REM pq_test.bat |
| 4 | 4 | ||
| 5 | set TEST=Debug\pq_test.exe | 5 | set pq_test_bin=%1 |
| 6 | if not exist %TEST% exit /b 1 | 6 | set pq_test_bin=%pq_test_bin:/=\% |
| 7 | if not exist %pq_test_bin% exit /b 1 | ||
| 7 | 8 | ||
| 8 | set pq_output=pq_output.txt | 9 | set pq_output=pq_output.txt |
| 9 | if exist %pq_output% del %pq_output% | 10 | if exist %pq_output% del %pq_output% |
| 10 | 11 | ||
| 11 | %TEST% > %pq_output% | 12 | %pq_test_bin% > %pq_output% |
| 12 | fc /b %pq_output% %srcdir%\pq_expected.txt | 13 | fc /b %pq_output% %srcdir%\pq_expected.txt |
| 13 | 14 | ||
| 14 | endlocal | 15 | endlocal |
diff --git a/tests/servertest.bat b/tests/servertest.bat index d3dd178..8c9bd97 100644 --- a/tests/servertest.bat +++ b/tests/servertest.bat | |||
| @@ -2,13 +2,10 @@ | |||
| 2 | setlocal enabledelayedexpansion | 2 | setlocal enabledelayedexpansion |
| 3 | REM servertest.bat | 3 | REM servertest.bat |
| 4 | 4 | ||
| 5 | set servertest_bin=Debug\servertest.exe | 5 | set servertest_bin=%1 |
| 6 | set servertest_bin=%servertest_bin:/=\% | ||
| 6 | if not exist %servertest_bin% exit /b 1 | 7 | if not exist %servertest_bin% exit /b 1 |
| 7 | 8 | ||
| 8 | if "%srcdir%"=="" ( | ||
| 9 | set srcdir=. | ||
| 10 | ) | ||
| 11 | |||
| 12 | %servertest_bin% %srcdir%\server.pem %srcdir%\server.pem %srcdir%\ca.pem | 9 | %servertest_bin% %srcdir%\server.pem %srcdir%\server.pem %srcdir%\ca.pem |
| 13 | if !errorlevel! neq 0 ( | 10 | if !errorlevel! neq 0 ( |
| 14 | exit /b 1 | 11 | exit /b 1 |
diff --git a/tests/ssltest.bat b/tests/ssltest.bat index e52efed..f068cb0 100644 --- a/tests/ssltest.bat +++ b/tests/ssltest.bat | |||
| @@ -2,16 +2,14 @@ | |||
| 2 | setlocal enabledelayedexpansion | 2 | setlocal enabledelayedexpansion |
| 3 | REM ssltest.bat | 3 | REM ssltest.bat |
| 4 | 4 | ||
| 5 | set ssltest_bin=Debug\ssltest.exe | 5 | set ssltest_bin=%1 |
| 6 | set ssltest_bin=%ssltest_bin:/=\% | ||
| 6 | if not exist %ssltest_bin% exit /b 1 | 7 | if not exist %ssltest_bin% exit /b 1 |
| 7 | 8 | ||
| 8 | set openssl_bin=..\apps\openssl\Debug\openssl.exe | 9 | set openssl_bin=%2 |
| 10 | set openssl_bin=%openssl_bin:/=\% | ||
| 9 | if not exist %openssl_bin% exit /b 1 | 11 | if not exist %openssl_bin% exit /b 1 |
| 10 | 12 | ||
| 11 | if "%srcdir%"=="" ( | ||
| 12 | set srcdir=. | ||
| 13 | ) | ||
| 14 | |||
| 15 | %srcdir%\testssl.bat %srcdir%\server.pem %srcdir%\server.pem %srcdir%\ca.pem ^ | 13 | %srcdir%\testssl.bat %srcdir%\server.pem %srcdir%\server.pem %srcdir%\ca.pem ^ |
| 16 | %ssltest_bin% %openssl_bin% | 14 | %ssltest_bin% %openssl_bin% |
| 17 | if !errorlevel! neq 0 ( | 15 | if !errorlevel! neq 0 ( |
diff --git a/tests/testdsa.bat b/tests/testdsa.bat index 9a9690e..898ded8 100644 --- a/tests/testdsa.bat +++ b/tests/testdsa.bat | |||
| @@ -5,29 +5,26 @@ REM testdsa.bat | |||
| 5 | 5 | ||
| 6 | REM # Test DSA certificate generation of openssl | 6 | REM # Test DSA certificate generation of openssl |
| 7 | 7 | ||
| 8 | set cmd=..\apps\openssl\Debug\openssl.exe | 8 | set openssl_bin=%1 |
| 9 | if not exist %cmd% exit /b 1 | 9 | set openssl_bin=%openssl_bin:/=\% |
| 10 | 10 | if not exist %openssl_bin% exit /b 1 | |
| 11 | if "%srcdir%"=="" ( | ||
| 12 | set srcdir=. | ||
| 13 | ) | ||
| 14 | 11 | ||
| 15 | REM # Generate DSA paramter set | 12 | REM # Generate DSA paramter set |
| 16 | %cmd% dsaparam 512 -out dsa512.pem | 13 | %openssl_bin% dsaparam 512 -out dsa512.pem |
| 17 | if !errorlevel! neq 0 ( | 14 | if !errorlevel! neq 0 ( |
| 18 | exit /b 1 | 15 | exit /b 1 |
| 19 | ) | 16 | ) |
| 20 | 17 | ||
| 21 | 18 | ||
| 22 | REM # Generate a DSA certificate | 19 | REM # Generate a DSA certificate |
| 23 | %cmd% req -config %srcdir%\openssl.cnf -x509 -newkey dsa:dsa512.pem -out testdsa.pem -keyout testdsa.key | 20 | %openssl_bin% req -config %srcdir%\openssl.cnf -x509 -newkey dsa:dsa512.pem -out testdsa.pem -keyout testdsa.key |
| 24 | if !errorlevel! neq 0 ( | 21 | if !errorlevel! neq 0 ( |
| 25 | exit /b 1 | 22 | exit /b 1 |
| 26 | ) | 23 | ) |
| 27 | 24 | ||
| 28 | 25 | ||
| 29 | REM # Now check the certificate | 26 | REM # Now check the certificate |
| 30 | %cmd% x509 -text -in testdsa.pem | 27 | %openssl_bin% x509 -text -in testdsa.pem |
| 31 | if !errorlevel! neq 0 ( | 28 | if !errorlevel! neq 0 ( |
| 32 | exit /b 1 | 29 | exit /b 1 |
| 33 | ) | 30 | ) |
diff --git a/tests/testenc.bat b/tests/testenc.bat index a925ec3..93dfc0c 100644 --- a/tests/testenc.bat +++ b/tests/testenc.bat | |||
| @@ -3,16 +3,16 @@ setlocal enabledelayedexpansion | |||
| 3 | REM testenc.bat | 3 | REM testenc.bat |
| 4 | 4 | ||
| 5 | set test=p | 5 | set test=p |
| 6 | set cmd=..\apps\openssl\Debug\openssl.exe | ||
| 7 | if not exist %cmd% exit /b 1 | ||
| 8 | 6 | ||
| 9 | set srcdir=..\..\tests | 7 | set openssl_bin=%1 |
| 8 | set openssl_bin=%openssl_bin:/=\% | ||
| 9 | if not exist %openssl_bin% exit /b 1 | ||
| 10 | 10 | ||
| 11 | copy %srcdir%\openssl.cnf %test% | 11 | copy %srcdir%\openssl.cnf %test% |
| 12 | 12 | ||
| 13 | echo cat | 13 | echo cat |
| 14 | %cmd% enc -in %test% -out %test%.cipher | 14 | %openssl_bin% enc -in %test% -out %test%.cipher |
| 15 | %cmd% enc -in %test%.cipher -out %test%.clear | 15 | %openssl_bin% enc -in %test%.cipher -out %test%.clear |
| 16 | fc /b %test% %test%.clear | 16 | fc /b %test% %test%.clear |
| 17 | if !errorlevel! neq 0 ( | 17 | if !errorlevel! neq 0 ( |
| 18 | exit /b 1 | 18 | exit /b 1 |
| @@ -21,8 +21,8 @@ if !errorlevel! neq 0 ( | |||
| 21 | ) | 21 | ) |
| 22 | 22 | ||
| 23 | echo base64 | 23 | echo base64 |
| 24 | %cmd% enc -a -e -in %test% -out %test%.cipher | 24 | %openssl_bin% enc -a -e -in %test% -out %test%.cipher |
| 25 | %cmd% enc -a -d -in %test%.cipher -out %test%.clear | 25 | %openssl_bin% enc -a -d -in %test%.cipher -out %test%.clear |
| 26 | fc /b %test% %test%.clear | 26 | fc /b %test% %test%.clear |
| 27 | if !errorlevel! neq 0 ( | 27 | if !errorlevel! neq 0 ( |
| 28 | exit /b 1 | 28 | exit /b 1 |
| @@ -45,8 +45,8 @@ for %%i in ( | |||
| 45 | rc4 rc4-40 | 45 | rc4 rc4-40 |
| 46 | ) do ( | 46 | ) do ( |
| 47 | echo %%i | 47 | echo %%i |
| 48 | %cmd% %%i -e -k test -in %test% -out %test%.%%i.cipher | 48 | %openssl_bin% %%i -e -k test -in %test% -out %test%.%%i.cipher |
| 49 | %cmd% %%i -d -k test -in %test%.%%i.cipher -out %test%.%%i.clear | 49 | %openssl_bin% %%i -d -k test -in %test%.%%i.cipher -out %test%.%%i.clear |
| 50 | fc /b %test% %test%.%%i.clear | 50 | fc /b %test% %test%.%%i.clear |
| 51 | if !errorlevel! neq 0 ( | 51 | if !errorlevel! neq 0 ( |
| 52 | exit /b 1 | 52 | exit /b 1 |
| @@ -55,8 +55,8 @@ for %%i in ( | |||
| 55 | ) | 55 | ) |
| 56 | 56 | ||
| 57 | echo %%i base64 | 57 | echo %%i base64 |
| 58 | %cmd% %%i -a -e -k test -in %test% -out %test%.%%i.cipher | 58 | %openssl_bin% %%i -a -e -k test -in %test% -out %test%.%%i.cipher |
| 59 | %cmd% %%i -a -d -k test -in %test%.%%i.cipher -out %test%.%%i.clear | 59 | %openssl_bin% %%i -a -d -k test -in %test%.%%i.cipher -out %test%.%%i.clear |
| 60 | fc /b %test% %test%.%%i.clear | 60 | fc /b %test% %test%.%%i.clear |
| 61 | if !errorlevel! neq 0 ( | 61 | if !errorlevel! neq 0 ( |
| 62 | exit /b 1 | 62 | exit /b 1 |
diff --git a/tests/testrsa.bat b/tests/testrsa.bat index 6d88d21..59c3b5d 100644 --- a/tests/testrsa.bat +++ b/tests/testrsa.bat | |||
| @@ -5,29 +5,26 @@ REM testrsa.bat | |||
| 5 | 5 | ||
| 6 | REM # Test RSA certificate generation of openssl | 6 | REM # Test RSA certificate generation of openssl |
| 7 | 7 | ||
| 8 | set cmd=..\apps\openssl\Debug\openssl.exe | 8 | set openssl_bin=%1 |
| 9 | if not exist %cmd% exit /b 1 | 9 | set openssl_bin=%openssl_bin:/=\% |
| 10 | 10 | if not exist %openssl_bin% exit /b 1 | |
| 11 | if "%srcdir%"=="" ( | ||
| 12 | set srcdir=. | ||
| 13 | ) | ||
| 14 | 11 | ||
| 15 | REM # Generate RSA private key | 12 | REM # Generate RSA private key |
| 16 | %cmd% genrsa -out rsakey.pem | 13 | %openssl_bin% genrsa -out rsakey.pem |
| 17 | if !errorlevel! neq 0 ( | 14 | if !errorlevel! neq 0 ( |
| 18 | exit /b 1 | 15 | exit /b 1 |
| 19 | ) | 16 | ) |
| 20 | 17 | ||
| 21 | 18 | ||
| 22 | REM # Generate an RSA certificate | 19 | REM # Generate an RSA certificate |
| 23 | %cmd% req -config %srcdir%\openssl.cnf -key rsakey.pem -new -x509 -days 365 -out rsacert.pem | 20 | %openssl_bin% req -config %srcdir%\openssl.cnf -key rsakey.pem -new -x509 -days 365 -out rsacert.pem |
| 24 | if !errorlevel! neq 0 ( | 21 | if !errorlevel! neq 0 ( |
| 25 | exit /b 1 | 22 | exit /b 1 |
| 26 | ) | 23 | ) |
| 27 | 24 | ||
| 28 | 25 | ||
| 29 | REM # Now check the certificate | 26 | REM # Now check the certificate |
| 30 | %cmd% x509 -text -in rsacert.pem | 27 | %openssl_bin% x509 -text -in rsacert.pem |
| 31 | if !errorlevel! neq 0 ( | 28 | if !errorlevel! neq 0 ( |
| 32 | exit /b 1 | 29 | exit /b 1 |
| 33 | ) | 30 | ) |
diff --git a/tests/tlstest.bat b/tests/tlstest.bat index b7b1ecf..25664cf 100644 --- a/tests/tlstest.bat +++ b/tests/tlstest.bat | |||
| @@ -2,13 +2,10 @@ | |||
| 2 | setlocal enabledelayedexpansion | 2 | setlocal enabledelayedexpansion |
| 3 | REM tlstest.bat | 3 | REM tlstest.bat |
| 4 | 4 | ||
| 5 | set tlstest_bin=Debug\tlstest.exe | 5 | set tlstest_bin=%1 |
| 6 | set tlstest_bin=%tlstest_bin:/=\% | ||
| 6 | if not exist %tlstest_bin% exit /b 1 | 7 | if not exist %tlstest_bin% exit /b 1 |
| 7 | 8 | ||
| 8 | if "%srcdir%"=="" ( | ||
| 9 | set srcdir=. | ||
| 10 | ) | ||
| 11 | |||
| 12 | %tlstest_bin% %srcdir%\ca.pem %srcdir%\server.pem %srcdir%\server.pem | 9 | %tlstest_bin% %srcdir%\ca.pem %srcdir%\server.pem %srcdir%\server.pem |
| 13 | if !errorlevel! neq 0 ( | 10 | if !errorlevel! neq 0 ( |
| 14 | exit /b 1 | 11 | exit /b 1 |
