This is a forwarded message From: Pavel Tsekov <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Date: Thursday, April 11, 2002, 12:39:59 PM Subject: [BUG & suggested PATCH] EVP_DecodeUpdate 0.9.6b & 0.9.6c
Seem like the original message could not made its way to the mail list so am I forwarding it. ===8<==============Original message text=============== Hello, there! :) My colleague Nedelcho Stanev and myself have identified what we would think to be a bug (or a flaw) in the EVP_DecodeUpdate() routine. We were trying to read base64 encoded data with the base64 BIO which has the 'next' member pointed to membuf BIO in which we write the encoded data. So far so good ... Eventually it turned up that some of the data we pass to the BIO chain is properly decoded while other not - or more properly would be to say - partially decoded. We tried to debug the problem and here is what we have found: The EVP_DecodeUpdate() routine errnously returns 0 (EOF) if the buffer passed it, ends with CRLF and EVP_DecodeBlock() has just processed the data upto the ending CRLF. Attached is a patch and a testcase. I tried to follow the coding style and to make the change not intrusive :) though its a very small change :) Here is how to reproduce: 1. Base64 encode a file lets say > 200kb 2. unix2dos the output 3. Use the attached testcase to decode the file ===8<===========End of original message text===========
encode.c.patch
Description: Binary data
bio.cpp
Description: Binary data