Great! Thanks for your help.
Edson E. Watanabe
- Original Message -
From: "root" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, July 09, 2000 4:26 PM
Subject: Re: BIO Filter for compression
"Edson E. Watanabe" wrote:
Did someone write a BIO filter for gzip/zlib compression/decompression?
Is it easy to write?
I think I could use crypto/evp/bio_b64.c as a starting point (writing a
BIO_f_gzip filter for compressing and a BIO_f_gunzip for expanding), but
want to know if are there any pitfalls in implementing or installing new
Yes,its very easy. I wrote one "ZBIO" from gzio.c code in GNU ZLIB for my
secure transfer of file server.You have to create a new BIO method and a
function to return a pointer to that method when its requested.Then you
to fill its pointer to function members with the gzread/gzwrite code in
In fact, its just an exercise because there are few things to add/modify.
This is the new method context: (name of variables could be re-written
in cipher bio or b64 bio...)
typedef struct z_struct
z_stream stream; /* This is original ZLIB context */
And this is the method
#define BIO_TYPE_COMP (12|0x0200) /* filter */
static BIO_METHOD methods_z=
zbio_write, /* this is gzwrite() */
zbio_read, /*gzread() */
zbio_ctrl, /* ctrl could set the compress level */
This is how I've called my bio:
I use this BIO at the botton of a B64 bio and a encryption BIO, without
I use the same BIO for compress and uncompress: if I call BIO_read it
uncompresses and if I call BIO_wrie it compresses.
Hope this helps
Pablo J. Royo
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]