PortAuthority

Check-in [8bfea4409e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Hotfix for tls issues on macOS
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:8bfea4409e379e306acd780b6915e77c2f06ac96
User & Date: kevin 2017-04-08 02:23:05
Context
2017-04-24
02:54
rev bump check-in: 83d6383bd1 user: kevin tags: trunk
2017-04-08
02:23
Hotfix for tls issues on macOS check-in: 8bfea4409e user: kevin tags: trunk
2017-04-03
02:53
Update tls for macOS check-in: 928bac40e5 user: kevin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to libs/softwareupdate/softwareupdate.tcl.

     4      4   
     5      5   #MIT license
     6      6   
     7      7   package provide softwareupdate 1.5
     8      8   package require http
     9      9   package require tls
    10     10   
    11         -http::register https 443 [list ::tls::socket -tls1 1]   ;# "-tls1 1" is required since [POODLE]
           11  +::http::register https 443 [list ::tls::socket -servername codebykevin.com -request 0 -require 0 -ssl2 0 -ssl3 0 -tls1 1]
    12     12   
    13     13   namespace eval softwareupdate {
    14     14   
    15     15       if {![info exists library]} {
    16     16   	variable library [file dirname [info script]]
    17     17       }
    18     18   

Deleted libs/tcltls1.7.11/pkgIndex.tcl.

     1         -if {[package vsatisfies [package present Tcl] 8.5]} {
     2         -	package ifneeded tls 1.7.11 [list apply {{dir} {
     3         -		if {{shared} eq "static"} {
     4         -			load {} Tls
     5         -		} else {
     6         -			load [file join $dir tcltls.dylib] Tls
     7         -		}
     8         -
     9         -		set tlsTclInitScript [file join $dir tls.tcl]
    10         -		if {[file exists $tlsTclInitScript]} {
    11         -			source $tlsTclInitScript
    12         -		}
    13         -	}} $dir]
    14         -} elseif {[package vsatisfies [package present Tcl] 8.4]} {
    15         -	package ifneeded tls 1.7.11 [list load [file join $dir tcltls.dylib] Tls]
    16         -}

Deleted libs/tcltls1.7.11/tcltls.dylib.

cannot compute difference between binary files

Deleted libs/tdom0.8.3/libtdom0.8.3.dylib.

cannot compute difference between binary files

Deleted libs/tdom0.8.3/libtdomstub0.8.3.a.

cannot compute difference between binary files

Deleted libs/tdom0.8.3/pkgIndex.tcl.

     1         -package ifneeded tdom 0.8.3 "load [list [file join $dir libtdom0.8.3.dylib]];         source [list [file join $dir tdom.tcl]]"

Deleted libs/tdom0.8.3/tdom.tcl.

     1         -#----------------------------------------------------------------------------
     2         -#   Copyright (c) 1999 Jochen Loewer (loewerj@hotmail.com)
     3         -#----------------------------------------------------------------------------
     4         -#
     5         -#   $Id: tdom.tcl,v 1.19 2005/01/11 15:57:19 rolf Exp $
     6         -#
     7         -#
     8         -#   The higher level functions of tDOM written in plain Tcl.
     9         -#
    10         -#
    11         -#   The contents of this file are subject to the Mozilla Public License
    12         -#   Version 1.1 (the "License"); you may not use this file except in
    13         -#   compliance with the License. You may obtain a copy of the License at
    14         -#   http://www.mozilla.org/MPL/
    15         -#
    16         -#   Software distributed under the License is distributed on an "AS IS"
    17         -#   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
    18         -#   License for the specific language governing rights and limitations
    19         -#   under the License.
    20         -#
    21         -#   The Original Code is tDOM.
    22         -#
    23         -#   The Initial Developer of the Original Code is Jochen Loewer
    24         -#   Portions created by Jochen Loewer are Copyright (C) 1998, 1999
    25         -#   Jochen Loewer. All Rights Reserved.
    26         -#
    27         -#   Contributor(s):
    28         -#       Rolf Ade (rolf@pointsman.de):   'fake' nodelists/live childNodes
    29         -#
    30         -#   written by Jochen Loewer
    31         -#   April, 1999
    32         -#
    33         -#----------------------------------------------------------------------------
    34         -
    35         -package require tdom 
    36         -
    37         -#----------------------------------------------------------------------------
    38         -#   setup namespaces for additional Tcl level methods, etc.
    39         -#
    40         -#----------------------------------------------------------------------------
    41         -namespace eval ::dom {
    42         -    namespace eval  domDoc {
    43         -    }
    44         -    namespace eval  domNode {
    45         -    }
    46         -    namespace eval  DOMImplementation {
    47         -    }
    48         -    namespace eval  xpathFunc {
    49         -    }
    50         -    namespace eval  xpathFuncHelper {
    51         -    }
    52         -}
    53         -
    54         -namespace eval ::tDOM { 
    55         -    variable extRefHandlerDebug 0
    56         -    variable useForeignDTD ""
    57         -
    58         -    namespace export xmlOpenFile xmlReadFile extRefHandler baseURL
    59         -}
    60         -
    61         -#----------------------------------------------------------------------------
    62         -#   hasFeature (DOMImplementation method)
    63         -#
    64         -#
    65         -#   @in  url    the URL, where to get the XML document
    66         -#
    67         -#   @return     document object
    68         -#   @exception  XML parse errors, ...
    69         -#
    70         -#----------------------------------------------------------------------------
    71         -proc ::dom::DOMImplementation::hasFeature { dom feature {version ""} } {
    72         -
    73         -    switch $feature {
    74         -        xml -
    75         -        XML {
    76         -            if {($version == "") || ($version == "1.0")} {
    77         -                return 1
    78         -            }
    79         -        }
    80         -    }
    81         -    return 0
    82         -
    83         -}
    84         -
    85         -#----------------------------------------------------------------------------
    86         -#   load (DOMImplementation method)
    87         -#
    88         -#       requests a XML document via http using the given URL and
    89         -#       builds up a DOM tree in memory returning the document object
    90         -#
    91         -#
    92         -#   @in  url    the URL, where to get the XML document
    93         -#
    94         -#   @return     document object
    95         -#   @exception  XML parse errors, ...
    96         -#
    97         -#----------------------------------------------------------------------------
    98         -proc ::dom::DOMImplementation::load { dom url } {
    99         -
   100         -    error "Sorry, load method not implemented yet!"
   101         -
   102         -}
   103         -
   104         -#----------------------------------------------------------------------------
   105         -#   isa (docDoc method, for [incr tcl] compatibility)
   106         -#
   107         -#
   108         -#   @in  className
   109         -#
   110         -#   @return         1 iff inherits from the given class
   111         -#
   112         -#----------------------------------------------------------------------------
   113         -proc ::dom::domDoc::isa { doc className } {
   114         -
   115         -    if {$className == "domDoc"} {
   116         -        return 1
   117         -    }
   118         -    return 0
   119         -}
   120         -
   121         -#----------------------------------------------------------------------------
   122         -#   info (domDoc method, for [incr tcl] compatibility)
   123         -#
   124         -#
   125         -#   @in  subcommand
   126         -#   @in  args
   127         -#
   128         -#----------------------------------------------------------------------------
   129         -proc ::dom::domDoc::info { doc subcommand args } {
   130         -
   131         -    switch $subcommand {
   132         -        class {
   133         -            return "domDoc"
   134         -        }
   135         -        inherit {
   136         -            return ""
   137         -        }
   138         -        heritage {
   139         -            return "domDoc {}"
   140         -        }
   141         -        default {
   142         -            error "domDoc::info subcommand $subcommand not yet implemented!"
   143         -        }
   144         -    }
   145         -}
   146         -
   147         -#----------------------------------------------------------------------------
   148         -#   importNode (domDoc method)
   149         -#
   150         -#       Document Object Model (Core) Level 2 method
   151         -#
   152         -#
   153         -#   @in  subcommand
   154         -#   @in  args
   155         -#
   156         -#----------------------------------------------------------------------------
   157         -proc ::dom::domDoc::importNode { doc importedNode deep } {
   158         -
   159         -    if {$deep || ($deep == "-deep")} {
   160         -        set node [$importedNode cloneNode -deep]
   161         -    } else {
   162         -        set node [$importedNode cloneNode]
   163         -    }
   164         -    return $node
   165         -}
   166         -
   167         -#----------------------------------------------------------------------------
   168         -#   isa (domNode method, for [incr tcl] compatibility)
   169         -#
   170         -#
   171         -#   @in  className
   172         -#
   173         -#   @return         1 iff inherits from the given class
   174         -#
   175         -#----------------------------------------------------------------------------
   176         -proc ::dom::domNode::isa { doc className } {
   177         -
   178         -    if {$className == "domNode"} {
   179         -        return 1
   180         -    }
   181         -    return 0
   182         -}
   183         -
   184         -#----------------------------------------------------------------------------
   185         -#   info (domNode method, for [incr tcl] compatibility)
   186         -#
   187         -#
   188         -#   @in  subcommand
   189         -#   @in  args
   190         -#
   191         -#----------------------------------------------------------------------------
   192         -proc ::dom::domNode::info { doc subcommand args } {
   193         -
   194         -    switch $subcommand {
   195         -        class {
   196         -            return "domNode"
   197         -        }
   198         -        inherit {
   199         -            return ""
   200         -        }
   201         -        heritage {
   202         -            return "domNode {}"
   203         -        }
   204         -        default {
   205         -            error "domNode::info subcommand $subcommand not yet implemented!"
   206         -        }
   207         -    }
   208         -}
   209         -
   210         -#----------------------------------------------------------------------------
   211         -#   isWithin (domNode method)
   212         -#
   213         -#       tests, whether a node object is nested below another tag
   214         -#
   215         -#
   216         -#   @in  tagName  the nodeName of an elment node
   217         -#
   218         -#   @return       1 iff node is nested below a element with nodeName tagName
   219         -#                 0 otherwise
   220         -#
   221         -#----------------------------------------------------------------------------
   222         -proc ::dom::domNode::isWithin { node tagName } {
   223         -
   224         -    while {[$node parentNode] != ""} {
   225         -        set node [$node parentNode]
   226         -        if {[$node nodeName] == $tagName} {
   227         -            return 1
   228         -        }
   229         -    }
   230         -    return 0
   231         -}
   232         -
   233         -#----------------------------------------------------------------------------
   234         -#   tagName (domNode method)
   235         -#
   236         -#       same a nodeName for element interface
   237         -#
   238         -#----------------------------------------------------------------------------
   239         -proc ::dom::domNode::tagName { node } {
   240         -
   241         -    if {[$node nodeType] == "ELEMENT_NODE"} {
   242         -        return [$node nodeName]
   243         -    }
   244         -    return -code error "NOT_SUPPORTED_ERR not an element!"
   245         -}
   246         -
   247         -#----------------------------------------------------------------------------
   248         -#   simpleTranslate (domNode method)
   249         -#
   250         -#       applies simple translation rules similar to Cost's simple
   251         -#       translations to a node
   252         -#
   253         -#
   254         -#   @in  output_var
   255         -#   @in  trans_specs
   256         -#
   257         -#----------------------------------------------------------------------------
   258         -proc ::dom::domNode::simpleTranslate { node output_var trans_specs } {
   259         -
   260         -    upvar $output_var output
   261         -
   262         -    if {[$node nodeType] == "TEXT_NODE"} {
   263         -        append output [cgiQuote [$node nodeValue]]
   264         -        return
   265         -    }
   266         -    set found 0
   267         -
   268         -    foreach {match action} $trans_specs {
   269         -
   270         -        if {[catch {
   271         -            if {!$found && ([$node selectNode self::$match] != "") } {
   272         -              set found 1
   273         -            }
   274         -        } err]} {
   275         -            if {![string match "NodeSet expected for parent axis!" $err]} {
   276         -                error $err
   277         -            }
   278         -        }
   279         -        if {$found && ($action != "-")} {
   280         -            set stop 0
   281         -            foreach {type value} $action {
   282         -                switch $type {
   283         -                    prefix { append output [subst $value] }
   284         -                    tag    { append output <$value>       }
   285         -                    start  { append output [eval $value]  }
   286         -                    stop   { set stop 1                   }
   287         -                }
   288         -            }
   289         -            if {!$stop} {
   290         -                foreach child [$node childNodes] {
   291         -                    simpleTranslate  $child output $trans_specs
   292         -                }
   293         -            }
   294         -            foreach {type value} $action {
   295         -                switch $type {
   296         -                    suffix { append output [subst $value] }
   297         -                    end    { append output [eval $value]  }
   298         -                    tag    { append output </$value>      }
   299         -                }
   300         -            }
   301         -            return
   302         -        }
   303         -    }
   304         -    foreach child [$node childNodes] {
   305         -        simpleTranslate $child output $trans_specs
   306         -    }
   307         -}
   308         -
   309         -#----------------------------------------------------------------------------
   310         -#   a DOM conformant 'live' childNodes
   311         -#
   312         -#   @return   a 'nodelist' object (it is just the normal node)
   313         -#
   314         -#----------------------------------------------------------------------------
   315         -proc ::dom::domNode::childNodesLive { node } {
   316         -
   317         -    return $node
   318         -}
   319         -
   320         -#----------------------------------------------------------------------------
   321         -#   item method on a 'nodelist' object
   322         -#
   323         -#   @return   a 'nodelist' object (it is just a normal
   324         -#
   325         -#----------------------------------------------------------------------------
   326         -proc ::dom::domNode::item { nodeListNode index } {
   327         -
   328         -    return [lindex [$nodeListNode childNodes] $index]
   329         -}
   330         -
   331         -#----------------------------------------------------------------------------
   332         -#   length method on a 'nodelist' object
   333         -#
   334         -#   @return   a 'nodelist' object (it is just a normal
   335         -#
   336         -#----------------------------------------------------------------------------
   337         -proc ::dom::domNode::length { nodeListNode } {
   338         -
   339         -    return [llength [$nodeListNode childNodes]]
   340         -}
   341         -
   342         -#----------------------------------------------------------------------------
   343         -#   appendData on a 'CharacterData' object
   344         -#
   345         -#----------------------------------------------------------------------------
   346         -proc ::dom::domNode::appendData { node  arg } {
   347         -
   348         -    set type [$node nodeType]
   349         -    if {($type != "TEXT_NODE") && ($type != "CDATA_SECTION_NODE") &&
   350         -        ($type != "COMMENT_NODE")
   351         -    } {
   352         -        return -code error "NOT_SUPPORTED_ERR: node is not a cdata node"
   353         -    }
   354         -    set oldValue [$node nodeValue]
   355         -    $node nodeValue [append oldValue $arg]
   356         -}
   357         -
   358         -#----------------------------------------------------------------------------
   359         -#   deleteData on a 'CharacterData' object
   360         -#
   361         -#----------------------------------------------------------------------------
   362         -proc ::dom::domNode::deleteData { node offset count } {
   363         -
   364         -    set type [$node nodeType]
   365         -    if {($type != "TEXT_NODE") && ($type != "CDATA_SECTION_NODE") &&
   366         -        ($type != "COMMENT_NODE")
   367         -    } {
   368         -        return -code error "NOT_SUPPORTED_ERR: node is not a cdata node"
   369         -    }
   370         -    incr offset -1
   371         -    set before [string range [$node nodeValue] 0 $offset]
   372         -    incr offset
   373         -    incr offset $count
   374         -    set after  [string range [$node nodeValue] $offset end]
   375         -    $node nodeValue [append before $after]
   376         -}
   377         -
   378         -#----------------------------------------------------------------------------
   379         -#   insertData on a 'CharacterData' object
   380         -#
   381         -#----------------------------------------------------------------------------
   382         -proc ::dom::domNode::insertData { node  offset arg } {
   383         -
   384         -    set type [$node nodeType]
   385         -    if {($type != "TEXT_NODE") && ($type != "CDATA_SECTION_NODE") &&
   386         -        ($type != "COMMENT_NODE")
   387         -    } {
   388         -        return -code error "NOT_SUPPORTED_ERR: node is not a cdata node"
   389         -    }
   390         -    incr offset -1
   391         -    set before [string range [$node nodeValue] 0 $offset]
   392         -    incr offset
   393         -    set after  [string range [$node nodeValue] $offset end]
   394         -    $node nodeValue [append before $arg $after]
   395         -}
   396         -
   397         -#----------------------------------------------------------------------------
   398         -#   replaceData on a 'CharacterData' object
   399         -#
   400         -#----------------------------------------------------------------------------
   401         -proc ::dom::domNode::replaceData { node offset count arg } {
   402         -
   403         -    set type [$node nodeType]
   404         -    if {($type != "TEXT_NODE") && ($type != "CDATA_SECTION_NODE") &&
   405         -        ($type != "COMMENT_NODE")
   406         -    } {
   407         -        return -code error "NOT_SUPPORTED_ERR: node is not a cdata node"
   408         -    }
   409         -    incr offset -1
   410         -    set before [string range [$node nodeValue] 0 $offset]
   411         -    incr offset
   412         -    incr offset $count
   413         -    set after  [string range [$node nodeValue] $offset end]
   414         -    $node nodeValue [append before $arg $after]
   415         -}
   416         -
   417         -#----------------------------------------------------------------------------
   418         -#   substringData on a 'CharacterData' object
   419         -#
   420         -#   @return   part of the node value (text)
   421         -#
   422         -#----------------------------------------------------------------------------
   423         -proc ::dom::domNode::substringData { node offset count } {
   424         -
   425         -    set type [$node nodeType]
   426         -    if {($type != "TEXT_NODE") && ($type != "CDATA_SECTION_NODE") &&
   427         -        ($type != "COMMENT_NODE")
   428         -    } {
   429         -        return -code error "NOT_SUPPORTED_ERR: node is not a cdata node"
   430         -    }
   431         -    set endOffset [expr $offset + $count - 1]
   432         -    return [string range [$node nodeValue] $offset $endOffset]
   433         -}
   434         -
   435         -#----------------------------------------------------------------------------
   436         -#   coerce2number
   437         -#
   438         -#----------------------------------------------------------------------------
   439         -proc ::dom::xpathFuncHelper::coerce2number { type value } {
   440         -    switch $type {
   441         -        empty      { return 0 }
   442         -        number -
   443         -        string     { return $value }
   444         -        attrvalues { return [lindex $value 0] }
   445         -        nodes      { return [[lindex $value 0] selectNodes number()] }
   446         -        attrnodes  { return [lindex $value 1] }
   447         -    }
   448         -}
   449         -
   450         -#----------------------------------------------------------------------------
   451         -#   coerce2string
   452         -#
   453         -#----------------------------------------------------------------------------
   454         -proc ::dom::xpathFuncHelper::coerce2string { type value } {
   455         -    switch $type {
   456         -        empty      { return "" }
   457         -        number -
   458         -        string     { return $value }
   459         -        attrvalues { return [lindex $value 0] }
   460         -        nodes      { return [[lindex $value 0] selectNodes string()] }
   461         -        attrnodes  { return [lindex $value 1] }
   462         -    }
   463         -}
   464         -
   465         -#----------------------------------------------------------------------------
   466         -#   function-available
   467         -#
   468         -#----------------------------------------------------------------------------
   469         -proc ::dom::xpathFunc::function-available { ctxNode pos
   470         -                                            nodeListType nodeList args} {
   471         -
   472         -    if {[llength $args] != 2} {
   473         -        error "function-available(): wrong # of args!"
   474         -    }
   475         -    foreach { arg1Typ arg1Value } $args break
   476         -    set str [::dom::xpathFuncHelper::coerce2string $arg1Typ $arg1Value ]
   477         -    switch $str {
   478         -        boolean -
   479         -        ceiling -
   480         -        concat -
   481         -        contains -
   482         -        count -
   483         -        current -
   484         -        document -
   485         -        element-available -
   486         -        false -
   487         -        floor -
   488         -        format-number -
   489         -        generate-id -
   490         -        id -
   491         -        key -
   492         -        last -
   493         -        lang -
   494         -        local-name -
   495         -        name -
   496         -        namespace-uri -
   497         -        normalize-space -
   498         -        not -
   499         -        number -
   500         -        position -
   501         -        round -
   502         -        starts-with -
   503         -        string -
   504         -        string-length -
   505         -        substring -
   506         -        substring-after -
   507         -        substring-before -
   508         -        sum -
   509         -        translate -
   510         -        true -
   511         -        unparsed-entity-uri {
   512         -            return [list bool true]
   513         -        }
   514         -        default {
   515         -            set TclXpathFuncs [info procs ::dom::xpathFunc::*]
   516         -            if {[lsearch -exact $TclXpathFuncs $str] != -1} {
   517         -                return [list bool true]
   518         -            } else {
   519         -                return [list bool false]
   520         -            }
   521         -        }
   522         -    }
   523         -}
   524         -
   525         -#----------------------------------------------------------------------------
   526         -#   element-available
   527         -#
   528         -#   This is not strictly correct. The XSLT namespace may be bound
   529         -#   to another prefix (and the prefix 'xsl' may be bound to another
   530         -#   namespace). Since the expression context isn't available at the
   531         -#   moment at tcl coded XPath functions, this couldn't be done better
   532         -#   than this "works in the 'normal' cases" version.
   533         -#----------------------------------------------------------------------------
   534         -proc ::dom::xpathFunc::element-available { ctxNode pos
   535         -                                            nodeListType nodeList args} {
   536         -
   537         -    if {[llength $args] != 2} {
   538         -        error "element-available(): wrong # of args!"
   539         -    }
   540         -    foreach { arg1Typ arg1Value } $args break
   541         -    set str [::dom::xpathFuncHelper::coerce2string $arg1Typ $arg1Value ]
   542         -    switch $str {
   543         -        xsl:stylesheet -
   544         -        xsl:transform -
   545         -        xsl:include -
   546         -        xsl:import -
   547         -        xsl:strip-space -
   548         -        xsl:preserve-space -
   549         -        xsl:template -
   550         -        xsl:apply-templates -
   551         -        xsl:apply-imports -
   552         -        xsl:call-template -
   553         -        xsl:element -
   554         -        xsl:attribute -
   555         -        xsl:attribute-set -
   556         -        xsl:text -
   557         -        xsl:processing-instruction -
   558         -        xsl:comment -
   559         -        xsl:copy -
   560         -        xsl:value-of -
   561         -        xsl:number -
   562         -        xsl:for-each -
   563         -        xsl:if -
   564         -        xsl:choose -
   565         -        xsl:when -
   566         -        xsl:otherwise -
   567         -        xsl:sort -
   568         -        xsl:variable -
   569         -        xsl:param -
   570         -        xsl:copy-of -
   571         -        xsl:with-param -
   572         -        xsl:key -
   573         -        xsl:message -
   574         -        xsl:decimal-format -
   575         -        xsl:namespace-alias -
   576         -        xsl:output -
   577         -        xsl:fallback {
   578         -            return [list bool true]
   579         -        }
   580         -        default {
   581         -            return [list bool false]
   582         -        }
   583         -    }
   584         -}
   585         -
   586         -#----------------------------------------------------------------------------
   587         -#   system-property
   588         -#
   589         -#   This is not strictly correct. The XSLT namespace may be bound
   590         -#   to another prefix (and the prefix 'xsl' may be bound to another
   591         -#   namespace). Since the expression context isn't available at the
   592         -#   moment at tcl coded XPath functions, this couldn't be done better
   593         -#   than this "works in the 'normal' cases" version.
   594         -#----------------------------------------------------------------------------
   595         -proc ::dom::xpathFunc::system-property { ctxNode pos
   596         -                                         nodeListType nodeList args } {
   597         -
   598         -    if {[llength $args] != 2} {
   599         -        error "system-property(): wrong # of args!"
   600         -    }
   601         -    foreach { arg1Typ arg1Value } $args break
   602         -    set str [::dom::xpathFuncHelper::coerce2string $arg1Typ $arg1Value ]
   603         -    switch $str {
   604         -        xsl:version {
   605         -            return [list number 1.0]
   606         -        }
   607         -        xsl:vendor {
   608         -            return [list string "Jochen Loewer (loewerj@hotmail.com), Rolf Ade (rolf@pointsman.de) et. al."]
   609         -        }
   610         -        xsl:vendor-url {
   611         -            return [list string "http://www.tdom.org"]
   612         -        }
   613         -        default {
   614         -            return [list string ""]
   615         -        }
   616         -    }
   617         -}
   618         -
   619         -#----------------------------------------------------------------------------
   620         -#   IANAEncoding2TclEncoding
   621         -#
   622         -#----------------------------------------------------------------------------
   623         -
   624         -# As of version 8.3.4 tcl supports 
   625         -# cp860 cp861 cp862 cp863 tis-620 cp864 cp865 cp866 gb12345 cp949
   626         -# cp950 cp869 dingbats ksc5601 macCentEuro cp874 macUkraine jis0201
   627         -# gb2312 euc-cn euc-jp iso8859-10 macThai jis0208 iso2022-jp
   628         -# macIceland iso2022 iso8859-13 iso8859-14 jis0212 iso8859-15 cp737
   629         -# iso8859-16 big5 euc-kr macRomania macTurkish gb1988 iso2022-kr
   630         -# macGreek ascii cp437 macRoman iso8859-1 iso8859-2 iso8859-3 ebcdic
   631         -# macCroatian koi8-r iso8859-4 iso8859-5 cp1250 macCyrillic iso8859-6
   632         -# cp1251 koi8-u macDingbats iso8859-7 cp1252 iso8859-8 cp1253
   633         -# iso8859-9 cp1254 cp1255 cp850 cp1256 cp932 identity cp1257 cp852
   634         -# macJapan cp1258 shiftjis utf-8 cp855 cp936 symbol cp775 unicode
   635         -# cp857
   636         -# 
   637         -# Just add more mappings (and mail them to the tDOM mailing list, please).
   638         -
   639         -proc tDOM::IANAEncoding2TclEncoding {IANAName} {
   640         -    
   641         -    # First the most widespread encodings with there
   642         -    # preferred MIME name, to speed lookup in this
   643         -    # usual cases. Later the official names and the
   644         -    # aliases.
   645         -    #
   646         -    # For "official names for character sets that may be
   647         -    # used in the Internet" see 
   648         -    # http://www.iana.org/assignments/character-sets
   649         -    # (that's the source for the encoding names below)
   650         -    # 
   651         -    # Matching is case-insensitive
   652         -
   653         -    switch [string tolower $IANAName] {
   654         -        "us-ascii"    {return ascii}
   655         -        "utf-8"       {return utf-8}
   656         -        "utf-16"      {return unicode; # not sure about this}
   657         -        "iso-8859-1"  {return iso8859-1}
   658         -        "iso-8859-2"  {return iso8859-2}
   659         -        "iso-8859-3"  {return iso8859-3}
   660         -        "iso-8859-4"  {return iso8859-4}
   661         -        "iso-8859-5"  {return iso8859-5}
   662         -        "iso-8859-6"  {return iso8859-6}
   663         -        "iso-8859-7"  {return iso8859-7}
   664         -        "iso-8859-8"  {return iso8859-8}
   665         -        "iso-8859-9"  {return iso8859-9}
   666         -        "iso-8859-10" {return iso8859-10}
   667         -        "iso-8859-13" {return iso8859-13}
   668         -        "iso-8859-14" {return iso8859-14}
   669         -        "iso-8859-15" {return iso8859-15}
   670         -        "iso-8859-16" {return iso8859-16}
   671         -        "iso-2022-kr" {return iso2022-kr}
   672         -        "euc-kr"      {return euc-kr}
   673         -        "iso-2022-jp" {return iso2022-jp}
   674         -        "koi8-r"      {return koi8-r}
   675         -        "shift_jis"   {return shiftjis}
   676         -        "euc-jp"      {return euc-jp}
   677         -        "gb2312"      {return gb2312}
   678         -        "big5"        {return big5}
   679         -        "cp866"       {return cp866}
   680         -        "cp1250"      {return cp1250}
   681         -        "cp1253"      {return cp1253}
   682         -        "cp1254"      {return cp1254}
   683         -        "cp1255"      {return cp1255}
   684         -        "cp1256"      {return cp1256}
   685         -        "cp1257"      {return cp1257}
   686         -
   687         -        "windows-1251" -
   688         -        "cp1251"      {return cp1251}
   689         -
   690         -        "windows-1252" -
   691         -        "cp1252"      {return cp1252}    
   692         -
   693         -        "iso_8859-1:1987" -
   694         -        "iso-ir-100" -
   695         -        "iso_8859-1" -
   696         -        "latin1" -
   697         -        "l1" -
   698         -        "ibm819" -
   699         -        "cp819" -
   700         -        "csisolatin1" {return iso8859-1}
   701         -        
   702         -        "iso_8859-2:1987" -
   703         -        "iso-ir-101" -
   704         -        "iso_8859-2" -
   705         -        "iso-8859-2" -
   706         -        "latin2" -
   707         -        "l2" -
   708         -        "csisolatin2" {return iso8859-2}
   709         -
   710         -        "iso_8859-5:1988" -
   711         -        "iso-ir-144" -
   712         -        "iso_8859-5" -
   713         -        "iso-8859-5" -
   714         -        "cyrillic" -
   715         -        "csisolatincyrillic" {return iso8859-5}
   716         -
   717         -        "ms_kanji" -
   718         -        "csshiftjis"  {return shiftjis}
   719         -        
   720         -        "csiso2022kr" {return iso2022-kr}
   721         -
   722         -        "ibm866" -
   723         -        "csibm866"    {return cp866}
   724         -        
   725         -        default {
   726         -            # There are much more encoding names out there
   727         -            # It's only laziness, that let me stop here.
   728         -            error "Unrecognized encoding name '$IANAName'"
   729         -        }
   730         -    }
   731         -}
   732         -
   733         -#----------------------------------------------------------------------------
   734         -#   xmlOpenFile
   735         -#
   736         -#----------------------------------------------------------------------------
   737         -proc tDOM::xmlOpenFile {filename {encodingString {}}} {
   738         -
   739         -    set fd [open $filename]
   740         -
   741         -    if {$encodingString != {}} {
   742         -        upvar $encodingString encString
   743         -    }
   744         -
   745         -    # The autodetection of the encoding follows
   746         -    # XML Recomendation, Appendix F
   747         -
   748         -    fconfigure $fd -encoding binary
   749         -    if {![binary scan [read $fd 4] "H8" firstBytes]} {
   750         -        # very short (< 4 Bytes) file
   751         -        seek $fd 0 start
   752         -        set encString UTF-8
   753         -        return $fd
   754         -    }
   755         -    
   756         -    # First check for BOM
   757         -    switch [string range $firstBytes 0 3] {
   758         -        "feff" -
   759         -        "fffe" {
   760         -            # feff: UTF-16, big-endian BOM
   761         -            # ffef: UTF-16, little-endian BOM
   762         -            seek $fd 0 start
   763         -            set encString UTF-16            
   764         -            fconfigure $fd -encoding identity
   765         -            return $fd
   766         -        }
   767         -    }
   768         -
   769         -    # If the entity has a XML Declaration, the first four characters
   770         -    # must be "<?xm".
   771         -    switch $firstBytes {
   772         -        "3c3f786d" {
   773         -            # UTF-8, ISO 646, ASCII, some part of ISO 8859, Shift-JIS,
   774         -            # EUC, or any other 7-bit, 8-bit, or mixed-width encoding which 
   775         -            # ensures that the characters of ASCII have their normal positions,
   776         -            # width and values; the actual encoding declaration must be read to
   777         -            # detect which of these applies, but since all of these encodings
   778         -            # use the same bit patterns for the ASCII characters, the encoding
   779         -            # declaration itself be read reliably.
   780         -
   781         -            # First 300 bytes should be enough for a XML Declaration
   782         -            # This is of course not 100 percent bullet-proof.
   783         -            set head [read $fd 296]
   784         -
   785         -            # Try to find the end of the XML Declaration
   786         -            set closeIndex [string first ">" $head]
   787         -            if {$closeIndex == -1} {
   788         -                error "Weird XML data or not XML data at all"
   789         -            }
   790         -
   791         -            seek $fd 0 start
   792         -            set xmlDeclaration [read $fd [expr {$closeIndex + 5}]]
   793         -            # extract the encoding information
   794         -            set pattern {^[^>]+encoding=[\x20\x9\xd\xa]*["']([^ "']+)['"]}
   795         -            # emacs: "
   796         -            if {![regexp $pattern $head - encStr]} {
   797         -                # Probably something like <?xml version="1.0"?>. 
   798         -                # Without encoding declaration this must be UTF-8
   799         -                set encoding utf-8
   800         -                set encString UTF-8
   801         -            } else {
   802         -                set encoding [IANAEncoding2TclEncoding $encStr]
   803         -                set encString $encStr
   804         -            }
   805         -        }
   806         -        "0000003c" -
   807         -        "0000003c" -
   808         -        "3c000000" -
   809         -        "00003c00" {
   810         -            # UCS-4
   811         -            error "UCS-4 not supported"
   812         -        }
   813         -        "003c003f" -
   814         -        "3c003f00" {
   815         -            # UTF-16, big-endian, no BOM
   816         -            # UTF-16, little-endian, no BOM
   817         -            seek $fd 0 start
   818         -            set encoding identity
   819         -            set encString UTF-16
   820         -        }
   821         -        "4c6fa794" {
   822         -            # EBCDIC in some flavor
   823         -            error "EBCDIC not supported"
   824         -        }
   825         -        default {
   826         -            # UTF-8 without an encoding declaration
   827         -            seek $fd 0 start
   828         -            set encoding identity
   829         -            set encString "UTF-8"
   830         -        }
   831         -    }
   832         -    fconfigure $fd -encoding $encoding
   833         -    return $fd
   834         -}
   835         -
   836         -#----------------------------------------------------------------------------
   837         -#   xmlReadFile
   838         -#
   839         -#----------------------------------------------------------------------------
   840         -proc tDOM::xmlReadFile {filename {encodingString {}}} {
   841         -
   842         -    if {$encodingString != {}} {
   843         -        upvar $encodingString encString
   844         -    }
   845         -    
   846         -    set fd [xmlOpenFile $filename encString]
   847         -    set data [read $fd [file size $filename]]
   848         -    close $fd 
   849         -    return $data
   850         -}
   851         -
   852         -#----------------------------------------------------------------------------
   853         -#   extRefHandler
   854         -#   
   855         -#   A very simple external entity resolver, included for convenience.
   856         -#   Depends on the tcllib package uri and resolves only file URLs. 
   857         -#
   858         -#----------------------------------------------------------------------------
   859         -
   860         -if {![catch {package require uri}]} {
   861         -    proc tDOM::extRefHandler {base systemId publicId} {
   862         -        variable extRefHandlerDebug
   863         -        variable useForeignDTD
   864         -
   865         -        if {$extRefHandlerDebug} {
   866         -            puts stderr "tDOM::extRefHandler called with:"
   867         -            puts stderr "\tbase:     '$base'"
   868         -            puts stderr "\tsystemId: '$systemId'"
   869         -            puts stderr "\tpublicId: '$publicId'"
   870         -        }
   871         -        if {$systemId == ""} {
   872         -            if {$useForeignDTD != ""} {
   873         -                set systemId $useForeignDTD
   874         -            } else {
   875         -                error "::tDOM::useForeignDTD does\
   876         -                        not point to the foreign DTD"
   877         -            }
   878         -        }
   879         -        set absolutURI [uri::resolve $base $systemId]
   880         -        array set uriData [uri::split $absolutURI]
   881         -        switch $uriData(scheme) {
   882         -            file {
   883         -                return [list string $absolutURI [xmlReadFile $uriData(path)]]
   884         -            }
   885         -            default {
   886         -                error "can only handle file URI's"
   887         -            }
   888         -        }
   889         -    }
   890         -}
   891         -
   892         -#----------------------------------------------------------------------------
   893         -#   baseURL
   894         -#   
   895         -#   A simple convenience proc which returns an absolute URL for a given
   896         -#   filename.
   897         -#
   898         -#----------------------------------------------------------------------------
   899         -
   900         -proc tDOM::baseURL {path} {
   901         -    switch [file pathtype $path] {
   902         -        "relative" {
   903         -            return "file://[pwd]/$path"
   904         -        }
   905         -        default {
   906         -            return "file://$path"
   907         -        }
   908         -    }
   909         -}
   910         -
   911         -# EOF

Added libs/tls1.6.7/libtls1.6.7.dylib.

cannot compute difference between binary files

Added libs/tls1.6.7/pkgIndex.tcl.

            1  +package ifneeded tls 1.6.7     "[list source [file join $dir tls.tcl]] ;      [list tls::initlib $dir libtls1.6.7.dylib]"

Added libs/tls1.6.7/tls.tcl.

            1  +#
            2  +# Copyright (C) 1997-2000 Matt Newman <matt@novadigm.com> 
            3  +#
            4  +# $Header: /cvsroot/tls/tls/tls.tcl,v 1.14 2015/07/07 17:16:03 andreas_kupries Exp $
            5  +#
            6  +namespace eval tls {
            7  +    variable logcmd tclLog
            8  +    variable debug 0
            9  + 
           10  +    # Default flags passed to tls::import
           11  +    variable defaults {}
           12  +
           13  +    # Maps UID to Server Socket
           14  +    variable srvmap
           15  +    variable srvuid 0
           16  +
           17  +    # Over-ride this if you are using a different socket command
           18  +    variable socketCmd
           19  +    if {![info exists socketCmd]} {
           20  +        set socketCmd [info command ::socket]
           21  +    }
           22  +}
           23  +
           24  +proc tls::initlib {dir dll} {
           25  +    # Package index cd's into the package directory for loading.
           26  +    # Irrelevant to unixoids, but for Windows this enables the OS to find
           27  +    # the dependent DLL's in the CWD, where they may be.
           28  +    set cwd [pwd]
           29  +    catch {cd $dir}
           30  +    if {[string equal $::tcl_platform(platform) "windows"] &&
           31  +	![string equal [lindex [file system $dir] 0] "native"]} {
           32  +	# If it is a wrapped executable running on windows, the openssl
           33  +	# dlls must be copied out of the virtual filesystem to the disk
           34  +	# where Windows will find them when resolving the dependency in
           35  +	# the tls dll. We choose to make them siblings of the executable.
           36  +	package require starkit
           37  +	set dst [file nativename [file dirname $starkit::topdir]]
           38  +	foreach sdll [glob -nocomplain -directory $dir -tails *eay32.dll] {
           39  +	    catch {file delete -force            $dst/$sdll}
           40  +	    catch {file copy   -force $dir/$sdll $dst/$sdll}
           41  +	}
           42  +    }
           43  +    set res [catch {uplevel #0 [list load [file join [pwd] $dll]]} err]
           44  +    catch {cd $cwd}
           45  +    if {$res} {
           46  +	namespace eval [namespace parent] {namespace delete tls}
           47  +	return -code $res $err
           48  +    }
           49  +    rename tls::initlib {}
           50  +}
           51  +
           52  +#
           53  +# Backwards compatibility, also used to set the default
           54  +# context options
           55  +#
           56  +proc tls::init {args} {
           57  +    variable defaults
           58  +
           59  +    set defaults $args
           60  +}
           61  +#
           62  +# Helper function - behaves exactly as the native socket command.
           63  +#
           64  +proc tls::socket {args} {
           65  +    variable socketCmd
           66  +    variable defaults
           67  +    set idx [lsearch $args -server]
           68  +    if {$idx != -1} {
           69  +	set server 1
           70  +	set callback [lindex $args [expr {$idx+1}]]
           71  +	set args [lreplace $args $idx [expr {$idx+1}]]
           72  +
           73  +	set usage "wrong # args: should be \"tls::socket -server command ?options? port\""
           74  +	set options "-cadir, -cafile, -certfile, -cipher, -command, -dhparams, -keyfile, -myaddr, -password, -request, -require, -servername, -ssl2, -ssl3, -tls1, -tls1.1 or -tls1.2"
           75  +    } else {
           76  +	set server 0
           77  +
           78  +	set usage "wrong # args: should be \"tls::socket ?options? host port\""
           79  +	set options "-async, -cadir, -cafile, -certfile, -cipher, -command, -dhparams, -keyfile, -myaddr, -myport, -password, -request, -require, -servername, -ssl2, -ssl3, -tls1, -tls1.1 or -tls1.2"
           80  +    }
           81  +    set argc [llength $args]
           82  +    set sopts {}
           83  +    set iopts [concat [list -server $server] $defaults]	;# Import options
           84  +
           85  +    for {set idx 0} {$idx < $argc} {incr idx} {
           86  +	set arg [lindex $args $idx]
           87  +	switch -glob -- $server,$arg {
           88  +	    0,-async	{lappend sopts $arg}
           89  +	    0,-myport	-
           90  +	    *,-type	-
           91  +	    *,-myaddr	{lappend sopts $arg [lindex $args [incr idx]]}
           92  +	    *,-cadir	-
           93  +	    *,-cafile	-
           94  +	    *,-certfile	-
           95  +	    *,-cipher	-
           96  +	    *,-command	-
           97  +	    *,-dhparams -
           98  +	    *,-keyfile	-
           99  +	    *,-password	-
          100  +	    *,-request	-
          101  +	    *,-require	-
          102  +            *,-servername -
          103  +	    *,-ssl2	-
          104  +	    *,-ssl3	-
          105  +	    *,-tls1	-
          106  +	    *,-tls1.1	-
          107  +	    *,-tls1.2	{lappend iopts $arg [lindex $args [incr idx]]}
          108  +	    -*		{return -code error "bad option \"$arg\": must be one of $options"}
          109  +	    default	{break}
          110  +	}
          111  +    }
          112  +    if {$server} {
          113  +	if {($idx + 1) != $argc} {
          114  +	    return -code error $usage
          115  +	}
          116  +	set uid [incr ::tls::srvuid]
          117  +
          118  +	set port [lindex $args [expr {$argc-1}]]
          119  +	lappend sopts $port
          120  +	#set sopts [linsert $sopts 0 -server $callback]
          121  +	set sopts [linsert $sopts 0 -server [list tls::_accept $iopts $callback]]
          122  +	#set sopts [linsert $sopts 0 -server [list tls::_accept $uid $callback]]
          123  +    } else {
          124  +	if {($idx + 2) != $argc} {
          125  +	    return -code error $usage
          126  +	}
          127  +	set host [lindex $args [expr {$argc-2}]]
          128  +	set port [lindex $args [expr {$argc-1}]]
          129  +	lappend sopts $host $port
          130  +    }
          131  +    #
          132  +    # Create TCP/IP socket
          133  +    #
          134  +    set chan [eval $socketCmd $sopts]
          135  +    if {!$server && [catch {
          136  +	#
          137  +	# Push SSL layer onto socket
          138  +	#
          139  +	eval [list tls::import] $chan $iopts
          140  +    } err]} {
          141  +	set info ${::errorInfo}
          142  +	catch {close $chan}
          143  +	return -code error -errorinfo $info $err
          144  +    }
          145  +    return $chan
          146  +}
          147  +
          148  +# tls::_accept --
          149  +#
          150  +#   This is the actual accept that TLS sockets use, which then calls
          151  +#   the callback registered by tls::socket.
          152  +#
          153  +# Arguments:
          154  +#   iopts	tls::import opts
          155  +#   callback	server callback to invoke
          156  +#   chan	socket channel to accept/deny
          157  +#   ipaddr	calling IP address
          158  +#   port	calling port
          159  +#
          160  +# Results:
          161  +#   Returns an error if the callback throws one.
          162  +#
          163  +proc tls::_accept { iopts callback chan ipaddr port } {
          164  +    log 2 [list tls::_accept $iopts $callback $chan $ipaddr $port]
          165  +
          166  +    set chan [eval [list tls::import $chan] $iopts]
          167  +
          168  +    lappend callback $chan $ipaddr $port
          169  +    if {[catch {
          170  +	uplevel #0 $callback
          171  +    } err]} {
          172  +	log 1 "tls::_accept error: ${::errorInfo}"
          173  +	close $chan
          174  +	error $err $::errorInfo $::errorCode
          175  +    } else {
          176  +	log 2 "tls::_accept - called \"$callback\" succeeded"
          177  +    }
          178  +}
          179  +#
          180  +# Sample callback for hooking: -
          181  +#
          182  +# error
          183  +# verify
          184  +# info
          185  +#
          186  +proc tls::callback {option args} {
          187  +    variable debug
          188  +
          189  +    #log 2 [concat $option $args]
          190  +
          191  +    switch -- $option {
          192  +	"error"	{
          193  +	    foreach {chan msg} $args break
          194  +
          195  +	    log 0 "TLS/$chan: error: $msg"
          196  +	}
          197  +	"verify"	{
          198  +	    # poor man's lassign
          199  +	    foreach {chan depth cert rc err} $args break
          200  +
          201  +	    array set c $cert
          202  +
          203  +	    if {$rc != "1"} {
          204  +		log 1 "TLS/$chan: verify/$depth: Bad Cert: $err (rc = $rc)"
          205  +	    } else {
          206  +		log 2 "TLS/$chan: verify/$depth: $c(subject)"
          207  +	    }
          208  +	    if {$debug > 0} {
          209  +		return 1;	# FORCE OK
          210  +	    } else {
          211  +		return $rc
          212  +	    }
          213  +	}
          214  +	"info"	{
          215  +	    # poor man's lassign
          216  +	    foreach {chan major minor state msg} $args break
          217  +
          218  +	    if {$msg != ""} {
          219  +		append state ": $msg"
          220  +	    }
          221  +	    # For tracing
          222  +	    upvar #0 tls::$chan cb
          223  +	    set cb($major) $minor
          224  +
          225  +	    log 2 "TLS/$chan: $major/$minor: $state"
          226  +	}
          227  +	default	{
          228  +	    return -code error "bad option \"$option\":\
          229  +		    must be one of error, info, or verify"
          230  +	}
          231  +    }
          232  +}
          233  +
          234  +proc tls::xhandshake {chan} {
          235  +    upvar #0 tls::$chan cb
          236  +
          237  +    if {[info exists cb(handshake)] && \
          238  +	$cb(handshake) == "done"} {
          239  +	return 1
          240  +    }
          241  +    while {1} {
          242  +	vwait tls::${chan}(handshake)
          243  +	if {![info exists cb(handshake)]} {
          244  +	    return 0
          245  +	}
          246  +	if {$cb(handshake) == "done"} {
          247  +	    return 1
          248  +	}
          249  +    }
          250  +}
          251  +
          252  +proc tls::password {} {
          253  +    log 0 "TLS/Password: did you forget to set your passwd!"
          254  +    # Return the worlds best kept secret password.
          255  +    return "secret"
          256  +}
          257  +
          258  +proc tls::log {level msg} {
          259  +    variable debug
          260  +    variable logcmd
          261  +
          262  +    if {$level > $debug || $logcmd == ""} {
          263  +	return
          264  +    }
          265  +    set cmd $logcmd
          266  +    lappend cmd $msg
          267  +    uplevel #0 $cmd
          268  +}
          269  +