Tcl Library Source Code

Ticket Change Details
Login
Overview

Artifact ID: bf7318005d50d804148dcfb400bbe6a4a20edf20b32414475ec8e212c1221039
Ticket: d56da1abcaa028bed473ff5ffbd814f41909c5f5
Incorrect padding of data when using input channel
User & Date: anonymous 2019-06-06 08:43:14
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    Blowfish pads an incoming stream improperly. This was seen and reported by Jim in this thread on comp.lang.tcl:
    https://groups.google.com/forum/#!topic/comp.lang.tcl/XhDe5-yLzw0
    
    The improper padding happens in the procedure blowfish::Chunk which already contains a FIXME comment. The procedure needs to care about 2 things:
    
    1. Data must always be processed in multiples of 8 bytes. However, it's not guaranteed that a multiple of 8 bytes is read even in the middle of a stream. Reasons can be an odd user provided chunk size or a nonblocking channel. My patch introduces a new variable state(remainder) to hold the modulo data.
    
    2. Apply padding at the end of the stream, and only there. Don't pad an empty string. Unfortunately, blowfish::Pad is doing exactly this. I think an empty string should not be padded. Likewise an empty data set encrpyts to an empty data set. If this is not correct then extra care has to be taken with the remainig data at EOF. Also, blowfish::Chunk didn't call pad with the user provided pad character.
    
    The attached patch takes care of both points.
    
    Missing: A test for the input channel API.
    
    -- Stephan Effelsberg
    
  5. foundin changed to: "1.0.4"
  6. is_private changed to: "0"
  7. login: "anonymous"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "87a8af3af6267b859f2893f3f1d57a347c5b095a"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "anonymous"
  14. subsystem changed to: "blowfish"
  15. title changed to: "Incorrect padding of data when using input channel"
  16. type changed to: "Bug"