On 4/16/2013 10:28 PM, Dave Thompson wrote:
From: owner-openssl-us...@openssl.org On Behalf Of Zach
Sent: Tuesday, 16 April, 2013 15:55
I'm still getting an error when trying to read this key using the BIO
interface:
Error: error:0906D064:PEM routines:PEM_read_bio:bad base64 decode
...
The body part of your string (between BEGIN line and END line) must
have newlines -- actual newlines in the data \n not discarded source
linebreaks \(EOL) -- at intervals of no more than 76 characters.
This sounds like a gross violation of the Postel principle.
The /only/ reason for the mention of any maximum line length in the
Base64 specs is to accomodate ancient 7-bit ASCII only mail servers
with artificial Holerith punched card like line length limitations.
Adding those line feeds may also be useful in some human-viewed files,
such as the output of openssl x509 -text.
No sane Base64 decoder should care. But the code in
crypto/evp/bio_b64.c seems to be stupidly line oriented with small line
buffers
in an overcomplicated state, when a streaming Base64 encoder/decoder
should be able to get away with a few unsigned ints and a state
machine.
(The normal output from PEM_write and thus most commandline utilities
is intervals of 64 characters, which is usually convenient. I observe
you've broken your lines above at 63 for some reason.)
> ...
Enjoy
Jakob
--
Jakob Bohm, CIO, Partner, WiseMo A/S. http://www.wisemo.com
Transformervej 29, 2730 Herlev, Denmark. Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager majord...@openssl.org