Commit 5f447011a4 for openssl.org

commit 5f447011a4c42b1b4b6fd9266385b6a61961a9ef
Author: Dr. David von Oheimb <dev@ddvo.net>
Date:   Wed Feb 4 10:36:31 2026 +0100

    CMS/PKCS#7 doc: Fix inconsistencies and missing detail w.r.t. smimesign and smimeencrypt purposes

    * Fix inconsistent doc (so far using purpose names smime_sign and smime_encrypt) vs. implementation
    * Add the info that "smimesign" is the default purpose here.

    Reviewed-by: Paul Dale <paul.dale@oracle.com>
    Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
    MergeDate: Fri Mar 27 06:25:20 2026
    (Merged from https://github.com/openssl/openssl/pull/18914)

diff --git a/doc/man1/openssl-verification-options.pod b/doc/man1/openssl-verification-options.pod
index 7ad8c111cd..ffaae0b91d 100644
--- a/doc/man1/openssl-verification-options.pod
+++ b/doc/man1/openssl-verification-options.pod
@@ -532,7 +532,7 @@ and thus the commands L<openssl-s_client(1)> and L<openssl-s_server(1)>
 check for consistency with
 TLS server (C<sslserver>) or TLS client use (C<sslclient>), respectively.
 By default, CMS signature validation, which can be done via L<openssl-cms(1)>,
-checks for consistency with S/MIME signing use (C<smimesign>).
+checks for consistency with the S/MIME signing purpose (C<smimesign>).

 While IETF RFC 5280 says that B<id-kp-serverAuth> and B<id-kp-clientAuth>
 are only for WWW use, in practice they are used for all kinds of TLS clients
diff --git a/doc/man3/CMS_verify.pod b/doc/man3/CMS_verify.pod
index bfcd97017b..9ec172468d 100644
--- a/doc/man3/CMS_verify.pod
+++ b/doc/man3/CMS_verify.pod
@@ -88,8 +88,11 @@ the I<certs> parameter (if it is not NULL) and then looking in any
 certificates contained in the I<cms> structure unless B<CMS_NOINTERN> is set.
 If any signing certificate cannot be located the operation fails.

-Each signing certificate is chain verified using the I<smimesign> purpose and
+Each signing certificate is chain verified
 using the trusted certificate store I<store> if supplied.
+The purpose required in this verification is I<smimesign>
+unless a different one (or B<X509_PURPOSE_DEFAULT_ANY>)
+has been set in I<store> using L<X509_STORE_set_purpose(3)>.
 Any internal certificates in the message, which may have been added using
 L<CMS_add1_cert(3)>, are used as untrusted CAs.
 If CRL checking is enabled in I<store> and B<CMS_NOCRL> is not set,
@@ -176,6 +179,7 @@ be held in memory if it is not detached.
 =head1 SEE ALSO

 L<PKCS7_verify(3)>, L<CMS_add1_cert(3)>, L<CMS_add1_crl(3)>,
+L<X509_STORE_set_purpose(3)>,
 L<OSSL_ESS_check_signing_certs(3)>,
 L<ERR_get_error(3)>, L<CMS_sign(3)>

diff --git a/doc/man3/PKCS7_verify.pod b/doc/man3/PKCS7_verify.pod
index 17131b0c90..3dd30b63bf 100644
--- a/doc/man3/PKCS7_verify.pod
+++ b/doc/man3/PKCS7_verify.pod
@@ -73,8 +73,11 @@ the I<certs> parameter (if it is not NULL). Then they are looked up in any
 certificates contained in the I<p7> structure unless B<PKCS7_NOINTERN> is set.
 If any signer's certificates cannot be located the operation fails.

-Each signer's certificate is chain verified using the B<smimesign> purpose and
+Each signer's certificate is chain verified
 using the trusted certificate store I<store> if supplied.
+The purpose required in this verification is I<smimesign>
+unless a different one (or B<X509_PURPOSE_DEFAULT_ANY>) has been set in
+I<store> using L<X509_STORE_set_purpose(3)> and unless B<PKCS7_NOCHAIN> is set.
 Any internal certificates in the message, which may have been added using
 L<PKCS7_add_certificate(3)>, are used as untrusted CAs unless B<PKCS7_NOCHAIN>
 is set.
@@ -151,6 +154,7 @@ be held in memory if it is not detached.
 =head1 SEE ALSO

 L<CMS_verify(3)>, L<PKCS7_add_certificate(3)>, L<PKCS7_add_crl(3)>,
+L<X509_STORE_set_purpose(3)>,
 L<ERR_get_error(3)>, L<PKCS7_sign(3)>

 =head1 COPYRIGHT