[openssl-commits] [openssl] master update

Dr. Stephen Henson steve at openssl.org
Fri May 13 01:27:57 UTC 2016


The branch master has been updated
       via  f47e5647750d4443cbdd7fc2311f838f0f103112 (commit)
      from  3ec8a1cfd8e06e2308fc318d8071aa7b5ddda146 (commit)


- Log -----------------------------------------------------------------
commit f47e5647750d4443cbdd7fc2311f838f0f103112
Author: Dr. Stephen Henson <steve at openssl.org>
Date:   Thu May 12 17:13:50 2016 +0100

    Fix signer option and support format SMIME.
    
    Fix -signer option in smime utility to output signer certificates
    when verifying.
    
    Add support for format SMIME for -inform and -outform with cms and
    smime utilities.
    
    PR#4215
    
    Reviewed-by: Viktor Dukhovni <viktor at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 apps/apps.h  |  1 +
 apps/cms.c   |  8 ++++----
 apps/opt.c   |  4 +++-
 apps/smime.c | 10 +++++-----
 4 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/apps/apps.h b/apps/apps.h
index fc96d81..4b11dbc 100644
--- a/apps/apps.h
+++ b/apps/apps.h
@@ -410,6 +410,7 @@ typedef struct string_int_pair_st {
 # define OPT_FMT_HTTP            (1L <<  9)
 # define OPT_FMT_PVK             (1L << 10)
 # define OPT_FMT_PDE     (OPT_FMT_PEMDER | OPT_FMT_ENGINE)
+# define OPT_FMT_PDS     (OPT_FMT_PEMDER | OPT_FMT_SMIME)
 # define OPT_FMT_ANY     ( \
         OPT_FMT_PEMDER | OPT_FMT_PKCS12 | OPT_FMT_SMIME | \
         OPT_FMT_ENGINE | OPT_FMT_MSBLOB | OPT_FMT_NETSCAPE | \
diff --git a/apps/cms.c b/apps/cms.c
index 7bc40d5..84cea9d 100644
--- a/apps/cms.c
+++ b/apps/cms.c
@@ -134,8 +134,8 @@ OPTIONS cms_options[] = {
         "  cert.pem... recipient certs for encryption\n"},
     {OPT_HELP_STR, 1, '-', "Valid options are:\n"},
     {"help", OPT_HELP, '-', "Display this summary"},
-    {"inform", OPT_INFORM, 'F', "Input format SMIME (default), PEM or DER"},
-    {"outform", OPT_OUTFORM, 'F',
+    {"inform", OPT_INFORM, 'c', "Input format SMIME (default), PEM or DER"},
+    {"outform", OPT_OUTFORM, 'c',
      "Output format SMIME (default), PEM or DER"},
     {"in", OPT_IN, '<', "Input file"},
     {"out", OPT_OUT, '>', "Output file"},
@@ -278,11 +278,11 @@ int cms_main(int argc, char **argv)
             ret = 0;
             goto end;
         case OPT_INFORM:
-            if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &informat))
+            if (!opt_format(opt_arg(), OPT_FMT_PDS, &informat))
                 goto opthelp;
             break;
         case OPT_OUTFORM:
-            if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &outformat))
+            if (!opt_format(opt_arg(), OPT_FMT_PDS, &outformat))
                 goto opthelp;
             break;
         case OPT_OUT:
diff --git a/apps/opt.c b/apps/opt.c
index 82ac5a8..84e8661 100644
--- a/apps/opt.c
+++ b/apps/opt.c
@@ -180,7 +180,7 @@ char *opt_init(int ac, char **av, const OPTIONS *o)
         switch (i) {
         case   0: case '-': case '/': case '<': case '>': case 'E': case 'F':
         case 'M': case 'U': case 'f': case 'l': case 'n': case 'p': case 's':
-        case 'u':
+        case 'u': case 'c':
             break;
         default:
             assert(0);
@@ -756,10 +756,12 @@ int opt_next(void)
                 return -1;
             }
             break;
+        case 'c':
         case 'E':
         case 'F':
         case 'f':
             if (opt_format(arg,
+                           o->valtype == 'c' ? OPT_FMT_PDS :
                            o->valtype == 'E' ? OPT_FMT_PDE :
                            o->valtype == 'F' ? OPT_FMT_PEMDER
                            : OPT_FMT_ANY, &ival))
diff --git a/apps/smime.c b/apps/smime.c
index 3257a23..cd68e55 100644
--- a/apps/smime.c
+++ b/apps/smime.c
@@ -115,15 +115,15 @@ OPTIONS smime_options[] = {
     {"noattr", OPT_NOATTR, '-', "Don't include any signed attributes"},
     {"binary", OPT_BINARY, '-', "Don't translate message to text"},
     {"certfile", OPT_CERTFILE, '<', "Other certificates file"},
-    {"signer", OPT_SIGNER, '<', "Signer certificate file"},
+    {"signer", OPT_SIGNER, 's', "Signer certificate file"},
     {"recip", OPT_RECIP, '<', "Recipient certificate file for decryption"},
     {"in", OPT_IN, '<', "Input file"},
-    {"inform", OPT_INFORM, 'F', "Input format SMIME (default), PEM or DER"},
+    {"inform", OPT_INFORM, 'c', "Input format SMIME (default), PEM or DER"},
     {"inkey", OPT_INKEY, '<',
      "Input private key (if not signer or recipient)"},
     {"keyform", OPT_KEYFORM, 'f', "Input private key format (PEM or ENGINE)"},
     {"out", OPT_OUT, '>', "Output file"},
-    {"outform", OPT_OUTFORM, 'F',
+    {"outform", OPT_OUTFORM, 'c',
      "Output format SMIME (default), PEM or DER"},
     {"content", OPT_CONTENT, '<',
      "Supply or override content for detached signature"},
@@ -200,14 +200,14 @@ int smime_main(int argc, char **argv)
             ret = 0;
             goto end;
         case OPT_INFORM:
-            if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &informat))
+            if (!opt_format(opt_arg(), OPT_FMT_PDS, &informat))
                 goto opthelp;
             break;
         case OPT_IN:
             infile = opt_arg();
             break;
         case OPT_OUTFORM:
-            if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &outformat))
+            if (!opt_format(opt_arg(), OPT_FMT_PDS, &outformat))
                 goto opthelp;
             break;
         case OPT_OUT:


More information about the openssl-commits mailing list