[openssl-commits] [openssl] master update

Dr. Stephen Henson steve at openssl.org
Thu May 19 21:43:41 UTC 2016


The branch master has been updated
       via  2197494da6a2f4b1cc7024bb647c775f277f53c5 (commit)
      from  6c4be50a5d775866e79b2f58fafb23a862bd38b2 (commit)


- Log -----------------------------------------------------------------
commit 2197494da6a2f4b1cc7024bb647c775f277f53c5
Author: Dr. Stephen Henson <steve at openssl.org>
Date:   Thu May 19 17:22:57 2016 +0100

    Use correct EOL in headers.
    
    RT#1817
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

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

Summary of changes:
 apps/cms.c         | 8 +++++---
 apps/smime.c       | 8 +++++---
 doc/apps/cms.pod   | 6 ++++++
 doc/apps/smime.pod | 7 +++++++
 4 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/apps/cms.c b/apps/cms.c
index 1c3069f..3a9b7af 100644
--- a/apps/cms.c
+++ b/apps/cms.c
@@ -216,6 +216,7 @@ int cms_main(int argc, char **argv)
     unsigned char *pwri_pass = NULL, *pwri_tmp = NULL;
     unsigned char *secret_key = NULL, *secret_keyid = NULL;
     long ltmp;
+    const char *mime_eol = "\n";
     OPTION_CHOICE o;
 
     if ((vpm = X509_VERIFY_PARAM_new()) == NULL)
@@ -348,6 +349,7 @@ int cms_main(int argc, char **argv)
             flags |= CMS_NOOLDMIMETYPE;
             break;
         case OPT_CRLFEOL:
+            mime_eol = "\r\n";
             flags |= CMS_CRLFEOL;
             break;
         case OPT_NOOUT:
@@ -1040,11 +1042,11 @@ int cms_main(int argc, char **argv)
                 CMS_ContentInfo_print_ctx(out, cms, 0, NULL);
         } else if (outformat == FORMAT_SMIME) {
             if (to)
-                BIO_printf(out, "To: %s\n", to);
+                BIO_printf(out, "To: %s%s", to, mime_eol);
             if (from)
-                BIO_printf(out, "From: %s\n", from);
+                BIO_printf(out, "From: %s%s", from, mime_eol);
             if (subject)
-                BIO_printf(out, "Subject: %s\n", subject);
+                BIO_printf(out, "Subject: %s%s", subject, mime_eol);
             if (operation == SMIME_RESIGN)
                 ret = SMIME_write_CMS(out, cms, indata, flags);
             else
diff --git a/apps/smime.c b/apps/smime.c
index ae1b017..f9f3d23 100644
--- a/apps/smime.c
+++ b/apps/smime.c
@@ -134,6 +134,7 @@ int smime_main(int argc, char **argv)
         FORMAT_PEM;
     int vpmtouched = 0, rv = 0;
     ENGINE *e = NULL;
+    const char *mime_eol = "\n";
 
     if ((vpm = X509_VERIFY_PARAM_new()) == NULL)
         return 1;
@@ -224,6 +225,7 @@ int smime_main(int argc, char **argv)
             break;
         case OPT_CRLFEOL:
             flags |= PKCS7_CRLFEOL;
+            mime_eol = "\r\n";
             break;
         case OPT_RAND:
             inrand = opt_arg();
@@ -574,11 +576,11 @@ int smime_main(int argc, char **argv)
         PEM_write_bio_PKCS7(out, p7);
     else {
         if (to)
-            BIO_printf(out, "To: %s\n", to);
+            BIO_printf(out, "To: %s%s", to, mime_eol);
         if (from)
-            BIO_printf(out, "From: %s\n", from);
+            BIO_printf(out, "From: %s%s", from, mime_eol);
         if (subject)
-            BIO_printf(out, "Subject: %s\n", subject);
+            BIO_printf(out, "Subject: %s%s", subject, mime_eol);
         if (outformat == FORMAT_SMIME) {
             if (operation == SMIME_RESIGN)
                 rv = SMIME_write_PKCS7(out, p7, indata, flags);
diff --git a/doc/apps/cms.pod b/doc/apps/cms.pod
index 2c75664..4876ef1 100644
--- a/doc/apps/cms.pod
+++ b/doc/apps/cms.pod
@@ -74,6 +74,7 @@ B<openssl> B<cms>
 [B<-noattr>]
 [B<-nosmimecap>]
 [B<-binary>]
+[B<-crlfeol>]
 [B<-asciicrlf>]
 [B<-nodetach>]
 [B<-certfile file>]
@@ -340,6 +341,11 @@ effectively using CR and LF as end of line: as required by the S/MIME
 specification. When this option is present no translation occurs. This
 is useful when handling binary data which may not be in MIME format.
 
+=item B<-crlfeol>
+
+normally the output file uses a single B<LF> as end of line. When this
+option is present B<CRLF> is used instead.
+
 =item B<-asciicrlf>
 
 when signing use ASCII CRLF format canonicalisation. This strips trailing
diff --git a/doc/apps/smime.pod b/doc/apps/smime.pod
index 8b58ccc..4dc7378 100644
--- a/doc/apps/smime.pod
+++ b/doc/apps/smime.pod
@@ -14,6 +14,8 @@ B<openssl> B<smime>
 [B<-resign>]
 [B<-verify>]
 [B<-pk7out>]
+[B<-binary>]
+[B<-crlfeol>]
 [B<-[cipher]>]
 [B<-in file>]
 [B<-CAfile file>]
@@ -245,6 +247,11 @@ effectively using CR and LF as end of line: as required by the S/MIME
 specification. When this option is present no translation occurs. This
 is useful when handling binary data which may not be in MIME format.
 
+=item B<-crlfeol>
+
+normally the output file uses a single B<LF> as end of line. When this
+option is present B<CRLF> is used instead.
+
 =item B<-nodetach>
 
 when signing a message use opaque signing: this form is more resistant


More information about the openssl-commits mailing list