Discussion:
SMIME decrypt: header too long
(too old to reply)
Beat Jucker
2005-06-01 11:08:06 UTC
Permalink
I have an intermediate SMIME decrypting problem. I'm using following
commandline interface (little bit outdated openssl 0.9.6b @ HPUX-B.11.11):

cat email | openssl smime -decrypt -inkey mykey -recip mycert

This works usually without problems. But Emails from one particular
address I can decrypt only most of the time. Sometimes I'll get
following error message:

openssl-0.9.6b:

Error reading S/MIME message
27549:error:0D06B078:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:139:
27549:error:21078082:PKCS7 routines:B64_READ_PKCS7:decode error:pk7_mime.c:142:
27549:error:2107A08B:PKCS7 routines:SMIME_read_PKCS7:pkcs7 parse error:pk7_mime.c:299:

same effect with openssl-0.9.7-beta6:

Error reading S/MIME message
13482:error:0D06B08E:asn1 encoding routines:ASN1_d2i_bio:not enough data:a_d2i_fp.c:240:
13482:error:21078082:PKCS7 routines:B64_READ_PKCS7:decode error:pk7_mime.c:142:
13482:error:2107A08B:PKCS7 routines:SMIME_read_PKCS7:pkcs7 parse error:pk7_mime.c:299:

When I'll try the same command later it might or might not get decrypted successful ...
What does "header too long" mean in the context of SMIME decrypt (or "not enough data")?

Thanks,
-- Beat
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-***@openssl.org
Automated List Manager ***@openssl.org
Victor B. Wagner
2005-06-01 11:12:59 UTC
Permalink
Post by Beat Jucker
I have an intermediate SMIME decrypting problem. I'm using following
cat email | openssl smime -decrypt -inkey mykey -recip mycert
This works usually without problems. But Emails from one particular
address I can decrypt only most of the time. Sometimes I'll get
Error reading S/MIME message
Once I've got simular problem with opaque signed message (DER format)
which was attached to the E-Mail and used Quoted-Printable transfer
encoding. Thus all end-of-lines inside message data was converted from
CRLF to LF by some intermediate mail server.

So, investigating transport envelope of problematic messages can be
helpful.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-***@openssl.org
Automated List Manager ***@openssl.org
Peter Cope
2005-06-01 11:19:40 UTC
Permalink
--0-1683960573-1117624751=:57877
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Try using the asn1parser (an option with openssl). If this doesn't complete without an error then you may have a problem with the way your originator is producing ASN.1 (we did here and I had to solve it by producing a bit of code to act as a 'filter' to correct the problem!).

Peter

Beat Jucker <***@glue.ch> wrote:
I have an intermediate SMIME decrypting problem. I'm using following
commandline interface (little bit outdated openssl 0.9.6b @ HPUX-B.11.11):

cat email | openssl smime -decrypt -inkey mykey -recip mycert

This works usually without problems. But Emails from one particular
address I can decrypt only most of the time. Sometimes I'll get
following error message:

openssl-0.9.6b:

Error reading S/MIME message
27549:error:0D06B078:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:139:
27549:error:21078082:PKCS7 routines:B64_READ_PKCS7:decode error:pk7_mime.c:142:
27549:error:2107A08B:PKCS7 routines:SMIME_read_PKCS7:pkcs7 parse error:pk7_mime.c:299:

same effect with openssl-0.9.7-beta6:

Error reading S/MIME message
13482:error:0D06B08E:asn1 encoding routines:ASN1_d2i_bio:not enough data:a_d2i_fp.c:240:
13482:error:21078082:PKCS7 routines:B64_READ_PKCS7:decode error:pk7_mime.c:142:
13482:error:2107A08B:PKCS7 routines:SMIME_read_PKCS7:pkcs7 parse error:pk7_mime.c:299:

When I'll try the same command later it might or might not get decrypted successful ...
What does "header too long" mean in the context of SMIME decrypt (or "not enough data")?

Thanks,
-- Beat
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-***@openssl.org
Automated List Manager ***@openssl.org

--0-1683960573-1117624751=:57877
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit <DIV>Try using the asn1parser (an option with openssl).&nbsp; If this doesn't complete without an error then you may have a problem with the way your originator is producing ASN.1 (we did here and I had to solve it by producing a bit of code to act as a 'filter' to correct the problem!).</DIV> <DIV>&nbsp;</DIV> <DIV>Peter<BR><BR><B><I>Beat Jucker &lt;***@glue.ch&gt;</I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">I have an intermediate SMIME decrypting problem. I'm using following <BR>commandline interface (little bit outdated openssl 0.9.6b @ HPUX-B.11.11):<BR><BR>cat email | openssl smime -decrypt -inkey mykey -recip mycert<BR><BR>This works usually without problems. But Emails from one particular<BR>address I can decrypt only most of the time. Sometimes I'll get<BR>following error message:<BR><BR>openssl-0.9.6b:<BR><BR>Error reading S/MIME message<BR>27549:error:0D06B078:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:139:<BR>27549:error:21078082:PKCS7 routines:B64_READ_PKCS7:decode error:pk7_mime.c:142:<BR>27549:error:2107A08B:PKCS7 routines:SMIME_read_PKCS7:pkcs7 parse error:pk7_mime.c:299:<BR><BR>same effect with openssl-0.9.7-beta6:<BR><BR>Error reading S/MIME message<BR>13482:error:0D06B08E:asn1 encoding routines:ASN1_d2i_bio:not enough
data:a_d2i_fp.c:240:<BR>13482:error:21078082:PKCS7 routines:B64_READ_PKCS7:decode error:pk7_mime.c:142:<BR>13482:error:2107A08B:PKCS7 routines:SMIME_read_PKCS7:pkcs7 parse error:pk7_mime.c:299:<BR><BR>When I'll try the same command later it might or might not get decrypted successful ... <BR>What does "header too long" mean in the context of SMIME decrypt (or "not enough data")?<BR><BR>Thanks,<BR>-- Beat<BR>______________________________________________________________________<BR>OpenSSL Project http://www.openssl.org<BR>User Support Mailing List openssl-***@openssl.org<BR>Automated List Manager ***@openssl.org<BR></BLOCKQUOTE>
--0-1683960573-1117624751=:57877--
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-***@openssl.org
Automated List Manager ***@openssl.org
Beat Jucker
2005-06-01 13:16:00 UTC
Permalink
Post by Peter Cope
Try using the asn1parser (an option with openssl).
no problem: asn1parse tells me

0:d=0 hl=2 l=inf cons: SEQUENCE
2:d=1 hl=2 l= 9 prim: OBJECT :pkcs7-envelopedData
...

But I'm realy confused because exactly the same message sometimes
might/mightnot decrypt. Could it have something todo with openssl
initialisation? Therefor I'm interested to know the possible reasons of

openssl-0.9.6: error:0D06B078:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:139:
openssl-0.9.7: error:0D06B08E:asn1 encoding routines:ASN1_d2i_bio:not enough data:a_d2i_fp.c:240:

Thanks
-- Beat
Post by Peter Cope
I have an intermediate SMIME decrypting problem. I'm using following
cat email | openssl smime -decrypt -inkey mykey -recip mycert
This works usually without problems. But Emails from one particular
address I can decrypt only most of the time. Sometimes I'll get
Error reading S/MIME message
Error reading S/MIME message
When I'll try the same command later it might or might not get decrypted successful ...
What does "header too long" mean in the context of SMIME decrypt (or "not enough data")?
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-***@openssl.org
Automated List Manager ***@openssl.org
Loading...