Index: ChangeLog ================================================================== --- ChangeLog +++ ChangeLog @@ -1,5 +1,12 @@ +2008-06-18 Pat Thoyts + + * tests/ciphers.test: Fix for different openssl versions. + * win/makefile.vc: Updates to support tests. + * win/rules.vc: + * win/nmakehlp.c: + 2008-03-19 Jeff Hobbs *** TLS 1.6 TAGGED *** * Makefile.in (dist): update to include win/ and file.srl Index: tests/ciphers.test ================================================================== --- tests/ciphers.test +++ tests/ciphers.test @@ -23,11 +23,11 @@ # One of these should == 1, depending on what type of ssl library # tls was compiled against. (RSA BSAFE SSL-C or OpenSSL). # set ::tcltest::testConstraints(rsabsafe) 0 -set ::tcltest::testConstraints(openssl) 1 +set ::tcltest::testConstraints(openssl) [string match "OpenSSL*" [tls::version]] set ::EXPECTEDCIPHERS(rsabsafe) { EDH-DSS-RC4-SHA EDH-RSA-DES-CBC3-SHA EDH-DSS-DES-CBC3-SHA @@ -75,10 +75,41 @@ EXP1024-RC4-SHA IDEA-CBC-SHA RC4-MD5 RC4-SHA } + +set ::EXPECTEDCIPHERS(openssl0.9.8) { + DHE-RSA-AES256-SHA + DHE-DSS-AES256-SHA + AES256-SHA + EDH-RSA-DES-CBC3-SHA + EDH-DSS-DES-CBC3-SHA + DES-CBC3-SHA + DHE-RSA-AES128-SHA + DHE-DSS-AES128-SHA + AES128-SHA + IDEA-CBC-SHA + RC4-SHA + RC4-MD5 + EDH-RSA-DES-CBC-SHA + EDH-DSS-DES-CBC-SHA + DES-CBC-SHA + EXP-EDH-RSA-DES-CBC-SHA + EXP-EDH-DSS-DES-CBC-SHA + EXP-DES-CBC-SHA + EXP-RC2-CBC-MD5 + EXP-RC4-MD5 +} + +set version "" +if {[string match "OpenSSL*" [tls::version]]} { + regexp {OpenSSL ([\d\.]+)} [tls::version] -> version +} +if {![info exists ::EXPECTEDCIPHERS(openssl$version)]} { + set version "" +} proc listcompare {wants haves} { array set want {} array set have {} foreach item $wants { set want($item) 1 } @@ -107,22 +138,22 @@ test ciphers-1.3 {Tls::ciphers for ssl3} {openssl} { # This will fail if you compiled against RSA bsafe or with a # different set of defines than the default. # Change the constraint setting above. - listcompare $::EXPECTEDCIPHERS(openssl) [tls::ciphers ssl3] + listcompare $::EXPECTEDCIPHERS(openssl$version) [tls::ciphers ssl3] } {} # This version of the test is correct for OpenSSL only. # An equivalent test for the RSA BSAFE SSL-C is earlier in this file. test ciphers-1.4 {Tls::ciphers for tls1} {openssl} { # This will fail if you compiled against RSA bsafe or with a # different set of defines than the default. # Change the constraint setting in all.tcl - listcompare $::EXPECTEDCIPHERS(openssl) [tls::ciphers tls1] + listcompare $::EXPECTEDCIPHERS(openssl$version) [tls::ciphers tls1] } {} # cleanup ::tcltest::cleanupTests return Index: win/makefile.vc ================================================================== --- win/makefile.vc +++ win/makefile.vc @@ -16,11 +16,11 @@ # Copyright (c) 2001 ActiveState Corporation. # Copyright (c) 2001-2002 David Gravereaux. # Copyright (c) 2003-2006 Pat Thoyts # #------------------------------------------------------------------------- -# RCS: @(#)$Id: makefile.vc,v 1.6 2008/03/19 22:38:26 hobbs2 Exp $ +# RCS: @(#)$Id: makefile.vc,v 1.7 2008/06/18 11:29:37 patthoyts Exp $ #------------------------------------------------------------------------- # Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR) # or with the MS Platform SDK (MSSDK). Visual Studio .NET 2003 and 2005 define # VCINSTALLDIR instead. The MSVC Toolkit release defines yet another. @@ -353,33 +353,33 @@ $(PROJECT): setup $(OUT_DIR)\pkgIndex.tcl $(OUT_DIR)\tls.tcl $(PRJLIB) install: install-binaries install-libraries install-docs test: setup $(PROJECT) @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) - @set TCLLIBPATH=$(OUT_DIR:\=/) + @set TCLLIBPATH=$(OUT_DIR_PATH:\=/) !if $(TCLINSTALL) @set PATH=$(_TCLDIR)\bin;$(PATH) !else @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) !endif !if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE" $(DEBUGGER) $(TCLSH) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) !else @echo Please wait while the tests are collected... - $(TCLSH) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) > tests.log + $(DEBUGGER) $(TCLSH) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) > tests.log type tests.log | more !endif shell: setup $(PROJECT) @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) - @set TCLLIBPATH=$(OUT_DIR:\=/) + @set TCLLIBPATH=$(OUT_DIR_PATH:\=/) !if $(TCLINSTALL) @set PATH=$(_TCLDIR)\bin;$(PATH) !else @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) !endif - $(DEBUGGER) $(TCLSH) + $(DEBUGGER) $(TCLSH) $(SCRIPT) setup: @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR) @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR) Index: win/nmakehlp.c ================================================================== --- win/nmakehlp.c +++ win/nmakehlp.c @@ -9,18 +9,23 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * * ---------------------------------------------------------------------------- - * RCS: @(#) $Id: nmakehlp.c,v 1.3 2008/03/19 02:34:21 patthoyts Exp $ + * RCS: @(#) $Id: nmakehlp.c,v 1.4 2008/06/18 11:29:37 patthoyts Exp $ * ---------------------------------------------------------------------------- */ #define _CRT_SECURE_NO_DEPRECATE #include +#define NO_SHLWAPI_GDI +#define NO_SHLWAPI_STREAM +#define NO_SHLWAPI_REG +#include #pragma comment (lib, "user32.lib") #pragma comment (lib, "kernel32.lib") +#pragma comment (lib, "shlwapi.lib") #include #include /* * This library is required for x64 builds with _some_ versions of MSVC @@ -43,10 +48,11 @@ int CheckForCompilerFeature(const char *option); int CheckForLinkerFeature(const char *option); int IsIn(const char *string, const char *substring); int GrepForDefine(const char *file, const char *string); int SubstituteFile(const char *substs, const char *filename); +int QualifyPath(const char *path); const char * GetVersionFromFile(const char *filename, const char *match); DWORD WINAPI ReadFromPipe(LPVOID args); /* globals */ @@ -163,14 +169,25 @@ &dwWritten, NULL); return 0; } printf("%s\n", GetVersionFromFile(argv[2], argv[3])); return 0; + case 'Q': + if (argc != 3) { + chars = snprintf(msg, sizeof(msg) - 1, + "usage: %s -q path\n" + "Emit the fully qualified path\n" + "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); + WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, + &dwWritten, NULL); + return 2; + } + return QualifyPath(argv[2]); } } chars = snprintf(msg, sizeof(msg) - 1, - "usage: %s -c|-l|-f|-g|-V ...\n" + "usage: %s -c|-l|-f|-g|-V|-s|-Q ...\n" "This is a little helper app to equalize shell differences between WinNT and\n" "Win9x and get nmake.exe to accomplish its job.\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; @@ -712,10 +729,34 @@ list_free(&substPtr); } fclose(fp); return 0; } + +/* + * QualifyPath -- + * + * This composes the current working directory with a provided path + * and returns the fully qualified and normalized path. + * Mostly needed to setup paths for testing. + */ + +int +QualifyPath( + const char *szPath) +{ + char szCwd[MAX_PATH + 1]; + char szTmp[MAX_PATH + 1]; + char *p; + GetCurrentDirectory(MAX_PATH, szCwd); + while ((p = strchr(szPath, '/')) && *p) + *p = '\\'; + PathCombine(szTmp, szCwd, szPath); + PathCanonicalize(szCwd, szTmp); + printf("%s\n", szCwd); + return 0; +} /* * Local variables: * mode: c * c-basic-offset: 4 Index: win/rules.vc ================================================================== --- win/rules.vc +++ win/rules.vc @@ -12,11 +12,11 @@ # # Copyright (c) 2001-2002 David Gravereaux. # Copyright (c) 2003-2008 Patrick Thoyts # #------------------------------------------------------------------------------ -# RCS: @(#) $Id: rules.vc,v 1.3 2008/03/19 02:34:21 patthoyts Exp $ +# RCS: @(#) $Id: rules.vc,v 1.4 2008/06/18 11:29:37 patthoyts Exp $ #------------------------------------------------------------------------------ !ifndef _RULES_VC _RULES_VC = 1 @@ -594,10 +594,20 @@ !endif !endif !endif !endif + + +#---------------------------------------------------------- +# Setup the fully qualified OUT_DIR path as OUT_DIR_PATH +#---------------------------------------------------------- +!if [echo OUT_DIR_PATH = \>> version.vc] \ + && [nmakehlp -Q "$(OUT_DIR)" >> version.vc] +!endif +!include version.vc + #---------------------------------------------------------- # Display stats being used. #----------------------------------------------------------