diff options
author | Richard Levitte <levitte@openssl.org> | 2002-07-18 08:47:33 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2002-07-18 08:47:33 +0000 |
commit | 8e6cbcd7c0c661016f25f4782fb5f662b4dff140 (patch) | |
tree | 2bb0558a209033232ba82d8743ccca5ed5114f54 /crypto/pkcs7/pk7_mime.c | |
parent | 9335a5f7c07cf16d3d167edee078b33c8dab725d (diff) | |
download | openssl-8e6cbcd7c0c661016f25f4782fb5f662b4dff140.tar.gz |
Make S/MIME output conform with the mail and MIME standards.
PR: 151
Diffstat (limited to 'crypto/pkcs7/pk7_mime.c')
-rw-r--r-- | crypto/pkcs7/pk7_mime.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/crypto/pkcs7/pk7_mime.c b/crypto/pkcs7/pk7_mime.c index 086d394270..d5fb9ec8a7 100644 --- a/crypto/pkcs7/pk7_mime.c +++ b/crypto/pkcs7/pk7_mime.c @@ -164,34 +164,34 @@ int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags) bound[i] = c; } bound[32] = 0; - BIO_printf(bio, "MIME-Version: 1.0\n"); + BIO_printf(bio, "MIME-Version: 1.0\r\n"); BIO_printf(bio, "Content-Type: multipart/signed;"); BIO_printf(bio, " protocol=\"application/x-pkcs7-signature\";"); - BIO_printf(bio, " micalg=sha1; boundary=\"----%s\"\n\n", bound); + BIO_printf(bio, " micalg=sha1; boundary=\"----%s\"\r\n\r\n", bound); BIO_printf(bio, "This is an S/MIME signed message\n\n"); /* Now write out the first part */ - BIO_printf(bio, "------%s\n", bound); - if(flags & PKCS7_TEXT) BIO_printf(bio, "Content-Type: text/plain\n\n"); + BIO_printf(bio, "------%s\r\n", bound); + if(flags & PKCS7_TEXT) BIO_printf(bio, "Content-Type: text/plain\r\n\r\n"); while((i = BIO_read(data, linebuf, MAX_SMLEN)) > 0) BIO_write(bio, linebuf, i); - BIO_printf(bio, "\n------%s\n", bound); + BIO_printf(bio, "\r\n------%s\r\n", bound); /* Headers for signature */ - BIO_printf(bio, "Content-Type: application/x-pkcs7-signature; name=\"smime.p7s\"\n"); - BIO_printf(bio, "Content-Transfer-Encoding: base64\n"); - BIO_printf(bio, "Content-Disposition: attachment; filename=\"smime.p7s\"\n\n"); + BIO_printf(bio, "Content-Type: application/x-pkcs7-signature; name=\"smime.p7s\"\r\n"); + BIO_printf(bio, "Content-Transfer-Encoding: base64\r\n"); + BIO_printf(bio, "Content-Disposition: attachment; filename=\"smime.p7s\"\r\n\r\n"); B64_write_PKCS7(bio, p7); - BIO_printf(bio,"\n------%s--\n\n", bound); + BIO_printf(bio,"\r\n------%s--\r\n\r\n", bound); return 1; } /* MIME headers */ - BIO_printf(bio, "MIME-Version: 1.0\n"); - BIO_printf(bio, "Content-Disposition: attachment; filename=\"smime.p7m\"\n"); - BIO_printf(bio, "Content-Type: application/x-pkcs7-mime; name=\"smime.p7m\"\n"); - BIO_printf(bio, "Content-Transfer-Encoding: base64\n\n"); + BIO_printf(bio, "MIME-Version: 1.0\r\n"); + BIO_printf(bio, "Content-Disposition: attachment; filename=\"smime.p7m\"\r\n"); + BIO_printf(bio, "Content-Type: application/x-pkcs7-mime; name=\"smime.p7m\"\r\n"); + BIO_printf(bio, "Content-Transfer-Encoding: base64\r\n\r\n"); B64_write_PKCS7(bio, p7); - BIO_printf(bio, "\n"); + BIO_printf(bio, "\r\n"); return 1; } |