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

450916
diff -up openssl-1.0.2i/apps/cms.c.trusted-first openssl-1.0.2i/apps/cms.c
450916
--- openssl-1.0.2i/apps/cms.c.trusted-first	2016-09-22 12:23:06.000000000 +0200
450916
+++ openssl-1.0.2i/apps/cms.c	2016-09-22 14:01:27.436630359 +0200
450916
@@ -646,6 +646,8 @@ int MAIN(int argc, char **argv)
450916
                    "-CApath dir    trusted certificates directory\n");
450916
         BIO_printf(bio_err, "-CAfile file   trusted certificates file\n");
450916
         BIO_printf(bio_err,
450916
+                   "-trusted_first use trusted certificates first when building the trust chain\n");
450916
+        BIO_printf(bio_err,
450916
                    "-no_alt_chains only ever use the first certificate chain found\n");
450916
         BIO_printf(bio_err,
450916
                    "-crl_check     check revocation status of signer's certificate using CRLs\n");
450916
diff -up openssl-1.0.2i/apps/ocsp.c.trusted-first openssl-1.0.2i/apps/ocsp.c
450916
--- openssl-1.0.2i/apps/ocsp.c.trusted-first	2016-09-22 12:23:06.000000000 +0200
450916
+++ openssl-1.0.2i/apps/ocsp.c	2016-09-22 14:01:27.436630359 +0200
450916
@@ -537,6 +537,8 @@ int MAIN(int argc, char **argv)
450916
         BIO_printf(bio_err,
450916
                    "-CAfile file         trusted certificates file\n");
450916
         BIO_printf(bio_err,
450916
+                   "-trusted_first       use trusted certificates first when building the trust chain\n");
450916
+        BIO_printf(bio_err,
450916
                    "-no_alt_chains       only ever use the first certificate chain found\n");
450916
         BIO_printf(bio_err,
450916
                    "-VAfile file         validator certificates file\n");
450916
diff -up openssl-1.0.2i/apps/s_client.c.trusted-first openssl-1.0.2i/apps/s_client.c
450916
--- openssl-1.0.2i/apps/s_client.c.trusted-first	2016-09-22 14:01:27.402629569 +0200
450916
+++ openssl-1.0.2i/apps/s_client.c	2016-09-22 14:01:27.436630359 +0200
450916
@@ -330,6 +330,8 @@ static void sc_usage(void)
450916
     BIO_printf(bio_err, " -CApath arg   - PEM format directory of CA's\n");
450916
     BIO_printf(bio_err, " -CAfile arg   - PEM format file of CA's\n");
450916
     BIO_printf(bio_err,
450916
+               " -trusted_first - Use trusted CA's first when building the trust chain\n");
450916
+    BIO_printf(bio_err,
450916
                " -no_alt_chains - only ever use the first certificate chain found\n");
450916
     BIO_printf(bio_err,
450916
                " -reconnect    - Drop and re-make the connection with the same Session-ID\n");
450916
diff -up openssl-1.0.2i/apps/smime.c.trusted-first openssl-1.0.2i/apps/smime.c
450916
--- openssl-1.0.2i/apps/smime.c.trusted-first	2016-09-22 12:23:06.000000000 +0200
450916
+++ openssl-1.0.2i/apps/smime.c	2016-09-22 14:01:27.436630359 +0200
450916
@@ -442,6 +442,8 @@ int MAIN(int argc, char **argv)
450916
                    "-CApath dir    trusted certificates directory\n");
450916
         BIO_printf(bio_err, "-CAfile file   trusted certificates file\n");
450916
         BIO_printf(bio_err,
450916
+                   "-trusted_first use trusted certificates first when building the trust chain\n");
450916
+        BIO_printf(bio_err,
450916
                    "-no_alt_chains only ever use the first certificate chain found\n");
450916
         BIO_printf(bio_err,
450916
                    "-crl_check     check revocation status of signer's certificate using CRLs\n");
450916
diff -up openssl-1.0.2i/apps/s_server.c.trusted-first openssl-1.0.2i/apps/s_server.c
450916
--- openssl-1.0.2i/apps/s_server.c.trusted-first	2016-09-22 14:01:27.374628918 +0200
450916
+++ openssl-1.0.2i/apps/s_server.c	2016-09-22 14:01:27.437630382 +0200
450916
@@ -571,6 +571,8 @@ static void sv_usage(void)
450916
     BIO_printf(bio_err, " -CApath arg   - PEM format directory of CA's\n");
450916
     BIO_printf(bio_err, " -CAfile arg   - PEM format file of CA's\n");
450916
     BIO_printf(bio_err,
450916
+               " -trusted_first - Use trusted CA's first when building the trust chain\n");
450916
+    BIO_printf(bio_err,
450916
                " -no_alt_chains - only ever use the first certificate chain found\n");
450916
     BIO_printf(bio_err,
450916
                " -nocert       - Don't use any certificates (Anon-DH)\n");
450916
diff -up openssl-1.0.2i/apps/s_time.c.trusted-first openssl-1.0.2i/apps/s_time.c
450916
--- openssl-1.0.2i/apps/s_time.c.trusted-first	2016-09-22 14:01:27.368628779 +0200
450916
+++ openssl-1.0.2i/apps/s_time.c	2016-09-22 14:01:27.437630382 +0200
450916
@@ -182,6 +182,7 @@ static void s_time_usage(void)
450916
                 file if not specified by this option\n\
450916
 -CApath arg   - PEM format directory of CA's\n\
450916
 -CAfile arg   - PEM format file of CA's\n\
450916
+-trusted_first - Use trusted CA's first when building the trust chain\n\
450916
 -cipher       - preferred cipher to use, play with 'openssl ciphers'\n\n";
450916
 
450916
     printf("usage: s_time <args>\n\n");
450916
diff -up openssl-1.0.2i/apps/ts.c.trusted-first openssl-1.0.2i/apps/ts.c
450916
--- openssl-1.0.2i/apps/ts.c.trusted-first	2016-09-22 14:01:27.400629522 +0200
450916
+++ openssl-1.0.2i/apps/ts.c	2016-09-22 14:01:27.437630382 +0200
450916
@@ -352,7 +352,7 @@ int MAIN(int argc, char **argv)
450916
                "ts -verify [-data file_to_hash] [-digest digest_bytes] "
450916
                "[-queryfile request.tsq] "
450916
                "-in response.tsr [-token_in] "
450916
-               "-CApath ca_path -CAfile ca_file.pem "
450916
+               "-CApath ca_path -CAfile ca_file.pem -trusted_first"
450916
                "-untrusted cert_file.pem\n");
450916
  cleanup:
450916
     /* Clean up. */
450916
diff -up openssl-1.0.2i/apps/verify.c.trusted-first openssl-1.0.2i/apps/verify.c
450916
--- openssl-1.0.2i/apps/verify.c.trusted-first	2016-09-22 14:01:27.438630405 +0200
450916
+++ openssl-1.0.2i/apps/verify.c	2016-09-22 14:02:37.951269140 +0200
450916
@@ -231,7 +231,7 @@ int MAIN(int argc, char **argv)
450916
  usage:
450916
     if (ret == 1) {
450916
         BIO_printf(bio_err,
450916
-                   "usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check]");
450916
+                   "usage: verify [-verbose] [-CApath path] [-CAfile file] [-trusted_first] [-purpose purpose] [-crl_check]");
450916
         BIO_printf(bio_err, " [-no_alt_chains] [-attime timestamp]");
450916
 #ifndef OPENSSL_NO_ENGINE
450916
         BIO_printf(bio_err, " [-engine e]");
450916
diff -up openssl-1.0.2i/doc/apps/cms.pod.trusted-first openssl-1.0.2i/doc/apps/cms.pod
450916
--- openssl-1.0.2i/doc/apps/cms.pod.trusted-first	2016-09-22 12:23:06.000000000 +0200
450916
+++ openssl-1.0.2i/doc/apps/cms.pod	2016-09-22 14:01:27.438630405 +0200
450916
@@ -35,6 +35,7 @@ B<openssl> B<cms>
450916
 [B<-print>]
450916
 [B<-CAfile file>]
450916
 [B<-CApath dir>]
450916
+[B<-trusted_first>]
450916
 [B<-no_alt_chains>]
450916
 [B<-md digest>]
450916
 [B<-[cipher]>]
450916
@@ -248,6 +249,12 @@ B<-verify>. This directory must be a sta
450916
 is a hash of each subject name (using B<x509 -hash>) should be linked
450916
 to each certificate.
450916
 
450916
+=item B<-trusted_first>
450916
+
450916
+Use certificates in CA file or CA directory before untrusted certificates
450916
+from the message when building the trust chain to verify certificates.
450916
+This is mainly useful in environments with Bridge CA or Cross-Certified CAs.
450916
+
450916
 =item B<-md digest>
450916
 
450916
 digest algorithm to use when signing or resigning. If not present then the
450916
diff -up openssl-1.0.2i/doc/apps/ocsp.pod.trusted-first openssl-1.0.2i/doc/apps/ocsp.pod
450916
--- openssl-1.0.2i/doc/apps/ocsp.pod.trusted-first	2016-09-22 14:01:27.401629545 +0200
450916
+++ openssl-1.0.2i/doc/apps/ocsp.pod	2016-09-22 14:01:27.438630405 +0200
450916
@@ -29,6 +29,7 @@ B<openssl> B<ocsp>
450916
 [B<-path>]
450916
 [B<-CApath dir>]
450916
 [B<-CAfile file>]
450916
+[B<-trusted_first>]
450916
 [B<-no_alt_chains>]
450916
 [B<-VAfile file>]
450916
 [B<-validity_period n>]
450916
@@ -144,6 +145,13 @@ connection timeout to the OCSP responder
450916
 file or pathname containing trusted CA certificates. These are used to verify
450916
 the signature on the OCSP response.
450916
 
450916
+=item B<-trusted_first>
450916
+
450916
+Use certificates in CA file or CA directory over certificates provided
450916
+in the response or residing in other certificates file when building the trust
450916
+chain to verify responder certificate.
450916
+This is mainly useful in environments with Bridge CA or Cross-Certified CAs.
450916
+
450916
 =item B<-no_alt_chains>
450916
 
450916
 See L<B<verify>|verify(1)> manual page for details.
450916
diff -up openssl-1.0.2i/doc/apps/s_client.pod.trusted-first openssl-1.0.2i/doc/apps/s_client.pod
450916
--- openssl-1.0.2i/doc/apps/s_client.pod.trusted-first	2016-09-22 14:01:27.412629801 +0200
450916
+++ openssl-1.0.2i/doc/apps/s_client.pod	2016-09-22 14:01:27.438630405 +0200
450916
@@ -19,6 +19,7 @@ B<openssl> B<s_client>
450916
 [B<-pass arg>]
450916
 [B<-CApath directory>]
450916
 [B<-CAfile filename>]
450916
+[B<-trusted_first>]
450916
 [B<-no_alt_chains>]
450916
 [B<-reconnect>]
450916
 [B<-pause>]
450916
@@ -125,7 +126,7 @@ also used when building the client certi
450916
 A file containing trusted certificates to use during server authentication
450916
 and to use when attempting to build the client certificate chain.
450916
 
450916
-=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>
450916
+=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>
450916
 
450916
 Set various certificate chain valiadition option. See the
450916
 L<B<verify>|verify(1)> manual page for details.
450916
diff -up openssl-1.0.2i/doc/apps/smime.pod.trusted-first openssl-1.0.2i/doc/apps/smime.pod
450916
--- openssl-1.0.2i/doc/apps/smime.pod.trusted-first	2016-09-22 12:23:06.000000000 +0200
450916
+++ openssl-1.0.2i/doc/apps/smime.pod	2016-09-22 14:01:27.438630405 +0200
450916
@@ -15,6 +15,9 @@ B<openssl> B<smime>
450916
 [B<-pk7out>]
450916
 [B<-[cipher]>]
450916
 [B<-in file>]
450916
+[B<-CAfile file>]
450916
+[B<-CApath dir>]
450916
+[B<-trusted_first>]
450916
 [B<-no_alt_chains>]
450916
 [B<-certfile file>]
450916
 [B<-signer file>]
450916
@@ -150,6 +153,12 @@ B<-verify>. This directory must be a sta
450916
 is a hash of each subject name (using B<x509 -hash>) should be linked
450916
 to each certificate.
450916
 
450916
+=item B<-trusted_first>
450916
+
450916
+Use certificates in CA file or CA directory over certificates provided
450916
+in the message when building the trust chain to verify a certificate.
450916
+This is mainly useful in environments with Bridge CA or Cross-Certified CAs.
450916
+
450916
 =item B<-md digest>
450916
 
450916
 digest algorithm to use when signing or resigning. If not present then the
450916
diff -up openssl-1.0.2i/doc/apps/s_server.pod.trusted-first openssl-1.0.2i/doc/apps/s_server.pod
450916
--- openssl-1.0.2i/doc/apps/s_server.pod.trusted-first	2016-09-22 14:01:27.412629801 +0200
450916
+++ openssl-1.0.2i/doc/apps/s_server.pod	2016-09-22 14:01:27.438630405 +0200
450916
@@ -33,6 +33,7 @@ B<openssl> B<s_server>
450916
 [B<-state>]
450916
 [B<-CApath directory>]
450916
 [B<-CAfile filename>]
450916
+[B<-trusted_first>]
450916
 [B<-no_alt_chains>]
450916
 [B<-nocert>]
450916
 [B<-cipher cipherlist>]
450916
@@ -178,6 +179,12 @@ and to use when attempting to build the
450916
 is also used in the list of acceptable client CAs passed to the client when
450916
 a certificate is requested.
450916
 
450916
+=item B<-trusted_first>
450916
+
450916
+Use certificates in CA file or CA directory before other certificates 
450916
+when building the trust chain to verify client certificates.
450916
+This is mainly useful in environments with Bridge CA or Cross-Certified CAs.
450916
+
450916
 =item B<-no_alt_chains>
450916
 
450916
 See the L<B<verify>|verify(1)> manual page for details.
450916
diff -up openssl-1.0.2i/doc/apps/s_time.pod.trusted-first openssl-1.0.2i/doc/apps/s_time.pod
450916
--- openssl-1.0.2i/doc/apps/s_time.pod.trusted-first	2016-09-22 12:23:06.000000000 +0200
450916
+++ openssl-1.0.2i/doc/apps/s_time.pod	2016-09-22 14:01:27.439630429 +0200
450916
@@ -14,6 +14,7 @@ B<openssl> B<s_time>
450916
 [B<-key filename>]
450916
 [B<-CApath directory>]
450916
 [B<-CAfile filename>]
450916
+[B<-trusted_first>]
450916
 [B<-reuse>]
450916
 [B<-new>]
450916
 [B<-verify depth>]
450916
@@ -76,6 +77,12 @@ also used when building the client certi
450916
 A file containing trusted certificates to use during server authentication
450916
 and to use when attempting to build the client certificate chain.
450916
 
450916
+=item B<-trusted_first>
450916
+
450916
+Use certificates in CA file or CA directory over the certificates provided
450916
+by the server when building the trust chain to verify server certificate.
450916
+This is mainly useful in environments with Bridge CA or Cross-Certified CAs.
450916
+
450916
 =item B<-new>
450916
 
450916
 performs the timing test using a new session ID for each connection.
450916
diff -up openssl-1.0.2i/doc/apps/ts.pod.trusted-first openssl-1.0.2i/doc/apps/ts.pod
450916
--- openssl-1.0.2i/doc/apps/ts.pod.trusted-first	2016-09-22 12:23:06.000000000 +0200
450916
+++ openssl-1.0.2i/doc/apps/ts.pod	2016-09-22 14:01:27.439630429 +0200
450916
@@ -46,6 +46,7 @@ B<-verify>
450916
 [B<-token_in>]
450916
 [B<-CApath> trusted_cert_path]
450916
 [B<-CAfile> trusted_certs.pem]
450916
+[B<-trusted_first>]
450916
 [B<-untrusted> cert_file.pem]
450916
 
450916
 =head1 DESCRIPTION
450916
@@ -324,6 +325,12 @@ L<verify(1)|verify(1)> for additional de
450916
 or B<-CApath> must be specified.
450916
 (Optional)
450916
 
450916
+=item B<-trusted_first>
450916
+
450916
+Use certificates in CA file or CA directory before other certificates
450916
+when building the trust chain to verify certificates.
450916
+This is mainly useful in environments with Bridge CA or Cross-Certified CAs.
450916
+
450916
 =item B<-untrusted> cert_file.pem
450916
 
450916
 Set of additional untrusted certificates in PEM format which may be
450916
diff -up openssl-1.0.2i/doc/apps/verify.pod.trusted-first openssl-1.0.2i/doc/apps/verify.pod
450916
--- openssl-1.0.2i/doc/apps/verify.pod.trusted-first	2016-09-22 12:23:06.000000000 +0200
450916
+++ openssl-1.0.2i/doc/apps/verify.pod	2016-09-22 14:01:27.439630429 +0200
450916
@@ -9,6 +9,7 @@ verify - Utility to verify certificates.
450916
 B<openssl> B<verify>
450916
 [B<-CApath directory>]
450916
 [B<-CAfile file>]
450916
+[B<-trusted_first>]
450916
 [B<-purpose purpose>]
450916
 [B<-policy arg>]
450916
 [B<-ignore_critical>]
450916
@@ -86,6 +87,12 @@ If a valid CRL cannot be found an error
450916
 A file of untrusted certificates. The file should contain multiple certificates
450916
 in PEM format concatenated together.
450916
 
450916
+=item B<-trusted_first>
450916
+
450916
+Use certificates in CA file or CA directory before the certificates in the untrusted
450916
+file when building the trust chain to verify certificates.
450916
+This is mainly useful in environments with Bridge CA or Cross-Certified CAs.
450916
+
450916
 =item B<-purpose purpose>
450916
 
450916
 The intended use for the certificate. If this option is not specified,