This commit was manufactured by cvs2svn to create branch

'OpenSSL_0_9_7-stable'.
This commit is contained in:
cvs2svn 2002-11-15 22:37:19 +00:00
commit 97d58eadbf
9 changed files with 681 additions and 0 deletions

63
INSTALL.WCE Normal file
View file

@ -0,0 +1,63 @@
INSTALLATION FOR THE WINDOWS CE PLATFORM
----------------------------------------
Building OpenSSL for Windows CE requires the following external tools:
* Microsoft eMbedded Visual C++ 3.0
* wcecompat compatibility library (www.essemer.com.au)
* Optionally ceutils for running automated tests (www.essemer.com.au)
The C Runtime Library implementation for Windows CE that is included with
Microsoft eMbedded Visual C++ 3.0 is incomplete and in some places
incorrect. wcecompat plugs the holes and tries to bring the Windows CE
CRT to a level that is more compatible with ANSI C. wcecompat goes further
and provides low-level IO and stream IO support for stdin/stdout/stderr
(which Windows CE does not provide). This IO functionality is not needed
by the OpenSSL library itself but is used for the tests and openssl.exe.
More information is available at www.essemer.com.au.
Building
--------
You need Perl for Win32. Unless you will build on Cygwin, you will need
ActiveState Perl, available from http://www.activestate.com/ActivePerl.
Setup the eMbedded Visual C++ environment. There are batch files for doing
this installed with eVC++. For an ARM processor, for example, execute:
> "C:\Program Files\Microsoft eMbedded Tools\EVC\WCE300\BIN\WCEARM.BAT"
Next indicate where wcecompat is located:
> set WCECOMPAT=C:\wcecompat
Next you should run Configure:
> perl Configure VC-CE
Next you need to build the Makefiles:
> ms\do_ms
If you get errors about things not having numbers assigned then check the
troubleshooting section in INSTALL.W32: you probably won't be able to compile
it as it stands.
Then from the VC++ environment at a prompt do:
- to build static libraries:
> nmake -f ms\ce.mak
- or to build DLLs:
> nmake -f ms\cedll.mak
If all is well it should compile and you will have some static libraries and
executables in out32, or some DLLs and executables in out32dll. If you want
to try the tests then make sure the ceutils are in the path and do:
> cd out32
> ..\ms\testce

19
ms/tencce.bat Normal file
View file

@ -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

234
ms/testce.bat Normal file
View file

@ -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%

2
ms/testce2.bat Normal file
View file

@ -0,0 +1,2 @@
cecopy %1.exe CE:\OpenSSL
cerun CE:\OpenSSL\%1 %2 %3 %4 %5 %6 %7 %8 %9

97
ms/testencce.bat Normal file
View file

@ -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

42
ms/testpemce.bat Normal file
View file

@ -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

104
ms/testssce.bat Normal file
View file

@ -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

8
ms/tpemce.bat Normal file
View file

@ -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%

112
util/pl/VC-CE.pl Normal file
View file

@ -0,0 +1,112 @@
#!/usr/local/bin/perl
# VC-CE.pl - the file for eMbedded Visual C++ 3.0 for windows CE, static libraries
#
$ssl= "ssleay32";
$crypto="libeay32";
$RSAref="RSAref32";
$o='\\';
$cp='copy nul+'; # Timestamps get stuffed otherwise
$rm='del';
# C compiler stuff
$cc='$(CC)';
$cflags=' /W3 /WX /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -D$(TARGETCPU) -D_$(TARGETCPU)_ -DUNDER_CE=300 -D_WIN32_CE=300 -DWIN32_PLATFORM_PSPC -DUNICODE -D_UNICODE -DWIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -I$(WCECOMPAT)/include';
$lflags="/nologo /subsystem:windowsce,3.00 /machine:$(TARGETCPU) /opt:ref";
$mlflags='';
$out_def="out32";
$tmp_def="tmp32";
$inc_def="inc32";
if ($debug)
{
$cflags=" /MDd /W3 /WX /Zi /Yd /Od /nologo -DWIN32 -D_DEBUG -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DDEBUG -DDSO_WIN32";
$lflags.=" /debug";
$mlflags.=' /debug';
}
$obj='.obj';
$ofile="/Fo";
# EXE linking stuff
$link="link";
$efile="/out:";
$exep='.exe';
if ($no_sock)
{ $ex_libs=""; }
else { $ex_libs='winsock.lib $(WCECOMPAT)/lib/wcecompatex.lib'; }
#else { $ex_libs='winsock.lib coredll.lib $(WCECOMPAT)/lib/wcecompatex.lib'; }
# static library stuff
$mklib='lib';
$ranlib='';
$plib="";
$libp=".lib";
$shlibp=($shlib)?".dll":".lib";
$lfile='/out:';
$shlib_ex_obj="";
#$app_ex_obj="setargv.obj";
$app_ex_obj="";
$bn_asm_obj='';
$bn_asm_src='';
$des_enc_obj='';
$des_enc_src='';
$bf_enc_obj='';
$bf_enc_src='';
if ($shlib)
{
$mlflags.=" $lflags /dll";
# $cflags =~ s| /MD| /MT|;
$lib_cflag=" -D_WINDLL -D_DLL";
$out_def="out32dll";
$tmp_def="tmp32dll";
}
$cflags.=" /Fd$out_def";
sub do_lib_rule
{
local($objs,$target,$name,$shlib)=@_;
local($ret,$Name);
$taget =~ s/\//$o/g if $o ne '/';
($Name=$name) =~ tr/a-z/A-Z/;
# $target="\$(LIB_D)$o$target";
$ret.="$target: $objs\n";
if (!$shlib)
{
# $ret.="\t\$(RM) \$(O_$Name)\n";
$ex =' ';
$ret.="\t\$(MKLIB) $lfile$target @<<\n $objs $ex\n<<\n";
}
else
{
local($ex)=($target =~ /O_SSL/)?' $(L_CRYPTO)':'';
# $ex.=' winsock.lib coredll.lib $(WCECOMPAT)/lib/wcecompatex.lib';
$ex.=' winsock.lib $(WCECOMPAT)/lib/wcecompatex.lib';
$ret.="\t\$(LINK) \$(MLFLAGS) $efile$target /def:ms/${Name}.def @<<\n \$(SHLIB_EX_OBJ) $objs $ex\n<<\n";
}
$ret.="\n";
return($ret);
}
sub do_link_rule
{
local($target,$files,$dep_libs,$libs)=@_;
local($ret,$_);
$file =~ s/\//$o/g if $o ne '/';
$n=&bname($targer);
$ret.="$target: $files $dep_libs\n";
$ret.=" \$(LINK) \$(LFLAGS) $efile$target @<<\n";
$ret.=" \$(APP_EX_OBJ) $files $libs\n<<\n\n";
return($ret);
}
1;