On Sun, Jul 25, 2004, Kai-Min Sung wrote:

> Hi,
> 
> I'm attaching two patches, one implementing the CRLF fix as a flag
> (BIO_FLAGS_BASE64_CRLF) to the b64 BIO and another implemented as a
> new filtering BIO (BIO_TYPE_CRLF_FILTER).  The latter was authored by
> a coworker (Matt Pauker).  These are patches to the openssl-0.9.7c
> code base, although I suspect they will work for 0.9.7d also. 
> Feedback would be appreciated for either one.
> 

Thank you for the contribution. Unfortunately there are quite a few problems
with the filtering BIO and non-blocking I/O.

This is always a bit tricky because some kind of internal state often needs to
be maintained. The standard OpenSSL BIOs had been unchanged from SSLeay days
until fairly recently and had several bugs in their non-blocking I/O behaviour:
there's at least one remaining.

Anyway here's some of the issues I noted...

If the next BIO in the chain indicates that a retry is needed the number of
bytes succesfully written (from the supplied buffer) must be returned by the
function, not the retry code. This is so the application knows where to restart
the operation.

Additionally if a retry occurs while the CR+LF is being written the BIO must
restart at that point.

The BIO type BIO_f_nbio_test() is something I found *very* useful for
checking non-blocking I/O functionality. It randomly writes some or none
of the supplied data and simulates a non-blocking stream very nicely. Its
undocumented at present but if you place a BIO_f_nbio_test() BIO after the
CRLF filter BIO that should do the trick.

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
Homepage: http://www.drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to