Hi,

I have played around with the BIO filter functions and created a program that basically compresses, encrypts and base64 encodes incoming cleartext and writes the result to a file (input->zlib->cipher->base64->file). This works well in the normal case, but if my program is killed, I loose all data since nothing is written to file until BIO_flush() is called. If I try to call BIO_flush(zlib) at regular intervals, the next following BIO_write fails.

The man page for BIO_flush() is not very clear, "normally writes out any internally buffered data, in some cases it is used to signal EOF and that no more data will be written". I assume it's the "some cases" I have come across or is there someway to flush the encrypted data to file at an interval, so that some data can be salvaged? If there is, can it be decrypted?

As a workaround I've started looking at using a memory buffer as a sink and writing the resulting encrypted buffer to a file if I can't get the above version to work better. The problem is that this will probably be slower and that the decryption gets a little more complicated.

Thank you,
    Jonas
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [email protected]
Automated List Manager                           [email protected]

Reply via email to