Skip to content
Tcl Source Code View Ticket
Login

View Ticket

tlsIO-2.11 failure

Closed / Out of Datec31ca233cacd7d6184877c54182f4b3a6ccb30f1Created 12 years agoUpdated 12 years ago
Descriptionplain2014-06-30 18:22:24
Starting with checkin 2a40293a49 on the Tcl trunk,
the test in the tls extension, tlsIO-2.11 fails:

---- Result was:
a:one b: c:
---- Result should have been (exact matching):
a:one b: c:two
==== tlsIO-2.11 FAILED
Referenced by3
  • d5a419a5f9Ticket [0f94f855ca] Infinite loop on writing to TLS channel on negotiation failure status still Open with 3 other changes ticket2015-04-09 18:36:45
  • af0d8f3b3c[c31ca233ca] Fix TclGetsObjBinary() so that each [gets] rediscovers whether a nonblocking channel is blocked. check-in2014-07-02 16:30:41
  • 6694ecd6d0[c31ca233ca] Fix TclGetsObjBinary() so that each [gets] rediscovers whether a nonblocking channel is blocked. check-in2014-07-02 16:20:30
dgp Ticket [c31ca233ca]: 3 changes [History diff]2014-06-30 18:22:46
dgpplain2014-06-30 19:03:00
bisecting onto dgp-trunk-flag-repair branch
shows the trouble arising in checkin 960f628ee8
dgpplain2014-06-30 19:53:13
Same checkins also introduce errors and 
failures in tlsIO-2.10.
dgpplain2014-06-30 19:58:51
Sorry, no.  The tlsIO-2.10 failures start
with checkin 98763462fb
dgpplain2014-06-30 20:26:31
Attached patch for tls, which was developed for
other reasons, cleans up tls management of chan
events.  Attached here because applying it stops
the failures of tlsIO-2.10.
dgpplain2014-07-02 15:16:50
The failure of tclIO-2.11 is a core bug.
I have a fix, and will commit when I have
a test in the core test suite.
dgpplain2014-07-02 16:31:02
tlsIO-2.11 failure fixed in Tcl 8.5 and trunk branches.
dgpplain2014-07-02 20:07:07
New attachment, eof.patch, is another way to
fix the failing test tlsIO-2.10.  

I believe the best thing is to apply both patches to tls.
After these patches, tls should continue to operate successfully
everywhere it always has, and in addition function correctly with
the current Tcl trunk.

What's happening is that during the handshake processing,
an EOF happens on the low-level encrypted socket.

Until recently, Tcl's I/O core has been allowing EOF
status flags to leak between levels in a channel stack.
In this case, the bug was an advantage to tls because it caused
the tls::socket to apparently also present an EOF state,
and this causes [gets] to complete successfully returning
an empty string.

Now that the core bugs are fixed, the EOF doesn't bubble up,
and so the failed handshake gets noticed and reported as
an error.  The failing [gets] causes the test to fail.
 
The eof.patch adds a tiny bit of code to explicitly notice
the low-level EOF and explicitly raise it again at the higher
level.

An additional change that might be worthwhile is to [catch]
the [gets] in the test.  The purpose of the test is to verify
that [readit] is called at all, not whether [gets] succeeds.
dgp Closed ticket [c31ca233ca]. [History diff]2015-05-11 17:55:18
Log in (anonymous is fine) to add a comment.

Attachments: