#include <sys/stat.h>
#include <fcntl.h>
#include <sys/types.h>
+#include <direct.h>
#ifdef G_OS_WIN32
#include <io.h>
return fd;
}
+gchar *
+g_mkdtemp (char *tmp_template)
+{
+ gunichar2* utf16_template;
+
+ utf16_template = u8to16 (tmp_template);
+
+ utf16_template = _wmktemp(utf16_template);
+ if (utf16_template && *utf16_template) {
+ if (_wmkdir (utf16_template) == 0){
+ char *ret = u16to8 (utf16_template);
+ g_free (utf16_template);
+ return ret;
+ }
+ }
+
+ g_free (utf16_template);
+ return NULL;
+}
+
#ifdef _MSC_VER
#pragma warning(disable:4701)
#endif
#define g_ascii_strtod strtod
#define g_ascii_isalnum isalnum
+#ifdef WIN32
+gchar *g_mkdtemp (gchar *tmpl);
+#else
+#define g_mkdtemp mkdtemp
+#endif
+
/*
* Pattern matching
*/
Or you can use a comma delimited list of the workds CJK, MidWest,
Other, Rare and West to specificy which encoding assemblies to distribute.
.TP
-.TP
.I "-L path"
Adds the `path' do the search list for assemblies. The rules are the
same as for the compiler -lib: or -L flags.
+.TP
+.I "--library [LIB,]PATH"
+Embeds the dynamic library file pointed to by `PATH' and optionally
+give it the name `LIB' into the bundled executable. This is used to
+ship native library dependencies that are unpacked at startup and
+loaded from the runtime.
+.TP
.I "--lists-targets"
Lists all of the available local cross compilation targets available
as precompiled binaries on the Mono distribution server.
System.Xml.Serialization \
Mono.CSharp \
Microsoft.CSharp \
- Mono.Security.Providers.DotNet \
- Mono.Security.Providers.NewSystemSource \
- Mono.Security.Providers.NewTls \
System.Runtime.InteropServices.RuntimeInformation \
System.Reflection.DispatchProxy \
System.Xml.XPath.XmlDocument \
System.Data.Linq \
System.Net.Http \
System.Net.Http.WebRequest \
- Mono.Security.Providers.DotNet \
- Mono.Security.Providers.OldTls \
- Mono.Security.Providers.NewSystemSource \
- Mono.Security.Providers.NewTls \
System.Runtime.InteropServices.RuntimeInformation \
System.Reflection.Context \
System.Net.Http.WinHttpHandler \
System.Web.Http \
System.Web.Http.SelfHost \
System.Web.Http.WebHost \
- Mono.Security.Providers.NewSystemSource \
- Mono.Security.Providers.NewTls \
System.Runtime.InteropServices.RuntimeInformation
# These are the subdirs which depends on libs in net_4_x_dirs
System.ComponentModel.Composition.4.5 \
System.Windows \
System.Xml.Serialization \
- Mono.Security.Providers.DotNet \
- Mono.Security.Providers.OldTls \
System.DirectoryServices.Protocols \
RabbitMQ.Client \
Microsoft.VisualC \
* with newer runtimes, and vice versa.
*/
internal const int MAJOR_VERSION = 2;
- internal const int MINOR_VERSION = 43;
+ internal const int MINOR_VERSION = 44;
enum WPSuspendPolicy {
NONE = 0,
GET_THIS = 2,
SET_VALUES = 3,
GET_DOMAIN = 4,
+ SET_THIS = 5,
}
enum CmdArrayRef {
return SendReceive (CommandSet.STACK_FRAME, (int)CmdStackFrame.GET_DOMAIN, new PacketWriter ().WriteId (thread_id).WriteId (id)).ReadId ();
}
+ internal void StackFrame_SetThis (long thread_id, long id, ValueImpl value) {
+ SendReceive (CommandSet.STACK_FRAME, (int)CmdStackFrame.SET_THIS, new PacketWriter ().WriteId (thread_id).WriteId (id).WriteValue (value));
+ }
+
/*
* ARRAYS
*/
return vm.DecodeValue (vm.conn.StackFrame_GetThis (thread.Id, Id));
}
+ // Since protocol version 2.44
+ public void SetThis (Value value) {
+ if (value == null)
+ throw new ArgumentNullException ("value");
+ if (Method.IsStatic || !Method.DeclaringType.IsValueType)
+ throw new InvalidOperationException ("The frame's method needs to be a valuetype instance method.");
+ vm.conn.StackFrame_SetThis (thread.Id, Id, vm.EncodeValue (value));
+ }
+
public void SetValue (LocalVariable var, Value value) {
if (var == null)
throw new ArgumentNullException ("var");
AssertValue ("T", s ["s"]);
AssertValue (45, s ["k"]);
+ // Test SetThis ()
+ s ["i"] = vm.CreateValue (55);
+ frame.SetThis (s);
+ obj = frame.GetThis ();
+ Assert.IsTrue (obj is StructMirror);
+ s = obj as StructMirror;
+ AssertValue (55, s ["i"]);
+ AssertValue ("T", s ["s"]);
+ AssertValue (45, s ["k"]);
+
// this on static vtype methods
e = run_until ("vtypes3");
e = step_until (e.Thread, "static_foo");
+++ /dev/null
-thisdir = class/Mono.Security.Providers.DotNet
-SUBDIRS =
-include ../../build/rules.make
-
-LIBRARY = Mono.Security.Providers.DotNet.dll
-LIB_REFS = System Mono.Security
-LIB_MCS_FLAGS = -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign
-
-EXTRA_DISTFILES = README.md
-
-include ../../build/library.make
-
-$(the_lib): ../Mono.Security/Makefile
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.30729</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{391EDD2B-85AC-4FCA-B607-AAD6C51E6799}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <OutputPath>./../../class/lib/net_4_x</OutputPath>\r
- <IntermediateOutputPath>obj-net_4_x</IntermediateOutputPath>\r
- <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
- <NoStdLib>True</NoStdLib>\r
- \r
- <NoConfig>True</NoConfig>\r
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>\r
- </RootNamespace>\r
- <AssemblyName>Mono.Security.Providers.DotNet</AssemblyName>\r
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <SignAssembly>true</SignAssembly>\r
- <DelaySign>true</DelaySign>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <Optimize>false</Optimize>\r
- <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <Optimize>true</Optimize>\r
- <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <!-- Set AddAdditionalExplicitAssemblyReferences to false, otherwise if targetting .NET4.0, \r
- Microsoft.NETFramework.props will force a dependency on the assembly System.Core. This\r
- is a problem to compile the Mono mscorlib.dll -->\r
- <PropertyGroup>\r
- <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>\r
- </PropertyGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs" />\r
- <Compile Include="..\..\build\common\Locale.cs" />\r
- <Compile Include=".\Mono.Security.Providers.DotNet\DotNetSslStreamImpl.cs" />\r
- <Compile Include=".\Mono.Security.Providers.DotNet\DotNetTlsProvider.cs" />\r
- <Compile Include=".\Properties\AssemblyInfo.cs" />\r </ItemGroup>\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <PropertyGroup>\r
- <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
-
- </PreBuildEvent>\r
- <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
-\r
- </PreBuildEvent>\r
- <PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
-
- </PostBuildEvent>\r
- <PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
-\r
- </PostBuildEvent>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="../corlib/corlib-net_4_x.csproj">\r
- <Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
- <Name>corlib-net_4_x</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="../System/System-net_4_x.csproj">\r
- <Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>\r
- <Name>System-net_4_x</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="../Mono.Security/Mono.Security-net_4_x.csproj">\r
- <Project>{42D59DE7-586F-4ACF-BDD5-E7869E39E3EF}</Project>\r
- <Name>Mono.Security-net_4_x</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
-</Project>\r
-
+++ /dev/null
-./Properties/AssemblyInfo.cs
-../../build/common/Consts.cs
-../../build/common/Locale.cs
-
-./Mono.Security.Providers.DotNet/DotNetTlsProvider.cs
-./Mono.Security.Providers.DotNet/DotNetSslStreamImpl.cs
+++ /dev/null
-//
-// DotNetSslStreamImpl.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.IO;
-using System.Net;
-using System.Net.Security;
-using System.Threading.Tasks;
-using System.Security.Authentication;
-using System.Security.Cryptography.X509Certificates;
-using System.Security.Principal;
-using System.Security.Cryptography;
-using MSI = Mono.Security.Interface;
-
-namespace Mono.Security.Providers.DotNet
-{
- class DotNetSslStreamImpl : MSI.IMonoSslStream
- {
- DotNetTlsProvider provider;
- SslStream impl;
-
- internal SslStream Impl {
- get {
- CheckDisposed ();
- return impl;
- }
- }
-
- public DotNetSslStreamImpl (
- Stream innerStream, bool leaveInnerStreamOpen, DotNetTlsProvider provider,
- RemoteCertificateValidationCallback userCertificateValidationCallback,
- LocalCertificateSelectionCallback userCertificateSelectionCallback)
- {
- this.provider = provider;
- impl = new SslStream (
- innerStream, leaveInnerStreamOpen,
- userCertificateValidationCallback,
- userCertificateSelectionCallback);
- }
-
- public void AuthenticateAsClient (string targetHost)
- {
- Impl.AuthenticateAsClient (targetHost);
- }
-
- public void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
- {
- Impl.AuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation);
- }
-
- public IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState)
- {
- return Impl.BeginAuthenticateAsClient (targetHost, asyncCallback, asyncState);
- }
-
- public IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
- {
- return Impl.BeginAuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
- }
-
- public void EndAuthenticateAsClient (IAsyncResult asyncResult)
- {
- Impl.EndAuthenticateAsClient (asyncResult);
- }
-
- public void AuthenticateAsServer (X509Certificate serverCertificate)
- {
- Impl.AuthenticateAsServer (serverCertificate);
- }
-
- public void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
- {
- Impl.AuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
- }
-
- public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState)
- {
- return Impl.BeginAuthenticateAsServer (serverCertificate, asyncCallback, asyncState);
- }
-
- public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
- {
- return Impl.BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
- }
-
- public void EndAuthenticateAsServer (IAsyncResult asyncResult)
- {
- Impl.EndAuthenticateAsServer (asyncResult);
- }
-
- public Task AuthenticateAsClientAsync (string targetHost)
- {
- return Impl.AuthenticateAsClientAsync (targetHost);
- }
-
- public Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
- {
- return Impl.AuthenticateAsClientAsync (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation);
- }
-
- public Task AuthenticateAsServerAsync (X509Certificate serverCertificate)
- {
- return Impl.AuthenticateAsServerAsync (serverCertificate);
- }
-
- public Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
- {
- return Impl.AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
- }
-
- public void Flush ()
- {
- Impl.Flush ();
- }
-
- public int Read (byte[] buffer, int offset, int count)
- {
- return Impl.Read (buffer, offset, count);
- }
-
- public void Write (byte[] buffer)
- {
- Impl.Write (buffer);
- }
-
- public void Write (byte[] buffer, int offset, int count)
- {
- Impl.Write (buffer, offset, count);
- }
-
- public IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
- {
- return Impl.BeginRead (buffer, offset, count, asyncCallback, asyncState);
- }
-
- public int EndRead (IAsyncResult asyncResult)
- {
- return Impl.EndRead (asyncResult);
- }
-
- public IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
- {
- return Impl.BeginWrite (buffer, offset, count, asyncCallback, asyncState);
- }
-
- public void EndWrite (IAsyncResult asyncResult)
- {
- Impl.EndWrite (asyncResult);
- }
-
- public TransportContext TransportContext {
- get { throw new NotSupportedException (); }
- }
-
- public bool IsAuthenticated {
- get { return Impl.IsAuthenticated; }
- }
-
- public bool IsMutuallyAuthenticated {
- get { return Impl.IsMutuallyAuthenticated; }
- }
-
- public bool IsEncrypted {
- get { return Impl.IsEncrypted; }
- }
-
- public bool IsSigned {
- get { return Impl.IsSigned; }
- }
-
- public bool IsServer {
- get { return Impl.IsServer; }
- }
-
- public CipherAlgorithmType CipherAlgorithm {
- get { return Impl.CipherAlgorithm; }
- }
-
- public int CipherStrength {
- get { return Impl.CipherStrength; }
- }
-
- public HashAlgorithmType HashAlgorithm {
- get { return Impl.HashAlgorithm; }
- }
-
- public int HashStrength {
- get { return Impl.HashStrength; }
- }
-
- public ExchangeAlgorithmType KeyExchangeAlgorithm {
- get { return Impl.KeyExchangeAlgorithm; }
- }
-
- public int KeyExchangeStrength {
- get { return KeyExchangeStrength; }
- }
-
- public bool CanRead {
- get { return Impl.CanRead; }
- }
-
- public bool CanTimeout {
- get { return Impl.CanTimeout; }
- }
-
- public bool CanWrite {
- get { return Impl.CanWrite; }
- }
-
- public long Length {
- get { return Impl.Length; }
- }
-
- public long Position {
- get { return Impl.Position; }
- }
-
- public void SetLength (long value)
- {
- Impl.SetLength (value);
- }
-
- public AuthenticatedStream AuthenticatedStream {
- get { return Impl; }
- }
-
- public int ReadTimeout {
- get { return Impl.ReadTimeout; }
- set { Impl.ReadTimeout = value; }
- }
-
- public int WriteTimeout {
- get { return Impl.WriteTimeout; }
- set { Impl.WriteTimeout = value; }
- }
-
- public bool CheckCertRevocationStatus {
- get { return Impl.CheckCertRevocationStatus; }
- }
-
- public X509Certificate InternalLocalCertificate {
- get {
- try {
- return LocalCertificate;
- } catch {
- return null;
- }
- }
- }
-
- public X509Certificate LocalCertificate {
- get { return Impl.LocalCertificate; }
- }
-
- public X509Certificate RemoteCertificate {
- get { return Impl.RemoteCertificate; }
- }
-
- public SslProtocols SslProtocol {
- get { return Impl.SslProtocol; }
- }
-
- MSI.MonoTlsProvider MSI.IMonoSslStream.Provider {
- get { return provider; }
- }
-
- MSI.MonoTlsConnectionInfo MSI.IMonoSslStream.GetConnectionInfo ()
- {
- return null;
- }
-
- void CheckDisposed ()
- {
- if (impl == null)
- throw new ObjectDisposedException ("MonoSslStream");
- }
-
- public void Dispose ()
- {
- Dispose (true);
- GC.SuppressFinalize (this);
- }
-
- protected void Dispose (bool disposing)
- {
- if (impl != null && disposing) {
- impl.Dispose ();
- impl = null;
- }
- }
- }
-}
-
+++ /dev/null
-//
-// MonoDefaultTlsProvider.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.IO;
-using System.Net;
-using System.Net.Security;
-using System.Security.Authentication;
-using System.Security.Cryptography.X509Certificates;
-using Mono.Security.Interface;
-
-namespace Mono.Security.Providers.DotNet
-{
- /*
- * This provider only uses the public .NET APIs from System.dll.
- *
- * It is primarily intended for testing.
- */
- public class DotNetTlsProvider : MonoTlsProvider
- {
- static readonly Guid id = new Guid ("3a7b3a26-0dbd-4572-a5b8-fdce766bf0dd");
-
- public override Guid ID {
- get { return id; }
- }
-
- public override string Name {
- get { return "dotnet"; }
- }
-
- public override bool SupportsSslStream {
- get { return true; }
- }
-
- public override bool SupportsConnectionInfo {
- get { return false; }
- }
-
- public override bool SupportsMonoExtensions {
- get { return false; }
- }
-
- internal override bool SupportsTlsContext {
- get { return false; }
- }
-
- public override SslProtocols SupportedProtocols {
- get { return (SslProtocols)ServicePointManager.SecurityProtocol; }
- }
-
- public override IMonoSslStream CreateSslStream (
- Stream innerStream, bool leaveInnerStreamOpen,
- MonoTlsSettings settings = null)
- {
- if (settings != null)
- throw new NotSupportedException ("Mono-specific API Extensions not available.");
-
- RemoteCertificateValidationCallback validation_callback = null;
- LocalCertificateSelectionCallback selection_callback = null;
-
- if (settings != null) {
- validation_callback = ConvertCallback (settings.RemoteCertificateValidationCallback);
- selection_callback = ConvertCallback (settings.ClientCertificateSelectionCallback);
- }
-
- return new DotNetSslStreamImpl (innerStream, leaveInnerStreamOpen, this, validation_callback, selection_callback);
- }
-
- internal override IMonoTlsContext CreateTlsContext (
- string hostname, bool serverMode, TlsProtocols protocolFlags,
- X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
- bool remoteCertRequired, MonoEncryptionPolicy encryptionPolicy,
- MonoTlsSettings settings)
- {
- throw new NotSupportedException ();
- }
-
- internal static RemoteCertificateValidationCallback ConvertCallback (MonoRemoteCertificateValidationCallback callback)
- {
- if (callback == null)
- return null;
-
- return (s, c, ch, e) => callback (null, c, ch, (MonoSslPolicyErrors)e);
- }
-
- internal static LocalCertificateSelectionCallback ConvertCallback (MonoLocalCertificateSelectionCallback callback)
- {
- if (callback == null)
- return null;
-
- return (s, t, lc, rc, ai) => callback (t, lc, rc, ai);
- }
-
- }
-}
-
+++ /dev/null
-//
-// AssemblyInfo.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Reflection;
-using System.Resources;
-using System.Security;
-using System.Security.Permissions;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about the system assembly
-
-[assembly: AssemblyVersion (Consts.FxVersion)]
-
-[assembly: AssemblyCompany ("MONO development team")]
-[assembly: AssemblyCopyright ("(c) 2015 Xamarin")]
-[assembly: AssemblyDescription ("Mono.Security.Providers.DotNet.dll")]
-[assembly: AssemblyProduct ("MONO CLI")]
-[assembly: AssemblyTitle ("Mono.Security.Providers.DotNet.dll")]
-[assembly: CLSCompliant (true)]
-[assembly: ComVisible (false)]
-[assembly: NeutralResourcesLanguage ("en-US")]
-
+++ /dev/null
-See mcs/class/Mono.Security.Providers.NewSystemSource/README.md for a detailed README.
+++ /dev/null
-thisdir = class/Mono.Security.Providers.NewSystemSource
-SUBDIRS =
-include ../../build/rules.make
-
-LIB_REFS = System
-
-LIBRARY = Mono.Security.Providers.NewSystemSource.dll
-
-LIB_MCS_FLAGS = -d:SECURITY_DEP \
- -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -d:MONO -d:FEATURE_PAL -d:MONO_FEATURE_NEW_TLS \
- -d:MONO_FEATURE_NEW_SYSTEM_SOURCE -d:DISABLE_CAS_USE
-
-ifdef MOBILE_PROFILE
-LIB_REFS += Mono.Security
-else
-LIB_REFS += MonoSecurity=Mono.Security
-LIB_MCS_FLAGS += -d:MONO_SECURITY_ALIAS
-endif
-
-EXTRA_DISTFILES = README.md
-
-include ../../build/library.make
-
-$(the_lib): ../Mono.Security/Makefile
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.30729</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{0BB4541F-9B1A-4CBC-BEB1-00B31B37F74E}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <OutputPath>./../../class/lib/net_4_x</OutputPath>\r
- <IntermediateOutputPath>obj-net_4_x</IntermediateOutputPath>\r
- <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
- <NoStdLib>True</NoStdLib>\r
- \r
- <NoConfig>True</NoConfig>\r
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>\r
- </RootNamespace>\r
- <AssemblyName>Mono.Security.Providers.NewSystemSource</AssemblyName>\r
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <SignAssembly>true</SignAssembly>\r
- <DelaySign>true</DelaySign>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <Optimize>false</Optimize>\r
- <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;SECURITY_DEP;MONO;FEATURE_PAL;MONO_FEATURE_NEW_TLS;MONO_FEATURE_NEW_SYSTEM_SOURCE;DISABLE_CAS_USE;MONO_SECURITY_ALIAS</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <Optimize>true</Optimize>\r
- <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;SECURITY_DEP;MONO;FEATURE_PAL;MONO_FEATURE_NEW_TLS;MONO_FEATURE_NEW_SYSTEM_SOURCE;DISABLE_CAS_USE;MONO_SECURITY_ALIAS</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <!-- Set AddAdditionalExplicitAssemblyReferences to false, otherwise if targetting .NET4.0, \r
- Microsoft.NETFramework.props will force a dependency on the assembly System.Core. This\r
- is a problem to compile the Mono mscorlib.dll -->\r
- <PropertyGroup>\r
- <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>\r
- </PropertyGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs" />\r
- <Compile Include="..\..\build\common\Locale.cs" />\r
- <Compile Include="..\..\build\common\SR.cs" />\r
- <Compile Include="..\referencesource\mscorlib\InternalApis\NDP_Common\inc\PinnableBufferCache.cs" />\r
- <Compile Include="..\referencesource\System\net\System\Net\_LazyAsyncResult.cs" />\r
- <Compile Include="..\referencesource\System\net\System\Net\_LoggingObject.cs" />\r
- <Compile Include="..\referencesource\System\net\System\Net\_NTAuthentication.cs" />\r
- <Compile Include="..\referencesource\System\net\System\Net\_SecureChannel.cs" />\r
- <Compile Include="..\referencesource\System\net\System\Net\_SslSessionsCache.cs" />\r
- <Compile Include="..\referencesource\System\net\System\Net\Logging.cs" />\r
- <Compile Include="..\referencesource\System\net\System\Net\SecureProtocols\_FixedSizeReader.cs" />\r
- <Compile Include="..\referencesource\System\net\System\Net\SecureProtocols\_HelperAsyncResults.cs" />\r
- <Compile Include="..\referencesource\System\net\System\Net\SecureProtocols\_SslState.cs" />\r
- <Compile Include="..\referencesource\System\net\System\Net\SecureProtocols\_SslStream.cs" />\r
- <Compile Include="..\referencesource\System\net\System\Net\SecureProtocols\SslStream.cs" />\r
- <Compile Include="..\System\Mono.Net.Security\CallbackHelpers.cs" />\r
- <Compile Include="..\System\Mono.Net.Security\IMonoTlsProvider.cs" />\r
- <Compile Include="..\System\Mono.Net.Security\MonoTlsProviderFactory.cs" />\r
- <Compile Include="..\System\Mono.Net.Security\MonoTlsProviderWrapper.cs" />\r
- <Compile Include="..\System\ReferenceSources\_SecureChannel.cs" />\r
- <Compile Include="..\System\ReferenceSources\_SslState.cs" />\r
- <Compile Include="..\System\ReferenceSources\_SslStream.cs" />\r
- <Compile Include="..\System\ReferenceSources\Internal.cs" />\r
- <Compile Include="..\System\ReferenceSources\SR.cs" />\r
- <Compile Include="..\System\ReferenceSources\SR2.cs" />\r
- <Compile Include="..\System\ReferenceSources\SslStream.cs" />\r
- <Compile Include="..\System\ReferenceSources\SSPIConfiguration.cs" />\r
- <Compile Include="..\System\ReferenceSources\SSPISafeHandles.cs" />\r
- <Compile Include="..\System\ReferenceSources\SSPIWrapper.cs" />\r
- <Compile Include=".\Properties\AssemblyInfo.cs" />\r </ItemGroup>\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <PropertyGroup>\r
- <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
-
- </PreBuildEvent>\r
- <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
-\r
- </PreBuildEvent>\r
- <PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
-
- </PostBuildEvent>\r
- <PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
-\r
- </PostBuildEvent>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="../corlib/corlib-net_4_x.csproj">\r
- <Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
- <Name>corlib-net_4_x</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="../System/System-net_4_x.csproj">\r
- <Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>\r
- <Name>System-net_4_x</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="../Mono.Security/Mono.Security-net_4_x.csproj">\r
- <Project>{42D59DE7-586F-4ACF-BDD5-E7869E39E3EF}</Project>\r
- <Name>Mono.Security-net_4_x</Name>\r
- <Aliases>MonoSecurity</Aliases> </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
-</Project>\r
-
+++ /dev/null
-./Properties/AssemblyInfo.cs
-../../build/common/SR.cs
-../../build/common/Consts.cs
-../../build/common/Locale.cs
-
-../referencesource/System/net/System/Net/Logging.cs
-../referencesource/System/net/System/Net/_SslSessionsCache.cs
-../referencesource/System/net/System/Net/_LazyAsyncResult.cs
-../referencesource/System/net/System/Net/_LoggingObject.cs
-../referencesource/System/net/System/Net/_NTAuthentication.cs
-../referencesource/System/net/System/Net/_SecureChannel.cs
-../referencesource/System/net/System/Net/SecureProtocols/SslStream.cs
-../referencesource/System/net/System/Net/SecureProtocols/_SslState.cs
-../referencesource/System/net/System/Net/SecureProtocols/_SslStream.cs
-../referencesource/System/net/System/Net/SecureProtocols/_FixedSizeReader.cs
-../referencesource/System/net/System/Net/SecureProtocols/_HelperAsyncResults.cs
-../referencesource/mscorlib/InternalApis/NDP_Common/inc/PinnableBufferCache.cs
-
-../System/ReferenceSources/SR.cs
-../System/ReferenceSources/SR2.cs
-../System/ReferenceSources/Internal.cs
-../System/ReferenceSources/SSPIWrapper.cs
-../System/ReferenceSources/SSPISafeHandles.cs
-../System/ReferenceSources/SslStream.cs
-../System/ReferenceSources/_SslState.cs
-../System/ReferenceSources/_SslStream.cs
-../System/ReferenceSources/_SecureChannel.cs
-../System/ReferenceSources/SSPIConfiguration.cs
-../System/Mono.Net.Security/CallbackHelpers.cs
-../System/Mono.Net.Security/IMonoTlsProvider.cs
-../System/Mono.Net.Security/MonoTlsProviderFactory.cs
-../System/Mono.Net.Security/MonoTlsProviderWrapper.cs
-
+++ /dev/null
-//
-// AssemblyInfo.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Reflection;
-using System.Resources;
-using System.Security;
-using System.Security.Permissions;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about the system assembly
-
-[assembly: AssemblyVersion (Consts.FxVersion)]
-
-[assembly: AssemblyCompany ("MONO development team")]
-[assembly: AssemblyCopyright ("(c) 2015 Xamarin")]
-[assembly: AssemblyDescription ("Mono.Security.Providers.NewSystemSource.dll")]
-[assembly: AssemblyProduct ("MONO CLI")]
-[assembly: AssemblyTitle ("Mono.Security.Providers.NewSystemSource.dll")]
-[assembly: CLSCompliant (true)]
-[assembly: ComVisible (false)]
-[assembly: NeutralResourcesLanguage ("en-US")]
-
-[assembly: InternalsVisibleTo ("Mono.Security.Providers.NewTls, PublicKey=002400000480000094000000060200000024000052534131000400001100000003336d6aed41624ca156ab579881fe90a576f1dfec48378fc94e4e440f4556776224e2d70c18996d91f36227f539fdb44340e07651f1455a489b29a7e6219a8f85e52b0f8588b4f8a857746a8468d37b556223d1452f3fcbaf0f269cdf1900ceb68f69485dc5887750d19571030c732331e00387d9b813a9ad52891087301793")]
-[assembly: InternalsVisibleTo ("Mono.Security.Providers.NewTls, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
+++ /dev/null
-Mono.Security.Interface / Mono.Security.Providers
-=================================================
-
-This is not a public API yet, but will eventually become public.
-
-
-Mono.Security.Interface
------------------------
-
-`Mono.Security.Interface` provides an abstraction layer for the TLS
-APIs that are currently being used by Mono's class libraries.
-
-The main API entry points are `MonoTlsProviderFactory.GetProvider()`
-and `MonoTlsProviderFactory.InstallProvider()`.
-
-Mono.Net.Security
------------------
-
-`Mono.Net.Security` provides the internal implementation and lives
-inside `System.dll` as private and internal APIs. `Mono.Security.dll`
-uses reflection to access these.
-
-On Mobile, the `Mono.Security.Interface` APIs are included as public
-APIs in `System.dll`.
-
-Mono.Security.Providers
------------------------
-
-Implementations of the `Mono.Security.Interface.MonoTlsProvider` class
-to provide TLS functionality.
-
-The default provider is inside `System.dll` - it will be used automatically
-if you don't explicitly install a custom provider, so simply call
-`MonoTlsProviderFactory.GetProvider()` to use it.
-
-* DotNet:
- Provides the default `SslStream` implementation from `System.dll`, only using
- public .NET types.
-
-* NewSystemSource:
- Compiles several referencesource files which would normally live inside
- `System.dll` if we compiled it with their `SslStream` implementation.
-
- This allows to keep the code in `System.dll` as-is, while still providing the
- new `SslStream`, which will be required by the new TLS code.
-
- `System.dll` needs to make its internals visible and we're using several compiler /
- external alias tricks in here to make this work.
-
- In this configuration, `MONO_SYSTEM_ALIAS`, `MONO_FEATURE_NEW_TLS` and
- `MONO_FEATURE_NEW_SYSTEM_SOURCE` (defining conditional for this configuration)
- are defined. We do not define `MONO_X509_ALIAS here`.
-
-The `Mono.Security.Providers.DotNet` and `Mono.Security.Providers.NewSystemSource` directory is currently
-enabled in the top-level `Makefile`, but the resulting binaries should only be used to test the new TLS
-code and not shipped as stable APIs.
-
-Pending changes
----------------
-
-This code is not actually being used in `System.dll` yet. I have some
-local changes which will switch the existing code in `WebClient`,
-`SmptClient` and `FtpWebRequest` over, but these need to be carefully
-tested.
-
-At the moment, this work branch only provides new code and build
-changes, which shuffle some stuff around. There are also several
-new files which are conditional and not actually being built by
-default.
-
-Build Configurations
---------------------
-
-* Normal build:
- Builds everything as before with some new APIs added, but without
- modifying any existing functionality.
-
-* Build with the `newtls` profile:
- Builds `System.dll` with the new `SslStream` implementation from the
- referencesource. This is currently a "build then throw away" profile
- and not enabled from the top-level Makefile. The resulting `System.dll`
- won't actually work at runtime since it's missing the new TLS code;
- building it helps find problems and ensures that it will actually
- be possible to build this once we deploy it.
-
-* Mono.Security.Providers:
- The new TLS code requires the newly built `System` and `Mono.Security.Providers.NewSystemSource`
- from this branch installed in the system. It is recommended to install it
- into a custom prefix and set that as custom runtime in Xamarin Studio.
-
-
-Last changed March 07th, 2015,
-Martin Baulig <martin.baulig@xamarin.com>
-
-
+++ /dev/null
-thisdir = class/Mono.Security.Providers.NewTls
-SUBDIRS =
-include ../../build/rules.make
-
-LIBRARY = Mono.Security.Providers.NewTls.dll
-LIB_REFS = System NewSystemSource=Mono.Security.Providers.NewSystemSource Mono.Security
-LIB_MCS_FLAGS = -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign
-
-include ../../build/library.make
-
-$(the_lib): ../Mono.Security/Makefile
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.30729</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{C8B8E524-BB3A-44E2-8C22-E3313E9F477C}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <OutputPath>./../../class/lib/net_4_x</OutputPath>\r
- <IntermediateOutputPath>obj-net_4_x</IntermediateOutputPath>\r
- <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
- <NoStdLib>True</NoStdLib>\r
- \r
- <NoConfig>True</NoConfig>\r
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>\r
- </RootNamespace>\r
- <AssemblyName>Mono.Security.Providers.NewTls</AssemblyName>\r
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <SignAssembly>true</SignAssembly>\r
- <DelaySign>true</DelaySign>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <Optimize>false</Optimize>\r
- <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <Optimize>true</Optimize>\r
- <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <!-- Set AddAdditionalExplicitAssemblyReferences to false, otherwise if targetting .NET4.0, \r
- Microsoft.NETFramework.props will force a dependency on the assembly System.Core. This\r
- is a problem to compile the Mono mscorlib.dll -->\r
- <PropertyGroup>\r
- <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>\r
- </PropertyGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs" />\r
- <Compile Include="..\..\build\common\Locale.cs" />\r
- <Compile Include="..\..\build\common\SR.cs" />\r
- <Compile Include=".\Mono.Security.Providers.NewTls\ITlsConfiguration.cs" />\r
- <Compile Include=".\Mono.Security.Providers.NewTls\ITlsContext.cs" />\r
- <Compile Include=".\Mono.Security.Providers.NewTls\MonoNewTlsStream.cs" />\r
- <Compile Include=".\Mono.Security.Providers.NewTls\MonoNewTlsStreamFactory.cs" />\r
- <Compile Include=".\Mono.Security.Providers.NewTls\NewTlsProvider.cs" />\r
- <Compile Include=".\Mono.Security.Providers.NewTls\TlsContextWrapper.cs" />\r
- <Compile Include=".\Mono.Security.Providers.NewTls\TlsProviderFactory.cs" />\r
- <Compile Include=".\Properties\AssemblyInfo.cs" />\r </ItemGroup>\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <PropertyGroup>\r
- <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
-
- </PreBuildEvent>\r
- <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
-\r
- </PreBuildEvent>\r
- <PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
-
- </PostBuildEvent>\r
- <PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
-\r
- </PostBuildEvent>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="../corlib/corlib-net_4_x.csproj">\r
- <Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
- <Name>corlib-net_4_x</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="../System/System-net_4_x.csproj">\r
- <Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>\r
- <Name>System-net_4_x</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="../Mono.Security/Mono.Security-net_4_x.csproj">\r
- <Project>{42D59DE7-586F-4ACF-BDD5-E7869E39E3EF}</Project>\r
- <Name>Mono.Security-net_4_x</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="../Mono.Security.Providers.NewSystemSource/Mono.Security.Providers.NewSystemSource-net_4_x.csproj">\r
- <Project>{0BB4541F-9B1A-4CBC-BEB1-00B31B37F74E}</Project>\r
- <Name>Mono.Security.Providers.NewSystemSource-net_4_x</Name>\r
- <Aliases>NewSystemSource</Aliases> </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
-</Project>\r
-
+++ /dev/null
-./Properties/AssemblyInfo.cs
-../../build/common/SR.cs
-../../build/common/Consts.cs
-../../build/common/Locale.cs
-
-./Mono.Security.Providers.NewTls/ITlsConfiguration.cs
-./Mono.Security.Providers.NewTls/ITlsContext.cs
-
-./Mono.Security.Providers.NewTls/MonoNewTlsStream.cs
-./Mono.Security.Providers.NewTls/MonoNewTlsStreamFactory.cs
-./Mono.Security.Providers.NewTls/NewTlsProvider.cs
-./Mono.Security.Providers.NewTls/TlsContextWrapper.cs
-./Mono.Security.Providers.NewTls/TlsProviderFactory.cs
+++ /dev/null
-//
-// ITlsContext.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015-2016 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Security.Cryptography;
-
-using Mono.Security.Interface;
-using MX = Mono.Security.X509;
-
-namespace Mono.Security.Providers.NewTls
-{
- interface ITlsConfiguration
- {
- bool HasCredentials {
- get;
- }
-
- void SetCertificate (MX.X509Certificate certificate, AsymmetricAlgorithm privateKey);
-
- bool? AskForClientCertificate {
- get; set;
- }
- }
-}
+++ /dev/null
-//
-// ITlsContext.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015-2016 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-extern alias NewSystemSource;
-
-using System;
-using System.Security.Cryptography;
-
-using Mono.Security.Interface;
-using MX = Mono.Security.X509;
-
-namespace Mono.Security.Providers.NewTls
-{
- interface ITlsContext : IDisposable
- {
- bool IsValid {
- get;
- }
-
- TlsException LastError {
- get;
- }
-
- bool ReceivedCloseNotify {
- get;
- }
-
- MonoTlsConnectionInfo ConnectionInfo {
- get;
- }
-
- MX.X509Certificate GetRemoteCertificate (out MX.X509CertificateCollection remoteCertificateStore);
-
- bool VerifyRemoteCertificate ();
-
- int GenerateNextToken (TlsBuffer incoming, TlsMultiBuffer outgoing);
-
- int DecryptMessage (ref TlsBuffer incoming);
-
- int EncryptMessage (ref TlsBuffer incoming);
-
- byte[] CreateAlert (Alert alert);
-
- byte[] CreateHelloRequest ();
- }
-}
-
+++ /dev/null
-//
-// MonoNewTlsStream.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-extern alias NewSystemSource;
-
-using EncryptionPolicy = NewSystemSource::System.Net.Security.EncryptionPolicy;
-using LocalCertificateSelectionCallback = NewSystemSource::System.Net.Security.LocalCertificateSelectionCallback;
-using RemoteCertificateValidationCallback = NewSystemSource::System.Net.Security.RemoteCertificateValidationCallback;
-using SslStream = NewSystemSource::System.Net.Security.SslStream;
-
-using System;
-using System.IO;
-using System.Threading.Tasks;
-
-using MSI = Mono.Security.Interface;
-
-using XAuthenticatedStream = System.Net.Security.AuthenticatedStream;
-using System.Security.Cryptography.X509Certificates;
-
-namespace Mono.Security.Providers.NewTls
-{
- public class MonoNewTlsStream : SslStream, MSI.IMonoSslStream
- {
- MSI.MonoTlsProvider provider;
-
- internal MonoNewTlsStream (Stream innerStream, MSI.MonoTlsProvider provider, MSI.MonoTlsSettings settings)
- : this (innerStream, false, provider, settings)
- {
- }
-
- internal MonoNewTlsStream (Stream innerStream, bool leaveOpen, MSI.MonoTlsProvider provider, MSI.MonoTlsSettings settings)
- : base (innerStream, leaveOpen, EncryptionPolicy.RequireEncryption, provider, settings)
- {
- this.provider = provider;
- }
-
- public MSI.MonoTlsProvider Provider {
- get { return provider; }
- }
-
- new public bool IsClosed {
- get { return base.IsClosed; }
- }
-
- public MSI.MonoTlsConnectionInfo GetConnectionInfo ()
- {
- return GetMonoConnectionInfo ();
- }
-
- public Task Shutdown ()
- {
- return Task.Factory.FromAsync ((state, result) => BeginShutdown (state, result), EndShutdown, null);
- }
-
- public Task RequestRenegotiation ()
- {
- return Task.Factory.FromAsync ((state, result) => BeginRenegotiate (state, result), EndRenegotiate, null);
- }
-
- X509Certificate MSI.IMonoSslStream.InternalLocalCertificate {
- get { return InternalLocalCertificate; }
- }
-
- XAuthenticatedStream MSI.IMonoSslStream.AuthenticatedStream {
- get { return this; }
- }
- }
-}
-
-
+++ /dev/null
-//
-// MonoNewTlsStreamFactory.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-extern alias NewSystemSource;
-
-using XEncryptionPolicy = NewSystemSource::System.Net.Security.EncryptionPolicy;
-using XSslPolicyErrors = NewSystemSource::System.Net.Security.SslPolicyErrors;
-using XLocalCertificateSelectionCallback = NewSystemSource::System.Net.Security.LocalCertificateSelectionCallback;
-using XRemoteCertificateValidationCallback = NewSystemSource::System.Net.Security.RemoteCertificateValidationCallback;
-
-using System;
-using System.IO;
-using System.Net.Security;
-using System.Security.Authentication;
-
-using Mono.Security.Interface;
-
-using PSSCX = System.Security.Cryptography.X509Certificates;
-using SSCX = System.Security.Cryptography.X509Certificates;
-
-namespace Mono.Security.Providers.NewTls
-{
- public static class MonoNewTlsStreamFactory
- {
- internal static IMonoSslStream CreateSslStream (
- Stream innerStream, bool leaveInnerStreamOpen,
- MonoTlsProvider provider, MonoTlsSettings settings = null)
- {
- return new MonoNewTlsStream (innerStream, leaveInnerStreamOpen, provider, settings);
- }
-
- public static MonoNewTlsStream CreateServer (
- Stream innerStream, bool leaveOpen, MonoTlsProvider provider, MonoTlsSettings settings,
- SSCX.X509Certificate serverCertificate, bool clientCertificateRequired,
- SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
- {
- var stream = new MonoNewTlsStream (innerStream, leaveOpen, provider, settings);
-
- try {
- stream.AuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
- } catch (Exception ex) {
- var tlsEx = stream.LastError;
- if (tlsEx != null)
- throw new AggregateException (ex, tlsEx);
- throw;
- }
-
- return stream;
- }
-
- public static MonoNewTlsStream CreateClient (
- Stream innerStream, bool leaveOpen, MonoTlsProvider provider, MonoTlsSettings settings,
- string targetHost, PSSCX.X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
- {
- var stream = new MonoNewTlsStream (innerStream, leaveOpen, provider, settings);
-
- try {
- stream.AuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation);
- } catch (Exception ex) {
- var tlsEx = stream.LastError;
- if (tlsEx != null)
- throw new AggregateException (ex, tlsEx);
- throw;
- }
- return stream;
- }
- }
-}
+++ /dev/null
-//
-// NewTlsProvider.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-extern alias NewSystemSource;
-
-using System;
-using System.IO;
-using System.Net;
-using System.Net.Security;
-using System.Security.Authentication;
-
-using MSI = Mono.Security.Interface;
-using MX = Mono.Security.X509;
-
-using PSSCX = System.Security.Cryptography.X509Certificates;
-using SSCX = System.Security.Cryptography.X509Certificates;
-
-namespace Mono.Security.Providers.NewTls
-{
- public class NewTlsProvider : MSI.MonoTlsProvider
- {
- static readonly Guid id = new Guid ("e5ff34f1-8b7a-4aa6-aff9-24719d709693");
-
- public override Guid ID {
- get { return id; }
- }
-
- public override string Name {
- get { return "newtls"; }
- }
-
- public override bool SupportsSslStream {
- get { return true; }
- }
-
- public override bool SupportsConnectionInfo {
- get { return true; }
- }
-
- public override bool SupportsMonoExtensions {
- get { return true; }
- }
-
- internal override bool SupportsTlsContext {
- get { return true; }
- }
-
- public override SslProtocols SupportedProtocols {
- get { return SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls; }
- }
-
- public override MSI.IMonoSslStream CreateSslStream (
- Stream innerStream, bool leaveInnerStreamOpen,
- MSI.MonoTlsSettings settings = null)
- {
- return MonoNewTlsStreamFactory.CreateSslStream (innerStream, leaveInnerStreamOpen, this, settings);
- }
-
- internal override MSI.IMonoTlsContext CreateTlsContext (
- string hostname, bool serverMode, MSI.TlsProtocols protocolFlags,
- SSCX.X509Certificate serverCertificate, PSSCX.X509CertificateCollection clientCertificates,
- bool remoteCertRequired, MSI.MonoEncryptionPolicy encryptionPolicy,
- MSI.MonoTlsSettings settings)
- {
- var config = TlsProviderFactory.CreateTlsConfiguration (
- hostname, serverMode, protocolFlags, serverCertificate,
- remoteCertRequired, settings);
- return new TlsContextWrapper (config, serverMode);
- }
- }
-}
-
+++ /dev/null
-//
-// TlsContextWrapper.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-extern alias NewSystemSource;
-
-using System;
-using System.Security.Cryptography;
-
-using SSCX = System.Security.Cryptography.X509Certificates;
-using PSSCX = System.Security.Cryptography.X509Certificates;
-
-using MSI = Mono.Security.Interface;
-using MX = Mono.Security.X509;
-
-namespace Mono.Security.Providers.NewTls
-{
- class TlsContextWrapper : IDisposable, MSI.IMonoTlsContext
- {
- ITlsConfiguration config;
- ITlsContext context;
- bool serverMode;
-
- public TlsContextWrapper (ITlsConfiguration config, bool serverMode)
- {
- this.config = config;
- this.serverMode = serverMode;
- }
-
- public bool IsServer {
- get { return serverMode; }
- }
-
- public bool IsValid {
- get { return context != null && context.IsValid; }
- }
-
- public void Initialize (MSI.IMonoTlsEventSink eventSink)
- {
- if (context != null)
- throw new InvalidOperationException ();
- context = TlsProviderFactory.CreateTlsContext (config, serverMode, eventSink);
- }
-
- void Clear ()
- {
- if (context != null) {
- context.Dispose ();
- context = null;
- }
- }
-
- public ITlsConfiguration Configuration {
- get {
- if (config == null)
- throw new ObjectDisposedException ("TlsConfiguration");
- return config;
- }
- }
-
- public ITlsContext Context {
- get {
- if (!IsValid)
- throw new ObjectDisposedException ("TlsContext");
- return context;
- }
- }
-
- public bool HasCredentials {
- get { return Configuration.HasCredentials; }
- }
-
- public void SetCertificate (SSCX.X509Certificate certificate, AsymmetricAlgorithm privateKey)
- {
- var monoCert = new MX.X509Certificate (certificate.GetRawCertData ());
- Configuration.SetCertificate (monoCert, privateKey);
- }
-
- public int GenerateNextToken (MSI.IBufferOffsetSize incoming, out MSI.IBufferOffsetSize outgoing)
- {
- var input = incoming != null ? new MSI.TlsBuffer (BOSWrapper.Wrap (incoming)) : null;
- var output = new MSI.TlsMultiBuffer ();
- var retval = Context.GenerateNextToken (input, output);
- if (output.IsEmpty)
- outgoing = null;
- outgoing = BOSWrapper.Wrap (output.StealBuffer ());
- return (int)retval;
- }
-
- public int EncryptMessage (ref MSI.IBufferOffsetSize incoming)
- {
- var buffer = new MSI.TlsBuffer (BOSWrapper.Wrap (incoming));
- var retval = Context.EncryptMessage (ref buffer);
- incoming = BOSWrapper.Wrap (buffer.GetRemaining ());
- return (int)retval;
- }
-
- public int DecryptMessage (ref MSI.IBufferOffsetSize incoming)
- {
- var buffer = new MSI.TlsBuffer (BOSWrapper.Wrap (incoming));
- var retval = Context.DecryptMessage (ref buffer);
- incoming = buffer != null ? BOSWrapper.Wrap (buffer.GetRemaining ()) : null;
- return (int)retval;
- }
-
- class BOSWrapper : MSI.IBufferOffsetSize
- {
- public byte[] Buffer {
- get;
- private set;
- }
-
- public int Offset {
- get;
- private set;
- }
-
- public int Size {
- get;
- private set;
- }
-
- BOSWrapper (byte[] buffer, int offset, int size)
- {
- Buffer = buffer;
- Offset = offset;
- Size = size;
- }
-
- public static BOSWrapper Wrap (MSI.IBufferOffsetSize bos)
- {
- return bos != null ? new BOSWrapper (bos.Buffer, bos.Offset, bos.Size) : null;
- }
- }
-
- public byte[] CreateCloseNotify ()
- {
- return Context.CreateAlert (new MSI.Alert (MSI.AlertLevel.Warning, MSI.AlertDescription.CloseNotify));
- }
-
- public byte[] CreateHelloRequest ()
- {
- return Context.CreateHelloRequest ();
- }
-
- public SSCX.X509Certificate GetRemoteCertificate (out PSSCX.X509CertificateCollection remoteCertificateStore)
- {
- MX.X509CertificateCollection monoCollection;
- var remoteCert = Context.GetRemoteCertificate (out monoCollection);
- if (remoteCert == null) {
- remoteCertificateStore = null;
- return null;
- }
-
- remoteCertificateStore = new PSSCX.X509CertificateCollection ();
- foreach (var cert in monoCollection) {
- remoteCertificateStore.Add (new PSSCX.X509Certificate2 (cert.RawData));
- }
- return new PSSCX.X509Certificate2 (remoteCert.RawData);
-
- }
-
- public bool VerifyRemoteCertificate ()
- {
- return Context.VerifyRemoteCertificate ();
- }
-
- public Exception LastError {
- get {
- if (context != null)
- return context.LastError;
- return null;
- }
- }
-
- public bool ReceivedCloseNotify {
- get {
- return Context.ReceivedCloseNotify;
- }
- }
-
- public MSI.MonoTlsConnectionInfo GetConnectionInfo ()
- {
- return Context.ConnectionInfo;
- }
-
- public void Dispose ()
- {
- Dispose (true);
- GC.SuppressFinalize (this);
- }
-
- void Dispose (bool disposing)
- {
- Clear ();
- }
- }
-}
-
+++ /dev/null
-//
-// TlsProviderFactory.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015-2016 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-extern alias NewSystemSource;
-
-using System;
-using System.IO;
-
-using System.Net;
-using System.Net.Security;
-using System.Security.Authentication;
-
-using MSI = Mono.Security.Interface;
-using MX = Mono.Security.X509;
-
-using PSSCX = System.Security.Cryptography.X509Certificates;
-using SSCX = System.Security.Cryptography.X509Certificates;
-
-namespace Mono.Security.Providers.NewTls
-{
- static class TlsProviderFactory
- {
- const string assemblyName = "Mono.Security.NewTls, Version=4.0.0.0, Culture=neutral, PublicKeyToken=84e3aee7225169c2";
- const string tlsConfigTypeName = "Mono.Security.NewTls.TlsConfiguration";
- const string tlsContextTypeName = "Mono.Security.NewTls.TlsContext";
-
- static object CreateInstance (string typeName, object[] args)
- {
- var type = Type.GetType (typeName + ", " + assemblyName);
- return Activator.CreateInstance (type, args);
- }
-
- internal static ITlsConfiguration CreateTlsConfiguration (
- string hostname, bool serverMode, MSI.TlsProtocols protocolFlags,
- SSCX.X509Certificate serverCertificate, bool remoteCertRequired,
- MSI.MonoTlsSettings settings)
- {
- object[] args;
- ITlsConfiguration config;
- if (serverMode) {
- var cert = (PSSCX.X509Certificate2)serverCertificate;
- var monoCert = new MX.X509Certificate (cert.RawData);
- args = new object[] {
- (MSI.TlsProtocols)protocolFlags,
- (MSI.MonoTlsSettings)settings,
- monoCert,
- cert.PrivateKey
- };
- } else {
- args = new object[] {
- (MSI.TlsProtocols)protocolFlags,
- (MSI.MonoTlsSettings)settings,
- hostname
- };
- }
-
- config = (ITlsConfiguration)CreateInstance (tlsConfigTypeName, args);
-
- if (serverMode && remoteCertRequired)
- config.AskForClientCertificate = true;
-
- return config;
- }
-
- internal static ITlsContext CreateTlsContext (
- ITlsConfiguration config, bool serverMode,
- MSI.IMonoTlsEventSink eventSink)
- {
- return (ITlsContext)CreateInstance (
- tlsContextTypeName,
- new object[] { config, serverMode, eventSink });
- }
- }
-}
+++ /dev/null
-//
-// AssemblyInfo.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Reflection;
-using System.Resources;
-using System.Security;
-using System.Security.Permissions;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about the system assembly
-
-[assembly: AssemblyVersion (Consts.FxVersion)]
-
-[assembly: AssemblyCompany ("Xamarin")]
-[assembly: AssemblyCopyright ("(c) 2015 Xamarin")]
-[assembly: AssemblyDescription ("Mono.Security.Providers.NewTls.dll")]
-[assembly: AssemblyProduct ("MONO CLI")]
-[assembly: AssemblyTitle ("Mono.Security.Providers.NewTls.dll")]
-[assembly: CLSCompliant (false)]
-[assembly: ComVisible (false)]
-[assembly: NeutralResourcesLanguage ("en-US")]
-
-[assembly: InternalsVisibleTo ("Mono.Security.NewTls, PublicKey=002400000480000094000000060200000024000052534131000400001100000003336d6aed41624ca156ab579881fe90a576f1dfec48378fc94e4e440f4556776224e2d70c18996d91f36227f539fdb44340e07651f1455a489b29a7e6219a8f85e52b0f8588b4f8a857746a8468d37b556223d1452f3fcbaf0f269cdf1900ceb68f69485dc5887750d19571030c732331e00387d9b813a9ad52891087301793")]
+++ /dev/null
-Properties/AssemblyInfo.cs
-
-Mono.Security.Providers.NewTls/ITlsConfiguration.cs
-Mono.Security.Providers.NewTls/ITlsContext.cs
-
-Mono.Security.Providers.NewTls/MonoNewTlsStream.cs
-Mono.Security.Providers.NewTls/MonoNewTlsStreamFactory.cs
+++ /dev/null
-#include mobile_Mono.Security.Providers.NewTls.dll.sources
+++ /dev/null
-thisdir = class/Mono.Security.Providers.OldTls
-SUBDIRS =
-include ../../build/rules.make
-
-LIBRARY = Mono.Security.Providers.OldTls.dll
-LIB_REFS = System Mono.Security
-LIB_MCS_FLAGS = -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -d:SECURITY_DEP
-
-include ../../build/library.make
-
-$(the_lib): ../Mono.Security/Makefile
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.30729</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{E485E885-59B1-4081-BC66-56AAAFD8771A}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <OutputPath>./../../class/lib/net_4_x</OutputPath>\r
- <IntermediateOutputPath>obj-net_4_x</IntermediateOutputPath>\r
- <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
- <NoStdLib>True</NoStdLib>\r
- \r
- <NoConfig>True</NoConfig>\r
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>\r
- </RootNamespace>\r
- <AssemblyName>Mono.Security.Providers.OldTls</AssemblyName>\r
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <SignAssembly>true</SignAssembly>\r
- <DelaySign>true</DelaySign>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <Optimize>false</Optimize>\r
- <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;SECURITY_DEP</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <Optimize>true</Optimize>\r
- <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;SECURITY_DEP</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <!-- Set AddAdditionalExplicitAssemblyReferences to false, otherwise if targetting .NET4.0, \r
- Microsoft.NETFramework.props will force a dependency on the assembly System.Core. This\r
- is a problem to compile the Mono mscorlib.dll -->\r
- <PropertyGroup>\r
- <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>\r
- </PropertyGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs" />\r
- <Compile Include="..\..\build\common\Locale.cs" />\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Cryptography\MD5SHA1.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Cryptography\TlsHMAC.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Client\TlsClientCertificate.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Client\TlsClientCertificateVerify.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Client\TlsClientFinished.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Client\TlsClientHello.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Client\TlsClientKeyExchange.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Client\TlsServerCertificate.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Client\TlsServerCertificateRequest.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Client\TlsServerFinished.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Client\TlsServerHello.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Client\TlsServerHelloDone.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Client\TlsServerKeyExchange.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Server\TlsClientCertificate.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Server\TlsClientCertificateVerify.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Server\TlsClientFinished.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Server\TlsClientHello.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Server\TlsClientKeyExchange.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Server\TlsServerCertificate.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Server\TlsServerCertificateRequest.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Server\TlsServerFinished.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Server\TlsServerHello.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Server\TlsServerHelloDone.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Server\TlsServerKeyExchange.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake\ClientCertificateType.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake\HandshakeMessage.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake\HandshakeType.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\Alert.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\CipherAlgorithmType.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\CipherSuite.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\CipherSuiteCollection.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\CipherSuiteFactory.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\ClientContext.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\ClientRecordProtocol.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\ClientSessionCache.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\ContentType.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\Context.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\DebugHelper.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\ExchangeAlgorithmType.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\HandshakeState.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\HashAlgorithmType.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\HttpsClientStream.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\RecordProtocol.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\RSASslSignatureDeformatter.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\RSASslSignatureFormatter.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\SecurityCompressionType.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\SecurityParameters.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\SecurityProtocolType.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\ServerContext.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\ServerRecordProtocol.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\SslCipherSuite.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\SslClientStream.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\SslHandshakeHash.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\SslServerStream.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\SslStreamBase.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\TlsCipherSuite.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\TlsClientSettings.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\TlsException.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\TlsServerSettings.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\TlsStream.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.X509.Extensions\AuthorityKeyIdentifierExtension.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.X509.Extensions\ExtendedKeyUsageExtension.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.X509.Extensions\GeneralNames.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.X509.Extensions\NetscapeCertTypeExtension.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.X509.Extensions\SubjectAltNameExtension.cs" />\r
- <Compile Include="..\System\Mono.Net.Security\LegacySslStream.cs" />\r
- <Compile Include=".\Mono.Security.Providers.OldTls\OldTlsProvider.cs" />\r
- <Compile Include=".\Properties\AssemblyInfo.cs" />\r </ItemGroup>\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <PropertyGroup>\r
- <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
-
- </PreBuildEvent>\r
- <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
-\r
- </PreBuildEvent>\r
- <PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
-
- </PostBuildEvent>\r
- <PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
-\r
- </PostBuildEvent>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="../corlib/corlib-net_4_x.csproj">\r
- <Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
- <Name>corlib-net_4_x</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="../System/System-net_4_x.csproj">\r
- <Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>\r
- <Name>System-net_4_x</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="../Mono.Security/Mono.Security-net_4_x.csproj">\r
- <Project>{42D59DE7-586F-4ACF-BDD5-E7869E39E3EF}</Project>\r
- <Name>Mono.Security-net_4_x</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
-</Project>\r
-
+++ /dev/null
-./Properties/AssemblyInfo.cs
-../../build/common/Consts.cs
-../../build/common/Locale.cs
-../../build/common/MonoTODOAttribute.cs
-
-./Mono.Security.Providers.OldTls/OldTlsProvider.cs
-../System/Mono.Net.Security/LegacySslStream.cs
-
-../Mono.Security/Mono.Security.Cryptography/MD5SHA1.cs
-../Mono.Security/Mono.Security.Cryptography/TlsHMAC.cs
-../Mono.Security/Mono.Security.Protocol.Tls/Alert.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherAlgorithmType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherSuite.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteCollection.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ClientContext.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ClientRecordProtocol.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ClientSessionCache.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ContentType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/Context.cs
-../Mono.Security/Mono.Security.Protocol.Tls/DebugHelper.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/HandshakeState.cs
-../Mono.Security/Mono.Security.Protocol.Tls/HashAlgorithmType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs
-../Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs
-../Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SecurityCompressionType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SecurityParameters.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SecurityProtocolType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ServerContext.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ServerRecordProtocol.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslCipherSuite.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslHandshakeHash.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsCipherSuite.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsClientSettings.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsException.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsServerSettings.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs
-../Mono.Security/Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtension.cs
-../Mono.Security/Mono.Security.X509.Extensions/ExtendedKeyUsageExtension.cs
-../Mono.Security/Mono.Security.X509.Extensions/GeneralNames.cs
-../Mono.Security/Mono.Security.X509.Extensions/NetscapeCertTypeExtension.cs
-../Mono.Security/Mono.Security.X509.Extensions/SubjectAltNameExtension.cs
+++ /dev/null
-//
-// OldTlsProvider.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.IO;
-using System.Net;
-using System.Net.Security;
-using System.Security.Authentication;
-using System.Security.Cryptography.X509Certificates;
-using Mono.Security.Interface;
-using MNS = Mono.Net.Security;
-
-namespace Mono.Security.Providers.OldTls
-{
- public class OldTlsProvider : MonoTlsProvider
- {
- static readonly Guid id = new Guid ("cf8baa0d-c6ed-40ae-b512-dec8d097e9af");
-
- public override Guid ID {
- get { return id; }
- }
-
- public override string Name {
- get { return "old"; }
- }
-
- public override bool SupportsSslStream {
- get { return true; }
- }
-
- public override bool SupportsMonoExtensions {
- get { return false; }
- }
-
- public override bool SupportsConnectionInfo {
- get { return false; }
- }
-
- internal override bool SupportsTlsContext {
- get { return false; }
- }
-
- public override SslProtocols SupportedProtocols {
- get { return SslProtocols.Tls; }
- }
-
- public override IMonoSslStream CreateSslStream (
- Stream innerStream, bool leaveInnerStreamOpen,
- MonoTlsSettings settings = null)
- {
- var impl = new MNS.Private.LegacySslStream (innerStream, leaveInnerStreamOpen, this, settings);
- return new MNS.Private.MonoSslStreamImpl (impl);
- }
-
- internal override IMonoTlsContext CreateTlsContext (
- string hostname, bool serverMode, TlsProtocols protocolFlags,
- X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
- bool remoteCertRequired, MonoEncryptionPolicy encryptionPolicy,
- MonoTlsSettings settings)
- {
- throw new NotSupportedException ();
- }
- }
-}
-
+++ /dev/null
-//
-// AssemblyInfo.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Reflection;
-using System.Resources;
-using System.Security;
-using System.Security.Permissions;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about the system assembly
-
-[assembly: AssemblyVersion (Consts.FxVersion)]
-
-[assembly: AssemblyCompany ("MONO development team")]
-[assembly: AssemblyCopyright ("(c) 2015 Xamarin")]
-[assembly: AssemblyDescription ("Mono.Security.Providers.OldTls.dll")]
-[assembly: AssemblyProduct ("MONO CLI")]
-[assembly: AssemblyTitle ("Mono.Security.Providers.OldTls.dll")]
-[assembly: CLSCompliant (true)]
-[assembly: ComVisible (false)]
-[assembly: NeutralResourcesLanguage ("en-US")]
-
[assembly: InternalsVisibleTo ("System, PublicKey=00000000000000000400000000000000")]
#endif
-[assembly: InternalsVisibleTo ("Mono.Security.Providers.NewTls, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
-[assembly: InternalsVisibleTo ("Mono.Security.Providers.OldTls, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
-[assembly: InternalsVisibleTo ("Mono.Security.Providers.DotNet, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
-[assembly: InternalsVisibleTo ("Mono.Security.Providers.NewSystemSource, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
-[assembly: InternalsVisibleTo ("Xamarin.BoringTls, PublicKey=002400000480000094000000060200000024000052534131000400001100000099dd12eda85767ae6f06023ee28e711c7e5a212462095c83868c29db75eddf6d8e296e03824c14fedd5f55553fed0b6173be3cc985a4b7f9fb7c83ccff8ba3938563b3d1f45a81122f12a1bcb73edcaad61a8456c7595a6da5184b4dd9d10f011b949ef1391fccfeab1ba62aa51c267ef8bd57ef1b6ba5a4c515d0badb81a78f")]
get; set;
}
+ public string PeerDomainName {
+ get; set;
+ }
+
public override string ToString ()
{
return string.Format ("[MonoTlsConnectionInfo: {0}:{1}]", ProtocolVersion, CipherSuiteCode);
else {
IPHostEntry he = Dns.Resolve (Dns.GetHostName());
if (he.AddressList.Length == 0) throw new RemotingException ("IP address could not be determined for this host");
- host = he.AddressList [0].ToString ();
+ AddressFamily addressFamily = (Socket.OSSupportsIPv4) ? AddressFamily.InterNetwork : AddressFamily.InterNetworkV6;
+ IPAddress addr = GetMachineAddress (he, addressFamily);
+ if (addr != null)
+ host = addr.ToString ();
+ else
+ host = he.AddressList [0].ToString ();
}
}
else
server_thread.Join ();
server_thread = null;
}
+
+ private static IPAddress GetMachineAddress (IPHostEntry host, AddressFamily addressFamily)
+ {
+ IPAddress result = null;
+ if (host != null) {
+ IPAddress[] addressList = host.AddressList;
+ for (int i = 0; i < addressList.Length; i++) {
+ if (addressList[i].AddressFamily == addressFamily) {
+ result = addressList[i];
+ break;
+ }
+ }
+ }
+
+ return result;
+ }
}
class ClientConnection
[assembly: StringFreezing]
[assembly: DefaultDependency (LoadHint.Always)]
- [assembly: InternalsVisibleTo ("Mono.Security.Providers.NewSystemSource, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
- [assembly: InternalsVisibleTo ("Mono.Security.Providers.OldTls, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
- [assembly: InternalsVisibleTo ("Mono.Security.Providers.NewTls, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
- [assembly: InternalsVisibleTo ("Mono.Security.Providers.DotNet, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
[assembly: InternalsVisibleTo ("Mono.Security, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
- [assembly: InternalsVisibleTo ("Xamarin.BoringTls, PublicKey=002400000480000094000000060200000024000052534131000400001100000099dd12eda85767ae6f06023ee28e711c7e5a212462095c83868c29db75eddf6d8e296e03824c14fedd5f55553fed0b6173be3cc985a4b7f9fb7c83ccff8ba3938563b3d1f45a81122f12a1bcb73edcaad61a8456c7595a6da5184b4dd9d10f011b949ef1391fccfeab1ba62aa51c267ef8bd57ef1b6ba5a4c515d0badb81a78f")]
static IMonoTlsProvider CreateDefaultProvider ()
{
#if SECURITY_DEP
- MSI.MonoTlsProvider provider = null;
-#if MONO_FEATURE_NEW_SYSTEM_SOURCE
- /*
- * This is a hack, which is used in the Mono.Security.Providers.NewSystemSource
- * assembly, which will provide a "fake" System.dll. Use the public Mono.Security
- * API to get the "real" System.dll's provider via reflection, then wrap it with
- * the "fake" version's perceived view.
- *
- * NewSystemSource needs to compile MonoTlsProviderFactory.cs, IMonoTlsProvider.cs,
- * MonoTlsProviderWrapper.cs and CallbackHelpers.cs from this directory and only these.
- */
- provider = MSI.MonoTlsProviderFactory.GetProvider ();
-#else
- provider = CreateDefaultProviderImpl ();
-#endif
+ MSI.MonoTlsProvider provider = CreateDefaultProviderImpl ();
if (provider != null)
return new Private.MonoTlsProviderWrapper (provider);
#endif
#endregion
-#if SECURITY_DEP && !MONO_FEATURE_NEW_SYSTEM_SOURCE
+#if SECURITY_DEP
static Dictionary<string,string> providerRegistration;
return;
providerRegistration = new Dictionary<string,string> ();
providerRegistration.Add ("legacy", "Mono.Net.Security.Private.MonoLegacyTlsProvider");
- providerRegistration.Add ("newtls", "Mono.Security.Providers.NewTls.NewTlsProvider, Mono.Security.Providers.NewTls, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756");
- providerRegistration.Add ("oldtls", "Mono.Security.Providers.OldTls.OldTlsProvider, Mono.Security.Providers.OldTls, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756");
#if HAVE_BTLS
if (Mono.Btls.MonoBtlsProvider.IsSupported ())
providerRegistration.Add ("btls", "Mono.Btls.MonoBtlsProvider");
+++ /dev/null
-//
-// Internal.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System.Runtime.InteropServices;
-using System.Security.Cryptography.X509Certificates;
-
-namespace System.Net.Security
-{
- //From Schannel.h
- [Flags]
- internal enum SchProtocols
- {
- Zero = 0,
- PctClient = 0x00000002,
- PctServer = 0x00000001,
- Pct = (PctClient | PctServer),
- Ssl2Client = 0x00000008,
- Ssl2Server = 0x00000004,
- Ssl2 = (Ssl2Client | Ssl2Server),
- Ssl3Client = 0x00000020,
- Ssl3Server = 0x00000010,
- Ssl3 = (Ssl3Client | Ssl3Server),
- Tls10Client = 0x00000080,
- Tls10Server = 0x00000040,
- Tls10 = (Tls10Client | Tls10Server),
- Tls11Client = 0x00000200,
- Tls11Server = 0x00000100,
- Tls11 = (Tls11Client | Tls11Server),
- Tls12Client = 0x00000800,
- Tls12Server = 0x00000400,
- Tls12 = (Tls12Client | Tls12Server),
- Ssl3Tls = (Ssl3 | Tls10),
- UniClient = unchecked((int)0x80000000),
- UniServer = 0x40000000,
- Unified = (UniClient | UniServer),
- ClientMask = (PctClient | Ssl2Client | Ssl3Client | Tls10Client | Tls11Client | Tls12Client | UniClient),
- ServerMask = (PctServer | Ssl2Server | Ssl3Server | Tls10Server | Tls11Server | Tls12Server | UniServer)
- }
-
- //From Schannel.h
- [StructLayout (LayoutKind.Sequential)]
- internal class SslConnectionInfo
- {
- public readonly int Protocol;
- public readonly int DataCipherAlg;
- public readonly int DataKeySize;
- public readonly int DataHashAlg;
- public readonly int DataHashKeySize;
- public readonly int KeyExchangeAlg;
- public readonly int KeyExchKeySize;
-
- internal SslConnectionInfo (int protocol)
- {
- Protocol = protocol;
- }
- }
-}
+++ /dev/null
-//
-// SSPIConfiguration.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#if MONO_FEATURE_NEW_TLS && SECURITY_DEP
-#if MONO_SECURITY_ALIAS
-extern alias MonoSecurity;
-using MonoSecurity::Mono.Security.Interface;
-#else
-using Mono.Security.Interface;
-#endif
-using Mono.Net.Security;
-
-namespace System.Net.Security
-{
- internal interface SSPIConfiguration
- {
- IMonoTlsProvider Provider {
- get;
- }
-
- MonoTlsSettings Settings {
- get;
- }
-
- IMonoTlsEventSink EventSink {
- get;
- }
- }
-}
-#endif
+++ /dev/null
-//
-// SafeHandles.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-#if MONO_FEATURE_NEW_TLS && SECURITY_DEP
-#if MONO_SECURITY_ALIAS
-extern alias MonoSecurity;
-using IMonoTlsContext = MonoSecurity::Mono.Security.Interface.IMonoTlsContext;
-#else
-using IMonoTlsContext = Mono.Security.Interface.IMonoTlsContext;
-#endif
-
-using System.Runtime.InteropServices;
-using System.Security.Cryptography.X509Certificates;
-
-namespace System.Net.Security
-{
- class DummySafeHandle : SafeHandle
- {
- protected DummySafeHandle ()
- : base ((IntPtr)(-1), true)
- {
- }
-
- protected override bool ReleaseHandle ()
- {
- return true;
- }
-
- public override bool IsInvalid {
- get { return handle == (IntPtr)(-1); }
- }
- }
-
- class SafeFreeCertContext : DummySafeHandle
- {
- }
-
- class SafeFreeCredentials : DummySafeHandle
- {
- SecureCredential credential;
-
- public X509Certificate2 Certificate {
- get {
- if (IsInvalid)
- throw new ObjectDisposedException ("Certificate");
- return credential.certificate;
- }
- }
-
- public SafeFreeCredentials (SecureCredential credential)
- {
- this.credential = credential;
- bool success = true;
- DangerousAddRef (ref success);
- }
-
- public override bool IsInvalid {
- get {
- return credential.certificate == null;
- }
- }
-
- protected override bool ReleaseHandle ()
- {
- credential.Clear ();
- return base.ReleaseHandle ();
- }
- }
-
- class SafeDeleteContext : DummySafeHandle
- {
- IMonoTlsContext context;
-
- public IMonoTlsContext Context {
- get {
- if (IsInvalid)
- throw new ObjectDisposedException ("TlsContext");
- return context;
- }
- }
-
- public SafeDeleteContext (IMonoTlsContext context)
- {
- this.context = context;
- }
-
- public override bool IsInvalid {
- get {
- return context == null || !context.IsValid;
- }
- }
-
- protected override bool ReleaseHandle ()
- {
- context.Dispose ();
- context = null;
- return base.ReleaseHandle ();
- }
- }
-
- struct SecureCredential
- {
- public const int CurrentVersion = 0x4;
-
- [Flags]
- public enum Flags
- {
- Zero = 0,
- NoSystemMapper = 0x02,
- NoNameCheck = 0x04,
- ValidateManual = 0x08,
- NoDefaultCred = 0x10,
- ValidateAuto = 0x20,
- SendAuxRecord = 0x00200000,
- UseStrongCrypto = 0x00400000
- }
-
- int version;
- internal X509Certificate2 certificate;
- SchProtocols protocols;
- EncryptionPolicy policy;
-
- public SecureCredential (int version, X509Certificate2 certificate, SecureCredential.Flags flags, SchProtocols protocols, EncryptionPolicy policy)
- {
- this.version = version;
- this.certificate = certificate;
- this.protocols = protocols;
- this.policy = policy;
- }
-
- public void Clear ()
- {
- certificate = null;
- }
- }
-
- internal class SafeCredentialReference : DummySafeHandle
- {
- //
- // Static cache will return the target handle if found the reference in the table.
- //
- internal SafeFreeCredentials _Target;
-
- //
- //
- internal static SafeCredentialReference CreateReference (SafeFreeCredentials target)
- {
- SafeCredentialReference result = new SafeCredentialReference (target);
- if (result.IsInvalid)
- return null;
-
- return result;
- }
-
- private SafeCredentialReference (SafeFreeCredentials target)
- : base ()
- {
- // Bumps up the refcount on Target to signify that target handle is statically cached so
- // its dispose should be postponed
- bool b = false;
- try {
- target.DangerousAddRef (ref b);
- } catch {
- if (b) {
- target.DangerousRelease ();
- b = false;
- }
- } finally {
- if (b) {
- _Target = target;
- SetHandle (new IntPtr (0)); // make this handle valid
- }
- }
- }
-
- override protected bool ReleaseHandle ()
- {
- SafeFreeCredentials target = _Target;
- if (target != null)
- target.DangerousRelease ();
- _Target = null;
- return true;
- }
- }
-
-}
-#endif
+++ /dev/null
-//
-// SSPIWrapper.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#if MONO_FEATURE_NEW_TLS && SECURITY_DEP
-#if MONO_SECURITY_ALIAS
-extern alias MonoSecurity;
-#endif
-
-#if MONO_SECURITY_ALIAS
-using MX = MonoSecurity::Mono.Security.X509;
-using MonoSecurity::Mono.Security.Interface;
-#else
-using MX = Mono.Security.X509;
-using Mono.Security.Interface;
-#endif
-
-using System.Runtime.InteropServices;
-using System.Security.Authentication.ExtendedProtection;
-using System.Security.Cryptography.X509Certificates;
-using MNS = Mono.Net.Security;
-
-namespace System.Net.Security
-{
- internal class SSPIInterface
- {
- public IMonoTlsContext Context {
- get;
- private set;
- }
-
- public IMonoTlsEventSink EventSink {
- get;
- private set;
- }
-
- public SSPIInterface (IMonoTlsContext context, IMonoTlsEventSink eventSink)
- {
- Context = context;
- EventSink = eventSink;
- }
- }
-
- internal static class GlobalSSPI
- {
- internal static SSPIInterface Create (string hostname, bool serverMode, SchProtocols protocolFlags, X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
- bool remoteCertRequired, bool checkCertName, bool checkCertRevocationStatus, EncryptionPolicy encryptionPolicy,
- LocalCertSelectionCallback certSelectionDelegate, RemoteCertValidationCallback remoteValidationCallback, SSPIConfiguration userConfig)
- {
- if (userConfig.Settings != null && remoteValidationCallback != null)
- throw new InvalidOperationException ();
- var context = userConfig.Provider.CreateTlsContext (
- hostname, serverMode, (TlsProtocols)protocolFlags, serverCertificate, clientCertificates,
- remoteCertRequired, checkCertName, checkCertRevocationStatus,
- (MonoEncryptionPolicy)encryptionPolicy, userConfig.Settings);
- return new SSPIInterface (context, userConfig.EventSink);
- }
- }
-
- /*
- * SSPIWrapper _is a _class that provides a managed implementation of the equivalent
- * _class _in Microsofts .NET Framework.
- *
- * The SSPIWrapper class is used by the TLS/SSL stack to implement both the
- * protocol handshake as well as the encryption and decryption of messages.
- *
- * Microsoft's implementation of this class is merely a P/Invoke wrapper
- * around the native SSPI APIs on Windows. This implementation instead,
- * provides a managed implementation that uses the cross platform Mono.Security
- * to provide the equivalent functionality.
- *
- * Ideally, this should be abstracted with a different name, and decouple
- * the naming from the SSPIWrapper name, but this allows Mono to reuse
- * the .NET code with minimal changes.
- *
- * The "internal" methods here are the API that is consumed by the class
- * libraries.
- */
- internal static class SSPIWrapper
- {
- static void SetCredentials (SSPIInterface secModule, SafeFreeCredentials credentials)
- {
- if (credentials != null && !credentials.IsInvalid) {
- if (!secModule.Context.HasCredentials && credentials.Certificate != null) {
- var cert = new X509Certificate2 (credentials.Certificate.RawData);
- secModule.Context.SetCertificate (cert, credentials.Certificate.PrivateKey);
- }
- bool success = true;
- credentials.DangerousAddRef (ref success);
- }
- }
-
- /*
- * @safecontext is null on the first use, but it will become non-null for invocations
- * where the connection is being re-negotiated.
- *
- */
- internal static int AcceptSecurityContext (SSPIInterface secModule, ref SafeFreeCredentials credentials, ref SafeDeleteContext safeContext, ContextFlags inFlags, Endianness endianness, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, ref ContextFlags outFlags)
- {
- if (endianness != Endianness.Native)
- throw new NotSupportedException ();
-
- if (safeContext == null) {
- if (credentials == null || credentials.IsInvalid)
- return (int)SecurityStatus.CredentialsNeeded;
-
- secModule.Context.Initialize (secModule.EventSink);
- safeContext = new SafeDeleteContext (secModule.Context);
- }
-
- SetCredentials (secModule, credentials);
-
- var incoming = GetInputBuffer (inputBuffer);
- IBufferOffsetSize outgoing;
-
- var retval = (int)safeContext.Context.GenerateNextToken (incoming, out outgoing);
- UpdateOutput (outgoing, outputBuffer);
- return retval;
- }
-
- internal static int InitializeSecurityContext (SSPIInterface secModule, ref SafeFreeCredentials credentials, ref SafeDeleteContext safeContext, string targetName, ContextFlags inFlags, Endianness endianness, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, ref ContextFlags outFlags)
- {
- if (inputBuffer != null)
- throw new InvalidOperationException ();
-
- if (safeContext == null) {
- secModule.Context.Initialize (secModule.EventSink);
- safeContext = new SafeDeleteContext (secModule.Context);
- }
-
- return InitializeSecurityContext (secModule, credentials, ref safeContext, targetName, inFlags, endianness, null, outputBuffer, ref outFlags);
- }
-
- internal static int InitializeSecurityContext (SSPIInterface secModule, SafeFreeCredentials credentials, ref SafeDeleteContext safeContext, string targetName, ContextFlags inFlags, Endianness endianness, SecurityBuffer[] inputBuffers, SecurityBuffer outputBuffer, ref ContextFlags outFlags)
- {
- if (endianness != Endianness.Native)
- throw new NotSupportedException ();
-
- SetCredentials (secModule, credentials);
-
- SecurityBuffer inputBuffer = null;
- if (inputBuffers != null) {
- if (inputBuffers.Length != 2 || inputBuffers [1].type != BufferType.Empty)
- throw new NotSupportedException ();
- inputBuffer = inputBuffers [0];
- }
-
- var incoming = GetInputBuffer (inputBuffer);
- IBufferOffsetSize outgoing = null;
-
- var retval = (int)safeContext.Context.GenerateNextToken (incoming, out outgoing);
- UpdateOutput (outgoing, outputBuffer);
- return retval;
- }
-
- internal static int EncryptMessage (SSPIInterface secModule, SafeDeleteContext safeContext, SecurityBuffer securityBuffer, uint sequenceNumber)
- {
- var incoming = GetInputBuffer (securityBuffer);
- var retval = (int)safeContext.Context.EncryptMessage (ref incoming);
- UpdateOutput (incoming, securityBuffer);
- return retval;
- }
-
- internal static int DecryptMessage (SSPIInterface secModule, SafeDeleteContext safeContext, SecurityBuffer securityBuffer, uint sequenceNumber)
- {
- var incoming = GetInputBuffer (securityBuffer);
- var retval = (int)safeContext.Context.DecryptMessage (ref incoming);
- UpdateOutput (incoming, securityBuffer);
- return retval;
- }
-
- internal static byte[] CreateShutdownMessage (SSPIInterface secModule, SafeDeleteContext safeContext)
- {
- return safeContext.Context.CreateCloseNotify ();
- }
-
- internal static byte[] CreateHelloRequestMessage (SSPIInterface secModule, SafeDeleteContext safeContext)
- {
- return safeContext.Context.CreateHelloRequest ();
- }
-
- internal static bool IsClosed (SSPIInterface secModule, SafeDeleteContext safeContext)
- {
- return safeContext.Context.ReceivedCloseNotify;
- }
-
- internal static SafeFreeCredentials AcquireCredentialsHandle (SSPIInterface SecModule, string package, CredentialUse intent, SecureCredential scc)
- {
- return new SafeFreeCredentials (scc);
- }
-
- public static ChannelBinding QueryContextChannelBinding (SSPIInterface SecModule, SafeDeleteContext securityContext, ContextAttribute contextAttribute)
- {
- return null;
- }
-
- internal static X509Certificate2 GetRemoteCertificate (SafeDeleteContext safeContext, out X509Certificate2Collection remoteCertificateStore)
- {
- X509CertificateCollection monoCollection;
- if (safeContext == null || safeContext.IsInvalid) {
- remoteCertificateStore = null;
- return null;
- }
- var monoCert = safeContext.Context.GetRemoteCertificate (out monoCollection);
- if (monoCert == null) {
- remoteCertificateStore = null;
- return null;
- }
-
- remoteCertificateStore = new X509Certificate2Collection ();
- foreach (var cert in monoCollection) {
- remoteCertificateStore.Add (cert);
- }
- return (X509Certificate2)monoCert;
- }
-
- internal static bool CheckRemoteCertificate (SafeDeleteContext safeContext)
- {
- return safeContext.Context.VerifyRemoteCertificate ();
- }
-
- internal static MonoTlsConnectionInfo GetMonoConnectionInfo (SSPIInterface SecModule, SafeDeleteContext securityContext)
- {
- return securityContext.Context.GetConnectionInfo ();
- }
-
- internal static SslConnectionInfo GetConnectionInfo (SSPIInterface SecModule, SafeDeleteContext securityContext)
- {
- var info = securityContext.Context.GetConnectionInfo ();
- if (info == null)
- return null;
-
- return new SslConnectionInfo ((int)info.ProtocolVersion);
- }
-
- class InputBuffer : IBufferOffsetSize
- {
- public byte[] Buffer {
- get;
- private set;
- }
-
- public int Offset {
- get;
- private set;
- }
-
- public int Size {
- get;
- private set;
- }
-
- public InputBuffer (byte[] buffer, int offset, int size)
- {
- Buffer = buffer;
- Offset = offset;
- Size = size;
- }
- }
-
- static IBufferOffsetSize GetInputBuffer (SecurityBuffer incoming)
- {
- return incoming != null ? new InputBuffer (incoming.token, incoming.offset, incoming.size) : null;
- }
-
- static void UpdateOutput (IBufferOffsetSize buffer, SecurityBuffer outputBuffer)
- {
- if (buffer != null) {
- outputBuffer.token = buffer.Buffer;
- outputBuffer.offset = buffer.Offset;
- outputBuffer.size = buffer.Size;
- outputBuffer.type = BufferType.Token;
- } else {
- outputBuffer.token = null;
- outputBuffer.size = outputBuffer.offset = 0;
- outputBuffer.type = BufferType.Empty;
- }
- }
- }
-}
-#endif
+++ /dev/null
-//
-// Mono-specific additions to Microsoft's SslStream.cs
-//
-#if MONO_FEATURE_NEW_TLS && SECURITY_DEP
-#if MONO_SECURITY_ALIAS
-extern alias MonoSecurity;
-using MonoSecurity::Mono.Security.Interface;
-#else
-using Mono.Security.Interface;
-#endif
-using System.Threading;
-using System.Security.Cryptography.X509Certificates;
-using MNS = Mono.Net.Security;
-
-namespace System.Net.Security
-{
- using System.Net.Sockets;
- using System.IO;
-
- partial class SslStream : IMonoTlsEventSink
- {
- #if SECURITY_DEP
- SSPIConfiguration _Configuration;
-
- internal SslStream (Stream innerStream, bool leaveInnerStreamOpen, EncryptionPolicy encryptionPolicy, MonoTlsProvider provider, MonoTlsSettings settings)
- : base (innerStream, leaveInnerStreamOpen)
- {
- if (encryptionPolicy != EncryptionPolicy.RequireEncryption && encryptionPolicy != EncryptionPolicy.AllowNoEncryption && encryptionPolicy != EncryptionPolicy.NoEncryption)
- throw new ArgumentException (SR.GetString (SR.net_invalid_enum, "EncryptionPolicy"), "encryptionPolicy");
-
- var validationHelper = MNS.ChainValidationHelper.CloneWithCallbackWrapper (provider, ref settings, myUserCertValidationCallbackWrapper);
-
- LocalCertSelectionCallback selectionCallback = null;
- if (validationHelper.HasCertificateSelectionCallback)
- selectionCallback = validationHelper.SelectClientCertificate;
-
- var internalProvider = new MNS.Private.MonoTlsProviderWrapper (provider);
- _Configuration = new MyConfiguration (internalProvider, settings, this);
- _SslState = new SslState (innerStream, null, selectionCallback, encryptionPolicy, _Configuration);
- }
-
- /*
- * Mono-specific version of 'userCertValidationCallbackWrapper'; we're called from ChainValidationHelper.ValidateChain() here.
- *
- * Since we're built without the PrebuiltSystem alias, we can't use 'SslPolicyErrors' here. This prevents us from creating a subclass of 'ChainValidationHelper'
- * as well as providing a custom 'ServerCertValidationCallback'.
- */
- bool myUserCertValidationCallbackWrapper (ServerCertValidationCallback callback, X509Certificate certificate, X509Chain chain, MonoSslPolicyErrors sslPolicyErrors)
- {
- m_RemoteCertificateOrBytes = certificate == null ? null : certificate.GetRawCertData ();
- if (callback == null) {
- if (!_SslState.RemoteCertRequired)
- sslPolicyErrors &= ~MonoSslPolicyErrors.RemoteCertificateNotAvailable;
-
- return (sslPolicyErrors == MonoSslPolicyErrors.None);
- }
-
- return MNS.ChainValidationHelper.InvokeCallback (callback, this, certificate, chain, sslPolicyErrors);
- }
-
- class MyConfiguration : SSPIConfiguration
- {
- MNS.IMonoTlsProvider provider;
- MonoTlsSettings settings;
- IMonoTlsEventSink eventSink;
-
- public MyConfiguration (MNS.IMonoTlsProvider provider, MonoTlsSettings settings, IMonoTlsEventSink eventSink)
- {
- this.provider = provider;
- this.settings = settings;
- this.eventSink = eventSink;
- }
-
- public MNS.IMonoTlsProvider Provider {
- get { return provider; }
- }
-
- public MonoTlsSettings Settings {
- get { return settings; }
- }
-
- public IMonoTlsEventSink EventSink {
- get { return eventSink; }
- }
- }
- #endif
-
- internal bool IsClosed {
- get { return _SslState.IsClosed; }
- }
-
- internal Exception LastError {
- get { return lastError; }
- }
-
- #region IMonoTlsEventSink
-
- Exception lastError;
-
- void IMonoTlsEventSink.Error (Exception exception)
- {
- Interlocked.CompareExchange<Exception> (ref lastError, exception, null);
- }
-
- void IMonoTlsEventSink.ReceivedCloseNotify ()
- {
- }
-
- #endregion
-
- internal IAsyncResult BeginShutdown (AsyncCallback asyncCallback, object asyncState)
- {
- return _SslState.BeginShutdown (asyncCallback, asyncState);
- }
-
- internal void EndShutdown (IAsyncResult asyncResult)
- {
- _SslState.EndShutdown (asyncResult);
- }
-
- internal IAsyncResult BeginRenegotiate (AsyncCallback asyncCallback, object asyncState)
- {
- return _SslState.BeginRenegotiate (asyncCallback, asyncState);
- }
-
- internal void EndRenegotiate (IAsyncResult asyncResult)
- {
- _SslState.EndRenegotiate (asyncResult);
- }
-
- internal X509Certificate InternalLocalCertificate {
- get { return _SslState.InternalLocalCertificate; }
- }
-
- internal MonoTlsConnectionInfo GetMonoConnectionInfo ()
- {
- return _SslState.GetMonoConnectionInfo ();
- }
- }
-}
-#endif
+++ /dev/null
-//
-// Mono-specific additions to Microsoft's _SecureChannel.cs
-//
-#if MONO_FEATURE_NEW_TLS && SECURITY_DEP
-#if MONO_SECURITY_ALIAS
-extern alias MonoSecurity;
-using MonoSecurity::Mono.Security.Interface;
-#else
-using Mono.Security.Interface;
-#endif
-namespace System.Net.Security
-{
- partial class SecureChannel
- {
- internal MonoTlsConnectionInfo GetMonoConnectionInfo ()
- {
- return SSPIWrapper.GetMonoConnectionInfo (m_SecModule, m_SecurityContext);
- }
-
- internal ProtocolToken CreateShutdownMessage ()
- {
- var buffer = SSPIWrapper.CreateShutdownMessage (m_SecModule, m_SecurityContext);
- return new ProtocolToken (buffer, SecurityStatus.ContinueNeeded);
- }
-
- internal ProtocolToken CreateHelloRequestMessage ()
- {
- var buffer = SSPIWrapper.CreateHelloRequestMessage (m_SecModule, m_SecurityContext);
- return new ProtocolToken (buffer, SecurityStatus.ContinueNeeded);
- }
-
- internal bool IsClosed {
- get {
- if (m_SecModule == null || m_SecurityContext == null || m_SecurityContext.IsClosed)
- return true;
- return SSPIWrapper.IsClosed (m_SecModule, m_SecurityContext);
- }
- }
- }
-}
-#endif
+++ /dev/null
-//
-// Mono-specific additions to Microsoft's _SslState.cs
-//
-#if MONO_FEATURE_NEW_TLS && SECURITY_DEP
-#if MONO_SECURITY_ALIAS
-extern alias MonoSecurity;
-using MonoSecurity::Mono.Security.Interface;
-#else
-using Mono.Security.Interface;
-#endif
-namespace System.Net.Security
-{
- using System.IO;
- using System.Threading;
- using System.Net.Sockets;
-
- partial class SslState
- {
- int _SentShutdown;
-
- internal MonoTlsConnectionInfo GetMonoConnectionInfo ()
- {
- return Context.GetMonoConnectionInfo ();
- }
-
- internal bool IsClosed {
- get { return Context.IsClosed; }
- }
-
- internal ProtocolToken CreateShutdownMessage ()
- {
- return Context.CreateShutdownMessage ();
- }
-
- internal ProtocolToken CreateHelloRequestMessage ()
- {
- return Context.CreateHelloRequestMessage ();
- }
-
- internal IAsyncResult BeginShutdown (AsyncCallback asyncCallback, object asyncState)
- {
- var shutdownResult = new ShutdownAsyncResult (this, asyncState, asyncCallback);
-
- if (Interlocked.CompareExchange (ref _SentShutdown, 1, 0) == 1) {
- shutdownResult.InvokeCallback ();
- return shutdownResult;
- }
-
- try
- {
- CheckThrow (false);
- shutdownResult.SentShutdown = true;
- SecureStream.BeginShutdown (shutdownResult);
- return shutdownResult;
- } catch (Exception e) {
- if (e is IOException)
- throw;
- throw new IOException (SR.GetString (SR.mono_net_io_shutdown), e);
- }
- }
-
- internal void EndShutdown (IAsyncResult asyncResult)
- {
- if (asyncResult == null)
- throw new ArgumentNullException ("asyncResult");
-
- var shutdownResult = asyncResult as ShutdownAsyncResult;
- if (shutdownResult == null)
- throw new ArgumentException (SR.GetString (SR.net_io_async_result, asyncResult.GetType ().FullName), "asyncResult");
-
- if (shutdownResult.SentShutdown)
- SecureStream.EndShutdown (shutdownResult);
- }
-
- internal IAsyncResult BeginRenegotiate (AsyncCallback asyncCallback, object asyncState)
- {
- var lazyResult = new LazyAsyncResult (this, asyncState, asyncCallback);
-
- if (Interlocked.Exchange (ref _NestedAuth, 1) == 1)
- throw new InvalidOperationException (SR.GetString (SR.net_io_invalidnestedcall, "BeginRenegotiate", "renegotiate"));
- if (Interlocked.CompareExchange (ref _PendingReHandshake, 1, 0) == 1)
- throw new InvalidOperationException (SR.GetString (SR.net_io_invalidnestedcall, "BeginRenegotiate", "renegotiate"));
-
- try {
- CheckThrow (false);
- SecureStream.BeginRenegotiate (lazyResult);
- return lazyResult;
- } catch (Exception e) {
- _NestedAuth = 0;
- if (e is IOException)
- throw;
- throw new IOException (SR.GetString (SR.mono_net_io_renegotiate), e);
- }
- }
-
- internal void EndRenegotiate (IAsyncResult result)
- {
- if (result == null)
- throw new ArgumentNullException ("asyncResult");
-
- LazyAsyncResult lazyResult = result as LazyAsyncResult;
- if (lazyResult == null)
- throw new ArgumentException (SR.GetString (SR.net_io_async_result, result.GetType ().FullName), "asyncResult");
-
- if (Interlocked.Exchange (ref _NestedAuth, 0) == 0)
- throw new InvalidOperationException (SR.GetString (SR.net_io_invalidendcall, "EndRenegotiate"));
-
- SecureStream.EndRenegotiate (lazyResult);
- }
-
- internal bool CheckEnqueueHandshakeWrite (byte[] buffer, AsyncProtocolRequest asyncRequest)
- {
- return CheckEnqueueHandshake (buffer, asyncRequest);
- }
-
- internal void StartReHandshake (AsyncProtocolRequest asyncRequest)
- {
- if (IsServer) {
- byte[] buffer = null;
- if (CheckEnqueueHandshakeRead (ref buffer, asyncRequest))
- return;
-
- StartReceiveBlob (buffer, asyncRequest);
- return;
- }
-
- ForceAuthentication (false, null, asyncRequest);
- }
-
- class ShutdownAsyncResult : LazyAsyncResult
- {
- public bool SentShutdown;
-
- internal ShutdownAsyncResult (SslState instance, object userState, AsyncCallback callback)
- : base (instance, userState, callback)
- {
- }
- }
- }
-}
-#endif
+++ /dev/null
-//
-// Mono-specific additions to Microsoft's _SslStream.cs
-//
-#if MONO_FEATURE_NEW_TLS && SECURITY_DEP
-namespace System.Net.Security
-{
- using System.IO;
- using System.Threading;
- using System.Net.Sockets;
-
- partial class _SslStream
- {
- static readonly AsyncCallback _HandshakeWriteCallback = new AsyncCallback (HandshakeWriteCallback);
- static readonly HandshakeProtocolCallback _ResumeHandshakeWriteCallback = new HandshakeProtocolCallback (ResumeHandshakeWriteCallback);
-
- internal void BeginShutdown (LazyAsyncResult lazyResult)
- {
- HandshakeProtocolRequest asyncRequest = new HandshakeProtocolRequest (lazyResult);
-
- if (Interlocked.Exchange (ref _NestedWrite, 1) == 1)
- throw new NotSupportedException (SR.GetString (SR.net_io_invalidnestedcall, (asyncRequest != null ? "BeginShutdown" : "Shutdown"), "shutdown"));
-
- bool failed = false;
- try
- {
- ProtocolToken message = _SslState.CreateShutdownMessage ();
- asyncRequest.SetNextRequest (HandshakeProtocolState.Shutdown, message, _ResumeHandshakeWriteCallback);
-
- StartHandshakeWrite (asyncRequest);
- } catch (Exception e) {
- _SslState.FinishWrite ();
- failed = true;
- throw;
- } finally {
- if (failed)
- _NestedWrite = 0;
- }
- }
-
- internal void EndShutdown (LazyAsyncResult lazyResult)
- {
- if (Interlocked.Exchange (ref _NestedWrite, 0) == 0)
- throw new InvalidOperationException (SR.GetString (SR.net_io_invalidendcall, "EndShutdown"));
-
- // No "artificial" timeouts implemented so far, InnerStream controls timeout.
- lazyResult.InternalWaitForCompletion ();
-
- if (lazyResult.Result is Exception) {
- if (lazyResult.Result is IOException)
- throw (Exception)lazyResult.Result;
- throw new IOException (SR.GetString (SR.mono_net_io_shutdown), (Exception)lazyResult.Result);
- }
- }
-
- internal void BeginRenegotiate (LazyAsyncResult lazyResult)
- {
- HandshakeProtocolRequest asyncRequest = new HandshakeProtocolRequest (lazyResult);
-
- if (Interlocked.Exchange (ref _NestedWrite, 1) == 1)
- throw new NotSupportedException (SR.GetString (SR.net_io_invalidnestedcall, (asyncRequest != null ? "BeginRenegotiate" : "Renegotiate"), "renegotiate"));
-
- bool failed = false;
- try
- {
- if (_SslState.IsServer) {
- ProtocolToken message = _SslState.CreateHelloRequestMessage ();
- asyncRequest.SetNextRequest (HandshakeProtocolState.SendHelloRequest, message, _ResumeHandshakeWriteCallback);
- } else {
- asyncRequest.SetNextRequest (HandshakeProtocolState.ClientRenegotiation, null, _ResumeHandshakeWriteCallback);
- }
-
- StartHandshakeWrite (asyncRequest);
- } catch (Exception e) {
- _SslState.FinishWrite ();
- failed = true;
- throw;
- } finally {
- if (failed)
- _NestedWrite = 0;
- }
- }
-
- internal void EndRenegotiate (LazyAsyncResult lazyResult)
- {
- if (Interlocked.Exchange (ref _NestedWrite, 0) == 0)
- throw new InvalidOperationException (SR.GetString (SR.net_io_invalidendcall, "EndRenegotiate"));
-
- // No "artificial" timeouts implemented so far, InnerStream controls timeout.
- lazyResult.InternalWaitForCompletion();
-
- if (lazyResult.Result is Exception) {
- if (lazyResult.Result is IOException)
- throw (Exception)lazyResult.Result;
- throw new IOException (SR.GetString (SR.mono_net_io_renegotiate), (Exception)lazyResult.Result);
- }
- }
-
- void StartHandshakeWrite (HandshakeProtocolRequest asyncRequest)
- {
- byte[] buffer = null;
- if (asyncRequest.Message != null) {
- buffer = asyncRequest.Message.Payload;
- if (buffer.Length != asyncRequest.Message.Size) {
- buffer = new byte [asyncRequest.Message.Size];
- Buffer.BlockCopy (asyncRequest.Message.Payload, 0, buffer, 0, buffer.Length);
- }
- }
-
- switch (asyncRequest.State) {
- case HandshakeProtocolState.ClientRenegotiation:
- case HandshakeProtocolState.ServerRenegotiation:
- _SslState.StartReHandshake (asyncRequest);
- return;
-
- case HandshakeProtocolState.SendHelloRequest:
- if (_SslState.CheckEnqueueHandshakeWrite (buffer, asyncRequest)) {
- // operation is async and has been queued, return.
- return;
- }
- break;
-
- case HandshakeProtocolState.Shutdown:
- if (_SslState.CheckEnqueueWrite (asyncRequest)) {
- // operation is async and has been queued, return.
- return;
- }
- break;
-
- default:
- throw new InvalidOperationException ();
- }
-
- if (_SslState.LastPayload != null)
- throw new InvalidOperationException ();
-
- // prepare for the next request
- IAsyncResult ar = ((NetworkStream)_SslState.InnerStream).BeginWrite (buffer, 0, buffer.Length, _HandshakeWriteCallback, asyncRequest);
- if (!ar.CompletedSynchronously)
- return;
-
- HandshakeWriteCallback (asyncRequest, ar);
- }
-
- static void HandshakeWriteCallback (IAsyncResult transportResult)
- {
- if (transportResult.CompletedSynchronously)
- return;
-
- HandshakeProtocolRequest asyncRequest = (HandshakeProtocolRequest)transportResult.AsyncState;
-
- SslState sslState = (SslState)asyncRequest.AsyncObject;
- sslState.SecureStream.HandshakeWriteCallback (asyncRequest, transportResult);
- }
-
- void HandshakeWriteCallback (HandshakeProtocolRequest asyncRequest, IAsyncResult transportResult)
- {
- try {
- _SslState.InnerStream.EndWrite (transportResult);
- } catch (Exception e) {
- _SslState.FinishWrite ();
- if (!asyncRequest.IsUserCompleted) {
- asyncRequest.CompleteWithError (e);
- return;
- }
- throw;
- }
-
- if (asyncRequest.State == HandshakeProtocolState.SendHelloRequest) {
- asyncRequest.SetNextRequest (HandshakeProtocolState.ServerRenegotiation, null, _ResumeHandshakeWriteCallback);
- StartHandshakeWrite (asyncRequest);
- return;
- }
-
- try {
- _SslState.FinishWrite ();
- asyncRequest.CompleteUser ();
- } catch (Exception e) {
- if (!asyncRequest.IsUserCompleted) {
- asyncRequest.CompleteWithError (e);
- return;
- }
- throw;
- }
- }
-
- static void ResumeHandshakeWriteCallback (HandshakeProtocolRequest asyncRequest)
- {
- try {
- ((_SslStream)asyncRequest.AsyncObject).StartHandshakeWrite (asyncRequest);
- } catch (Exception e) {
- if (asyncRequest.IsUserCompleted) {
- // This will throw on a worker thread.
- throw;
- }
- ((_SslStream)asyncRequest.AsyncObject)._SslState.FinishWrite ();
- asyncRequest.CompleteWithError (e);
- }
- }
-
- delegate void HandshakeProtocolCallback (HandshakeProtocolRequest asyncRequest);
-
- enum HandshakeProtocolState {
- None,
- Shutdown,
- SendHelloRequest,
- ServerRenegotiation,
- ClientRenegotiation
- }
-
- class HandshakeProtocolRequest : AsyncProtocolRequest
- {
- public ProtocolToken Message;
- public HandshakeProtocolState State;
-
- public HandshakeProtocolRequest (LazyAsyncResult userAsyncResult)
- : base (userAsyncResult)
- {
- State = HandshakeProtocolState.None;
- }
-
- public void SetNextRequest (HandshakeProtocolState state, ProtocolToken message, HandshakeProtocolCallback callback)
- {
- State = state;
- Message = message;
- SetNextRequest (null, 0, 0, (r) => callback ((HandshakeProtocolRequest)r));
- }
- }
- }
-}
-#endif
<Compile Include="Mono.Net.Security\MonoTlsStream.cs" />\r
<Compile Include="Mono.Net.Security\NoReflectionHelper.cs" />\r
<Compile Include="Mono.Net.Security\SystemCertificateValidator.cs" />\r
- <Compile Include="ReferenceSources\_SecureChannel.cs" />\r
- <Compile Include="ReferenceSources\_SslState.cs" />\r
- <Compile Include="ReferenceSources\_SslStream.cs" />\r
<Compile Include="ReferenceSources\AssertWrapper.cs" />\r
<Compile Include="ReferenceSources\AutoWebProxyScriptEngine.cs" />\r
<Compile Include="ReferenceSources\BinaryCompatibility.cs" />\r
<Compile Include="ReferenceSources\EnvironmentHelpers.cs" />\r
<Compile Include="ReferenceSources\HttpApi.cs" />\r
<Compile Include="ReferenceSources\HttpSysSettings.cs" />\r
- <Compile Include="ReferenceSources\Internal.cs" />\r
<Compile Include="ReferenceSources\Logging.cs" />\r
<Compile Include="ReferenceSources\NativeMethods.cs" />\r
<Compile Include="ReferenceSources\RequestCacheProtocol.cs" />\r
<Compile Include="ReferenceSources\SR.cs" />\r
<Compile Include="ReferenceSources\SR2.cs" />\r
<Compile Include="ReferenceSources\SRCategoryAttribute.cs" />\r
- <Compile Include="ReferenceSources\SslStream.cs" />\r
- <Compile Include="ReferenceSources\SSPIConfiguration.cs" />\r
- <Compile Include="ReferenceSources\SSPISafeHandles.cs" />\r
- <Compile Include="ReferenceSources\SSPIWrapper.cs" />\r
<Compile Include="ReferenceSources\Win32Exception.cs" />\r
<Compile Include="System.CodeDom.Compiler\CodeCompiler.cs" />\r
<Compile Include="System.CodeDom.Compiler\CodeDomConfigurationHandler.cs" />\r
<Compile Include="Mono.Net.Security\MonoTlsStream.cs" />\r
<Compile Include="Mono.Net.Security\NoReflectionHelper.cs" />\r
<Compile Include="Mono.Net.Security\SystemCertificateValidator.cs" />\r
- <Compile Include="ReferenceSources\_SecureChannel.cs" />\r
- <Compile Include="ReferenceSources\_SslState.cs" />\r
- <Compile Include="ReferenceSources\_SslStream.cs" />\r
<Compile Include="ReferenceSources\AssertWrapper.cs" />\r
<Compile Include="ReferenceSources\AutoWebProxyScriptEngine.cs" />\r
<Compile Include="ReferenceSources\BinaryCompatibility.cs" />\r
<Compile Include="ReferenceSources\EnvironmentHelpers.cs" />\r
<Compile Include="ReferenceSources\HttpApi.cs" />\r
<Compile Include="ReferenceSources\HttpSysSettings.cs" />\r
- <Compile Include="ReferenceSources\Internal.cs" />\r
<Compile Include="ReferenceSources\Logging.cs" />\r
<Compile Include="ReferenceSources\NativeMethods.cs" />\r
<Compile Include="ReferenceSources\RequestCacheProtocol.cs" />\r
<Compile Include="ReferenceSources\SR.cs" />\r
<Compile Include="ReferenceSources\SR2.cs" />\r
<Compile Include="ReferenceSources\SRCategoryAttribute.cs" />\r
- <Compile Include="ReferenceSources\SslStream.cs" />\r
- <Compile Include="ReferenceSources\SSPIConfiguration.cs" />\r
- <Compile Include="ReferenceSources\SSPISafeHandles.cs" />\r
- <Compile Include="ReferenceSources\SSPIWrapper.cs" />\r
<Compile Include="ReferenceSources\Win32Exception.cs" />\r
<Compile Include="System.CodeDom.Compiler\CodeCompiler.cs" />\r
<Compile Include="System.CodeDom.Compiler\CodeDomConfigurationHandler.cs" />\r
{
public static readonly Win32IPAddressCollection Empty = new Win32IPAddressCollection (IntPtr.Zero);
- bool is_readonly;
-
// for static methods
Win32IPAddressCollection ()
{
{
foreach (IntPtr head in heads)
AddSubsequentlyString (head);
- is_readonly = true;
}
public Win32IPAddressCollection (params Win32_IP_ADDR_STRING [] al)
foreach (Win32_IP_ADDR_STRING a in al) {
if (String.IsNullOrEmpty (a.IpAddress))
continue;
- Add (IPAddress.Parse (a.IpAddress));
+ InternalAdd (IPAddress.Parse (a.IpAddress));
AddSubsequentlyString (a.Next);
}
- is_readonly = true;
}
public static Win32IPAddressCollection FromAnycast (IntPtr ptr)
Win32_IP_ADAPTER_ANYCAST_ADDRESS a;
for (IntPtr p = ptr; p != IntPtr.Zero; p = a.Next) {
a = (Win32_IP_ADAPTER_ANYCAST_ADDRESS) Marshal.PtrToStructure (p, typeof (Win32_IP_ADAPTER_ANYCAST_ADDRESS));
- c.Add (a.Address.GetIPAddress ());
+ c.InternalAdd (a.Address.GetIPAddress ());
}
- c.is_readonly = true;
return c;
}
a = (Win32_IP_ADAPTER_DNS_SERVER_ADDRESS) Marshal.PtrToStructure (p, typeof (Win32_IP_ADAPTER_DNS_SERVER_ADDRESS));
// FIXME: It somehow fails here. Looks like there is something wrong.
//if (a.Address.Sockaddr == IntPtr.Zero) throw new Exception ("pointer " + p + " a.length " + a.Address.SockaddrLength);
- c.Add (a.Address.GetIPAddress ());
+ c.InternalAdd (a.Address.GetIPAddress ());
}
- c.is_readonly = true;
return c;
}
Win32_IP_ADDR_STRING a;
for (IntPtr p = head; p != IntPtr.Zero; p = a.Next) {
a = (Win32_IP_ADDR_STRING) Marshal.PtrToStructure (p, typeof (Win32_IP_ADDR_STRING));
- Add (IPAddress.Parse (a.IpAddress));
+ InternalAdd (IPAddress.Parse (a.IpAddress));
}
}
-
- public override bool IsReadOnly {
- get { return is_readonly; }
- }
}
#endif
}
#if !MOBILE
class Win32NetworkInterfaceAPI : NetworkInterfaceFactory
{
- [DllImport ("iphlpapi.dll", SetLastError = true)]
+ private const string IPHLPAPI = "iphlpapi.dll";
+
+ [DllImport (IPHLPAPI, SetLastError = true)]
static extern int GetAdaptersAddresses (uint family, uint flags, IntPtr reserved, byte [] info, ref int size);
+ [DllImport (IPHLPAPI)]
+ static extern uint GetBestInterfaceEx (byte[] ipAddress, out int index);
+
unsafe static Win32_IP_ADAPTER_ADDRESSES [] GetAdaptersAddresses ()
{
byte [] bytes = null;
return ret;
}
+ private static int GetBestInterfaceForAddress (IPAddress addr) {
+ int index;
+ SocketAddress address = new SocketAddress (addr);
+ int error = (int) GetBestInterfaceEx (address.m_Buffer, out index);
+ if (error != 0) {
+ throw new NetworkInformationException (error);
+ }
+
+ return index;
+ }
+
public override int GetLoopbackInterfaceIndex ()
{
- throw new NotImplementedException ();
+ return GetBestInterfaceForAddress (IPAddress.Loopback);
}
public override IPAddress GetNetMask (IPAddress address)
ReferenceSources/ConfigurationManagerInternalFactory.cs
ReferenceSources/CAPI.cs
ReferenceSources/EnvironmentHelpers.cs
-ReferenceSources/Internal.cs
ReferenceSources/HttpApi.cs
ReferenceSources/HttpSysSettings.cs
ReferenceSources/LocalAppContextSwitches.cs
ReferenceSources/SRCategoryAttribute.cs
ReferenceSources/Win32Exception.cs
-ReferenceSources/SSPIConfiguration.cs
-ReferenceSources/SSPISafeHandles.cs
-ReferenceSources/SSPIWrapper.cs
-ReferenceSources/SslStream.cs
-ReferenceSources/_SecureChannel.cs
-ReferenceSources/_SslState.cs
-ReferenceSources/_SslStream.cs
-
../referencesource/System/misc/PrivilegedConfigurationManager.cs
../referencesource/System/regex/system/text/regularexpressions/Regex.cs
../referencesource/System/regex/system/text/regularexpressions/RegexBoyerMoore.cs
[Test]
public void DnsEnabled ()
{
+ if (Environment.OSVersion.Platform == PlatformID.Win32NT)
+ Assert.Ignore ("IsDnsEnabled is not nessasarily enabled for all interfaces on windows.");
+
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces ();
foreach (NetworkInterface adapter in adapters)
{
ReferenceSources/CAPI.cs
ReferenceSources/EnvironmentHelpers.cs
ReferenceSources/HttpApi.cs
-ReferenceSources/Internal.cs
ReferenceSources/LocalAppContextSwitches.cs
ReferenceSources/HttpSysSettings.cs
ReferenceSources/Logging.cs
[assembly: InternalsVisibleTo ("Xamarin.Mac, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
#endif
-[assembly: InternalsVisibleTo ("Xamarin.BoringTls, PublicKey=002400000480000094000000060200000024000052534131000400001100000099dd12eda85767ae6f06023ee28e711c7e5a212462095c83868c29db75eddf6d8e296e03824c14fedd5f55553fed0b6173be3cc985a4b7f9fb7c83ccff8ba3938563b3d1f45a81122f12a1bcb73edcaad61a8456c7595a6da5184b4dd9d10f011b949ef1391fccfeab1ba62aa51c267ef8bd57ef1b6ba5a4c515d0badb81a78f")]
[assembly: Guid ("BED7F4EA-1A96-11D2-8F08-00A0C9A6186D")]
--- /dev/null
+//
+// GCTest.cs - NUnit Test Cases for GC
+//
+// Authors:
+// Marek Safar <marek.safar@gmail.com>
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Threading.Tasks;
+
+using NUnit.Framework;
+
+namespace MonoTests.System {
+
+ [TestFixture]
+ public class GCTest {
+
+ class MyFinalizeObject
+ {
+ public volatile static int finalized;
+
+ ~MyFinalizeObject ()
+ {
+ if (finalized++ == 0) {
+ GC.ReRegisterForFinalize (this);
+ }
+ }
+ }
+
+ static void Run_ReRegisterForFinalizeTest ()
+ {
+ var m = new WeakReference<MyFinalizeObject> (new MyFinalizeObject ());
+ m.SetTarget (null);
+ }
+
+ [Test]
+ public void ReRegisterForFinalizeTest ()
+ {
+ Run_ReRegisterForFinalizeTest ();
+ var t = Task.Factory.StartNew (() => {
+ do {
+ GC.Collect ();
+ GC.WaitForPendingFinalizers ();
+ Task.Yield ();
+ } while (MyFinalizeObject.finalized != 2);
+ });
+
+ Assert.IsTrue (t.Wait (5000));
+ }
+ }
+}
\ No newline at end of file
System/CharEnumeratorTest.cs
System/CharTest.cs
System/DelegateTest.cs
+System/GCTest.cs
System/ModuleHandleTest.cs
System/NullableTest.cs
System/ObsoleteAttributeTest.cs
string direction = first && HasExtensionParameter ? "this" : "in";
first = false;
- if (parameter.ParameterType is ByReferenceType)
+ var pt = parameter.ParameterType;
+ var brt = pt as ByReferenceType;
+ if (brt != null) {
direction = parameter.IsOut ? "out" : "ref";
+ pt = brt.ElementType;
+ }
- TypeReference t = parameter.ParameterType;
- AddAttribute ("type", Utils.CleanupTypeName (t));
+ AddAttribute ("type", Utils.CleanupTypeName (pt));
if (parameter.IsOptional) {
AddAttribute ("optional", "true");
ParameterDefinition info = infos [i];
- if (info.ParameterType.IsByReference) {
- string modifier;
- if ((info.Attributes & (ParameterAttributes.Out | ParameterAttributes.In)) == ParameterAttributes.Out)
- modifier = "out";
- else
- modifier = "ref";
+ string modifier;
+ if ((info.Attributes & ParameterAttributes.In) != 0)
+ modifier = string.Empty;
+ else if ((info.Attributes & ParameterAttributes.Out) != 0 && info.ParameterType.IsByReference)
+ modifier = "out";
+ else
+ modifier = string.Empty;
+ if (modifier.Length > 0) {
signature.Append (modifier);
signature.Append (" ");
}
using System.Text;
using IKVM.Reflection;
using System.Linq;
-using System.Diagnostics;
using System.Net;
using System.Threading.Tasks;
static string output = "a.out";
static string object_out = null;
static List<string> link_paths = new List<string> ();
+ static Dictionary<string,string> libraries = new Dictionary<string,string> ();
static bool autodeps = false;
static bool keeptemp = false;
static bool compile_only = false;
cross_target = args [++i];
break;
+ case "--library":
+ if (i+1 == top){
+ Help ();
+ return 1;
+ }
+ if (custom_mode){
+ Console.Error.WriteLine ("--library can only be used with --simple/--runtime/--cross mode");
+ Help ();
+ return 1;
+ }
+ var lspec = args [++i];
+ var p = lspec.IndexOf (",");
+ string alias, path;
+ if (p == -1){
+ alias = Path.GetFileName (lspec);
+ path = lspec;
+ } else {
+ alias = lspec.Substring (0, p);
+ path = lspec.Substring (p+1);
+ }
+ if (!File.Exists (path)){
+ Console.Error.WriteLine ($"The specified library file {path} does not exist");
+ return 1;
+ }
+ libraries [alias] = path;
+ break;
+
case "--fetch-target":
if (i+1 == top){
Help ();
return 1;
}
var env = args [++i];
- var p = env.IndexOf ('=');
+ p = env.IndexOf ('=');
if (p == -1)
environment.Add (env, "");
else
foreach (var key in environment.Keys)
maker.AddStringPair ("env:" + key, key, environment [key]);
}
+ if (libraries.Count > 0){
+ foreach (var alias_and_path in libraries){
+ maker.Add ("library:" + alias_and_path.Key, alias_and_path.Value);
+ }
+ }
maker.Dump ();
maker.Close ();
return true;
string monoPath = GetEnv("MONOPREFIX", @"C:\Program Files (x86)\Mono");
string[] includes = new string[] {winsdkPath + @"\Include\um", winsdkPath + @"\Include\shared", vsPath + @"\include", monoPath + @"\include\mono-2.0", "." };
- string[] libs = new string[] { winsdkPath + @"\Lib\winv6.3\um\x86" , vsPath + @"\lib" };
+ // string[] libs = new string[] { winsdkPath + @"\Lib\winv6.3\um\x86" , vsPath + @"\lib" };
var linkLibraries = new string[] { "kernel32.lib",
"version.lib",
"Ws2_32.lib",
{
Console.WriteLine ("Usage is: mkbundle [options] assembly1 [assembly2...]\n\n" +
"Options:\n" +
- " --config F Bundle system config file `F'\n" +
- " --config-dir D Set MONO_CFG_DIR to `D'\n" +
- " --deps Turns on automatic dependency embedding (default on simple)\n" +
- " -L path Adds `path' to the search path for assemblies\n" +
- " --machine-config F Use the given file as the machine.config for the application.\n" +
- " -o out Specifies output filename\n" +
- " --nodeps Turns off automatic dependency embedding (default on custom)\n" +
- " --skip-scan Skip scanning assemblies that could not be loaded (but still embed them).\n" +
- " --i18n ENCODING none, all or comma separated list of CJK, MidWest, Other, Rare, West.\n" +
- " -v Verbose output\n" +
+ " --config F Bundle system config file `F'\n" +
+ " --config-dir D Set MONO_CFG_DIR to `D'\n" +
+ " --deps Turns on automatic dependency embedding (default on simple)\n" +
+ " -L path Adds `path' to the search path for assemblies\n" +
+ " --machine-config F Use the given file as the machine.config for the application.\n" +
+ " -o out Specifies output filename\n" +
+ " --nodeps Turns off automatic dependency embedding (default on custom)\n" +
+ " --skip-scan Skip scanning assemblies that could not be loaded (but still embed them).\n" +
+ " --i18n ENCODING none, all or comma separated list of CJK, MidWest, Other, Rare, West.\n" +
+ " -v Verbose output\n" +
"\n" +
"--simple Simple mode does not require a C toolchain and can cross compile\n" +
- " --cross TARGET Generates a binary for the given TARGET\n"+
- " --local-targets Lists locally available targets\n" +
- " --list-targets Lists available targets on the remote server\n" +
- " --options OPTIONS Embed the specified Mono command line options on target\n" +
- " --runtime RUNTIME Manually specifies the Mono runtime to use\n" +
- " --target-server URL Specified a server to download targets from, default is " + target_server + "\n" +
- " --env KEY=VALUE Hardcodes an environment variable for the target\n" +
+ " --cross TARGET Generates a binary for the given TARGET\n"+
+ " --env KEY=VALUE Hardcodes an environment variable for the target\n" +
+ " --library [LIB,]PATH Bundles the specified dynamic library to be used at runtime\n" +
+ " LIB is optional shortname for file located at PATH\n" +
+ " --list-targets Lists available targets on the remote server\n" +
+ " --local-targets Lists locally available targets\n" +
+ " --options OPTIONS Embed the specified Mono command line options on target\n" +
+ " --runtime RUNTIME Manually specifies the Mono runtime to use\n" +
+ " --target-server URL Specified a server to download targets from, default is " + target_server + "\n" +
"\n" +
"--custom Builds a custom launcher, options for --custom\n" +
- " -c Produce stub only, do not compile\n" +
- " -oo obj Specifies output filename for helper object file\n" +
+ " -c Produce stub only, do not compile\n" +
+ " -oo obj Specifies output filename for helper object file\n" +
" --dos2unix[=true|false]\n" +
- " When no value provided, or when `true` specified\n" +
- " `dos2unix` will be invoked to convert paths on Windows.\n" +
- " When `--dos2unix=false` used, dos2unix is NEVER used.\n" +
- " --keeptemp Keeps the temporary files\n" +
- " --static Statically link to mono libs\n" +
- " --nomain Don't include a main() function, for libraries\n" +
- " --custom-main C Link the specified compilation unit (.c or .obj) with entry point/init code\n" +
- " -z Compress the assemblies before embedding.\n" +
- " --static-ctor ctor Add a constructor call to the supplied function.\n" +
- " You need zlib development headers and libraries.\n");
+ " When no value provided, or when `true` specified\n" +
+ " `dos2unix` will be invoked to convert paths on Windows.\n" +
+ " When `--dos2unix=false` used, dos2unix is NEVER used.\n" +
+ " --keeptemp Keeps the temporary files\n" +
+ " --static Statically link to mono libs\n" +
+ " --nomain Don't include a main() function, for libraries\n" +
+ " --custom-main C Link the specified compilation unit (.c or .obj) with entry point/init code\n" +
+ " -z Compress the assemblies before embedding.\n" +
+ " --static-ctor ctor Add a constructor call to the supplied function.\n" +
+ " You need zlib development headers and libraries.\n");
}
[DllImport ("libc")]
ICALL(GC_1, "GetTotalMemory", ves_icall_System_GC_GetTotalMemory)
ICALL(GC_2, "InternalCollect", ves_icall_System_GC_InternalCollect)
ICALL(GC_3, "KeepAlive", ves_icall_System_GC_KeepAlive)
-ICALL(GC_4, "ReRegisterForFinalize", ves_icall_System_GC_ReRegisterForFinalize)
ICALL(GC_4a, "RecordPressure", mono_gc_add_memory_pressure)
ICALL(GC_6, "WaitForPendingFinalizers", ves_icall_System_GC_WaitForPendingFinalizers)
+ICALL(GC_6b, "_ReRegisterForFinalize", ves_icall_System_GC_ReRegisterForFinalize)
ICALL(GC_7, "_SuppressFinalize", ves_icall_System_GC_SuppressFinalize)
ICALL(GC_9, "get_ephemeron_tombstone", ves_icall_System_GC_get_ephemeron_tombstone)
ICALL(GC_8, "register_ephemeron_array", ves_icall_System_GC_register_ephemeron_array)
return res;
}
+void
+mono_loader_register_module (const char *name, MonoDl *module)
+{
+ if (!global_module_map)
+ global_module_map = g_hash_table_new (g_str_hash, g_str_equal);
+ g_hash_table_insert (global_module_map, g_strdup (name), module);
+}
+
static MonoDl *internal_module;
static gboolean
#include <mono/metadata/metadata.h>
#include <mono/metadata/image.h>
#include <mono/utils/mono-error.h>
+#include <mono/utils/mono-dl.h>
MONO_BEGIN_DECLS
void*
mono_lookup_internal_call_full (MonoMethod *method, mono_bool *uses_handles);
+void
+mono_loader_register_module (const char *name, MonoDl *module);
MONO_API const char*
mono_lookup_icall_symbol (MonoMethod *m);
CloseHandle (handle);
- return result != (DWORD)-1;
+ return result != (DWORD)-1 && result > 0;
}
gboolean
#define HEADER_LENGTH 11
#define MAJOR_VERSION 2
-#define MINOR_VERSION 43
+#define MINOR_VERSION 44
typedef enum {
CMD_SET_VM = 1,
CMD_STACK_FRAME_GET_THIS = 2,
CMD_STACK_FRAME_SET_VALUES = 3,
CMD_STACK_FRAME_GET_DOMAIN = 4,
+ CMD_STACK_FRAME_SET_THIS = 5,
} CmdStackFrame;
typedef enum {
buffer_add_domainid (buf, frame->domain);
break;
}
+ case CMD_STACK_FRAME_SET_THIS: {
+ guint8 *val_buf;
+ MonoType *t;
+ MonoDebugVarInfo *var;
+
+ t = &frame->actual_method->klass->byval_arg;
+ /* Checked by the sender */
+ g_assert (MONO_TYPE_ISSTRUCT (t));
+ var = jit->this_var;
+ g_assert (var);
+
+ val_buf = (guint8 *)g_alloca (mono_class_instance_size (mono_class_from_mono_type (t)));
+ err = decode_value (t, frame->domain, val_buf, p, &p, end);
+ if (err != ERR_NONE)
+ return err;
+
+ set_var (&frame->actual_method->klass->this_arg, var, &frame->ctx, frame->domain, val_buf, frame->reg_locations, &tls->restore_state.ctx);
+ break;
+ }
default:
return ERR_NOT_IMPLEMENTED;
}
"GET_THIS",
"SET_VALUES",
"GET_DOMAIN",
+ "SET_THIS"
};
static const char* array_cmds_str[] = {
+/*
+ * main.c: The main entry point for the mono executable
+ *
+ * The main entry point does a few things:
+ *
+ * * It probes whether the executable has a bundle appended
+ * at the end, and if so, registers the various bundled
+ * resources with Mono and executes the contained bundle
+ *
+ * * Parses the MONO_ENV_OPTIONS variable to treat the
+ * contents of the variable as command line arguments for
+ * the mono runtime
+ *
+ * * Launches Mono, by calling mono_main.
+ */
#include <config.h>
#include <fcntl.h>
#include <mono/metadata/assembly.h>
#include <mono/metadata/mono-config.h>
#include <mono/utils/mono-mmap.h>
+#include <mono/utils/mono-dl.h>
#include "mini.h"
#ifdef HAVE_UNISTD_H
return mono_main (argc, argv);
}
+/*
+ * The Mono executable can initialize itself from a payload attached
+ * at the end of the main program. The payload contains the
+ * main assembly, one or more managed assemblies, configuration
+ * files and other assets that are used instead of launching a
+ * program from the command line.
+ *
+ * The startup sequence probes for a magical signature at the end of
+ * the executable, if the 16 characters "xmonkeysloveplay" are found,
+ * the code expects the 64-bits just before it to contain an offset
+ * within the executable with a directory of assets.
+ *
+ * All pointers in the file format are encoded as little-endian values
+ *
+ * The format of the file is thus:
+ *
+ * Location Content
+ * -------- -------
+ * lenght-16 Optional "xmonkeysloveplay", indicating that a
+ * bundled payload is contained in the executable.
+ * length-24 pointer to the directory in the file, address DIR
+ *
+ * DIR 32-bit value with the number of entries in the directory
+ * DIR+4 First directory entry.
+ *
+ * Each directory entry is made up of:
+ * 4-bytes uint32_t containing the size of a string (STR)
+ * STRING UTF8 encoded and \0 terminated string
+ * 8-bytes uint64_t offset in the file with the payload associated with STRING
+ * 4-bytes uint32_t size of the asset
+ *
+ * The following are the known directory entries, without the quotes:
+ * "assembly:NAME" An assembly with the name NAME, assembly is in the payload
+ * "config:NAME" A configuration file (usually file.dll.config) in the payload that is
+ * loaded as the config file for an assembly
+ * "systemconfig:" Treats as a Mono system configuration, payload contains the config file.
+ * "options:" The payload contains command line options to initialize Mono, as if you
+ had set them on MONO_ENV_OPTIONS
+ * "config_dir:DIR" Configures the MONO_PATH to point to point to DIR
+ * "machineconfig:" The payload contains the machine.config file to use at runtime
+ * "env:" Sets the environment variable to the value encoded in the payload
+ * payload contains: 1-byte lenght for the \0 terminated variable,
+ * followed by the value.
+ * "library:NAME" Bundled dynamic library NAME, payload contains the dynamic library
+ */
#define STREAM_INT(x) GUINT32_TO_LE((*(uint32_t*)x))
#define STREAM_LONG(x) GUINT64_TO_LE((*(uint64_t*)x))
return buffer;
}
+/* Did we initialize the temporary directory for dynamic libraries */
+static int bundle_save_library_initialized;
+
+/* List of bundled libraries we unpacked */
+static GSList *bundle_library_paths;
+
+/* Directory where we unpacked dynamic libraries */
+static char *bundled_dylibrary_directory;
+
+static void
+delete_bundled_libraries ()
+{
+ GSList *list;
+
+ for (list = bundle_library_paths; list != NULL; list = list->next){
+ unlink (list->data);
+ }
+ rmdir (bundled_dylibrary_directory);
+}
+
+static void
+bundle_save_library_initialize ()
+{
+ bundle_save_library_initialized = 1;
+ char *path = g_build_filename (g_get_tmp_dir (), "mono-bundle-XXXXXX");
+ bundled_dylibrary_directory = g_mkdtemp (path);
+ g_free (path);
+ if (bundled_dylibrary_directory == NULL)
+ return;
+ atexit (delete_bundled_libraries);
+}
+
+static void
+save_library (int fd, uint64_t offset, uint64_t size, const char *destfname)
+{
+ MonoDl *lib;
+ char *file, *buffer, *err;
+ if (!bundle_save_library_initialized)
+ bundle_save_library_initialize ();
+
+ file = g_build_filename (bundled_dylibrary_directory, destfname);
+ buffer = load_from_region (fd, offset, size);
+ g_file_set_contents (file, buffer, size, NULL);
+ lib = mono_dl_open (file, MONO_DL_LAZY, &err);
+ if (err != NULL){
+ fprintf (stderr, "Error loading shared library: %s\n", file);
+ exit (1);
+ }
+ mono_loader_register_module (destfname, lib);
+ bundle_library_paths = g_slist_append (bundle_library_paths, file);
+
+ g_free (buffer);
+}
+
static gboolean
probe_embedded (const char *program, int *ref_argc, char **ref_argv [])
{
uint8_t count = *data++;
char *value = data + count + 1;
g_setenv (data, value, FALSE);
+ } else if (strncmp (kind, "library:", strlen ("library:")) == 0){
+ save_library (fd, offset, item_size, kind + strlen ("library:"));
} else {
fprintf (stderr, "Unknown stream on embedded package: %s\n", kind);
exit (1);
}
}
g_array_append_val (assemblies, last);
-
+
mono_register_bundled_assemblies ((const MonoBundledAssembly **) assemblies->data);
new_argv = g_new (char *, (*ref_argc)+1);
for (j = 0; j < *ref_argc; j++)
return mono_process_get_data (GINT_TO_POINTER (mono_process_current_pid ()), MONO_PROCESS_FAULTS);
}
+
+// If cpu_load gets inlined on Windows then cpu_load_1min, cpu_load_5min and cpu_load_15min can be folded into a single function and that will
+// cause a failure when registering counters since the same function address will be used by all three functions. Preventing this method from being inlined
+// will make sure the registered callback functions remains unique.
+#ifdef _MSC_VER
+__declspec(noinline)
+#endif
static double
cpu_load (int kind)
{
//Thread initialization code
-static void mono_threads_unregister_current_thread (MonoThreadInfo *info);
-
static inline void
mono_hazard_pointer_clear_all (MonoThreadHazardPointers *hp, int retain)
{
gpointer gc_unsafe_stackdata;
MonoThreadInfo *info;
int small_id;
+ gboolean result;
info = (MonoThreadInfo *) arg;
g_assert (info);
mono_native_tls_set_value (thread_exited_key, GUINT_TO_POINTER (1));
- mono_threads_platform_unregister (info);
-
/*
* TLS destruction order is not reliable so small_id might be cleaned up
* before us.
*/
if (threads_callbacks.thread_unregister)
threads_callbacks.thread_unregister (info);
- mono_threads_unregister_current_thread (info);
+
+ mono_threads_platform_unregister (info);
+ result = mono_thread_info_remove (info);
+ g_assert (result);
mono_threads_transition_detach (info);
mono_thread_info_suspend_unlock ();
#endif
}
-/**
- * Removes the current thread from the thread list.
- * This must be called from the thread unregister callback and nowhere else.
- * The current thread must be passed as TLS might have already been cleaned up.
-*/
-static void
-mono_threads_unregister_current_thread (MonoThreadInfo *info)
-{
- gboolean result;
- g_assert (mono_thread_info_get_tid (info) == mono_native_thread_id_get ());
- result = mono_thread_info_remove (info);
- g_assert (result);
-}
-
MonoThreadInfo*
mono_thread_info_current_unchecked (void)
{
mono_disasm_code_one
mono_dl_fallback_register
mono_dl_fallback_unregister
+mono_dl_open
mono_dllmap_insert
mono_domain_add_class_static_data
mono_domain_assembly_open
mono_ldtoken
mono_load_remote_field
mono_load_remote_field_new
+mono_loader_register_module
mono_lock_free_alloc
mono_lock_free_allocator_check_consistency
mono_lock_free_allocator_init_allocator
mono_disasm_code_one
mono_dl_fallback_register
mono_dl_fallback_unregister
+mono_dl_open
mono_dllmap_insert
mono_domain_add_class_static_data
mono_domain_assembly_open
mono_ldtoken
mono_load_remote_field
mono_load_remote_field_new
+mono_loader_register_module
mono_lock_free_alloc
mono_lock_free_allocator_check_consistency
mono_lock_free_allocator_init_allocator
<resources>System.Web.Http.WebHost.Properties.CommonWebApiResources,../../../external/aspnetwebstack/src/Common/CommonWebApiResources.resx System.Web.Http.WebHost.Properties.SRResources,../../../external/aspnetwebstack/src/System.Web.Http.WebHost/Properties/SRResources.resx</resources>
<response>System.Web.Http.WebHost.dll.sources</response>
</project>
- <project dir="class/Mono.Security.Providers.NewSystemSource" library="Mono.Security.Providers.NewSystemSource-net_4_x">
- <boot>false</boot>
- <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll -debug -optimize /noconfig -d:SECURITY_DEP -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -d:MONO -d:FEATURE_PAL -d:MONO_FEATURE_NEW_TLS -d:MONO_FEATURE_NEW_SYSTEM_SOURCE -d:DISABLE_CAS_USE -d:MONO_SECURITY_ALIAS -r:./../../class/lib/net_4_x/System.dll -r:MonoSecurity=./../../class/lib/net_4_x/Mono.Security.dll</flags>
- <output>Mono.Security.Providers.NewSystemSource.dll</output>
- <built_sources></built_sources>
- <library_output>./../../class/lib/net_4_x/Mono.Security.Providers.NewSystemSource.dll</library_output>
- <fx_version>4.5</fx_version>
- <profile>net_4_x</profile>
- <resources></resources>
- <response>Mono.Security.Providers.NewSystemSource.dll.sources</response>
- </project>
- <project dir="class/Mono.Security.Providers.NewTls" library="Mono.Security.Providers.NewTls-net_4_x">
- <boot>false</boot>
- <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll -debug -optimize /noconfig -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/Mono.Security.dll -r:NewSystemSource=./../../class/lib/net_4_x/Mono.Security.Providers.NewSystemSource.dll</flags>
- <output>Mono.Security.Providers.NewTls.dll</output>
- <built_sources></built_sources>
- <library_output>./../../class/lib/net_4_x/Mono.Security.Providers.NewTls.dll</library_output>
- <fx_version>4.5</fx_version>
- <profile>net_4_x</profile>
- <resources></resources>
- <response>Mono.Security.Providers.NewTls.dll.sources</response>
- </project>
<project dir="class/System.Runtime.InteropServices.RuntimeInformation" library="System.Runtime.InteropServices.RuntimeInformation-net_4_x">
<boot>false</boot>
<flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/net_4_x/System.dll</flags>
<resources></resources>
<response>System.Xml.Serialization.dll.sources</response>
</project>
- <project dir="class/Mono.Security.Providers.DotNet" library="Mono.Security.Providers.DotNet-net_4_x">
- <boot>false</boot>
- <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll -debug -optimize /noconfig -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/Mono.Security.dll</flags>
- <output>Mono.Security.Providers.DotNet.dll</output>
- <built_sources></built_sources>
- <library_output>./../../class/lib/net_4_x/Mono.Security.Providers.DotNet.dll</library_output>
- <fx_version>4.5</fx_version>
- <profile>net_4_x</profile>
- <resources></resources>
- <response>Mono.Security.Providers.DotNet.dll.sources</response>
- </project>
- <project dir="class/Mono.Security.Providers.OldTls" library="Mono.Security.Providers.OldTls-net_4_x">
- <boot>false</boot>
- <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll -debug -optimize /noconfig -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -d:SECURITY_DEP -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/Mono.Security.dll</flags>
- <output>Mono.Security.Providers.OldTls.dll</output>
- <built_sources></built_sources>
- <library_output>./../../class/lib/net_4_x/Mono.Security.Providers.OldTls.dll</library_output>
- <fx_version>4.5</fx_version>
- <profile>net_4_x</profile>
- <resources></resources>
- <response>Mono.Security.Providers.OldTls.dll.sources</response>
- </project>
<project dir="class/System.DirectoryServices.Protocols" library="System.DirectoryServices.Protocols-net_4_x">
<boot>false</boot>
<flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/System.DirectoryServices.dll -r:./../../class/lib/net_4_x/System.Xml.dll</flags>
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Http.WebHost-net_4_x", "mcs/class/System.Web.Http.WebHost/System.Web.Http.WebHost-net_4_x.csproj", "{2AF7E697-07BA-439E-89BF-076AEE4AE04C}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Security.Providers.NewSystemSource-net_4_x", "mcs/class/Mono.Security.Providers.NewSystemSource/Mono.Security.Providers.NewSystemSource-net_4_x.csproj", "{0BB4541F-9B1A-4CBC-BEB1-00B31B37F74E}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Security.Providers.NewTls-net_4_x", "mcs/class/Mono.Security.Providers.NewTls/Mono.Security.Providers.NewTls-net_4_x.csproj", "{C8B8E524-BB3A-44E2-8C22-E3313E9F477C}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Build.Framework-net_4_x", "mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-net_4_x.csproj", "{5E39A911-F4E6-4B4B-B8AC-111BB1DD80C6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Build.Utilities-net_4_x", "mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-net_4_x.csproj", "{8E5728E0-CEAF-431F-963E-EB1DEE15C506}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Xml.Serialization-net_4_x", "mcs/class/System.Xml.Serialization/System.Xml.Serialization-net_4_x.csproj", "{2210873E-99FC-48A2-A261-D650BAE33A1C}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Security.Providers.DotNet-net_4_x", "mcs/class/Mono.Security.Providers.DotNet/Mono.Security.Providers.DotNet-net_4_x.csproj", "{391EDD2B-85AC-4FCA-B607-AAD6C51E6799}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Security.Providers.OldTls-net_4_x", "mcs/class/Mono.Security.Providers.OldTls/Mono.Security.Providers.OldTls-net_4_x.csproj", "{E485E885-59B1-4081-BC66-56AAAFD8771A}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.DirectoryServices.Protocols-net_4_x", "mcs/class/System.DirectoryServices.Protocols/System.DirectoryServices.Protocols-net_4_x.csproj", "{EF08F249-31A1-4E62-8391-ECBA5227B686}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.VisualC-net_4_x", "mcs/class/Microsoft.VisualC/Microsoft.VisualC-net_4_x.csproj", "{ACA2694D-9F07-4AE2-9171-9AB5DD1A8C18}"
{2AF7E697-07BA-439E-89BF-076AEE4AE04C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2AF7E697-07BA-439E-89BF-076AEE4AE04C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2AF7E697-07BA-439E-89BF-076AEE4AE04C}.Release|Any CPU.Build.0 = Release|Any CPU
- {0BB4541F-9B1A-4CBC-BEB1-00B31B37F74E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0BB4541F-9B1A-4CBC-BEB1-00B31B37F74E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0BB4541F-9B1A-4CBC-BEB1-00B31B37F74E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0BB4541F-9B1A-4CBC-BEB1-00B31B37F74E}.Release|Any CPU.Build.0 = Release|Any CPU
- {C8B8E524-BB3A-44E2-8C22-E3313E9F477C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C8B8E524-BB3A-44E2-8C22-E3313E9F477C}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C8B8E524-BB3A-44E2-8C22-E3313E9F477C}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C8B8E524-BB3A-44E2-8C22-E3313E9F477C}.Release|Any CPU.Build.0 = Release|Any CPU
{5E39A911-F4E6-4B4B-B8AC-111BB1DD80C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5E39A911-F4E6-4B4B-B8AC-111BB1DD80C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5E39A911-F4E6-4B4B-B8AC-111BB1DD80C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2210873E-99FC-48A2-A261-D650BAE33A1C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2210873E-99FC-48A2-A261-D650BAE33A1C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2210873E-99FC-48A2-A261-D650BAE33A1C}.Release|Any CPU.Build.0 = Release|Any CPU
- {391EDD2B-85AC-4FCA-B607-AAD6C51E6799}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {391EDD2B-85AC-4FCA-B607-AAD6C51E6799}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {391EDD2B-85AC-4FCA-B607-AAD6C51E6799}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {391EDD2B-85AC-4FCA-B607-AAD6C51E6799}.Release|Any CPU.Build.0 = Release|Any CPU
- {E485E885-59B1-4081-BC66-56AAAFD8771A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E485E885-59B1-4081-BC66-56AAAFD8771A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E485E885-59B1-4081-BC66-56AAAFD8771A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E485E885-59B1-4081-BC66-56AAAFD8771A}.Release|Any CPU.Build.0 = Release|Any CPU
{EF08F249-31A1-4E62-8391-ECBA5227B686}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF08F249-31A1-4E62-8391-ECBA5227B686}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF08F249-31A1-4E62-8391-ECBA5227B686}.Release|Any CPU.ActiveCfg = Release|Any CPU