openssl base64 problems

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

openssl base64 problems

Beat Jucker
When I try to decode a particular smime message I'll get error
"ASN1_get_object:too long". First I thought there's something
wrong with ASN.1 syntax but than I found a major difference
in openssl base64 decoding compared to other base64 tools.

Given attached PEM file with all other base64 tools than
openssl (eg base64, mimencode, web online base64 decoder,
Asn1Editor, some kind of self written base64 test, etc) I'll
get a DER filesize of 5305 bytes with correct ASN.1 syntax.

With all openssl versions I have tested (0.9.5...0.9.8) I'll
get a DER filesize of only 5280 bytes (openssl base64 -d).
This behavior is only on a very few smime files I recieve,
no problems on all other smime files.

In my opinion there's something wrong with the PEM file.
I didn't write C code for a long time so I couldn't figure out
the reason why openssl stops decoding base64.
Any idea?

Thanks
-- Beat

smime.txt (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: openssl base64 problems (--> bug?)

Beat Jucker
Is this an openssl base64 bug?

With a particular message I don't get the correct size of the
decoded message. The base64 encoded file itself looks good.
Other tools than openssl does base64 decode correct.

cmdline example: openssl base64 -d -in text.pem -out text.der
--> size of text.der = 5280 bytes instead of 5305 bytes

When I insert at least one illegal base64 character somewhere
in the base64 text (e.g. <SPACE> as first character in the file
or insert an empty line somewhere in the base64 code) I'll get
the correct decoded message (5305 versus 5280 bytes)!

Does someone understand what's going on ...?

Regards
-- Beat

On Thu, Jun 16, 2005 at 02:58:24PM +0200, Beat Jucker wrote:

> When I try to decode a particular smime message I'll get error
> "ASN1_get_object:too long". First I thought there's something
> wrong with ASN.1 syntax but than I found a major difference
> in openssl base64 decoding compared to other base64 tools.
>
> Given attached PEM file with all other base64 tools than
> openssl (eg base64, mimencode, web online base64 decoder,
> Asn1Editor, some kind of self written base64 test, etc) I'll
> get a DER filesize of 5305 bytes with correct ASN.1 syntax.
>
> With all openssl versions I have tested (0.9.5...0.9.8) I'll
> get a DER filesize of only 5280 bytes (openssl base64 -d).
> This behavior is only on a very few smime files I recieve,
> no problems on all other smime files.
>
> In my opinion there's something wrong with the PEM file.
> I didn't write C code for a long time so I couldn't figure out
> the reason why openssl stops decoding base64.
> Any idea?
>
> Thanks
> -- Beat

text.mQaOkd.pem (7K) Download Attachment