Allow X509Chain to replace the root trust list when building a chain
authorZach Read <35631157+zwread@users.noreply.github.com>
Wed, 18 Sep 2019 15:31:26 +0000 (10:31 -0500)
committerJeremy Barton <jbarton@microsoft.com>
Wed, 18 Sep 2019 15:31:26 +0000 (08:31 -0700)
commitc3597ac4dd209a47f1eabc968dc27877e0d5a03b
tree926b28493f6962d2fbf519c49b2f008054e59384
parent251a92f60045373f54e230b0172edf5f080e670e
Allow X509Chain to replace the root trust list when building a chain

This enables users of X509Chain to specify a priori a set of trusted root authorities, which is used in place of the default root authorities.

By explicitly specifying the root authorities the caller enables revocation checking for normally untrusted roots, and simplifies the certificate acceptance by having the chain engine tell them if the root matched, vs doing a post-build check (in the case of cross-certified authorities this even tells the chain engine which path to prefer).

Commit migrated from https://github.com/dotnet/corefx/commit/e70e76159b3f34e4e35d241daf39d4f57f4bd82c
23 files changed:
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509Chain.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Stack.cs
src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509chain.c
src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509chain.h
src/libraries/System.Net.Http/src/System.Net.Http.csproj
src/libraries/System.Net.Security/src/System.Net.Security.csproj
src/libraries/System.Security.Cryptography.X509Certificates/ref/System.Security.Cryptography.X509Certificates.cs
src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.OSX/ChainPal.cs
src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Unix/ChainPal.cs
src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Unix/OpenSslX509ChainProcessor.cs
src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.cs
src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/ChainPal.BuildChain.cs
src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/FindPal.cs
src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Interop.crypt32.cs
src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Primitives.cs
src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/SafeHandles.cs
src/libraries/System.Security.Cryptography.X509Certificates/src/Resources/Strings.resx
src/libraries/System.Security.Cryptography.X509Certificates/src/System.Security.Cryptography.X509Certificates.csproj
src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509Chain.cs
src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509ChainPolicy.cs
src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509ChainTrustMode.cs [new file with mode: 0644]
src/libraries/System.Security.Cryptography.X509Certificates/tests/ChainTests.cs
src/libraries/System.Security.Cryptography.X509Certificates/tests/DynamicChainTests.cs