summaryrefslogtreecommitdiffstats
path: root/apps/cms.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2008-03-24 21:53:07 +0000
committerDr. Stephen Henson <steve@openssl.org>2008-03-24 21:53:07 +0000
commit6205171362d8a0c07a84d07c425f540507e5f685 (patch)
treeb077a45bedc8d703426f7a127902cc86e8f51fa3 /apps/cms.c
parentab568a17cfc11204b4576bf78b5d609dc6dd3b4f (diff)
Add support for CMS structure printing in cms utility.
Diffstat (limited to 'apps/cms.c')
-rw-r--r--apps/cms.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/apps/cms.c b/apps/cms.c
index 70847d90b7..9607ec5920 100644
--- a/apps/cms.c
+++ b/apps/cms.c
@@ -110,7 +110,7 @@ int MAIN(int argc, char **argv)
STACK_OF(X509) *encerts = NULL, *other = NULL;
BIO *in = NULL, *out = NULL, *indata = NULL;
int badarg = 0;
- int flags = CMS_DETACHED;
+ int flags = CMS_DETACHED, noout = 0, print = 0;
char *to = NULL, *from = NULL, *subject = NULL;
char *CAfile = NULL, *CApath = NULL;
char *passargin = NULL, *passin = NULL;
@@ -242,6 +242,13 @@ int MAIN(int argc, char **argv)
flags |= CMS_NOOLDMIMETYPE;
else if (!strcmp (*args, "-crlfeol"))
flags |= CMS_CRLFEOL;
+ else if (!strcmp (*args, "-noout"))
+ noout = 1;
+ else if (!strcmp (*args, "-print"))
+ {
+ noout = 1;
+ print = 1;
+ }
else if (!strcmp(*args,"-secretkey"))
{
long ltmp;
@@ -935,7 +942,12 @@ int MAIN(int argc, char **argv)
}
else
{
- if (outformat == FORMAT_SMIME)
+ if (noout)
+ {
+ if (print)
+ CMS_ContentInfo_print_ctx(out, cms, 0, NULL);
+ }
+ else if (outformat == FORMAT_SMIME)
{
if (to)
BIO_printf(out, "To: %s\n", to);