Hello,

We use a perl script to decrypt smime mails automatically. The script uses
the command line openssl tool for the crypto work and used to work
correctly. Only when we started to use a new certificate, the application
ceased to work.

We use the following command:

      my $cmd =  "openssl smime -decrypt -in tmp.txt -passin pass:<password>
-recip <certificate>.pem | openssl smime -verify -noverify";
      my $pid = open3 (gensym, \*OUT, ">&ERR", $cmd);

(the open3 thing is used in order to catch both STDOUT and STDERR quietly so
the script can be crontabbed). With the old certificate this worked without
any problems, with the new certificate we get the following errors:

error in mail <email subject>
Error reading S/MIME message
28707:error:0D06B078:asn1 encoding routines:ASN1_get_object:header too
long:asn1_lib.c:139:
28707:error:21078082:PKCS7 routines:B64_READ_PKCS7:decode
error:pk7_mime.c:142:
28707:error:2107A08B:PKCS7 routines:SMIME_read_PKCS7:pkcs7 parse
error:pk7_mime.c:299:
Error reading S/MIME message
28708:error:2107A087:PKCS7 routines:SMIME_read_PKCS7:no content
type:pk7_mime.c:222:

This happens for all mails. I tested the signing and the decrypting bit
seperately, with identical results for both. If I use 

openssl verify -verbose -purpose smimeencrypt <certificate>.pem

the result is (blanked out all potentially sensitive info):

<certificate>.pem: /O=<company sending the mails to us>/OU=BU VT BPG
Expl/OU=Company Name - <our company>/OU=Prefix - 1665/CN=<our contact
person>/Email=<email address where the mails are sent to>
error 20 at 0 depth lookup:unable to get local issuer certificate

This result is identical for the old and the new certificate.

Anyone any idea of how to solve this?

Thanks in advance,

Theo


#***************************************************************************
# 
# Dit e-mailbericht met eventuele attachments is uitsluitend bestemd voor de
# geadresseerde(n) en bevat mogelijk vertrouwelijke gegevens en/of is
# beschermd door intellectuele eigendomsrechten. Bent u niet de
# geadresseerde, neemt u dan zo spoedig mogelijk contact op met de afzender
# en verzoeken wij u het e-mailbericht en eventuele attachments van uw
# computer te verwijderen. Elk gebruik van de inhoud van dit e-mailbericht
# en eventuele attachments (waaronder verveelvoudiging, verspreiding of het
# anderzins openbaar maken in welke vorm dan ook) door andere personen dan
# de bedoelde geadresseerden is verboden. De weergegeven mening is puur
# persoonlijk en hoeft niet noodzakelijk over een te komen met die van
# Enertel. Enertel is niet aansprakelijk voor de inhoud van dit
# e-mailbericht en eventuele attachments.


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to