Ouch! PKCS7_encrypt() was heading MIME text headers twice
authorDr. Stephen Henson <steve@openssl.org>
Mon, 28 Feb 2000 14:11:19 +0000 (14:11 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Mon, 28 Feb 2000 14:11:19 +0000 (14:11 +0000)
because it added them manually and as part of SMIME_crlf_copy().
Removed the manual add.

CHANGES
crypto/pkcs7/pk7_smime.c

diff --git a/CHANGES b/CHANGES
index 3bab83fb4be6fc8764aa5373e256b01ae901f5c4..bf61913d7b01212b4d8b2f3c13d71d645914f67c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,10 @@
 
  Changes between 0.9.4 and 0.9.5  [28 Feb 2000]
 
+  *) PKCS7_encrypt() was adding text MIME headers twice because they
+     were added manually and by SMIME_crlf_copy().
+     [Steve Henson]
+
   *) In bntest.c don't call BN_rand with zero bits argument.
      [Steve Henson, pointed out by Andrew W. Gray <agray@iconsinc.com>]
 
index 17e51941c7113710f1509e2395e808e78902e9a1..b41f42ed04467216821c62a4e257d18eeaaf26ab 100644 (file)
@@ -329,7 +329,6 @@ PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, EVP_CIPHER *cipher,
        BIO *p7bio = NULL;
        int i;
        X509 *x509;
-       static char txthdr[] = "Content-type: text/plain\r\n\r\n";
        if(!(p7 = PKCS7_new())) {
                PKCS7err(PKCS7_F_PKCS7_ENCRYPT,ERR_R_MALLOC_FAILURE);
                return NULL;
@@ -355,12 +354,6 @@ PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, EVP_CIPHER *cipher,
                goto err;
        }
 
-       if(flags & PKCS7_TEXT) {
-               if(BIO_write(p7bio, txthdr, sizeof(txthdr) - 1) < 0) {
-                       goto err;
-               }
-       }
-
        SMIME_crlf_copy(in, p7bio, flags);
 
        BIO_flush(p7bio);