--- On Thu, 10/28/10, Dave Thompson <dthomp...@prinpay.com> wrote:

> From: Dave Thompson <dthomp...@prinpay.com>
> Subject: RE: B64_read_PKCS7 : Anyone modified the base64 reader to be more 
> forgiving?
> To: openssl-users@openssl.org
> Date: Thursday, October 28, 2010, 7:00 PM
> > From: owner-openssl-us...@openssl.org
> On Behalf Of Harakiri
> > Sent: Thursday, 28 October, 2010 07:52

> > 
> > However, it would be easy to fix i guess - the base64
> reader 
> > simply must ignore the rule that each line has to be a
> certain length.
> > 
> BIO_set_flags(b64,BIO_FLAGS_BASE64_NO_NL)
> 
> Output doesn't generate (any) linebreaks. Input doesn't 
> REQUIRE them every <80, but does ALLOW them anywhere.

Thanks for your reply, that does look like a good idea - however you say that 
the output doesnt generate any newlines either - well this not wanted because 
after decryption/verification the output generated by the CMD would then 
contain an invalid encoded message if the base64 block is just one line with no 
new lines.

Is BIO_set_flags(b64,BIO_FLAGS_BASE64_NO_NL) a global variable? 

Maybe it would be possible to set this to ignore NL/errors for reading but 
reset it again for writing the resulting message ?


> Alternatively, instead of using a BIO directly on the
> message 
> as received, you could first correct it by just breaking
> any 
> overlong base64 line(s); instead of actually parsing MIME 
> maybe you can assume nonheader nonmarker is base64 body.
> If it fits in memory you can just read it in and fix it, 
> then point to that in a memBIO you give to SIME_read_.
> If not you probably have to make a BIO_pair and a thread 
> that feeds your end with corrected data while OpenSSL 
> consumes the other end.

That sounds pretty complicated actually, and i dont want to pipe it into 
memory, it should work for streaming (as the default) so it can handle very 
large messages too.

Thanks for your reply.

Regards


      
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to