diff options
author | Martin Baulig <martin.baulig@xamarin.com> | 2015-11-13 21:04:03 +0300 |
---|---|---|
committer | Martin Baulig <martin.baulig@xamarin.com> | 2015-11-13 22:32:27 +0300 |
commit | ba97606b1d681de0f0a0651692bf0190f349ec77 (patch) | |
tree | 7fb3161a8400941003056fcd9b28b3f91806efc2 /mcs/class/Mono.Security/Mono.Security.Interface/CertificateValidationHelper.cs | |
parent | 3bc22b19614835c73c42101eaf58de6f666ef81a (diff) |
[Mono.Security]: Cleanup the internal `Mono.Security.Interface.ICertificateValidator'.
* ICertificateValidator.SelectClientCertificate(): return bool, indicating whether
a certificate has been selected or the caller should use its default
implementation (if it has any).
* ICertificateValidator.ValidateCertificate(): new common function for both client
and server certificates; replaces ValidateChain() and ValidateClientCertificate().
* MonoTlsProvider.InvokeSystemCertificateValidator(): return bool, indicating whether
the certificate has been validator or the default system validator should be used.
(cherry picked from commit 42421eec1e91cbcb09a531a77df296da9e5e9f5d)
Diffstat (limited to 'mcs/class/Mono.Security/Mono.Security.Interface/CertificateValidationHelper.cs')
-rw-r--r-- | mcs/class/Mono.Security/Mono.Security.Interface/CertificateValidationHelper.cs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/mcs/class/Mono.Security/Mono.Security.Interface/CertificateValidationHelper.cs b/mcs/class/Mono.Security/Mono.Security.Interface/CertificateValidationHelper.cs index e167286ae69..7fab7f7f35d 100644 --- a/mcs/class/Mono.Security/Mono.Security.Interface/CertificateValidationHelper.cs +++ b/mcs/class/Mono.Security/Mono.Security.Interface/CertificateValidationHelper.cs @@ -86,13 +86,17 @@ namespace Mono.Security.Interface get; } - X509Certificate SelectClientCertificate ( + /* + * Returns `true` if a client certificate has been selected (which could be `null`). + */ + bool SelectClientCertificate ( string targetHost, X509CertificateCollection localCertificates, X509Certificate remoteCertificate, - string[] acceptableIssuers); - - ValidationResult ValidateChain (string targetHost, X509CertificateCollection certificates); + string[] acceptableIssuers, out X509Certificate clientCertificate); - ValidationResult ValidateClientCertificate (X509CertificateCollection certificates); + /* + * If @serverMode is true, then we're a server and want to validate a certificate that we received from a client. + */ + ValidationResult ValidateCertificate (string targetHost, bool serverMode, X509CertificateCollection certificates); bool InvokeSystemValidator ( string targetHost, bool serverMode, X509CertificateCollection certificates, |