Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

EncryptingStreamWriter.close() does not call .flush() #148

Closed
GoogleCodeExporter opened this issue Mar 7, 2015 · 0 comments
Closed

EncryptingStreamWriter.close() does not call .flush() #148

GoogleCodeExporter opened this issue Mar 7, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Create an EncryptingStreamWriter
2. Write data to it
3. Call close() on the EncryptingStreamWriter
4. Attempt to read the data back with a DecryptingStreamReader

What is the expected output? What do you see instead?
Decoded stream should be read back correctly and in full. Instead, a partial 
block is returned, causing the following exception when reading the stream back:

    File "/lib/python2.7/site-packages/keyczar/keys.py", line 1202, in read
       decrypted_data = self.__cipher.decrypt(data_to_decrypt)
    ValueError: Input strings must be a multiple of 16 in length

This is caused because close() on EncryptingStreamWriter does not first call 
flush(), causing the final (partial) block to never be written to disk.

What version of the product are you using? On what operating system?
KeyCzar head

Original issue reported on code.google.com by arach...@notdot.net on 20 Nov 2013 at 4:20

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants