-Subproject commit 9ad688f0ae679b32e9c0a9b21bb63a4488c28b6b
+Subproject commit 432738a3c938b4f751307301c6aa07f2027a8864
private void GetClientCertificate ()
{
-#warning "Client certificate selection is unfinished"
+// TODO: Client certificate selection is unfinished
ClientContext context = (ClientContext)this.Context;
// note: the server may ask for mutual authentication
// Check server prf against client prf
if (!Compare (clientHash, serverHash))
{
-#warning Review that selected alert is correct
+// TODO: Review that selected alert is correct
throw new TlsException(AlertDescription.InsuficientSecurity, "Invalid ServerFinished message received.");
}
}
TEST_MCS_FLAGS += -d:MONO_FEATURE_PROCESS_START
endif
-LIB_MCS_FLAGS = -nowarn:618 -d:CONFIGURATION_2_0 $(REFERENCE_SOURCES_FLAGS) -unsafe $(RESOURCE_FILES:%=-resource:%)
+LIB_MCS_FLAGS = -d:CONFIGURATION_2_0 $(REFERENCE_SOURCES_FLAGS) -unsafe $(RESOURCE_FILES:%=-resource:%)
ifdef DYNAMIC_BTLS
LIB_MCS_FLAGS += -d:DYNAMIC_BTLS
# MOBILE_PROFILE needs SECURITY_DEP
#
ifdef MOBILE_PROFILE
-LIB_MCS_FLAGS += -d:INSIDE_SYSTEM -d:SECURITY_DEP
+LIB_MCS_FLAGS += -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635
else
EXTERN_ALIAS_FLAGS = -d:MONO_SECURITY_ALIAS
endif
}
}
- Exception GetException (MonoBtlsSslError status)
+ static Exception GetException (MonoBtlsSslError status)
{
var error = MonoBtlsError.GetError ();
- if (error == null)
- return new MonoBtlsException (status);
-
var text = MonoBtlsError.GetErrorString (error);
return new MonoBtlsException ("{0} {1}", status, text);
}
static class MonoBtlsX509StoreManager
{
static bool initialized;
+#if !ANDROID
static string machineTrustedRootPath;
static string machineIntermediateCAPath;
static string machineUntrustedPath;
static string userTrustedRootPath;
static string userIntermediateCAPath;
static string userUntrustedPath;
+#endif
static void Initialize ()
{
readonly MonoTlsStream tlsStream;
readonly HttpWebRequest request;
+#pragma warning disable 618
+
internal static ICertificateValidator GetInternalValidator (MonoTlsProvider provider, MonoTlsSettings settings)
{
if (settings == null)
certValidationCallback = ServicePointManager.ServerCertValidationCallback;
}
+#pragma warning restore 618
+
static X509Certificate DefaultSelectionCallback (string targetHost, X509CertificateCollection localCertificates, X509Certificate remoteCertificate, string[] acceptableIssuers)
{
X509Certificate clientCertificate;
*/
X509Certificate OnCertificateSelection (X509CertificateCollection clientCerts, X509Certificate serverCert, string targetHost, X509CertificateCollection serverRequestedCerts)
{
+#pragma warning disable 618
string [] acceptableIssuers = new string [serverRequestedCerts != null ? serverRequestedCerts.Count : 0];
for (int i = 0; i < acceptableIssuers.Length; i++)
acceptableIssuers [i] = serverRequestedCerts [i].GetIssuerName ();
X509Certificate clientCertificate;
certificateValidator.SelectClientCertificate (targetHost, clientCerts, serverCert, acceptableIssuers, out clientCertificate);
return clientCertificate;
+#pragma warning restore 618
}
public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState)
ServicePointManager.CheckCertificateRevocationList);
status = WebExceptionStatus.Success;
- } catch (Exception ex) {
+ } catch (Exception) {
status = WebExceptionStatus.SecureChannelFailure;
throw;
} finally {
return "md2RSA";
case "1.2.840.113549.1.1.3":
return "md4RSA";
- return "md4RSA";
- return "md4RSA";
case "1.3.14.3.2.27":
return "dsaSHA1";
case "2.16.840.1.101.2.1.1.19":
using System.Runtime.InteropServices;
using System.Security.Permissions;
+#pragma warning disable 618
+
namespace System.CodeDom.Compiler {
[ComVisible (true)]
}
}
}
+
+#pragma warning restore 618
\ No newline at end of file
}
}
+#if FEATURE_MONO_CAS
// and you must have discovery access to the combined path
// note: the cache behaviour is tested in the CAS tests
if (SecurityManager.SecurityEnabled) {
new FileIOPermission (FileIOPermissionAccess.PathDiscovery, basepath).Demand ();
}
+#endif
}
return(basepath);
using System.Reflection;
using System.Collections.Specialized;
+#pragma warning disable 618
+
namespace System.Configuration
{
public class AppSettingsReader
using System.Xml;
#endif
+#pragma warning disable 618
+
namespace System.Configuration
{
class ConfigHelper
#if (XML_DEP)
using System.Xml;
+#pragma warning disable 618
+
namespace System.Configuration
{
[PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
using System.Xml.XPath;
#endif
+#pragma warning disable 618
+
namespace System.Configuration
{
public sealed class ConfigurationSettings
using XmlNode = System.Object;
#endif
+#pragma warning disable 618
+
namespace System.Configuration
{
public class NameValueFileSectionHandler : IConfigurationSectionHandler
using XmlNode = System.Object;
#endif
+#pragma warning disable 618
+
namespace System.Configuration
{
/// <summary>
//
using System;
-using System.Diagnostics;
using System.Collections;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.IO;
using System.Runtime.InteropServices;
+#pragma warning disable 618
+
namespace System.Diagnostics
{
[DefaultEvent ("EntryWritten")]
}
// may throw ArgumentNullException
- [DefaultValue (""), ReadOnly (true), RecommendedAsConfigurable (true)]
+ [DefaultValue (""), ReadOnly (true), SettingsBindable (true)]
[TypeConverter ("System.Diagnostics.Design.CategoryValueConverter, " + Consts.AssemblySystem_Design)]
[SRDescription ("The category name for this performance counter.")]
public string CategoryName {
}
// may throw ArgumentNullException
- [DefaultValue (""), ReadOnly (true), RecommendedAsConfigurable (true)]
+ [DefaultValue (""), ReadOnly (true), SettingsBindable (true)]
[TypeConverter ("System.Diagnostics.Design.CounterNameConverter, " + Consts.AssemblySystem_Design)]
[SRDescription ("The name of this performance counter.")]
public string CounterName
set { lifetime = value; }
}
- [DefaultValue (""), ReadOnly (true), RecommendedAsConfigurable (true)]
+ [DefaultValue (""), ReadOnly (true), SettingsBindable (true)]
[TypeConverter ("System.Diagnostics.Design.InstanceNameConverter, " + Consts.AssemblySystem_Design)]
[SRDescription ("The instance name for this performance counter.")]
public string InstanceName {
// may throw ArgumentException if machine name format is wrong
[MonoTODO("What's the machine name format?")]
- [DefaultValue ("."), Browsable (false), RecommendedAsConfigurable (true)]
+ [DefaultValue ("."), Browsable (false), SettingsBindable (true)]
[SRDescription ("The machine where this performance counter resides.")]
public string MachineName {
get {return machineName;}
while (true) {
try {
resetEvent.WaitOne ();
- } catch (ObjectDisposedException e) {
+ } catch (ObjectDisposedException) {
// Notifications have been disabled and event
// has been closed but not yet nulled. End thread.
break;
[DefaultValue("*.*")]
[IODescription("File name filter pattern")]
- [RecommendedAsConfigurable(true)]
+ [SettingsBindable(true)]
[TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
public string Filter {
get { return filter; }
[DefaultValue("")]
[IODescription("The directory to monitor")]
- [RecommendedAsConfigurable(true)]
+ [SettingsBindable(true)]
[TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
[Editor ("System.Diagnostics.Design.FSWPathEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
public string Path {
using System.ComponentModel;
+#pragma warning disable 67
+
namespace System.IO
{
public class FileSystemWatcher : Component, IDisposable, ISupportInitialize
protected void OnRenamed (RenamedEventArgs e) { throw new NotImplementedException (); }
public WaitForChangedResult WaitForChanged (WatcherChangeTypes changeType) { throw new NotImplementedException (); }
public WaitForChangedResult WaitForChanged (WatcherChangeTypes changeType, int timeout) { throw new NotImplementedException (); }
- public virtual void Dispose () { throw new NotImplementedException (); }
protected override void Dispose (bool disposing) { throw new NotImplementedException (); }
}
}
\ No newline at end of file
using XmlNode = System.Object;
#endif
+#pragma warning disable 618
+
namespace System.Net.Configuration
{
class ConnectionManagementData
continue;
}
- string prefix = HandlersUtil.ExtractAttributeValue ("prefix", child);
+ //string prefix = HandlersUtil.ExtractAttributeValue ("prefix", child);
if (name == "add") {
- string type = HandlersUtil.ExtractAttributeValue ("type", child, false);
+ //string type = HandlersUtil.ExtractAttributeValue ("type", child, false);
if (child.Attributes != null && child.Attributes.Count != 0)
HandlersUtil.ThrowException ("Unrecognized attribute", child);
public override IcmpV4Statistics GetIcmpV4Statistics ()
{
- if (!Socket.SupportsIPv4)
+ if (!Socket.OSSupportsIPv4)
throw new NetworkInformationException ();
Win32_MIBICMPINFO stats;
GetIcmpStatistics (out stats, AF_INET);
public override IPGlobalStatistics GetIPv4GlobalStatistics ()
{
- if (!Socket.SupportsIPv4)
+ if (!Socket.OSSupportsIPv4)
throw new NetworkInformationException ();
Win32_MIB_IPSTATS stats;
GetIpStatisticsEx (out stats, AF_INET);
public override TcpStatistics GetTcpIPv4Statistics ()
{
- if (!Socket.SupportsIPv4)
+ if (!Socket.OSSupportsIPv4)
throw new NetworkInformationException ();
Win32_MIB_TCPSTATS stats;
GetTcpStatisticsEx (out stats, AF_INET);
public override UdpStatistics GetUdpIPv4Statistics ()
{
- if (!Socket.SupportsIPv4)
+ if (!Socket.OSSupportsIPv4)
throw new NetworkInformationException ();
Win32_MIB_UDPSTATS stats;
GetUdpStatisticsEx (out stats, AF_INET);
#if MONOTOUCH || XAMMAC
return new MacOsNetworkInterfaceAPI ();
#else
- Version windowsVer51 = new Version (5, 1);
bool runningOnUnix = (Environment.OSVersion.Platform == PlatformID.Unix);
if (runningOnUnix) {
}
#if !MOBILE
+ Version windowsVer51 = new Version (5, 1);
if (Environment.OSVersion.Version >= windowsVer51)
return new Win32NetworkInterfaceAPI ();
#endif
#if MONODROID
[DllImport ("__Internal")]
- protected static extern int _monodroid_get_android_api_level ();
+ static extern int _monodroid_get_android_api_level ();
[DllImport ("__Internal")]
- protected static extern bool _monodroid_get_network_interface_up_state (string ifname, ref bool is_up);
+ static extern bool _monodroid_get_network_interface_up_state (string ifname, ref bool is_up);
[DllImport ("__Internal")]
- protected static extern bool _monodroid_get_network_interface_supports_multicast (string ifname, ref bool supports_multicast);
+ static extern bool _monodroid_get_network_interface_supports_multicast (string ifname, ref bool supports_multicast);
bool android_use_java_api;
#endif
static IPAddress GetNonLoopbackIP ()
{
+#pragma warning disable 618
foreach (IPAddress addr in Dns.GetHostByName (Dns.GetHostName ()).AddressList)
if (!IPAddress.IsLoopback (addr))
return addr;
+#pragma warning restore 618
+
throw new InvalidOperationException ("Could not resolve non-loopback IP address for localhost");
}
static MonoTlsProvider GetProvider ()
{
+#pragma warning disable 612
return MonoTlsProviderFactory.GetDefaultProvider ();
+#pragma warning restore 612
}
public SslStream (Stream innerStream)
if (endPoint == null)
throw new ArgumentNullException ("endPoint");
- SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndReceiveMessageFrom", "asyncResult");
+ /*SocketAsyncResult sockares =*/ ValidateEndIAsyncResult (asyncResult, "EndReceiveMessageFrom", "asyncResult");
throw new NotImplementedException ();
}
return false;
if (InputStream.EndRead (ares) <= 0)
return true;
- } catch (ObjectDisposedException e) {
+ } catch (ObjectDisposedException) {
input_stream = null;
return true;
} catch {
InternalWrite (bytes, 0, bytes.Length);
trailer_sent = true;
}
- } catch (IOException ex) {
+ } catch (IOException) {
// Ignore error due to connection reset by peer
}
}
return;
}
#endif
+
+#pragma warning disable 618
manager = (ConnectionManagementData) ConfigurationSettings.GetConfig (configKey);
+#pragma warning restore 618
if (manager != null) {
defaultConnectionLimit = (int) manager.GetMaxConnections ("*");
}
SetAuditRule((AuditRule)rule);
}
- internal new void Persist (SafeHandle handle)
+ internal void Persist (SafeHandle handle)
{
WriteLock();
try {
{
TypeDescriptionNode head = (TypeDescriptionNode)_providerTable[key];
TypeDescriptionNode target = head;
- TypeDescriptionNode prev = null;
+// TypeDescriptionNode prev = null;
while(target != null && target.Provider != provider)
{
- prev = target;
+// prev = target;
target = target.Next;
}
[ThreadStatic]
static int indentLevel;
static volatile int indentSize;
+#if CONFIGURATION_DEP
static volatile bool settingsInitialized;
static volatile bool defaultInitialized;
+#endif
// this is internal so TraceSource can use it. We want to lock on the same object because both TraceInternal and
// in the System.Diagnostics.Trace class
static internal void Refresh() {
lock (critSec) {
+#if CONFIGURATION_DEP
settingsInitialized = false;
+#endif
listeners = null;
}
InitializeSettings();
// call !
//
SocketException e = null;
- long scope = 0;
#if !MONO
+ long scope = 0;
if(Socket.OSSupportsIPv6)
{
byte[] bytes = new byte[IPv6AddressBytes];
// There are threading tricks a malicious app can use to create an ArraySegment with mismatched
// array/offset/count. Copy locally and make sure they're valid before using them.
internal static void ValidateSegment(ArraySegment<byte> segment) {
- if (segment == null || segment.Array == null) {
+ if (/*segment == null ||*/ segment.Array == null) {
throw new ArgumentNullException("segment");
}
// Length zero is explicitly allowed
internal static volatile bool s_SupportsIPv6;
internal static volatile bool s_OSSupportsIPv6;
internal static volatile bool s_Initialized;
+#if !MONO
private static volatile WaitOrTimerCallback s_RegisteredWaitCallback;
+#endif
private static volatile bool s_LoggingEnabled;
#if !FEATURE_PAL // perfcounter
internal static volatile bool s_PerfCountersEnabled;
DateTime tempUsed;
CookieCollection lruCc = null;
+#if !MONO
string lruDomain = null;
+#endif
string tempDomain = null;
PathList pathList;
// we also find the least used cookie collection in ENTIRE container
// we count the collection as LRU only if it holds 1+ elements
if (cc.Count > 0 && (tempUsed = cc.TimeStamp(CookieCollection.Stamp.Check)) < oldUsed) {
+#if !MONO
lruDomain = tempDomain;
+#endif
lruCc = cc;
oldUsed = tempUsed;
}
public override IAsyncResult BeginGetRequestStream(AsyncCallback callback, object state)
{
GlobalLog.Enter("FileWebRequest::BeginGetRequestStream");
+#if !MONO
bool success = true;
+#endif
try {
if (Aborted)
throw ExceptionHelper.RequestAbortedException;
m_ReadAResult = new LazyAsyncResult(this, state, callback);
ThreadPool.QueueUserWorkItem(s_GetRequestStreamCallback, m_ReadAResult);
} catch (Exception exception) {
+#if !MONO
success = false;
+#endif
if(Logging.On)Logging.Exception(Logging.Web, this, "BeginGetRequestStream", exception);
throw;
} finally {
public override IAsyncResult BeginGetResponse(AsyncCallback callback, object state)
{
GlobalLog.Enter("FileWebRequest::BeginGetResponse");
+#if !MONO
bool success = true;
+#endif
try {
if (Aborted)
m_WriteAResult = new LazyAsyncResult(this,state,callback);
ThreadPool.QueueUserWorkItem(s_GetResponseCallback,m_WriteAResult);
} catch (Exception exception) {
+#if !MONO
success = false;
+#endif
if(Logging.On)Logging.Exception(Logging.Web, this, "BeginGetResponse", exception);
throw;
} finally {
GlobalLog.Enter("FileWebRequest::EndGetRequestStream");
Stream stream;
+#if !MONO
bool success = false;
+#endif
try {
LazyAsyncResult ar = asyncResult as LazyAsyncResult;
if (asyncResult == null || ar == null) {
}
stream = (Stream) result;
m_writePending = false;
+#if !MONO
success = true;
+#endif
} catch (Exception exception) {
if(Logging.On)Logging.Exception(Logging.Web, this, "EndGetRequestStream", exception);
throw;
GlobalLog.Enter("FileWebRequest::EndGetResponse");
WebResponse response;
+#if !MONO
bool success = false;
+#endif
try {
LazyAsyncResult ar = asyncResult as LazyAsyncResult;
if (asyncResult == null || ar == null) {
}
response = (WebResponse) result;
m_readPending = false;
+#if !MONO
success = true;
+#endif
} catch (Exception exception) {
if(Logging.On)Logging.Exception(Logging.Web, this, "EndGetResponse", exception);
throw;
//used when the length of the header name itself is known (i.e. Subject : )
internal static string EncodeHeaderValue(string value, Encoding encoding, bool base64Encoding, int headerLength) {
- StringBuilder newString = new StringBuilder();
+// StringBuilder newString = new StringBuilder();
//no need to encode if it's pure ascii
if (IsAscii(value, false)) {
/// <devdoc>
/// </devdoc>
protected bool UseOptionC() {
- /* Mono: Set to false until we investigate https://bugzilla.xamarin.com/show_bug.cgi?id=25671 */
- return false;
#if FULL_AOT_RUNTIME
return false;
#else
+
+#if MONO
+ /* Mono: Set to false until we investigate https://bugzilla.xamarin.com/show_bug.cgi?id=25671 */
+ return false;
+#else
return(roptions & RegexOptions.Compiled) != 0;
+#endif
#endif
}
#endif
// This is code for Posix style properties - [:Ll:] or [:IsTibetan:].
// It currently doesn't do anything other than skip the whole thing!
if (CharsRight() > 0 && RightChar() == ':' && !inRange) {
- String name;
+// String name;
int savePos = Textpos();
MoveRight();
- name = ScanCapname();
+/* name = */ ScanCapname();
if (CharsRight() < 2 || MoveRightGetChar() != ':' || MoveRightGetChar() != ']')
Textto(savePos);
// else lookup name (nyi)
ProcessModuleCollection modules;
#endif // !FEATURE_PAL
+#if !MONO
bool haveMainWindow;
IntPtr mainWindowHandle; // no need to use SafeHandle for window
string mainWindowTitle;
+#endif
bool haveWorkingSetLimits;
IntPtr minWorkingSet;
IntPtr maxWorkingSet;
-
+
+#if !MONO
bool haveProcessorAffinity;
IntPtr processorAffinity;
+#endif
bool havePriorityClass;
ProcessPriorityClass priorityClass;
threads = null;
modules = null;
#endif // !FEATURE_PAL
+#if !MONO
mainWindowTitle = null;
+#endif
exited = false;
signaled = false;
+#if !MONO
haveMainWindow = false;
+#endif
haveWorkingSetLimits = false;
+#if !MONO
haveProcessorAffinity = false;
+#endif
havePriorityClass = false;
haveExitTime = false;
#if !MONO
#endif
// This exists in WaitHandle, but is oddly ifdefed for some reason...
+#if MONO
+ new
+#endif
private enum OpenExistingResult
{
Success,
//Non-Zero return
#if MONO
- if (!ReleaseSemaphore_internal(Handle, releaseCount, out previousCount))
+ if (!ReleaseSemaphore_internal(SafeWaitHandle.DangerousGetHandle(), releaseCount, out previousCount))
#else
if (!SafeNativeMethods.ReleaseSemaphore(SafeWaitHandle, releaseCount, out previousCount))
#endif