From 0bf23d9b2055223c6e7a1398d2243a65dfa4c30d Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Fri, 15 Nov 2002 22:37:18 +0000 Subject: WinCE patches --- ms/do_ms.bat | 2 + ms/tencce.bat | 19 +++++ ms/testce.bat | 234 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ ms/testce2.bat | 2 + ms/testencce.bat | 97 +++++++++++++++++++++++ ms/testpemce.bat | 42 ++++++++++ ms/testssce.bat | 104 +++++++++++++++++++++++++ ms/tpemce.bat | 8 ++ 8 files changed, 508 insertions(+) create mode 100644 ms/tencce.bat create mode 100644 ms/testce.bat create mode 100644 ms/testce2.bat create mode 100644 ms/testencce.bat create mode 100644 ms/testpemce.bat create mode 100644 ms/testssce.bat create mode 100644 ms/tpemce.bat (limited to 'ms') diff --git a/ms/do_ms.bat b/ms/do_ms.bat index 5cbc6f7d5f..a8cf515bac 100755 --- a/ms/do_ms.bat +++ b/ms/do_ms.bat @@ -5,6 +5,8 @@ rem perl util\mk1mf.pl VC-W31-32 >ms\w31.mak perl util\mk1mf.pl dll VC-W31-32 >ms\w31dll.mak perl util\mk1mf.pl no-asm VC-WIN32 >ms\nt.mak perl util\mk1mf.pl dll no-asm VC-WIN32 >ms\ntdll.mak +perl util\mk1mf.pl no-asm VC-CE >ms\ce.mak +perl util\mk1mf.pl dll no-asm VC-CE >ms\cedll.mak perl util\mkdef.pl 16 libeay > ms\libeay16.def perl util\mkdef.pl 32 libeay > ms\libeay32.def diff --git a/ms/tencce.bat b/ms/tencce.bat new file mode 100644 index 0000000000..6a944d7671 --- /dev/null +++ b/ms/tencce.bat @@ -0,0 +1,19 @@ +rem called by testencce + +echo test %1 %2 %3 %4 %5 %6 +cecopy %input% CE:\OpenSSL +cerun CE:\OpenSSL\%ssleay% %1 %2 %3 %4 %5 %6 -e -bufsize 113 -k test -in \OpenSSL\%input% -out \OpenSSL\%tmp1% +cerun CE:\OpenSSL\%ssleay% %1 %2 %3 %4 %5 %6 -d -bufsize 157 -k test -in \OpenSSL\%tmp1% -out \OpenSSL\%out1% +del %out1% >nul 2>&1 +cecopy CE:\OpenSSL\%out1% . +%cmp% %input% %out1% +if errorlevel 1 goto err + +echo test base64 %1 %2 %3 %4 %5 %6 +cerun CE:\OpenSSL\%ssleay% %1 %2 %3 %4 %5 %6 -a -e -bufsize 113 -k test -in \OpenSSL\%input% -out \OpenSSL\%tmp1% +cerun CE:\OpenSSL\%ssleay% %1 %2 %3 %4 %5 %6 -a -d -bufsize 157 -k test -in \OpenSSL\%tmp1% -out \OpenSSL\%out1% +del %out1% >nul 2>&1 +cecopy CE:\OpenSSL\%out1% . +%cmp% %input% %out1% + +:err diff --git a/ms/testce.bat b/ms/testce.bat new file mode 100644 index 0000000000..2ab010be6a --- /dev/null +++ b/ms/testce.bat @@ -0,0 +1,234 @@ +@echo off + +cemkdir CE:\OpenSSL + +set test=..\ms +set opath=%PATH% +PATH=..\ms;%PATH% +cecopy ..\apps\openssl.cnf CE:\OpenSSL +set OPENSSL_CONF=\OpenSSL\openssl.cnf +set HOME=\OpenSSL +set CERUN_PASS_ENV=OPENSSL_CONF HOME + +rem run this from inside the bin directory + +rem Copy the DLL's (though they'll only exist if we're in out32dll) +if exist libeay32.dll cecopy libeay32.dll CE:\OpenSSL +if exist ssleay32.dll cecopy ssleay32.dll CE:\OpenSSL + +echo rsa_test +call %test%\testce2 rsa_test +if errorlevel 1 goto done + +echo destest +call %test%\testce2 destest +if errorlevel 1 goto done + +echo ideatest +call %test%\testce2 ideatest +if errorlevel 1 goto done + +echo bftest +call %test%\testce2 bftest +if errorlevel 1 goto done + +echo shatest +call %test%\testce2 shatest +if errorlevel 1 goto done + +echo sha1test +call %test%\testce2 sha1test +if errorlevel 1 goto done + +echo md5test +call %test%\testce2 md5test +if errorlevel 1 goto done + +echo md2test +call %test%\testce2 md2test +if errorlevel 1 goto done + +echo mdc2test +call %test%\testce2 mdc2test +if errorlevel 1 goto done + +echo rc2test +call %test%\testce2 rc2test +if errorlevel 1 goto done + +echo rc4test +call %test%\testce2 rc4test +if errorlevel 1 goto done + +echo randtest +call %test%\testce2 randtest +if errorlevel 1 goto done + +echo dhtest +call %test%\testce2 dhtest +if errorlevel 1 goto done + +echo exptest +call %test%\testce2 exptest +if errorlevel 1 goto done + +echo dsatest +call %test%\testce2 dsatest +if errorlevel 1 goto done + +echo testenc +call %test%\testencce openssl.exe +if errorlevel 1 goto done + +echo testpem +call %test%\testpemce openssl.exe +if errorlevel 1 goto done + +cecopy openssl.exe CE:\OpenSSL + +echo verify +copy ..\certs\*.pem cert.tmp >nul +cecopy cert.tmp CE:\OpenSSL +cemkdir CE:\OpenSSL\certs +rem cecopy ..\certs\*.pem CE:\OpenSSL\certs +cecopy ..\certs\ca-cert.pem CE:\OpenSSL\certs +cecopy ..\certs\dsa-ca.pem CE:\OpenSSL\certs +cecopy ..\certs\dsa-pca.pem CE:\OpenSSL\certs +cecopy ..\certs\factory.pem CE:\OpenSSL\certs +cecopy ..\certs\ICE-CA.pem CE:\OpenSSL\certs +cecopy ..\certs\ICE-root.pem CE:\OpenSSL\certs +cecopy ..\certs\ICE-user.pem CE:\OpenSSL\certs +cecopy ..\certs\nortelCA.pem CE:\OpenSSL\certs +cecopy ..\certs\pca-cert.pem CE:\OpenSSL\certs +cecopy ..\certs\RegTP-4R.pem CE:\OpenSSL\certs +cecopy ..\certs\RegTP-5R.pem CE:\OpenSSL\certs +cecopy ..\certs\RegTP-6R.pem CE:\OpenSSL\certs +cecopy ..\certs\rsa-cca.pem CE:\OpenSSL\certs +cecopy ..\certs\thawteCb.pem CE:\OpenSSL\certs +cecopy ..\certs\thawteCp.pem CE:\OpenSSL\certs +cecopy ..\certs\timCA.pem CE:\OpenSSL\certs +cecopy ..\certs\tjhCA.pem CE:\OpenSSL\certs +cecopy ..\certs\vsign1.pem CE:\OpenSSL\certs +cecopy ..\certs\vsign2.pem CE:\OpenSSL\certs +cecopy ..\certs\vsign3.pem CE:\OpenSSL\certs +cecopy ..\certs\vsignss.pem CE:\OpenSSL\certs +cecopy ..\certs\vsigntca.pem CE:\OpenSSL\certs +cerun CE:\OpenSSL\openssl verify -CAfile \OpenSSL\cert.tmp \OpenSSL\certs\*.pem + +echo testss +call %test%\testssce openssl.exe +if errorlevel 1 goto done + +cecopy ssltest.exe CE:\OpenSSL +cecopy ..\apps\server.pem CE:\OpenSSL +cecopy ..\apps\client.pem CE:\OpenSSL + +echo test sslv2 +cerun CE:\OpenSSL\ssltest -ssl2 +if errorlevel 1 goto done + +echo test sslv2 with server authentication +cerun CE:\OpenSSL\ssltest -ssl2 -server_auth -CAfile \OpenSSL\cert.tmp +if errorlevel 1 goto done + +echo test sslv2 with client authentication +cerun CE:\OpenSSL\ssltest -ssl2 -client_auth -CAfile \OpenSSL\cert.tmp +if errorlevel 1 goto done + +echo test sslv2 with both client and server authentication +cerun CE:\OpenSSL\ssltest -ssl2 -server_auth -client_auth -CAfile \OpenSSL\cert.tmp +if errorlevel 1 goto done + +echo test sslv3 +cerun CE:\OpenSSL\ssltest -ssl3 +if errorlevel 1 goto done + +echo test sslv3 with server authentication +cerun CE:\OpenSSL\ssltest -ssl3 -server_auth -CAfile \OpenSSL\cert.tmp +if errorlevel 1 goto done + +echo test sslv3 with client authentication +cerun CE:\OpenSSL\ssltest -ssl3 -client_auth -CAfile \OpenSSL\cert.tmp +if errorlevel 1 goto done + +echo test sslv3 with both client and server authentication +cerun CE:\OpenSSL\ssltest -ssl3 -server_auth -client_auth -CAfile \OpenSSL\cert.tmp +if errorlevel 1 goto done + +echo test sslv2/sslv3 +cerun CE:\OpenSSL\ssltest +if errorlevel 1 goto done + +echo test sslv2/sslv3 with server authentication +cerun CE:\OpenSSL\ssltest -server_auth -CAfile \OpenSSL\cert.tmp +if errorlevel 1 goto done + +echo test sslv2/sslv3 with client authentication +cerun CE:\OpenSSL\ssltest -client_auth -CAfile \OpenSSL\cert.tmp +if errorlevel 1 goto done + +echo test sslv2/sslv3 with both client and server authentication +cerun CE:\OpenSSL\ssltest -server_auth -client_auth -CAfile \OpenSSL\cert.tmp +if errorlevel 1 goto done + +echo test sslv2 via BIO pair +cerun CE:\OpenSSL\ssltest -bio_pair -ssl2 +if errorlevel 1 goto done + +echo test sslv2/sslv3 with 1024 bit DHE via BIO pair +cerun CE:\OpenSSL\ssltest -bio_pair -dhe1024dsa -v +if errorlevel 1 goto done + +echo test sslv2 with server authentication via BIO pair +cerun CE:\OpenSSL\ssltest -bio_pair -ssl2 -server_auth -CAfile \OpenSSL\cert.tmp +if errorlevel 1 goto done + +echo test sslv2 with client authentication via BIO pair +cerun CE:\OpenSSL\ssltest -bio_pair -ssl2 -client_auth -CAfile \OpenSSL\cert.tmp +if errorlevel 1 goto done + +echo test sslv2 with both client and server authentication via BIO pair +cerun CE:\OpenSSL\ssltest -bio_pair -ssl2 -server_auth -client_auth -CAfile \OpenSSL\cert.tmp +if errorlevel 1 goto done + +echo test sslv3 via BIO pair +cerun CE:\OpenSSL\ssltest -bio_pair -ssl3 +if errorlevel 1 goto done + +echo test sslv3 with server authentication via BIO pair +cerun CE:\OpenSSL\ssltest -bio_pair -ssl3 -server_auth -CAfile \OpenSSL\cert.tmp +if errorlevel 1 goto done + +echo test sslv3 with client authentication via BIO pair +cerun CE:\OpenSSL\ssltest -bio_pair -ssl3 -client_auth -CAfile \OpenSSL\cert.tmp +if errorlevel 1 goto done + +echo test sslv3 with both client and server authentication via BIO pair +cerun CE:\OpenSSL\ssltest -bio_pair -ssl3 -server_auth -client_auth -CAfile \OpenSSL\cert.tmp +if errorlevel 1 goto done + +echo test sslv2/sslv3 via BIO pair +cerun CE:\OpenSSL\ssltest +if errorlevel 1 goto done + +echo test sslv2/sslv3 with server authentication +cerun CE:\OpenSSL\ssltest -bio_pair -server_auth -CAfile \OpenSSL\cert.tmp +if errorlevel 1 goto done + +echo test sslv2/sslv3 with client authentication via BIO pair +cerun CE:\OpenSSL\ssltest -bio_pair -client_auth -CAfile \OpenSSL\cert.tmp +if errorlevel 1 goto done + +echo test sslv2/sslv3 with both client and server authentication via BIO pair +cerun CE:\OpenSSL\ssltest -bio_pair -server_auth -client_auth -CAfile \OpenSSL\cert.tmp +if errorlevel 1 goto done + +del cert.tmp + +echo passed all tests +goto end +:done +echo problems..... +:end +PATH=%opath% + diff --git a/ms/testce2.bat b/ms/testce2.bat new file mode 100644 index 0000000000..24265b948f --- /dev/null +++ b/ms/testce2.bat @@ -0,0 +1,2 @@ +cecopy %1.exe CE:\OpenSSL +cerun CE:\OpenSSL\%1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/ms/testencce.bat b/ms/testencce.bat new file mode 100644 index 0000000000..04faa5d99b --- /dev/null +++ b/ms/testencce.bat @@ -0,0 +1,97 @@ +@echo off +echo start testenc + +path=..\ms;%path% +set ssleay=%1% +copy ..\ms\testenc.bat >nul +set input=testenc.bat +set tmp1=cipher.out +set out1=clear.out +set cmp=perl ..\ms\cmp.pl + +cecopy %ssleay% CE:\OpenSSL + +cd +call tencce.bat enc +if errorlevel 1 goto err + +call tencce.bat rc4 +if errorlevel 1 goto err + +call tencce.bat des-cfb +if errorlevel 1 goto err + +call tencce.bat des-ede-cfb +if errorlevel 1 goto err + +call tencce.bat des-ede3-cfb +if errorlevel 1 goto err + +call tencce.bat des-ofb +if errorlevel 1 goto err + +call tencce.bat des-ede-ofb +if errorlevel 1 goto err + +call tencce.bat des-ede3-ofb +if errorlevel 1 goto err + +call tencce.bat des-ecb +if errorlevel 1 goto err + +call tencce.bat des-ede +if errorlevel 1 goto err + +call tencce.bat des-ede3 +if errorlevel 1 goto err + +call tencce.bat des-cbc +if errorlevel 1 goto err + +call tencce.bat des-ede-cbc +if errorlevel 1 goto err + +call tencce.bat des-ede3-cbc +if errorlevel 1 goto err + +call tencce.bat idea-ecb +if errorlevel 1 goto err + +call tencce.bat idea-cfb +if errorlevel 1 goto err + +call tencce.bat idea-ofb +if errorlevel 1 goto err + +call tencce.bat idea-cbc +if errorlevel 1 goto err + +call tencce.bat rc2-ecb +if errorlevel 1 goto err + +call tencce.bat rc2-cfb +if errorlevel 1 goto err + +call tencce.bat rc2-ofb +if errorlevel 1 goto err + +call tencce.bat rc2-cbc +if errorlevel 1 goto err + +call tencce.bat bf-ecb +if errorlevel 1 goto err + +call tencce.bat bf-cfb +if errorlevel 1 goto err + +call tencce.bat bf-ofb +if errorlevel 1 goto err + +call tencce.bat bf-cbc +if errorlevel 1 goto err + +echo OK +del %out1% >nul 2>&1 +del %tmp1% >nul 2>&1 +:err + diff --git a/ms/testpemce.bat b/ms/testpemce.bat new file mode 100644 index 0000000000..c793c3e514 --- /dev/null +++ b/ms/testpemce.bat @@ -0,0 +1,42 @@ +@echo off +set ssleay=%1% +set tmp1=pem.out +set cmp=fc.exe + +cecopy %ssleay% CE:\OpenSSL + +copy ..\test\testcrl.pem >nul +call tpemce.bat crl testcrl.pem +if errorlevel 1 goto err + +copy ..\test\testp7.pem >nul +call tpemce.bat pkcs7 testp7.pem +if errorlevel 1 goto err + +copy ..\test\testreq2.pem >nul +call tpemce.bat req testreq2.pem +if errorlevel 1 goto err + +copy ..\test\testrsa.pem >nul +call tpemce.bat rsa testrsa.pem +if errorlevel 1 goto err + +copy ..\test\testx509.pem >nul +call tpemce.bat x509 testx509.pem +if errorlevel 1 goto err + +copy ..\test\v3-cert1.pem >nul +call tpemce.bat x509 v3-cert1.pem +if errorlevel 1 goto err + +copy ..\test\v3-cert1.pem >nul +call tpemce.bat x509 v3-cert1.pem +if errorlevel 1 goto err + +copy ..\test\testsid.pem >nul +call tpemce.bat sess_id testsid.pem +if errorlevel 1 goto err + +echo OK +del %tmp1% >nul 2>&1 +:err diff --git a/ms/testssce.bat b/ms/testssce.bat new file mode 100644 index 0000000000..dbb25abdb0 --- /dev/null +++ b/ms/testssce.bat @@ -0,0 +1,104 @@ +rem set ssleay=..\out\ssleay +set ssleay=%1 + +set reqcmd=%ssleay% req +set x509cmd=%ssleay% x509 +set verifycmd=%ssleay% verify + +set CAkey=\OpenSSL\keyCA.ss +set CAcert=\OpenSSL\certCA.ss +set CAserial=\OpenSSL\certCA.srl +set CAreq=\OpenSSL\reqCA.ss +cecopy ..\test\CAss.cnf CE:\OpenSSL +set CAconf=\OpenSSL\CAss.cnf +set CAreq2=\OpenSSL\req2CA.ss + +cecopy ..\test\Uss.cnf CE:\OpenSSL +set Uconf=\OpenSSL\Uss.cnf +set Ukey=\OpenSSL\keyU.ss +set Ureq=\OpenSSL\reqU.ss +set Ucert=\OpenSSL\certU.ss + +echo make a certificate request using 'req' +cerun CE:\OpenSSL\%reqcmd% -config %CAconf% -out %CAreq% -keyout %CAkey% -new +if errorlevel 1 goto e_req + +echo convert the certificate request into a self signed certificate using 'x509' +cerun CE:\OpenSSL\%x509cmd% -CAcreateserial -in %CAreq% -days 30 -req -out %CAcert% -signkey %CAkey% "> \OpenSSL\err.ss" +if errorlevel 1 goto e_x509 + +echo -- +echo convert a certificate into a certificate request using 'x509' +cerun CE:\OpenSSL\%x509cmd% -in %CAcert% -x509toreq -signkey %CAkey% -out %CAreq2% "> \OpenSSL\err.ss" +if errorlevel 1 goto e_x509_2 + +cerun CE:\OpenSSL\%reqcmd% -verify -in %CAreq% -noout +if errorlevel 1 goto e_vrfy_1 + +cerun CE:\OpenSSL\%reqcmd% -verify -in %CAreq2% -noout +if errorlevel 1 goto e_vrfy_2 + +cerun CE:\OpenSSL\%verifycmd% -CAfile %CAcert% %CAcert% +if errorlevel 1 goto e_vrfy_3 + +echo -- +echo make another certificate request using 'req' +cerun CE:\OpenSSL\%reqcmd% -config %Uconf% -out %Ureq% -keyout %Ukey% -new "> \OpenSSL\err.ss" +if errorlevel 1 goto e_req_gen + +echo -- +echo sign certificate request with the just created CA via 'x509' +cerun CE:\OpenSSL\%x509cmd% -CAcreateserial -in %Ureq% -days 30 -req -out %Ucert% -CA %CAcert% -CAkey %CAkey% -CAserial %CAserial% +if errorlevel 1 goto e_x_sign + +cerun CE:\OpenSSL\%verifycmd% -CAfile %CAcert% %Ucert% +echo -- +echo Certificate details +cerun CE:\OpenSSL\%x509cmd% -subject -issuer -startdate -enddate -noout -in %Ucert% + +cecopy CE:%CAcert% . +cecopy CE:%CAkey% . +cecopy CE:%CAserial% . +cecopy CE:%Ucert% . +cecopy CE:%Ukey% . + +echo Everything appeared to work +echo -- +echo The generated CA certificate is %CAcert% +echo The generated CA private key is %CAkey% +echo The current CA signing serial number is in %CAserial% + +echo The generated user certificate is %Ucert% +echo The generated user private key is %Ukey% +echo -- + +cedel CE:\OpenSSL\err.ss + +goto end + +:e_req +echo error using 'req' to generate a certificate request +goto end +:e_x509 +echo error using 'x509' to self sign a certificate request +goto end +:e_x509_2 +echo error using 'x509' convert a certificate to a certificate request +goto end +:e_vrfy_1 +echo first generated request is invalid +goto end +:e_vrfy_2 +echo second generated request is invalid +goto end +:e_vrfy_3 +echo first generated cert is invalid +goto end +:e_req_gen +echo error using 'req' to generate a certificate request +goto end +:e_x_sign +echo error using 'x509' to sign a certificate request +goto end + +:end diff --git a/ms/tpemce.bat b/ms/tpemce.bat new file mode 100644 index 0000000000..17b2acd390 --- /dev/null +++ b/ms/tpemce.bat @@ -0,0 +1,8 @@ +rem called by testpemce + +echo test %1 %2 +cecopy %2 CE:\OpenSSL +cerun CE:\OpenSSL\%ssleay% %1 -in \OpenSSL\%2 -out \OpenSSL\%tmp1% +del %tmp1% >nul 2>&1 +cecopy CE:\OpenSSL\%tmp1% . +%cmp% %2 %tmp1% -- cgit v1.2.3