LIBRARY = Mono.Security.dll
LOCAL_MCS_FLAGS = -lib:$(the_libdir_base)bare
LIB_REFS = System
-LIB_MCS_FLAGS = -unsafe -nowarn:1030
+LIB_MCS_FLAGS = -unsafe -nowarn:1030,3009
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:169,219,618,672
include ../../build/library.make
this.policy_errors = policy_errors;
}
- internal ValidationResult (bool trusted, bool user_defined, int error_code)
+ internal ValidationResult (bool trusted, bool user_denied, int error_code)
{
this.trusted = trusted;
this.user_denied = user_denied;
this.error_code = error_code;
- this.policy_errors = policy_errors;
}
public bool Trusted {
{
}
- volatile static MonoTlsSettings defaultSettings;
+ static MonoTlsSettings defaultSettings;
public static MonoTlsSettings DefaultSettings {
get {
public Type3Message (Type2Message type2) : base (3)
{
_type2 = type2;
- _level = DefaultAuthLevel;
+ _level = NtlmSettings.DefaultAuthLevel;
_challenge = (byte[]) type2.Nonce.Clone ();
_domain = type2.TargetName;
throw new InvalidOperationException (
"Refusing to use legacy-mode LM/NTLM authentication " +
"unless explicitly enabled using DefaultAuthLevel.");
-
+
+ #pragma warning disable 618
using (var legacy = new ChallengeResponse (_password, _challenge)) {
lm = legacy.LM;
ntlm = legacy.NT;
}
+ #pragma warning restore 618
} else {
ChallengeResponse2.Compute (_type2, _level, _username, _password, _domain, out lm, out ntlm);
}
private X509Certificate FindParentCertificate (X509Certificate cert)
{
+ #pragma warning disable 618
// This certificate is the root certificate
if (cert.GetName () == cert.GetIssuerName ())
return null;
return certificate;
}
return null;
+ #pragma warning restore 618
}
#endregion
try {
SendAlert(alert);
} catch (Exception alertEx) {
- ex = new IOException (string.Format ("Error while sending TLS Alert ({0}:{1}): {2}", alert.Level, alert.Description, ex), ex);
+ ex = new IOException (string.Format ("Error while sending TLS Alert ({0}:{1}): {2}", alert.Level, alert.Description, ex), alertEx);
}
}
throw new TlsException(AlertDescription.UnexpectedMessage, String.Format(CultureInfo.CurrentUICulture,
"Unknown server handshake message received ({0})",
type.ToString()));
- break;
}
throw new TlsException (AlertDescription.HandshakeFailiure, String.Format ("Protocol error, unexpected protocol transition from {0} to {1}", last, type));
}
readonly MonoTlsStream tlsStream;
readonly HttpWebRequest request;
- static bool is_macosx;
- static bool is_mobile;
-#if !MOBILE
- static X509RevocationMode revocation_mode;
-#endif
-
- static ChainValidationHelper ()
- {
-#if MONOTOUCH
- is_macosx = true;
- is_mobile = true;
-#elif MONODROID
- is_macosx = false;
- is_mobile = true;
-#else
- is_macosx = System.IO.File.Exists (OSX509Certificates.SecurityLibrary);
- is_mobile = false;
-#endif
-
-#if !MOBILE
- revocation_mode = X509RevocationMode.NoCheck;
- try {
- string str = Environment.GetEnvironmentVariable ("MONO_X509_REVOCATION_MODE");
- if (String.IsNullOrEmpty (str))
- return;
- revocation_mode = (X509RevocationMode)Enum.Parse (typeof(X509RevocationMode), str, true);
- } catch {
- }
-#endif
- }
-
internal static ICertificateValidator GetDefaultValidator (MonoTlsProvider provider, MonoTlsSettings settings)
{
if (settings == null)
#region Fields
SslStreamBase ssl_stream;
- MonoTlsProvider provider;
- MonoTlsSettings settings;
ICertificateValidator certificateValidator;
#endregion // Fields
public LegacySslStream (Stream innerStream, bool leaveInnerStreamOpen, MonoTlsProvider provider, MonoTlsSettings settings)
: base (innerStream, leaveInnerStreamOpen)
{
- this.provider = provider;
- this.settings = settings;
- this.certificateValidator = ChainValidationHelper.GetDefaultValidator (provider, settings);
+ certificateValidator = ChainValidationHelper.GetDefaultValidator (provider, settings);
}
#endregion // Constructors
internal static class SystemCertificateValidator
{
static bool is_macosx;
- static bool is_mobile;
#if !MOBILE
static X509RevocationMode revocation_mode;
#endif
{
#if MONOTOUCH
is_macosx = true;
- is_mobile = true;
#elif MONODROID
is_macosx = false;
- is_mobile = true;
#else
is_macosx = System.IO.File.Exists (OSX509Certificates.SecurityLibrary);
- is_mobile = false;
#endif
#if !MOBILE