Blame SOURCES/openssl-1.0.2m-trusted-first-doc.patch

96a864
diff -up openssl-1.0.2m/apps/cms.c.trusted-first openssl-1.0.2m/apps/cms.c
96a864
--- openssl-1.0.2m/apps/cms.c.trusted-first	2017-11-02 15:32:57.000000000 +0100
96a864
+++ openssl-1.0.2m/apps/cms.c	2017-11-13 09:08:18.613672265 +0100
96a864
@@ -644,6 +644,8 @@ int MAIN(int argc, char **argv)
96a864
                    "-CApath dir    trusted certificates directory\n");
96a864
         BIO_printf(bio_err, "-CAfile file   trusted certificates file\n");
96a864
         BIO_printf(bio_err,
96a864
+                   "-trusted_first use trusted certificates first when building the trust chain\n");
96a864
+        BIO_printf(bio_err,
96a864
                    "-no_alt_chains only ever use the first certificate chain found\n");
96a864
         BIO_printf(bio_err,
96a864
                    "-crl_check     check revocation status of signer's certificate using CRLs\n");
96a864
diff -up openssl-1.0.2m/apps/ocsp.c.trusted-first openssl-1.0.2m/apps/ocsp.c
96a864
--- openssl-1.0.2m/apps/ocsp.c.trusted-first	2017-11-02 15:32:57.000000000 +0100
96a864
+++ openssl-1.0.2m/apps/ocsp.c	2017-11-13 09:08:18.613672265 +0100
96a864
@@ -537,6 +537,8 @@ int MAIN(int argc, char **argv)
96a864
         BIO_printf(bio_err,
96a864
                    "-CAfile file         trusted certificates file\n");
96a864
         BIO_printf(bio_err,
96a864
+                   "-trusted_first       use trusted certificates first when building the trust chain\n");
96a864
+        BIO_printf(bio_err,
96a864
                    "-no_alt_chains       only ever use the first certificate chain found\n");
96a864
         BIO_printf(bio_err,
96a864
                    "-VAfile file         validator certificates file\n");
96a864
diff -up openssl-1.0.2m/apps/s_client.c.trusted-first openssl-1.0.2m/apps/s_client.c
96a864
--- openssl-1.0.2m/apps/s_client.c.trusted-first	2017-11-13 09:08:18.571671320 +0100
96a864
+++ openssl-1.0.2m/apps/s_client.c	2017-11-13 09:08:18.613672265 +0100
96a864
@@ -334,6 +334,8 @@ static void sc_usage(void)
96a864
     BIO_printf(bio_err, " -CApath arg   - PEM format directory of CA's\n");
96a864
     BIO_printf(bio_err, " -CAfile arg   - PEM format file of CA's\n");
96a864
     BIO_printf(bio_err,
96a864
+               " -trusted_first - Use trusted CA's first when building the trust chain\n");
96a864
+    BIO_printf(bio_err,
96a864
                " -no_alt_chains - only ever use the first certificate chain found\n");
96a864
     BIO_printf(bio_err,
96a864
                " -reconnect    - Drop and re-make the connection with the same Session-ID\n");
96a864
diff -up openssl-1.0.2m/apps/smime.c.trusted-first openssl-1.0.2m/apps/smime.c
96a864
--- openssl-1.0.2m/apps/smime.c.trusted-first	2017-11-02 15:32:57.000000000 +0100
96a864
+++ openssl-1.0.2m/apps/smime.c	2017-11-13 09:08:18.614672288 +0100
96a864
@@ -440,6 +440,8 @@ int MAIN(int argc, char **argv)
96a864
                    "-CApath dir    trusted certificates directory\n");
96a864
         BIO_printf(bio_err, "-CAfile file   trusted certificates file\n");
96a864
         BIO_printf(bio_err,
96a864
+                   "-trusted_first use trusted certificates first when building the trust chain\n");
96a864
+        BIO_printf(bio_err,
96a864
                    "-no_alt_chains only ever use the first certificate chain found\n");
96a864
         BIO_printf(bio_err,
96a864
                    "-crl_check     check revocation status of signer's certificate using CRLs\n");
96a864
diff -up openssl-1.0.2m/apps/s_server.c.trusted-first openssl-1.0.2m/apps/s_server.c
96a864
--- openssl-1.0.2m/apps/s_server.c.trusted-first	2017-11-13 09:08:18.560671072 +0100
96a864
+++ openssl-1.0.2m/apps/s_server.c	2017-11-13 09:08:18.614672288 +0100
96a864
@@ -572,6 +572,8 @@ static void sv_usage(void)
96a864
     BIO_printf(bio_err, " -CApath arg   - PEM format directory of CA's\n");
96a864
     BIO_printf(bio_err, " -CAfile arg   - PEM format file of CA's\n");
96a864
     BIO_printf(bio_err,
96a864
+               " -trusted_first - Use trusted CA's first when building the trust chain\n");
96a864
+    BIO_printf(bio_err,
96a864
                " -no_alt_chains - only ever use the first certificate chain found\n");
96a864
     BIO_printf(bio_err,
96a864
                " -nocert       - Don't use any certificates (Anon-DH)\n");
96a864
diff -up openssl-1.0.2m/apps/s_time.c.trusted-first openssl-1.0.2m/apps/s_time.c
96a864
--- openssl-1.0.2m/apps/s_time.c.trusted-first	2017-11-13 09:08:18.526670306 +0100
96a864
+++ openssl-1.0.2m/apps/s_time.c	2017-11-13 09:08:18.614672288 +0100
96a864
@@ -182,6 +182,7 @@ static void s_time_usage(void)
96a864
                 file if not specified by this option\n\
96a864
 -CApath arg   - PEM format directory of CA's\n\
96a864
 -CAfile arg   - PEM format file of CA's\n\
96a864
+-trusted_first - Use trusted CA's first when building the trust chain\n\
96a864
 -cipher       - preferred cipher to use, play with 'openssl ciphers'\n\n";
96a864
 
96a864
     printf("usage: s_time <args>\n\n");
96a864
diff -up openssl-1.0.2m/apps/ts.c.trusted-first openssl-1.0.2m/apps/ts.c
96a864
--- openssl-1.0.2m/apps/ts.c.trusted-first	2017-11-13 09:08:18.569671275 +0100
96a864
+++ openssl-1.0.2m/apps/ts.c	2017-11-13 09:08:18.614672288 +0100
96a864
@@ -352,7 +352,7 @@ int MAIN(int argc, char **argv)
96a864
                "ts -verify [-data file_to_hash] [-digest digest_bytes] "
96a864
                "[-queryfile request.tsq] "
96a864
                "-in response.tsr [-token_in] "
96a864
-               "-CApath ca_path -CAfile ca_file.pem "
96a864
+               "-CApath ca_path -CAfile ca_file.pem -trusted_first"
96a864
                "-untrusted cert_file.pem\n");
96a864
  cleanup:
96a864
     /* Clean up. */
96a864
diff -up openssl-1.0.2m/apps/verify.c.trusted-first openssl-1.0.2m/apps/verify.c
96a864
--- openssl-1.0.2m/apps/verify.c.trusted-first	2017-11-02 15:32:57.000000000 +0100
96a864
+++ openssl-1.0.2m/apps/verify.c	2017-11-13 09:08:18.615672310 +0100
96a864
@@ -227,7 +227,7 @@ int MAIN(int argc, char **argv)
96a864
  usage:
96a864
     if (ret == 1) {
96a864
         BIO_printf(bio_err,
96a864
-                   "usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check]");
96a864
+                   "usage: verify [-verbose] [-CApath path] [-CAfile file] [-trusted_first] [-purpose purpose] [-crl_check]");
96a864
         BIO_printf(bio_err, " [-no_alt_chains] [-attime timestamp]");
96a864
 #ifndef OPENSSL_NO_ENGINE
96a864
         BIO_printf(bio_err, " [-engine e]");
96a864
diff -up openssl-1.0.2m/doc/apps/cms.pod.trusted-first openssl-1.0.2m/doc/apps/cms.pod
96a864
--- openssl-1.0.2m/doc/apps/cms.pod.trusted-first	2017-11-02 15:32:58.000000000 +0100
96a864
+++ openssl-1.0.2m/doc/apps/cms.pod	2017-11-13 09:08:18.615672310 +0100
96a864
@@ -36,6 +36,7 @@ B<openssl> B<cms>
96a864
 [B<-print>]
96a864
 [B<-CAfile file>]
96a864
 [B<-CApath dir>]
96a864
+[B<-trusted_first>]
96a864
 [B<-no_alt_chains>]
96a864
 [B<-md digest>]
96a864
 [B<-[cipher]>]
96a864
@@ -249,6 +250,12 @@ B<-verify>. This directory must be a sta
96a864
 is a hash of each subject name (using B<x509 -hash>) should be linked
96a864
 to each certificate.
96a864
 
96a864
+=item B<-trusted_first>
96a864
+
96a864
+Use certificates in CA file or CA directory before untrusted certificates
96a864
+from the message when building the trust chain to verify certificates.
96a864
+This is mainly useful in environments with Bridge CA or Cross-Certified CAs.
96a864
+
96a864
 =item B<-md digest>
96a864
 
96a864
 digest algorithm to use when signing or resigning. If not present then the
96a864
diff -up openssl-1.0.2m/doc/apps/ocsp.pod.trusted-first openssl-1.0.2m/doc/apps/ocsp.pod
96a864
--- openssl-1.0.2m/doc/apps/ocsp.pod.trusted-first	2017-11-13 09:08:18.569671275 +0100
96a864
+++ openssl-1.0.2m/doc/apps/ocsp.pod	2017-11-13 09:08:18.615672310 +0100
96a864
@@ -31,6 +31,7 @@ B<openssl> B<ocsp>
96a864
 [B<-path>]
96a864
 [B<-CApath dir>]
96a864
 [B<-CAfile file>]
96a864
+[B<-trusted_first>]
96a864
 [B<-no_alt_chains>]
96a864
 [B<-VAfile file>]
96a864
 [B<-validity_period n>]
96a864
@@ -154,6 +155,13 @@ connection timeout to the OCSP responder
96a864
 file or pathname containing trusted CA certificates. These are used to verify
96a864
 the signature on the OCSP response.
96a864
 
96a864
+=item B<-trusted_first>
96a864
+
96a864
+Use certificates in CA file or CA directory over certificates provided
96a864
+in the response or residing in other certificates file when building the trust
96a864
+chain to verify responder certificate.
96a864
+This is mainly useful in environments with Bridge CA or Cross-Certified CAs.
96a864
+
96a864
 =item B<-no_alt_chains>
96a864
 
96a864
 See L<B<verify>|verify(1)> manual page for details.
96a864
diff -up openssl-1.0.2m/doc/apps/s_client.pod.trusted-first openssl-1.0.2m/doc/apps/s_client.pod
96a864
--- openssl-1.0.2m/doc/apps/s_client.pod.trusted-first	2017-11-13 09:08:18.582671567 +0100
96a864
+++ openssl-1.0.2m/doc/apps/s_client.pod	2017-11-13 09:08:18.615672310 +0100
96a864
@@ -20,6 +20,7 @@ B<openssl> B<s_client>
96a864
 [B<-pass arg>]
96a864
 [B<-CApath directory>]
96a864
 [B<-CAfile filename>]
96a864
+[B<-trusted_first>]
96a864
 [B<-no_alt_chains>]
96a864
 [B<-reconnect>]
96a864
 [B<-pause>]
96a864
@@ -129,7 +130,7 @@ also used when building the client certi
96a864
 A file containing trusted certificates to use during server authentication
96a864
 and to use when attempting to build the client certificate chain.
96a864
 
96a864
-=item B<-purpose, -ignore_critical, -issuer_checks, -crl_check, -crl_check_all, -policy_check, -extended_crl, -x509_strict, -policy -check_ss_sig -no_alt_chains>
96a864
+=item B<-purpose, -ignore_critical, -issuer_checks, -crl_check, -crl_check_all, -policy_check, -extended_crl, -x509_strict, -policy -check_ss_sig, -trusted_first -no_alt_chains>
96a864
 
96a864
 Set various certificate chain valiadition option. See the
96a864
 L<B<verify>|verify(1)> manual page for details.
96a864
diff -up openssl-1.0.2m/doc/apps/smime.pod.trusted-first openssl-1.0.2m/doc/apps/smime.pod
96a864
--- openssl-1.0.2m/doc/apps/smime.pod.trusted-first	2017-11-02 15:32:58.000000000 +0100
96a864
+++ openssl-1.0.2m/doc/apps/smime.pod	2017-11-13 09:08:18.615672310 +0100
96a864
@@ -16,6 +16,9 @@ B<openssl> B<smime>
96a864
 [B<-pk7out>]
96a864
 [B<-[cipher]>]
96a864
 [B<-in file>]
96a864
+[B<-CAfile file>]
96a864
+[B<-CApath dir>]
96a864
+[B<-trusted_first>]
96a864
 [B<-no_alt_chains>]
96a864
 [B<-certfile file>]
96a864
 [B<-signer file>]
96a864
@@ -151,6 +154,12 @@ B<-verify>. This directory must be a sta
96a864
 is a hash of each subject name (using B<x509 -hash>) should be linked
96a864
 to each certificate.
96a864
 
96a864
+=item B<-trusted_first>
96a864
+
96a864
+Use certificates in CA file or CA directory over certificates provided
96a864
+in the message when building the trust chain to verify a certificate.
96a864
+This is mainly useful in environments with Bridge CA or Cross-Certified CAs.
96a864
+
96a864
 =item B<-md digest>
96a864
 
96a864
 digest algorithm to use when signing or resigning. If not present then the
96a864
diff -up openssl-1.0.2m/doc/apps/s_server.pod.trusted-first openssl-1.0.2m/doc/apps/s_server.pod
96a864
--- openssl-1.0.2m/doc/apps/s_server.pod.trusted-first	2017-11-13 09:08:18.583671590 +0100
96a864
+++ openssl-1.0.2m/doc/apps/s_server.pod	2017-11-13 09:09:04.706710088 +0100
96a864
@@ -34,6 +34,7 @@ B<openssl> B<s_server>
96a864
 [B<-state>]
96a864
 [B<-CApath directory>]
96a864
 [B<-CAfile filename>]
96a864
+[B<-trusted_first>]
96a864
 [B<-no_alt_chains>]
96a864
 [B<-nocert>]
96a864
 [B<-client_sigalgs sigalglist>]
96a864
@@ -183,6 +184,12 @@ and to use when attempting to build the
96a864
 is also used in the list of acceptable client CAs passed to the client when
96a864
 a certificate is requested.
96a864
 
96a864
+=item B<-trusted_first>
96a864
+
96a864
+Use certificates in CA file or CA directory before other certificates 
96a864
+when building the trust chain to verify client certificates.
96a864
+This is mainly useful in environments with Bridge CA or Cross-Certified CAs.
96a864
+
96a864
 =item B<-no_alt_chains>
96a864
 
96a864
 See the L<B<verify>|verify(1)> manual page for details.
96a864
diff -up openssl-1.0.2m/doc/apps/s_time.pod.trusted-first openssl-1.0.2m/doc/apps/s_time.pod
96a864
--- openssl-1.0.2m/doc/apps/s_time.pod.trusted-first	2017-11-02 15:32:58.000000000 +0100
96a864
+++ openssl-1.0.2m/doc/apps/s_time.pod	2017-11-13 09:08:18.616672333 +0100
96a864
@@ -15,6 +15,7 @@ B<openssl> B<s_time>
96a864
 [B<-key filename>]
96a864
 [B<-CApath directory>]
96a864
 [B<-CAfile filename>]
96a864
+[B<-trusted_first>]
96a864
 [B<-reuse>]
96a864
 [B<-new>]
96a864
 [B<-verify depth>]
96a864
@@ -77,6 +78,12 @@ also used when building the client certi
96a864
 A file containing trusted certificates to use during server authentication
96a864
 and to use when attempting to build the client certificate chain.
96a864
 
96a864
+=item B<-trusted_first>
96a864
+
96a864
+Use certificates in CA file or CA directory over the certificates provided
96a864
+by the server when building the trust chain to verify server certificate.
96a864
+This is mainly useful in environments with Bridge CA or Cross-Certified CAs.
96a864
+
96a864
 =item B<-new>
96a864
 
96a864
 performs the timing test using a new session ID for each connection.
96a864
diff -up openssl-1.0.2m/doc/apps/ts.pod.trusted-first openssl-1.0.2m/doc/apps/ts.pod
96a864
--- openssl-1.0.2m/doc/apps/ts.pod.trusted-first	2017-11-02 15:32:58.000000000 +0100
96a864
+++ openssl-1.0.2m/doc/apps/ts.pod	2017-11-13 09:08:18.616672333 +0100
96a864
@@ -47,6 +47,7 @@ B<-verify>
96a864
 [B<-token_in>]
96a864
 [B<-CApath> trusted_cert_path]
96a864
 [B<-CAfile> trusted_certs.pem]
96a864
+[B<-trusted_first>]
96a864
 [B<-untrusted> cert_file.pem]
96a864
 
96a864
 =head1 DESCRIPTION
96a864
@@ -325,6 +326,12 @@ L<verify(1)|verify(1)> for additional de
96a864
 or B<-CApath> must be specified.
96a864
 (Optional)
96a864
 
96a864
+=item B<-trusted_first>
96a864
+
96a864
+Use certificates in CA file or CA directory before other certificates
96a864
+when building the trust chain to verify certificates.
96a864
+This is mainly useful in environments with Bridge CA or Cross-Certified CAs.
96a864
+
96a864
 =item B<-untrusted> cert_file.pem
96a864
 
96a864
 Set of additional untrusted certificates in PEM format which may be
96a864
diff -up openssl-1.0.2m/doc/apps/verify.pod.trusted-first openssl-1.0.2m/doc/apps/verify.pod
96a864
--- openssl-1.0.2m/doc/apps/verify.pod.trusted-first	2017-11-02 15:32:58.000000000 +0100
96a864
+++ openssl-1.0.2m/doc/apps/verify.pod	2017-11-13 09:08:18.616672333 +0100
96a864
@@ -10,6 +10,7 @@ verify - Utility to verify certificates.
96a864
 B<openssl> B<verify>
96a864
 [B<-CApath directory>]
96a864
 [B<-CAfile file>]
96a864
+[B<-trusted_first>]
96a864
 [B<-purpose purpose>]
96a864
 [B<-policy arg>]
96a864
 [B<-ignore_critical>]
96a864
@@ -87,6 +88,12 @@ If a valid CRL cannot be found an error
96a864
 A file of untrusted certificates. The file should contain multiple certificates
96a864
 in PEM format concatenated together.
96a864
 
96a864
+=item B<-trusted_first>
96a864
+
96a864
+Use certificates in CA file or CA directory before the certificates in the untrusted
96a864
+file when building the trust chain to verify certificates.
96a864
+This is mainly useful in environments with Bridge CA or Cross-Certified CAs.
96a864
+
96a864
 =item B<-purpose purpose>
96a864
 
96a864
 The intended use for the certificate. If this option is not specified,