From 940a26c0cf66647a20e2009986b561d710ce19d8 Mon Sep 17 00:00:00 2001 From: schwarze Date: Tue, 14 Dec 2021 15:46:48 +0000 Subject: [PATCH] document the very quirky behaviour of the SMIME_OLDMIME flag --- lib/libcrypto/man/SMIME_write_PKCS7.3 | 42 +++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/lib/libcrypto/man/SMIME_write_PKCS7.3 b/lib/libcrypto/man/SMIME_write_PKCS7.3 index 4257a890184..c1a9f051d07 100644 --- a/lib/libcrypto/man/SMIME_write_PKCS7.3 +++ b/lib/libcrypto/man/SMIME_write_PKCS7.3 @@ -1,7 +1,24 @@ -.\" $OpenBSD: SMIME_write_PKCS7.3,v 1.8 2021/12/13 17:24:39 schwarze Exp $ +.\" $OpenBSD: SMIME_write_PKCS7.3,v 1.9 2021/12/14 15:46:48 schwarze Exp $ .\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" -.\" This file was written by Dr. Stephen Henson . +.\" This file is a derived work. +.\" The changes are covered by the following Copyright and license: +.\" +.\" Copyright (c) 2021 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" The original file was written by Dr. Stephen Henson . .\" Copyright (c) 2002, 2003, 2006, 2007, 2015 The OpenSSL Project. .\" All rights reserved. .\" @@ -49,7 +66,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 13 2021 $ +.Dd $Mdocdate: December 14 2021 $ .Dt SMIME_WRITE_PKCS7 3 .Os .Sh NAME @@ -115,6 +132,25 @@ was also set in the previous call to or .Xr PKCS7_encrypt 3 . .Pp +The bit +.Dv SMIME_OLDMIME +is inverted before passing on the +.Fa flags +to +.Xr SMIME_write_ASN1 3 . +Consequently, if this bit is set in the +.Fa flags +argument, +.Qq application/pkcs7-mime +or +.Qq application/pkcs7-signature +is used in Content-Type headers. +Otherwise, +.Qq application/x-pkcs7-mime +or +.Qq application/x-pkcs7-signature +is used. +.Pp If cleartext signing is being used and .Dv PKCS7_STREAM is not set, then the data must be read twice: once to compute the -- 2.20.1