[Pkg-mono-svn-commits] [mono] 01/01: ChainValidationHelper: ignore port number when validating a certificate's host name.

Jo Shields directhex at moszumanska.debian.org
Wed Oct 12 08:59:24 UTC 2016


This is an automated email from the git hooks/post-receive script.

directhex pushed a commit to branch master-patches/ssl-validation-ignore-port-number
in repository mono.

commit 873636b82f237e78198839498d68da6c1a75e488
Author: Martin Baulig <martin.baulig at xamarin.com>
Date:   Sat Oct 1 21:29:32 2016 +0200

    ChainValidationHelper: ignore port number when validating a certificate's host name.
    
    (cherry picked from commit 4d28eb4b889d4f317675998f906cd9ca47440566)
    (cherry picked from commit 7c88bf755ec19ecd7e6db578de329567ee41b8d0)
    
    This fixes the certificate validation bug here:
    
    https://bugzilla.xamarin.com/show_bug.cgi?id=44708
---
 mcs/class/System/Mono.Net.Security/ChainValidationHelper.cs | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/mcs/class/System/Mono.Net.Security/ChainValidationHelper.cs b/mcs/class/System/Mono.Net.Security/ChainValidationHelper.cs
index 5d2812d..58d5c38 100644
--- a/mcs/class/System/Mono.Net.Security/ChainValidationHelper.cs
+++ b/mcs/class/System/Mono.Net.Security/ChainValidationHelper.cs
@@ -305,6 +305,13 @@ namespace Mono.Net.Security
 				return new ValidationResult (result, user_denied, 0, (MonoSslPolicyErrors)errors);
 			}
 
+			// Ignore port number when validating certificates.
+			if (!string.IsNullOrEmpty (host)) {
+				var pos = host.IndexOf (':');
+				if (pos > 0)
+					host = host.Substring (0, pos);
+			}
+
 			ICertificatePolicy policy = ServicePointManager.GetLegacyCertificatePolicy ();
 
 			int status11 = 0; // Error code passed to the obsolete ICertificatePolicy callback

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mono/packages/mono.git



More information about the Pkg-mono-svn-commits mailing list