S/MIME decoder

I wrote this simple tool because I was sometimes receiving S/MIME signed messages with non-detached signatures that couldn't be easily read in console mail readers (e.g. in pine). Of course I could have used openssl smime command line tool, but it needs some weird parameters to work. So I took this opportunity to write something that uses the OpenSSL library.

It can work either as a filter in which case it doesn't take any argument, or it can take a filename as an argument.

Get the source
smime-decode.c (Colorized)
$ gcc -o smime-decode smime-decode.c -lcrypto
Get the test file
signed with a detached or embedded signature
Test it
$ ./smime-decode test.txt.detached
This is a funny message, isn't it?
[Detached signature verified]
$ ./smime-decode test.txt.embedded
This is a funny message, isn't it?
[Embedded signature verified]
Place for your feedback...
21st October 2005 at 9:59
I had to add:
to solve X509_LOOKUP errors.
Nice prog :D
Aug 12   13:15 email (by asdas)
Oct 21   9:59 oops (by tritt)
Mar 3   13:57 thanks (by fsgd)
Oct 10   9:21 X509_LOOKUP’ undeclared (by jens)
Jun 29   20:57 Re: X509_LOOKUP’ undeclared (by Jaewoo Kim)