Check-in [4b6990b1fa]
Bounty program for improvements to Tcl and certain Tcl packages.
Overview
Comment:Fixed ciphers test for 0.9.8 and updated win build to support testing.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4b6990b1fa53e4c27ec785b0117dfcc8ae5fecc6
User & Date: patthoyts on 2008-06-18 11:29:36
Other Links: manifest | tags
Context
2009-04-23
23:12
* tls.tcl (tls::initlib): add support for Windows starpack operation that unbundles any constituent libraries. [AS Bug 82888] check-in: 573dc5879d user: hobbs2 tags: trunk
2008-06-18
11:29
Fixed ciphers test for 0.9.8 and updated win build to support testing. check-in: 4b6990b1fa user: patthoyts tags: trunk
2008-03-19
23:39
remove incorrect timing of tls 1.6 version change check-in: f613776715 user: hobbs2 tags: trunk, tls-1-6-0
Changes

Modified ChangeLog from [026238c27f] to [a72d9b7c9c].

            1  +2008-06-18  Pat Thoyts  <[email protected]>
            2  +
            3  +	* tests/ciphers.test: Fix for different openssl versions.
            4  +	* win/makefile.vc:    Updates to support tests.
            5  +	* win/rules.vc:
            6  +	* win/nmakehlp.c:
            7  +
     1      8   2008-03-19  Jeff Hobbs  <[email protected]>
     2      9   
     3     10   	*** TLS 1.6 TAGGED ***
     4     11   
     5     12   	* Makefile.in (dist): update to include win/ and file.srl
     6     13   
     7     14   	* win/makefile.vc: bump version to 1.6

Modified tests/ciphers.test from [6f8c36e170] to [775a49336b].

    21     21   
    22     22   package require tls
    23     23   
    24     24   # One of these should == 1, depending on what type of ssl library
    25     25   # tls was compiled against. (RSA BSAFE SSL-C or OpenSSL).
    26     26   #
    27     27   set ::tcltest::testConstraints(rsabsafe) 0
    28         -set ::tcltest::testConstraints(openssl) 1
           28  +set ::tcltest::testConstraints(openssl) [string match "OpenSSL*" [tls::version]]
    29     29   
    30     30   set ::EXPECTEDCIPHERS(rsabsafe) {
    31     31       EDH-DSS-RC4-SHA
    32     32       EDH-RSA-DES-CBC3-SHA
    33     33       EDH-DSS-DES-CBC3-SHA
    34     34       DES-CBC3-SHA
    35     35       RC4-SHA
................................................................................
    73     73       EXP1024-RC2-CBC-MD5
    74     74       EXP1024-RC4-MD5
    75     75       EXP1024-RC4-SHA
    76     76       IDEA-CBC-SHA
    77     77       RC4-MD5
    78     78       RC4-SHA
    79     79   }
           80  +
           81  +set ::EXPECTEDCIPHERS(openssl0.9.8) {
           82  +    DHE-RSA-AES256-SHA
           83  +    DHE-DSS-AES256-SHA
           84  +    AES256-SHA
           85  +    EDH-RSA-DES-CBC3-SHA
           86  +    EDH-DSS-DES-CBC3-SHA
           87  +    DES-CBC3-SHA
           88  +    DHE-RSA-AES128-SHA
           89  +    DHE-DSS-AES128-SHA
           90  +    AES128-SHA
           91  +    IDEA-CBC-SHA
           92  +    RC4-SHA
           93  +    RC4-MD5
           94  +    EDH-RSA-DES-CBC-SHA
           95  +    EDH-DSS-DES-CBC-SHA
           96  +    DES-CBC-SHA
           97  +    EXP-EDH-RSA-DES-CBC-SHA
           98  +    EXP-EDH-DSS-DES-CBC-SHA
           99  +    EXP-DES-CBC-SHA
          100  +    EXP-RC2-CBC-MD5
          101  +    EXP-RC4-MD5
          102  +}
          103  +
          104  +set version ""
          105  +if {[string match "OpenSSL*" [tls::version]]} {
          106  +   regexp {OpenSSL ([\d\.]+)} [tls::version] -> version
          107  +}
          108  +if {![info exists ::EXPECTEDCIPHERS(openssl$version)]} {
          109  +    set version ""
          110  +}
    80    111   
    81    112   proc listcompare {wants haves} {
    82    113       array set want {}
    83    114       array set have {}
    84    115       foreach item $wants { set want($item) 1 }
    85    116       foreach item $haves { set have($item) 1 }
    86    117       foreach item [lsort -dictionary [array names have]] {
................................................................................
   105    136       listcompare $::EXPECTEDCIPHERS(rsabsafe) [tls::ciphers tls1]
   106    137   } {}
   107    138   
   108    139   test ciphers-1.3 {Tls::ciphers for ssl3} {openssl} {
   109    140       # This will fail if you compiled against RSA bsafe or with a
   110    141       # different set of defines than the default.
   111    142       # Change the constraint setting above.
   112         -    listcompare $::EXPECTEDCIPHERS(openssl) [tls::ciphers ssl3]
          143  +    listcompare $::EXPECTEDCIPHERS(openssl$version) [tls::ciphers ssl3]
   113    144   } {}
   114    145   
   115    146   # This version of the test is correct for OpenSSL only.
   116    147   # An equivalent test for the RSA BSAFE SSL-C is earlier in this file.
   117    148   
   118    149   test ciphers-1.4 {Tls::ciphers for tls1} {openssl} {
   119    150       # This will fail if you compiled against RSA bsafe or with a
   120    151       # different set of defines than the default.
   121    152       # Change the constraint setting in all.tcl
   122         -    listcompare $::EXPECTEDCIPHERS(openssl) [tls::ciphers tls1]
          153  +    listcompare $::EXPECTEDCIPHERS(openssl$version) [tls::ciphers tls1]
   123    154   } {}
   124    155   
   125    156   
   126    157   # cleanup
   127    158   ::tcltest::cleanupTests
   128    159   return

Modified win/makefile.vc from [a996142e02] to [7cc71adccb].

    14     14   # Copyright (c) 1995-1996 Sun Microsystems, Inc.
    15     15   # Copyright (c) 1998-2000 Ajuba Solutions.
    16     16   # Copyright (c) 2001 ActiveState Corporation.
    17     17   # Copyright (c) 2001-2002 David Gravereaux.
    18     18   # Copyright (c) 2003-2006 Pat Thoyts
    19     19   #
    20     20   #-------------------------------------------------------------------------
    21         -# RCS: @(#)$Id: makefile.vc,v 1.6 2008/03/19 22:38:26 hobbs2 Exp $
           21  +# RCS: @(#)$Id: makefile.vc,v 1.7 2008/06/18 11:29:37 patthoyts Exp $
    22     22   #-------------------------------------------------------------------------
    23     23   
    24     24   # Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR)
    25     25   # or with the MS Platform SDK (MSSDK). Visual Studio .NET 2003 and 2005 define
    26     26   # VCINSTALLDIR instead. The MSVC Toolkit release defines yet another.
    27     27   !if !defined(MSDEVDIR) && !defined(MSVCDIR) && !defined(MSSDK) && !defined(VCINSTALLDIR) && !defined(VCToolkitInstallDir)
    28     28   MSG = ^
................................................................................
   351    351   
   352    352   all:	    setup $(PROJECT)
   353    353   $(PROJECT): setup $(OUT_DIR)\pkgIndex.tcl $(OUT_DIR)\tls.tcl $(PRJLIB)
   354    354   install:    install-binaries install-libraries install-docs
   355    355   
   356    356   test: setup $(PROJECT)
   357    357   	@set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
   358         -	@set TCLLIBPATH=$(OUT_DIR:\=/)
          358  +	@set TCLLIBPATH=$(OUT_DIR_PATH:\=/)
   359    359   !if $(TCLINSTALL)
   360    360   	@set PATH=$(_TCLDIR)\bin;$(PATH)
   361    361   !else
   362    362   	@set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
   363    363   !endif
   364    364   !if "$(OS)" == "Windows_NT"  || "$(MSVCDIR)" == "IDE"
   365    365   	$(DEBUGGER) $(TCLSH) "$(ROOT)/tests/all.tcl" $(TESTFLAGS)
   366    366   !else
   367    367   	@echo Please wait while the tests are collected...
   368         -	$(TCLSH) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) > tests.log
          368  +	$(DEBUGGER) $(TCLSH) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) > tests.log
   369    369   	type tests.log | more
   370    370   !endif
   371    371   
   372    372   shell: setup $(PROJECT)
   373    373   	@set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
   374         -	@set TCLLIBPATH=$(OUT_DIR:\=/)
          374  +	@set TCLLIBPATH=$(OUT_DIR_PATH:\=/)
   375    375   !if $(TCLINSTALL)
   376    376   	@set PATH=$(_TCLDIR)\bin;$(PATH)
   377    377   !else
   378    378   	@set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
   379    379   !endif
   380         -	$(DEBUGGER) $(TCLSH)
          380  +	$(DEBUGGER) $(TCLSH) $(SCRIPT)
   381    381   
   382    382   setup:
   383    383   	@if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR)
   384    384   	@if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR)
   385    385   
   386    386   # See <tcl>/win/coffbase.txt for extension base addresses.
   387    387   $(PRJLIB): $(DLLOBJS)

Modified win/nmakehlp.c from [3dec417f72] to [892a643209].

     7      7    * Copyright (c) 2002 by David Gravereaux.
     8      8    * Copyright (c) 2006 by Pat Thoyts
     9      9    *
    10     10    * See the file "license.terms" for information on usage and redistribution of
    11     11    * this file, and for a DISCLAIMER OF ALL WARRANTIES.
    12     12    *
    13     13    * ----------------------------------------------------------------------------
    14         - * RCS: @(#) $Id: nmakehlp.c,v 1.3 2008/03/19 02:34:21 patthoyts Exp $
           14  + * RCS: @(#) $Id: nmakehlp.c,v 1.4 2008/06/18 11:29:37 patthoyts Exp $
    15     15    * ----------------------------------------------------------------------------
    16     16    */
    17     17   
    18     18   #define _CRT_SECURE_NO_DEPRECATE
    19     19   #include <windows.h>
           20  +#define NO_SHLWAPI_GDI
           21  +#define NO_SHLWAPI_STREAM
           22  +#define NO_SHLWAPI_REG
           23  +#include <shlwapi.h>
    20     24   #pragma comment (lib, "user32.lib")
    21     25   #pragma comment (lib, "kernel32.lib")
           26  +#pragma comment (lib, "shlwapi.lib")
    22     27   #include <stdio.h>
    23     28   #include <math.h>
    24     29   
    25     30   /*
    26     31    * This library is required for x64 builds with _some_ versions of MSVC
    27     32    */
    28     33   #if defined(_M_IA64) || defined(_M_AMD64)
................................................................................
    41     46   /* protos */
    42     47   
    43     48   int		CheckForCompilerFeature(const char *option);
    44     49   int		CheckForLinkerFeature(const char *option);
    45     50   int		IsIn(const char *string, const char *substring);
    46     51   int		GrepForDefine(const char *file, const char *string);
    47     52   int		SubstituteFile(const char *substs, const char *filename);
           53  +int		QualifyPath(const char *path);
    48     54   const char *    GetVersionFromFile(const char *filename, const char *match);
    49     55   DWORD WINAPI	ReadFromPipe(LPVOID args);
    50     56   
    51     57   /* globals */
    52     58   
    53     59   #define CHUNK	25
    54     60   #define STATICBUFFERSIZE    1000
................................................................................
   161    167   		    argv[0]);
   162    168   		WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars,
   163    169   		    &dwWritten, NULL);
   164    170   		return 0;
   165    171   	    }
   166    172   	    printf("%s\n", GetVersionFromFile(argv[2], argv[3]));
   167    173   	    return 0;
          174  +	case 'Q':
          175  +	    if (argc != 3) {
          176  +		chars = snprintf(msg, sizeof(msg) - 1,
          177  +		    "usage: %s -q path\n"
          178  +		    "Emit the fully qualified path\n"
          179  +		    "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]);
          180  +		WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars,
          181  +		    &dwWritten, NULL);
          182  +		return 2;
          183  +	    }
          184  +	    return QualifyPath(argv[2]);
   168    185   	}
   169    186       }
   170    187       chars = snprintf(msg, sizeof(msg) - 1,
   171         -	    "usage: %s -c|-l|-f|-g|-V ...\n"
          188  +	    "usage: %s -c|-l|-f|-g|-V|-s|-Q ...\n"
   172    189   	    "This is a little helper app to equalize shell differences between WinNT and\n"
   173    190   	    "Win9x and get nmake.exe to accomplish its job.\n",
   174    191   	    argv[0]);
   175    192       WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL);
   176    193       return 2;
   177    194   }
   178    195   
................................................................................
   710    727   	}
   711    728   	
   712    729   	list_free(&substPtr);
   713    730       }
   714    731       fclose(fp);
   715    732       return 0;
   716    733   }
          734  +
          735  +/*
          736  + * QualifyPath --
          737  + *
          738  + *	This composes the current working directory with a provided path
          739  + *	and returns the fully qualified and normalized path.
          740  + *	Mostly needed to setup paths for testing.
          741  + */
          742  +
          743  +int
          744  +QualifyPath(
          745  +    const char *szPath)
          746  +{
          747  +    char szCwd[MAX_PATH + 1];
          748  +    char szTmp[MAX_PATH + 1];
          749  +    char *p;
          750  +    GetCurrentDirectory(MAX_PATH, szCwd);
          751  +    while ((p = strchr(szPath, '/')) && *p)
          752  +	*p = '\\';
          753  +    PathCombine(szTmp, szCwd, szPath);
          754  +    PathCanonicalize(szCwd, szTmp);
          755  +    printf("%s\n", szCwd);
          756  +    return 0;
          757  +}
   717    758   
   718    759   /*
   719    760    * Local variables:
   720    761    *   mode: c
   721    762    *   c-basic-offset: 4
   722    763    *   fill-column: 78
   723    764    *   indent-tabs-mode: t
   724    765    *   tab-width: 8
   725    766    * End:
   726    767    */

Modified win/rules.vc from [48e9d3924f] to [ead277b0fc].

    10     10   # See the file "license.terms" for information on usage and redistribution
    11     11   # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    12     12   # 
    13     13   # Copyright (c) 2001-2002 David Gravereaux.
    14     14   # Copyright (c) 2003-2008 Patrick Thoyts
    15     15   #
    16     16   #------------------------------------------------------------------------------
    17         -# RCS: @(#) $Id: rules.vc,v 1.3 2008/03/19 02:34:21 patthoyts Exp $
           17  +# RCS: @(#) $Id: rules.vc,v 1.4 2008/06/18 11:29:37 patthoyts Exp $
    18     18   #------------------------------------------------------------------------------
    19     19   
    20     20   !ifndef _RULES_VC
    21     21   _RULES_VC = 1
    22     22   
    23     23   cc32		= $(CC)   # built-in default.
    24     24   link32		= link
................................................................................
   592    592   TK_INCLUDES     = -I"$(_TKDIR)\generic" -I"$(_TKDIR)\win" -I"$(_TKDIR)\xlib"
   593    593   TK_LIBRARY	= $(_TKDIR)\library
   594    594   !endif
   595    595   
   596    596   !endif
   597    597   !endif
   598    598   !endif
          599  +
          600  +
          601  +#----------------------------------------------------------
          602  +# Setup the fully qualified OUT_DIR path as OUT_DIR_PATH
          603  +#----------------------------------------------------------
          604  +!if [echo OUT_DIR_PATH = \>> version.vc] \
          605  +    && [nmakehlp -Q "$(OUT_DIR)" >> version.vc]
          606  +!endif
          607  +!include version.vc
          608  +
   599    609   
   600    610   #----------------------------------------------------------
   601    611   # Display stats being used.
   602    612   #----------------------------------------------------------
   603    613   
   604    614   !message *** Intermediate directory will be '$(TMP_DIR)'
   605    615   !message *** Output directory will be '$(OUT_DIR)'