Fix for base64 BIO decoding bug

This commit is contained in:
Dr. Stephen Henson 1999-10-02 13:33:06 +00:00
parent c91e125934
commit 4579dd5dc6
3 changed files with 16 additions and 3 deletions

14
CHANGES
View File

@ -4,6 +4,20 @@
Changes between 0.9.4 and 0.9.5 [xx XXX 1999]
*) Fix for base64 decode bug. When a base64 bio reads only one line of
data and it contains EOF it will end up returning an error. This is
caused by input 46 bytes long. The cause is due to the way base64
BIOs find the start of base64 encoded data. They do this by trying a
trial decode on each line until they find one that works. When they
do a flag is set and it starts again knowing it can pass all the
data directly through the decoder. Unfortunately it doesn't reset
the context it uses. This means that if EOF is reached an attempt
is made to pass two EOFs through the context and this causes the
resulting error. This can also cause other problems as well. As is
usual with these problems it takes *ages* to find and the fix is
trivial: move one line.
[Steve Henson, reported by ian@uns.ns.ac.yu (Ivan Nejgebauer) ]
*) Ugly workaround to get s_client and s_server working under Windows. The
old code wouldn't work because it needed to select() on sockets and the
tty (for keypresses and to see if data could be written). Win32 only

3
STATUS
View File

@ -1,6 +1,6 @@
OpenSSL STATUS Last modified at
______________ $Date: 1999/09/30 08:32:54 $
______________ $Date: 1999/10/02 13:33:03 $
DEVELOPMENT STATE
@ -60,7 +60,6 @@
NEEDS PATCH
o Arne Ansper: d2i_ASN1_bytes bug
o base64 decoding bug (Ivan Nejgebauer)
o salzr@certco.com (Rich Salz): Bug in X509_name_print
<29E0A6D39ABED111A36000A0C99609CA2C2BA4@macertco-srv1.ma.certco.com>
o $(PERL) in */Makefile.ssl

View File

@ -237,8 +237,8 @@ static int b64_read(BIO *b, char *out, int outl)
&(ctx->tmp[0]));
for (x=0; x < i; x++)
ctx->tmp[x]=p[x];
EVP_DecodeInit(&ctx->base64);
}
EVP_DecodeInit(&ctx->base64);
ctx->start=0;
break;
}