Skip to content

OpenSSL-1.1.1d make test failed, test_enc test #171 zlib #9988

@schwartz-je

Description

@schwartz-je

Hello,
when building the last OpenSSL-1.1.1d version, I had some failure with make test.
This failure is detected with

openssl zlib -bufsize 113 -e -k test -in ./p -out ./p.zlib.cipher
openssl zlib -bufsize 157 -d -k test -in ./p.zlib.cipher -out ./p.zlib.clear

The decoded file is only 157 bytes long and the comparaison with the source file failed.

The error comes from apps/enc.c, line 589

while (BIO_pending(rbio) || !BIO_eof(rbio)) { ... }

Seems that 'BIO_f_zlib', in crypto/comp/c_zlib.c does not support the BIO_CTRL_PENDING and BIO_CTRL_EOF commands and pass them directly to the next BIO, despite having some bytes in an internal buffer.

A simple correction consists to revert this line to it's previous value (OpenSSL-1.1.1c)

for (;;) { ... }

A better one would be to implement the two commands in the zlib bio module.

An other simple question with the same test: what is the real goal of the '-a' (base64) option ?
To produce a encode64 output of compressed datas or
a compressed output of an encoded64 datas ?

For the first case, I think that the order of creating the BIO list should be modified
Actually we have:

wbio = bio_open_default (outfile, 'w', format);
wbio = BIO_push (BIO_new(BIO_f_zlib()), wbio);
if (base64) wbio = BIO_push(BIO_new(BIO_f_base64()), wbio);

Should be, in my opinion,

wbio = bio_open_default (outfile, 'w', format);
if (base64) wbio = BIO_push(BIO_new(BIO_f_base64()), wbio);
wbio = BIO_push (BIO_new(BIO_f_zlib()), wbio);

Many thanks for all your job

cfg.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions