Re: [BUG suggested PATCH] EVP_DecodeUpdate 0.9.6b 0.9.6c

2002-04-15 Thread Lutz Jaenicke

On Thu, Apr 11, 2002 at 12:39:59PM +0200, Pavel Tsekov wrote:
 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

I could easily reproduce your problem and solution.
I am currently checking in your patch.

Thanks,
Lutz
-- 
Lutz Jaenicke [EMAIL PROTECTED]
http://www.aet.TU-Cottbus.DE/personen/jaenicke/
BTU Cottbus, Allgemeine Elektrotechnik
Universitaetsplatz 3-4, D-03044 Cottbus
__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



Fwd: [BUG suggested PATCH] EVP_DecodeUpdate 0.9.6b 0.9.6c

2002-04-11 Thread Pavel Tsekov

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


[BUG suggested PATCH] EVP_DecodeUpdate 0.9.6b 0.9.6c

2002-04-11 Thread Pavel Tsekov

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


encode.c.patch
Description: Binary data


bio.cpp
Description: Binary data