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

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