==== output of "openssl version -a" ====
OpenSSL 0.9.3a 29 May 1999
built on: Tue Aug 10 10:16:58 CEST 1999
platform: linux-elf
options:  bn(64,32) md2(int) rc4(ptr,int) des(ptr,risc1,16,long) idea(int) 
blowfish(idx) 
compiler: gcc -DTHREADS -D_REENTRANT -DL_ENDIAN -DTERMIO -g -DSHA1_ASM -DMD5_ASM 
-DRMD160_ASM
==== output of "./config -t" ====
Operating system: i586-whatever-linux2
Configuring for linux-elf
/usr/bin/perl ./Configure linux-elf
==== compiler name and version ====
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3/specs
gcc version 2.7.2.3
==== problem description ====
The openssl program fails to decode base64-encoded input of data that was
exactly 46 or 47 bytes long before encoding.  To reproduce, run

echo "Has to be precisely forty-six characters long" | openssl enc -a \
        | openssl enc -d -a

This doesn't produce any output, but it should.  I have verified that the
anomaly is somehow tied to special processing of input lines which are 64
(or more) characters long, in crypto/evp/encode.c.  If the following
modification is made to that file

--- encode.c.old        Tue Aug 10 12:56:22 1999
+++ encode.c    Tue Aug 10 12:56:31 1999
@@ -283,12 +283,12 @@
                if (((i+1) == inl) && (((n&3) == 0) || eof))
                        v=B64_EOF;
 
-               if ((v == B64_EOF) || (n >= 64))
+               if ((v == B64_EOF) || (n >= 68))
                        {
                        /* This is needed to work correctly on 64 byte input
                         * lines.  We process the line and then need to
                         * accept the '\n' */
-                       if ((v != B64_EOF) && (n >= 64)) exp_nl=1;
+                       if ((v != B64_EOF) && (n >= 68)) exp_nl=1;
                        tmp2=v;
                        if (n > 0)
                                {

(i.e., the constant 64 is changed to 68), then the decoding will fail
for data that was 49 or 50 bytes long before encoding.
==== end of bug report ====
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to