mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 11:21:39 -10:00
Compare commits
197
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d83535725 | ||
|
|
79c7c38cc6 | ||
|
|
c43e6eb8bd | ||
|
|
2d945d75bb | ||
|
|
8bcbed62d9 | ||
|
|
7301209fc2 | ||
|
|
2b6077e482 | ||
|
|
efea2b4726 | ||
|
|
37d269cb52 | ||
|
|
997513da02 | ||
|
|
a29c99aa63 | ||
|
|
4321e5cd9a | ||
|
|
aacdaf236a | ||
|
|
528a903cfd | ||
|
|
c318f180b0 | ||
|
|
3d72bcc526 | ||
|
|
fd4e3c9764 | ||
|
|
20d7404ea9 | ||
|
|
76b97d3566 | ||
|
|
3c588b35d2 | ||
|
|
e1b7bac978 | ||
|
|
d85e7b8cb0 | ||
|
|
d0d92e6491 | ||
|
|
cc84b6bd09 | ||
|
|
83a5e2eca4 | ||
|
|
3053fb09ba | ||
|
|
5c74d39edb | ||
|
|
52f46e9211 | ||
|
|
c6e4b86d70 | ||
|
|
bc4e9422ba | ||
|
|
f868df7ad1 | ||
|
|
1160593964 | ||
|
|
a635b95a9b | ||
|
|
9017cb95c5 | ||
|
|
3a5f494f54 | ||
|
|
bda5fa2351 | ||
|
|
2c83d00c6e | ||
|
|
a8af2a6572 | ||
|
|
e82a5ef7dd | ||
|
|
1cbbb44782 | ||
|
|
f8df92a214 | ||
|
|
460affcfa9 | ||
|
|
8e088ee070 | ||
|
|
9d8d025d78 | ||
|
|
844b5e4fd4 | ||
|
|
8357c86c99 | ||
|
|
c1081e3165 | ||
|
|
8121e75d36 | ||
|
|
a35cd0df2d | ||
|
|
def927b812 | ||
|
|
240304600e | ||
|
|
5c0f445fcd | ||
|
|
ca535ed26a | ||
|
|
59faae46b2 | ||
|
|
9e17c5a5ab | ||
|
|
7dc803d5d3 | ||
|
|
4b9ddd701a | ||
|
|
22cbbbac9b | ||
|
|
0bc72bdb84 | ||
|
|
dcb167189d | ||
|
|
f8253aeac9 | ||
|
|
811a40b65c | ||
|
|
562523d4af | ||
|
|
f56e0724dc | ||
|
|
cfc81a28ab | ||
|
|
dd0a6c3e65 | ||
|
|
6a96f28f0d | ||
|
|
ca758193df | ||
|
|
31e71b735a | ||
|
|
543309ffe7 | ||
|
|
f49b93fddc | ||
|
|
17e92c8775 | ||
|
|
b82b0b8402 | ||
|
|
b95a41dbbd | ||
|
|
dc6930b8b4 | ||
|
|
a6f3e45a87 | ||
|
|
2bf0d19a48 | ||
|
|
ebabb14b44 | ||
|
|
4f1b4b7790 | ||
|
|
f092aa04a3 | ||
|
|
0adaad2c6d | ||
|
|
e6bf5554f3 | ||
|
|
489fc4f99e | ||
|
|
d81684a27b | ||
|
|
a4f8a1dc63 | ||
|
|
478b05fa6d | ||
|
|
b2285f8068 | ||
|
|
0dccf251d7 | ||
|
|
2352950b70 | ||
|
|
683110916c | ||
|
|
dd518c6631 | ||
|
|
870f68b185 | ||
|
|
704ecaa367 | ||
|
|
eed35d900c | ||
|
|
827524cf63 | ||
|
|
a7010722e2 | ||
|
|
26640c4791 | ||
|
|
74d30ea560 | ||
|
|
a2476fb2e5 | ||
|
|
8c049dfbe3 | ||
|
|
2562ae43d2 | ||
|
|
6609e27194 | ||
|
|
579de299a4 | ||
|
|
6bcd2dcbb0 | ||
|
|
aa2166908a | ||
|
|
77477b0e2b | ||
|
|
6843781a74 | ||
|
|
1155a5450d | ||
|
|
1864884b23 | ||
|
|
2f4c3bb46f | ||
|
|
a144ba8ec7 | ||
|
|
f915605202 | ||
|
|
af05134433 | ||
|
|
42841a8b49 | ||
|
|
9d6b03a587 | ||
|
|
139355c417 | ||
|
|
628f9128c1 | ||
|
|
965ef3944b | ||
|
|
40ccecff4d | ||
|
|
d5d3cd6b1b | ||
|
|
4eecc3c561 | ||
|
|
6401d82249 | ||
|
|
d075ef48bb | ||
|
|
11d4948c49 | ||
|
|
eabe8a6341 | ||
|
|
51226c86f9 | ||
|
|
dec6138558 | ||
|
|
f49e2aa9c7 | ||
|
|
a3342da9d3 | ||
|
|
0724a82762 | ||
|
|
eba7d86c48 | ||
|
|
f157f6db3c | ||
|
|
1fe015afe2 | ||
|
|
92e0fa92e2 | ||
|
|
e51b4ec685 | ||
|
|
622aeb1d4e | ||
|
|
31c048846e | ||
|
|
25482461f4 | ||
|
|
5b813a0669 | ||
|
|
7f3b986d89 | ||
|
|
06d7a3542b | ||
|
|
e2b0609fb6 | ||
|
|
3e53dd0781 | ||
|
|
7abb793172 | ||
|
|
2c48c4df45 | ||
|
|
0823bed71d | ||
|
|
0f29e3fd4c | ||
|
|
d92c873c2e | ||
|
|
e95a4a2e35 | ||
|
|
4a5da6f763 | ||
|
|
73e37f0ecf | ||
|
|
951b60ed56 | ||
|
|
85eb387b2b | ||
|
|
3b29ce1cd9 | ||
|
|
28763a2c12 | ||
|
|
5022db1956 | ||
|
|
cffefd0f53 | ||
|
|
48a394857e | ||
|
|
d884c7ffeb | ||
|
|
e44ea51d4f | ||
|
|
c08f535412 | ||
|
|
118040a594 | ||
|
|
9f253965d0 | ||
|
|
42421eec1e | ||
|
|
c207088bd5 | ||
|
|
94061273a9 | ||
|
|
151af80fc2 | ||
|
|
799c7e9d0e | ||
|
|
adadb49ff5 | ||
|
|
15eb87998b | ||
|
|
247e60c2ad | ||
|
|
b1829de7aa | ||
|
|
fbf049d785 | ||
|
|
f0e8eac918 | ||
|
|
f158270d86 | ||
|
|
4c1760785a | ||
|
|
45d05ecbef | ||
|
|
627393a8fb | ||
|
|
6e8009a6ff | ||
|
|
fadccb411b | ||
|
|
9f65659dd5 | ||
|
|
3d81daf796 | ||
|
|
aeeb425ee7 | ||
|
|
b11f4fd6f7 | ||
|
|
1dd2749f4e | ||
|
|
4364a6b752 | ||
|
|
35f9501967 | ||
|
|
6837c35527 | ||
|
|
2dbf0a0ed1 | ||
|
|
fbdb69cfff | ||
|
|
0bcc31e326 | ||
|
|
a9afeddd80 | ||
|
|
43307ff086 | ||
|
|
352334f2bd | ||
|
|
fff7805794 | ||
|
|
0942a3c114 | ||
|
|
c325d2544e |
No files matched your search
@@ -125,4 +125,5 @@ mono.h
|
||||
mono-*.tar.*
|
||||
tmpinst-dir.stamp
|
||||
msvc/scripts/inputs/
|
||||
extensions-config.h
|
||||
|
||||
+3
-1
@@ -1,7 +1,7 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
#AC_PREREQ([2.62])
|
||||
|
||||
AC_INIT(mono, [4.3.0],
|
||||
AC_INIT(mono, [4.3.1],
|
||||
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
|
||||
|
||||
AC_CONFIG_SRCDIR([README.md])
|
||||
@@ -3477,6 +3477,7 @@ AC_ARG_WITH(monodroid, [ --with-monodroid=yes,no If you want to b
|
||||
AC_ARG_WITH(monotouch, [ --with-monotouch=yes,no If you want to build the Xamarin.iOS assemblies (defaults to no)], [], [with_monotouch=no])
|
||||
AC_ARG_WITH(monotouch_watch, [ --with-monotouch_watch=yes,no If you want to build the Xamarin.WatchOS assemblies (defaults to no)],[], [with_monotouch_watch=no])
|
||||
AC_ARG_WITH(monotouch_tv, [ --with-monotouch_tv=yes,no If you want to build the Xamarin.TVOS assemblies (defaults to no)], [], [with_monotouch_tv=no])
|
||||
AC_ARG_WITH(bitcode, [ --with-bitcode=yes,no If bitcode is enabled (defaults to no)], [], [with_bitcode=no])
|
||||
AC_ARG_WITH(xammac, [ --with-xammac=yes,no If you want to build the Xamarin.Mac assemblies (defaults to no)], [], [with_xammac=no])
|
||||
|
||||
OPROFILE=no
|
||||
@@ -3590,6 +3591,7 @@ AM_CONDITIONAL(INSTALL_MONODROID, [test "x$with_monodroid" != "xno"])
|
||||
AM_CONDITIONAL(INSTALL_MONOTOUCH, [test "x$with_monotouch" != "xno"])
|
||||
AM_CONDITIONAL(INSTALL_MONOTOUCH_WATCH, [test "x$with_monotouch_watch" != "xno"])
|
||||
AM_CONDITIONAL(INSTALL_MONOTOUCH_TV, [test "x$with_monotouch_tv" != "xno"])
|
||||
AM_CONDITIONAL(BITCODE, test "x$with_bitcode" = "xyes")
|
||||
AM_CONDITIONAL(INSTALL_XAMMAC, [test "x$with_xammac" != "xno"])
|
||||
|
||||
AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
|
||||
|
||||
Vendored
+1
-1
Submodule external/ikdasm updated: 3bf7a4b543...d6db90d678.
Vendored
+1
-1
Submodule external/referencesource updated: d69f20d81d...06ad2f6b46.
+3
-1
@@ -868,7 +868,9 @@ environment variable to limit the extent of the messages you get:
|
||||
If set, the log mask is changed to the set value. Possible values are
|
||||
"asm" (assembly loader), "type", "dll" (native library loader), "gc"
|
||||
(garbage collector), "cfg" (config file loader), "aot" (precompiler),
|
||||
"security" (e.g. Moonlight CoreCLR support) and "all".
|
||||
"security" (e.g. Moonlight CoreCLR support), "threadpool" (thread pool generic),
|
||||
"io-threadpool" (thread pool I/O), "io-layer" (I/O layer - sockets, handles, shared memory etc)
|
||||
and "all".
|
||||
The default value is "all". Changing the mask value allows you to display only
|
||||
messages for a certain component. You can use multiple masks by comma
|
||||
separating them. For example to see config file messages and assembly loader
|
||||
|
||||
+2
-2
@@ -27,9 +27,9 @@ The Private Key File (pvk) that contains the private key used to digitally
|
||||
sign the PE executable. This private key must match the public key inside the
|
||||
publisher X.509 certificate.
|
||||
.TP
|
||||
.I "-a md5 | sha1"
|
||||
.I "-a sha1 | md5"
|
||||
The hash algorithm used in the digital signature of the PE executable. The
|
||||
default algorithm is MD5.
|
||||
default algorithm is SHA1.
|
||||
.TP
|
||||
.I "-$ individual | commercial"
|
||||
Add information about the publisher, i.e. if the signature is generated by an
|
||||
|
||||
@@ -11,6 +11,8 @@ monotouch_SUBDIRS := build class
|
||||
monotouch_watch_SUBDIRS := build class
|
||||
monotouch_tv_SUBDIRS := build class
|
||||
monotouch_runtime_SUBDIRS := build class
|
||||
monotouch_watch_runtime_SUBDIRS := build class
|
||||
monotouch_tv_runtime_SUBDIRS := build class
|
||||
xammac_SUBDIRS := build class
|
||||
mobile_SUBDIRS := build class
|
||||
mobile_static_SUBDIRS := build class
|
||||
@@ -65,6 +67,8 @@ $(_boot_:%=profile-do--monotouch--%): profile-do--monotouch--%:
|
||||
$(_boot_:%=profile-do--monotouch_watch--%): profile-do--monotouch_watch--%: profile-do--build--%
|
||||
$(_boot_:%=profile-do--monotouch_tv--%): profile-do--monotouch_tv--%: profile-do--build--%
|
||||
$(_boot_:%=profile-do--monotouch_runtime--%): profile-do--monotouch_runtime--%: profile-do--build--%
|
||||
$(_boot_:%=profile-do--monotouch_watch_runtime--%): profile-do--monotouch_watch_runtime--%: profile-do--build--%
|
||||
$(_boot_:%=profile-do--monotouch_tv_runtime--%): profile-do--monotouch_tv_runtime--%: profile-do--build--%
|
||||
$(_boot_:%=profile-do--xammac--%): profile-do--xammac--%: profile-do--build--%
|
||||
$(_boot_:%=profile-do--xammac_net_4_5--%): profile-do--xammac_net_4_5--%: profile-do--build--%
|
||||
$(_boot_:%=profile-do--mobile--%): profile-do--mobile--%: profile-do--build--%
|
||||
|
||||
@@ -1,42 +1,4 @@
|
||||
#! -*- makefile -*-
|
||||
include $(topdir)/build/profiles/monotouch_runtime.make
|
||||
|
||||
BOOTSTRAP_PROFILE = build
|
||||
|
||||
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
|
||||
MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
|
||||
|
||||
# Use system resgen as we don't want local System.Windows.Forms dependency
|
||||
RESGEN := $(dir $(shell which $(EXTERNAL_MCS)))resgen2
|
||||
|
||||
profile-check:
|
||||
@:
|
||||
|
||||
DEFAULT_REFERENCES = -r:mscorlib.dll
|
||||
|
||||
PROFILE_MCS_FLAGS = \
|
||||
-d:NET_1_1 \
|
||||
-d:NET_2_0 \
|
||||
-d:NET_2_1 \
|
||||
-d:NET_3_5 \
|
||||
-d:NET_4_0 \
|
||||
-d:NET_4_5 \
|
||||
-d:MOBILE,MOBILE_LEGACY \
|
||||
-d:MONO \
|
||||
-d:DISABLE_CAS_USE \
|
||||
-d:MONOTOUCH \
|
||||
-d:DISABLE_REMOTING \
|
||||
-d:DISABLE_COM \
|
||||
-d:FULL_AOT_RUNTIME \
|
||||
-nowarn:1699 \
|
||||
-nostdlib \
|
||||
-lib:$(topdir)/class/lib/$(PROFILE) \
|
||||
$(DEFAULT_REFERENCES) \
|
||||
$(PLATFORM_DEBUG_FLAGS)
|
||||
|
||||
FRAMEWORK_VERSION = 2.1
|
||||
NO_TEST = yes
|
||||
|
||||
# the tuner takes care of the install
|
||||
NO_INSTALL = yes
|
||||
MOBILE_STATIC = yes
|
||||
MOBILE_PROFILE = yes
|
||||
PROFILE_MCS_FLAGS += \
|
||||
-d:FULL_AOT_RUNTIME
|
||||
@@ -14,7 +14,25 @@ profile-check:
|
||||
@:
|
||||
|
||||
DEFAULT_REFERENCES = -r:mscorlib.dll
|
||||
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -d:MOBILE,MOBILE_LEGACY -d:MONOTOUCH -D:DISABLE_REMOTING -d:DISABLE_COM -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
|
||||
PROFILE_MCS_FLAGS = \
|
||||
-d:NET_1_1 \
|
||||
-d:NET_2_0 \
|
||||
-d:NET_2_1 \
|
||||
-d:NET_3_5 \
|
||||
-d:NET_4_0 \
|
||||
-d:NET_4_5 \
|
||||
-d:MOBILE,MOBILE_LEGACY \
|
||||
-d:MONO \
|
||||
-d:DISABLE_CAS_USE \
|
||||
-d:MONOTOUCH \
|
||||
-d:DISABLE_REMOTING \
|
||||
-d:DISABLE_COM \
|
||||
-d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK \
|
||||
-nowarn:1699 \
|
||||
-nostdlib \
|
||||
-lib:$(topdir)/class/lib/$(PROFILE) \
|
||||
$(DEFAULT_REFERENCES) \
|
||||
$(PLATFORM_DEBUG_FLAGS)
|
||||
|
||||
FRAMEWORK_VERSION = 2.1
|
||||
|
||||
|
||||
@@ -2,3 +2,8 @@ include $(topdir)/build/profiles/monotouch.make
|
||||
|
||||
PROFILE_MCS_FLAGS += \
|
||||
-d:MONOTOUCH_TV
|
||||
|
||||
NO_THREAD_ABORT=1
|
||||
NO_THREAD_SUSPEND_RESUME=1
|
||||
NO_MULTIPLE_APPDOMAINS=1
|
||||
NO_PROCESS_START=1
|
||||
@@ -0,0 +1,10 @@
|
||||
include $(topdir)/build/profiles/monotouch_runtime.make
|
||||
|
||||
PROFILE_MCS_FLAGS += \
|
||||
-d:MONOTOUCH_TV
|
||||
|
||||
NO_THREAD_ABORT=1
|
||||
NO_THREAD_SUSPEND_RESUME=1
|
||||
# The binding generator (btv) still needs to execute processes,
|
||||
# so we need a System.dll that can do that.
|
||||
#NO_PROCESS_START=1
|
||||
@@ -2,3 +2,8 @@ include $(topdir)/build/profiles/monotouch.make
|
||||
|
||||
PROFILE_MCS_FLAGS += \
|
||||
-d:MONOTOUCH_WATCH
|
||||
|
||||
NO_THREAD_ABORT=1
|
||||
NO_THREAD_SUSPEND_RESUME=1
|
||||
NO_MULTIPLE_APPDOMAINS=1
|
||||
NO_PROCESS_START=1
|
||||
@@ -0,0 +1,10 @@
|
||||
include $(topdir)/build/profiles/monotouch_runtime.make
|
||||
|
||||
PROFILE_MCS_FLAGS += \
|
||||
-d:MONOTOUCH_WATCH
|
||||
|
||||
NO_THREAD_ABORT=1
|
||||
NO_THREAD_SUSPEND_RESUME=1
|
||||
# The binding generator (bwatch) still needs to execute processes,
|
||||
# so we need a System.dll that can do that.
|
||||
#NO_PROCESS_START=1
|
||||
@@ -23,6 +23,7 @@ PROFILE_MCS_FLAGS = \
|
||||
-d:MOBILE \
|
||||
-d:MOBILE_DYNAMIC \
|
||||
-d:XAMMAC \
|
||||
-d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK \
|
||||
-nowarn:1699 \
|
||||
-nostdlib \
|
||||
-lib:$(topdir)/class/lib/$(PROFILE) \
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
include $(topdir)/build/profiles/net_4_x.make
|
||||
PROFILE_MCS_FLAGS += -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5
|
||||
PROFILE_MCS_FLAGS += \
|
||||
-d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK \
|
||||
-d:NO_SYSTEM_DRAWING_DEPENDENCY \
|
||||
-d:NO_WINFORMS_DEPENDENCY \
|
||||
-d:NO_SYSTEM_WEB_DEPENDENCY \
|
||||
-d:XAMMAC_4_5
|
||||
XAMMAC_4_5=1
|
||||
NO_WINDOWS_BASE=1
|
||||
NO_SYSTEM_WEB_DEPENDENCY=1
|
||||
|
||||
@@ -2,46 +2,7 @@ MCS_BUILD_DIR = ../../build
|
||||
|
||||
thisdir = class/Facades
|
||||
|
||||
monotouch_PARALLEL_SUBDIRS = System.Collections.Concurrent System.Collections System.ComponentModel.Annotations System.ComponentModel.EventBasedAsync System.ComponentModel \
|
||||
System.Diagnostics.Contracts System.Diagnostics.Debug System.Diagnostics.Tracing System.Diagnostics.Tools System.Dynamic.Runtime System.Globalization System.IO System.Linq.Expressions \
|
||||
System.Linq.Parallel System.Linq.Queryable System.Linq System.Net.NetworkInformation System.Net.Primitives System.Net.Requests System.ObjectModel \
|
||||
System.Reflection.Extensions System.Reflection.Primitives System.Reflection System.Resources.ResourceManager System.Runtime.Extensions \
|
||||
System.Runtime.InteropServices System.Runtime.InteropServices.WindowsRuntime System.Runtime.Numerics System.Runtime.Serialization.Json \
|
||||
System.Runtime.Serialization.Primitives System.Runtime.Serialization.Xml System.Runtime System.Security.Principal System.ServiceModel.Http \
|
||||
System.ServiceModel.Primitives System.ServiceModel.Security System.Text.Encoding.Extensions System.Text.Encoding System.Text.RegularExpressions System.Threading.Tasks.Parallel \
|
||||
System.Threading.Tasks System.Threading.Timer System.Threading System.Xml.ReaderWriter System.Xml.XDocument System.Xml.XmlSerializer \
|
||||
System.Runtime.Handles System.ServiceModel.Duplex System.ServiceModel.NetTcp \
|
||||
Microsoft.Win32.Primitives Microsoft.Win32.Registry System.AppContext System.Collections.NonGeneric System.Collections.Specialized System.ComponentModel.Primitives \
|
||||
System.ComponentModel.TypeConverter System.Console System.Data.Common System.Data.SqlClient System.Diagnostics.FileVersionInfo \
|
||||
System.Diagnostics.Process System.Diagnostics.TextWriterTraceListener System.Diagnostics.TraceEvent System.Diagnostics.TraceSource System.Globalization.Calendars \
|
||||
System.IO.Compression System.IO.Compression.ZipFile System.IO.FileSystem System.IO.FileSystem.DriveInfo System.IO.FileSystem.Primitives \
|
||||
System.IO.IsolatedStorage System.IO.MemoryMappedFiles System.IO.UnmanagedMemoryStream System.Net.AuthenticationManager System.Net.Cache \
|
||||
System.Net.HttpListener System.Net.Mail System.Net.NameResolution System.Net.Security System.Net.ServicePoint System.Net.Sockets \
|
||||
System.Net.Utilities System.Net.WebHeaderCollection System.Net.WebSockets System.Net.WebSockets.Client System.Resources.ReaderWriter System.Runtime.CompilerServices.VisualC \
|
||||
System.Security.AccessControl System.Security.Claims System.Security.Cryptography.DeriveBytes System.Security.Cryptography.Encoding System.Security.Cryptography.Encryption \
|
||||
System.Security.Cryptography.Encryption.Aes System.Security.Cryptography.Encryption.ECDiffieHellman System.Security.Cryptography.Encryption.ECDsa System.Security.Cryptography.Hashing \
|
||||
System.Security.Cryptography.Hashing.Algorithms System.Security.Cryptography.RSA System.Security.Cryptography.RandomNumberGenerator \
|
||||
System.Security.Cryptography.X509Certificates System.Security.Principal.Windows System.Threading.Thread System.Threading.ThreadPool \
|
||||
System.Xml.XPath System.Xml.XmlDocument System.Xml.Xsl.Primitives Microsoft.Win32.Registry.AccessControl System.Diagnostics.StackTrace System.Globalization.Extensions \
|
||||
System.IO.FileSystem.AccessControl System.Private.CoreLib.InteropServices System.Private.CoreLib.Threading System.Reflection.TypeExtensions \
|
||||
System.Security.SecureString System.Threading.AccessControl System.Threading.Overlapped System.Xml.XPath.XDocument
|
||||
|
||||
reflection_PARALLEL_SUBDIRS = System.Reflection.Emit.ILGeneration System.Reflection.Emit.Lightweight System.Reflection.Emit
|
||||
|
||||
mobile_static_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
|
||||
|
||||
net_4_x_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS) $(reflection_PARALLEL_SUBDIRS) System.Diagnostics.PerformanceCounter \
|
||||
System.IO.FileSystem.Watcher System.IO.Pipes System.Security.Cryptography.ProtectedData System.ServiceProcess.ServiceController System.Net.Http.WebRequestHandler
|
||||
|
||||
monodroid_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS) $(reflection_PARALLEL_SUBDIRS)
|
||||
|
||||
xammac_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS) $(reflection_PARALLEL_SUBDIRS)
|
||||
xammac_net_4_5_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS) $(reflection_PARALLEL_SUBDIRS)
|
||||
|
||||
monotouch_watch_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
|
||||
monotouch_tv_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
|
||||
|
||||
PROFILE_PARALLEL_SUBDIRS = $(net_4_x_PARALLEL_SUBDIRS)
|
||||
include subdirs.make
|
||||
|
||||
#OVERRIDE_TARGET_ALL = yes
|
||||
|
||||
@@ -68,6 +29,7 @@ include $(MCS_BUILD_DIR)/rules.make
|
||||
dist-local: dist-default
|
||||
|
||||
DIST_SUBDIRS = $(net_4_x_PARALLEL_SUBDIRS)
|
||||
DISTFILES=subdirs.make
|
||||
|
||||
doc-update-local:
|
||||
@echo "not doing docs"
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
MCS_BUILD_DIR = ../../../build
|
||||
|
||||
thisdir = class/Facades/System.IO.Compression
|
||||
SUBDIRS =
|
||||
include $(MCS_BUILD_DIR)/rules.make
|
||||
|
||||
LIBRARY_SUBDIR = Facades
|
||||
LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
|
||||
|
||||
LIBRARY = System.IO.Compression.dll
|
||||
|
||||
KEY_FILE = ../../msfinal.pub
|
||||
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
|
||||
LIB_REFS = System
|
||||
LIB_MCS_FLAGS = $(SIGN_FLAGS) /r:mscorlib /r:System.IO.Compression.dll
|
||||
|
||||
PLATFORM_DEBUG_FLAGS =
|
||||
|
||||
NO_TEST = yes
|
||||
|
||||
include $(MCS_BUILD_DIR)/library.make
|
||||
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{DA6DA8FE-0BF4-43C5-9BF8-896409EBDA70}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<NoWarn>1699,1616,1699,1699,1616,1699</NoWarn>
|
||||
<OutputPath>./../../../class/lib/net_4_x/Facades</OutputPath>
|
||||
<NoStdLib>True</NoStdLib>
|
||||
<NoConfig>True</NoConfig>
|
||||
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>
|
||||
</RootNamespace>
|
||||
<AssemblyName>System.IO.Compression</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<DelaySign>true</DelaySign>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<NoWarn>1699,1616,1699,1699,1616,1699</NoWarn>
|
||||
<Optimize>false</Optimize>
|
||||
<DefineConstants>DEBUG;TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<NoWarn>1699,1616,1699,1699,1616,1699</NoWarn>
|
||||
<Optimize>true</Optimize>
|
||||
<DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<!-- Set AddAdditionalExplicitAssemblyReferences to false, otherwise if targetting .NET4.0,
|
||||
Microsoft.NETFramework.props will force a dependency on the assembly System.Core. This
|
||||
is a problem to compile the Mono mscorlib.dll -->
|
||||
<PropertyGroup>
|
||||
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<Compile Include="AssemblyInfo.cs" />
|
||||
<Compile Include="TypeForwarders.cs" />␍ </ItemGroup>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
|
||||
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">
|
||||
|
||||
</PreBuildEvent>
|
||||
|
||||
<PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
|
||||
|
||||
</PostBuildEvent>
|
||||
<PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">
|
||||
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../../corlib/corlib-net_4_x.csproj">
|
||||
<Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>
|
||||
<Name>corlib-net_4_x</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="../../corlib/corlib-net_4_x.csproj">
|
||||
<Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>
|
||||
<Name>corlib-net_4_x</Name>
|
||||
</ProjectReference>
|
||||
<Reference Include="System.IO.Compression.dll">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>System.IO.Compression.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<ProjectReference Include="../../System/System-net_4_x.csproj">
|
||||
<Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>
|
||||
<Name>System-net_4_x</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
TypeForwarders.cs
|
||||
AssemblyInfo.cs
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
|
||||
# This file should only contain SUBDIRS variables
|
||||
# Caution while renaming SUBDIRS variables as those are used outside mono repository.
|
||||
# ie: macccore/builds/Makefile
|
||||
|
||||
monotouch_PARALLEL_SUBDIRS = System.Collections.Concurrent System.Collections System.ComponentModel.Annotations System.ComponentModel.EventBasedAsync System.ComponentModel \
|
||||
System.Diagnostics.Contracts System.Diagnostics.Debug System.Diagnostics.Tracing System.Diagnostics.Tools System.Dynamic.Runtime System.Globalization System.IO System.Linq.Expressions \
|
||||
System.Linq.Parallel System.Linq.Queryable System.Linq System.Net.NetworkInformation System.Net.Primitives System.Net.Requests System.ObjectModel \
|
||||
System.Reflection.Extensions System.Reflection.Primitives System.Reflection System.Resources.ResourceManager System.Runtime.Extensions \
|
||||
System.Runtime.InteropServices System.Runtime.InteropServices.WindowsRuntime System.Runtime.Numerics System.Runtime.Serialization.Json \
|
||||
System.Runtime.Serialization.Primitives System.Runtime.Serialization.Xml System.Runtime System.Security.Principal System.ServiceModel.Http \
|
||||
System.ServiceModel.Primitives System.ServiceModel.Security System.Text.Encoding.Extensions System.Text.Encoding System.Text.RegularExpressions System.Threading.Tasks.Parallel \
|
||||
System.Threading.Tasks System.Threading.Timer System.Threading System.Xml.ReaderWriter System.Xml.XDocument System.Xml.XmlSerializer \
|
||||
System.Runtime.Handles System.ServiceModel.Duplex System.ServiceModel.NetTcp \
|
||||
Microsoft.Win32.Primitives Microsoft.Win32.Registry System.AppContext System.Collections.NonGeneric System.Collections.Specialized System.ComponentModel.Primitives \
|
||||
System.ComponentModel.TypeConverter System.Console System.Data.Common System.Data.SqlClient System.Diagnostics.FileVersionInfo \
|
||||
System.Diagnostics.Process System.Diagnostics.TextWriterTraceListener System.Diagnostics.TraceEvent System.Diagnostics.TraceSource System.Globalization.Calendars \
|
||||
System.IO.Compression.ZipFile System.IO.FileSystem System.IO.FileSystem.DriveInfo System.IO.FileSystem.Primitives \
|
||||
System.IO.IsolatedStorage System.IO.MemoryMappedFiles System.IO.UnmanagedMemoryStream System.Net.AuthenticationManager System.Net.Cache \
|
||||
System.Net.HttpListener System.Net.Mail System.Net.NameResolution System.Net.Security System.Net.ServicePoint System.Net.Sockets \
|
||||
System.Net.Utilities System.Net.WebHeaderCollection System.Net.WebSockets System.Net.WebSockets.Client System.Resources.ReaderWriter System.Runtime.CompilerServices.VisualC \
|
||||
System.Security.AccessControl System.Security.Claims System.Security.Cryptography.DeriveBytes System.Security.Cryptography.Encoding System.Security.Cryptography.Encryption \
|
||||
System.Security.Cryptography.Encryption.Aes System.Security.Cryptography.Encryption.ECDiffieHellman System.Security.Cryptography.Encryption.ECDsa System.Security.Cryptography.Hashing \
|
||||
System.Security.Cryptography.Hashing.Algorithms System.Security.Cryptography.RSA System.Security.Cryptography.RandomNumberGenerator \
|
||||
System.Security.Cryptography.X509Certificates System.Security.Principal.Windows System.Threading.Thread System.Threading.ThreadPool \
|
||||
System.Xml.XPath System.Xml.XmlDocument System.Xml.Xsl.Primitives Microsoft.Win32.Registry.AccessControl System.Diagnostics.StackTrace System.Globalization.Extensions \
|
||||
System.IO.FileSystem.AccessControl System.Private.CoreLib.InteropServices System.Private.CoreLib.Threading System.Reflection.TypeExtensions \
|
||||
System.Security.SecureString System.Threading.AccessControl System.Threading.Overlapped System.Xml.XPath.XDocument
|
||||
|
||||
reflection_PARALLEL_SUBDIRS = System.Reflection.Emit.ILGeneration System.Reflection.Emit.Lightweight System.Reflection.Emit
|
||||
|
||||
mobile_static_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
|
||||
|
||||
net_4_x_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS) $(reflection_PARALLEL_SUBDIRS) System.Diagnostics.PerformanceCounter \
|
||||
System.IO.FileSystem.Watcher System.IO.Pipes System.Security.Cryptography.ProtectedData System.ServiceProcess.ServiceController System.Net.Http.WebRequestHandler
|
||||
|
||||
monodroid_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS) $(reflection_PARALLEL_SUBDIRS)
|
||||
|
||||
xammac_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS) $(reflection_PARALLEL_SUBDIRS)
|
||||
xammac_net_4_5_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS) $(reflection_PARALLEL_SUBDIRS)
|
||||
|
||||
monotouch_watch_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
|
||||
monotouch_tv_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
|
||||
|
||||
PROFILE_PARALLEL_SUBDIRS = $(net_4_x_PARALLEL_SUBDIRS)
|
||||
+11
-3
@@ -54,7 +54,8 @@ mobile_common_dirs := \
|
||||
Microsoft.CSharp \
|
||||
Mono.Security.Providers.DotNet \
|
||||
Mono.Security.Providers.OldTls \
|
||||
Mono.Security.Providers.NewSystemSource
|
||||
Mono.Security.Providers.NewSystemSource \
|
||||
Mono.Security.Providers.NewTls
|
||||
|
||||
mobile_static_dirs := \
|
||||
$(mobile_common_dirs) \
|
||||
@@ -85,6 +86,9 @@ monotouch_runtime_dirs := \
|
||||
System.XML \
|
||||
Mono.CSharp
|
||||
|
||||
monotouch_watch_runtime_dirs := $(monotouch_runtime_dirs)
|
||||
monotouch_tv_runtime_dirs := $(monotouch_runtime_dirs)
|
||||
|
||||
xammac_4_5_dirs := \
|
||||
corlib \
|
||||
System \
|
||||
@@ -130,6 +134,7 @@ xammac_4_5_dirs := \
|
||||
Mono.Security.Providers.DotNet \
|
||||
Mono.Security.Providers.OldTls \
|
||||
Mono.Security.Providers.NewSystemSource \
|
||||
Mono.Security.Providers.NewTls \
|
||||
$(pcl_facade_dirs)
|
||||
|
||||
net_4_x_dirs := \
|
||||
@@ -214,7 +219,9 @@ net_4_x_dirs := \
|
||||
System.Net.Http.Formatting \
|
||||
System.Web.Http \
|
||||
System.Web.Http.SelfHost \
|
||||
System.Web.Http.WebHost
|
||||
System.Web.Http.WebHost \
|
||||
Mono.Security.Providers.NewSystemSource \
|
||||
Mono.Security.Providers.NewTls
|
||||
|
||||
# These are the subdirs which depends on libs in net_4_x_dirs
|
||||
# or have proper dependencies between each other
|
||||
@@ -259,7 +266,6 @@ net_4_x_parallel_dirs := \
|
||||
System.Xml.Serialization \
|
||||
Mono.Security.Providers.DotNet \
|
||||
Mono.Security.Providers.OldTls \
|
||||
Mono.Security.Providers.NewSystemSource \
|
||||
System.DirectoryServices.Protocols \
|
||||
RabbitMQ.Client \
|
||||
Microsoft.VisualC \
|
||||
@@ -283,6 +289,8 @@ monotouch_SUBDIRS := $(monotouch_dirs)
|
||||
monotouch_watch_SUBDIRS := $(monotouch_watch_dirs)
|
||||
monotouch_tv_SUBDIRS := $(monotouch_tv_dirs)
|
||||
monotouch_runtime_SUBDIRS := $(monotouch_runtime_dirs)
|
||||
monotouch_watch_runtime_SUBDIRS := $(monotouch_watch_runtime_dirs)
|
||||
monotouch_tv_runtime_SUBDIRS := $(monotouch_tv_runtime_dirs)
|
||||
mobile_static_SUBDIRS := $(mobile_static_dirs)
|
||||
mobile_SUBDIRS := $(mobile_dynamic_dirs)
|
||||
xammac_SUBDIRS := $(xammac_dirs)
|
||||
|
||||
@@ -26,13 +26,17 @@ EXTRA_DISTFILES = \
|
||||
Test/resources/*.*proj \
|
||||
Test/resources/*.csproj
|
||||
|
||||
Test/resources/TestTasks.dll: Test/resources/TestTasks.cs
|
||||
$(CSCOMPILE) Test/resources/TestTasks.cs /r:$(XBUILD_FRAMEWORK) /r:$(XBUILD_UTILITIES) /target:library
|
||||
Test/resources/TestTasks-$(PROFILE).dll: Test/resources/TestTasks.cs
|
||||
$(CSCOMPILE) /out:$@ Test/resources/TestTasks.cs /r:$(XBUILD_FRAMEWORK) /r:$(XBUILD_UTILITIES) /target:library
|
||||
|
||||
clean-test-resources:
|
||||
rm -f Test/resources/TestTasks.dll
|
||||
rm -f Test/resources/TestTasks*.dll Test/resources/TestTasks*.dll.mdb
|
||||
|
||||
test-local: Test/resources/TestTasks.dll
|
||||
test-local: compile-resources
|
||||
|
||||
compile-resources: Test/resources/TestTasks-$(PROFILE).dll
|
||||
cp Test/resources/TestTasks-$(PROFILE).dll Test/resources/TestTasks.dll
|
||||
cp Test/resources/TestTasks-$(PROFILE).dll.mdb Test/resources/TestTasks.dll.mdb
|
||||
|
||||
clean-local: clean-test-resources
|
||||
|
||||
|
||||
@@ -87,14 +87,15 @@ namespace Microsoft.Build.Tasks {
|
||||
string config;
|
||||
|
||||
string guid_str = item.GetMetadata ("Project");
|
||||
Guid guid;
|
||||
if (!TryParseGuid (guid_str, out guid)) {
|
||||
|
||||
Guid guid = Guid.Empty;
|
||||
if (!string.IsNullOrEmpty(guid_str) && !TryParseGuid (guid_str, out guid)) {
|
||||
Log.LogError ("Project reference '{0}' has invalid or missing guid for metadata 'Project'.",
|
||||
item.ItemSpec);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (guidToConfigPlatform.TryGetValue (guid, out config)) {
|
||||
if (guid != Guid.Empty && guidToConfigPlatform.TryGetValue (guid, out config)) {
|
||||
string [] parts = config.Split (new char [] {'|'}, 2);
|
||||
|
||||
ITaskItem new_item = new TaskItem (item);
|
||||
|
||||
+3
-2
@@ -48,11 +48,12 @@ namespace Microsoft.Build.Utilities
|
||||
Version451,
|
||||
#endif
|
||||
#if XBUILD_14
|
||||
Version453,
|
||||
Version46,
|
||||
Version461,
|
||||
#endif
|
||||
|
||||
#if XBUILD_14
|
||||
VersionLatest = Version453
|
||||
VersionLatest = Version461
|
||||
#elif XBUILD_12
|
||||
VersionLatest = Version451
|
||||
#else
|
||||
|
||||
+28
-25
@@ -61,41 +61,44 @@ namespace Microsoft.Build.Utilities
|
||||
runningOnDotNet = !string.IsNullOrEmpty (windowsPath) && lib_mono_dir.StartsWith (windowsPath);
|
||||
|
||||
if (Environment.GetEnvironmentVariable ("TESTING_MONO") != null) {
|
||||
mono_dir = new string [] {
|
||||
Path.Combine (lib_mono_dir, "net_1_0"),
|
||||
Path.Combine (lib_mono_dir, "net_2_0"),
|
||||
Path.Combine (lib_mono_dir, "net_2_0"),
|
||||
Path.Combine (lib_mono_dir, "net_3_5"),
|
||||
mono_dir = new string [] { // TargetDotNetFrameworkVersion:
|
||||
Path.Combine (lib_mono_dir, "net_1_0"), // Version11
|
||||
Path.Combine (lib_mono_dir, "net_2_0"), // Version20
|
||||
Path.Combine (lib_mono_dir, "net_2_0"), // Version30
|
||||
Path.Combine (lib_mono_dir, "net_3_5"), // Version35
|
||||
// mono's 4.0 is not an actual framework directory with all tools etc
|
||||
// it's simply reference assemblies. So like .NET we consider 4.5 to
|
||||
// be a complete replacement for 4.0.
|
||||
Path.Combine (lib_mono_dir, "net_4_x"),
|
||||
Path.Combine (lib_mono_dir, "net_4_x"),
|
||||
Path.Combine (lib_mono_dir, "net_4_x"),
|
||||
Path.Combine (lib_mono_dir, "net_4_x")
|
||||
Path.Combine (lib_mono_dir, "net_4_x"), // Version40
|
||||
Path.Combine (lib_mono_dir, "net_4_x"), // Version45
|
||||
Path.Combine (lib_mono_dir, "net_4_x"), // Version451
|
||||
Path.Combine (lib_mono_dir, "net_4_x"), // Version46
|
||||
Path.Combine (lib_mono_dir, "net_4_x"), // Version461
|
||||
};
|
||||
} else if (runningOnDotNet) {
|
||||
mono_dir = new string [] {
|
||||
Path.Combine (lib_mono_dir, "v1.0.3705"),
|
||||
Path.Combine (lib_mono_dir, "v2.0.50727"),
|
||||
Path.Combine (lib_mono_dir, "v2.0.50727"),
|
||||
Path.Combine (lib_mono_dir, "v3.5"),
|
||||
Path.Combine (lib_mono_dir, "v4.0.30319"),
|
||||
Path.Combine (lib_mono_dir, "v4.0.30319"),
|
||||
Path.Combine (lib_mono_dir, "v4.0.30319"),
|
||||
Path.Combine (lib_mono_dir, "v4.0.30319")
|
||||
Path.Combine (lib_mono_dir, "v1.0.3705"), // Version11
|
||||
Path.Combine (lib_mono_dir, "v2.0.50727"), // Version20
|
||||
Path.Combine (lib_mono_dir, "v2.0.50727"), // Version30
|
||||
Path.Combine (lib_mono_dir, "v3.5"), // Version35
|
||||
Path.Combine (lib_mono_dir, "v4.0.30319"), // Version40
|
||||
Path.Combine (lib_mono_dir, "v4.0.30319"), // Version45
|
||||
Path.Combine (lib_mono_dir, "v4.0.30319"), // Version451
|
||||
Path.Combine (lib_mono_dir, "v4.0.30319"), // Version46
|
||||
Path.Combine (lib_mono_dir, "v4.0.30319"), // Version461
|
||||
};
|
||||
} else {
|
||||
mono_dir = new string [] {
|
||||
Path.Combine (lib_mono_dir, "1.0"),
|
||||
Path.Combine (lib_mono_dir, "2.0"),
|
||||
Path.Combine (lib_mono_dir, "2.0"),
|
||||
Path.Combine (lib_mono_dir, "3.5"),
|
||||
Path.Combine (lib_mono_dir, "1.0"), // Version11
|
||||
Path.Combine (lib_mono_dir, "2.0"), // Version20
|
||||
Path.Combine (lib_mono_dir, "2.0"), // Version30
|
||||
Path.Combine (lib_mono_dir, "3.5"), // Version35
|
||||
// see comment above regarding 4.0/4.5
|
||||
Path.Combine (lib_mono_dir, "4.5"),
|
||||
Path.Combine (lib_mono_dir, "4.5"),
|
||||
Path.Combine (lib_mono_dir, "4.5"),
|
||||
Path.Combine (lib_mono_dir, "4.5")
|
||||
Path.Combine (lib_mono_dir, "4.5"), // Version40
|
||||
Path.Combine (lib_mono_dir, "4.5"), // Version45
|
||||
Path.Combine (lib_mono_dir, "4.5"), // Version451
|
||||
Path.Combine (lib_mono_dir, "4.5"), // Version46
|
||||
Path.Combine (lib_mono_dir, "4.5"), // Version461
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,13 @@ ifdef MOBILE_STATIC
|
||||
LIB_MCS_FLAGS += -d:IOS_REFLECTION
|
||||
endif
|
||||
|
||||
ifndef NO_THREAD_ABORT
|
||||
REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_THREAD_ABORT
|
||||
endif
|
||||
|
||||
TEST_MCS_FLAGS = -r:System.Core.dll
|
||||
|
||||
LIB_MCS_FLAGS += $(REFERENCE_SOURCES_FLAGS)
|
||||
|
||||
include ../../build/library.make
|
||||
|
||||
@@ -499,6 +499,8 @@ namespace Mono.Data.Sqlite
|
||||
#if !SQLITE_STANDARD
|
||||
int len;
|
||||
return UTF8ToString(UnsafeNativeMethods.sqlite3_column_origin_name_interop(stmt._sqlite_stmt, index, out len), len);
|
||||
#elif MONOTOUCH
|
||||
throw new NotImplementedException ();
|
||||
#else
|
||||
return UTF8ToString(UnsafeNativeMethods.sqlite3_column_origin_name(stmt._sqlite_stmt, index), -1);
|
||||
#endif
|
||||
@@ -509,6 +511,8 @@ namespace Mono.Data.Sqlite
|
||||
#if !SQLITE_STANDARD
|
||||
int len;
|
||||
return UTF8ToString(UnsafeNativeMethods.sqlite3_column_database_name_interop(stmt._sqlite_stmt, index, out len), len);
|
||||
#elif MONOTOUCH
|
||||
throw new NotImplementedException ();
|
||||
#else
|
||||
return UTF8ToString(UnsafeNativeMethods.sqlite3_column_database_name(stmt._sqlite_stmt, index), -1);
|
||||
#endif
|
||||
@@ -519,6 +523,8 @@ namespace Mono.Data.Sqlite
|
||||
#if !SQLITE_STANDARD
|
||||
int len;
|
||||
return UTF8ToString(UnsafeNativeMethods.sqlite3_column_table_name_interop(stmt._sqlite_stmt, index, out len), len);
|
||||
#elif MONOTOUCH
|
||||
throw new NotImplementedException ();
|
||||
#else
|
||||
return UTF8ToString(UnsafeNativeMethods.sqlite3_column_table_name(stmt._sqlite_stmt, index), -1);
|
||||
#endif
|
||||
@@ -923,6 +929,17 @@ namespace Mono.Data.Sqlite
|
||||
return UnsafeNativeMethods.sqlite3_aggregate_context(context, 1);
|
||||
}
|
||||
|
||||
#if MONOTOUCH
|
||||
internal override void SetPassword(byte[] passwordBytes)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
internal override void ChangePassword(byte[] newPasswordBytes)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
#else
|
||||
internal override void SetPassword(byte[] passwordBytes)
|
||||
{
|
||||
int n = UnsafeNativeMethods.sqlite3_key(_sql, passwordBytes, passwordBytes.Length);
|
||||
@@ -934,6 +951,7 @@ namespace Mono.Data.Sqlite
|
||||
int n = UnsafeNativeMethods.sqlite3_rekey(_sql, newPasswordBytes, (newPasswordBytes == null) ? 0 : newPasswordBytes.Length);
|
||||
if (n > 0) throw new SqliteException(n, SQLiteLastError());
|
||||
}
|
||||
#endif
|
||||
|
||||
#if MONOTOUCH
|
||||
SQLiteUpdateCallback update_callback;
|
||||
|
||||
@@ -112,6 +112,8 @@ namespace Mono.Data.Sqlite
|
||||
#if !SQLITE_STANDARD
|
||||
int len;
|
||||
return UTF16ToString(UnsafeNativeMethods.sqlite3_column_origin_name16_interop(stmt._sqlite_stmt, index, out len), len);
|
||||
#elif MONOTOUCH
|
||||
throw new NotImplementedException ();
|
||||
#else
|
||||
return UTF16ToString(UnsafeNativeMethods.sqlite3_column_origin_name16(stmt._sqlite_stmt, index), -1);
|
||||
#endif
|
||||
@@ -122,6 +124,8 @@ namespace Mono.Data.Sqlite
|
||||
#if !SQLITE_STANDARD
|
||||
int len;
|
||||
return UTF16ToString(UnsafeNativeMethods.sqlite3_column_database_name16_interop(stmt._sqlite_stmt, index, out len), len);
|
||||
#elif MONOTOUCH
|
||||
throw new NotImplementedException ();
|
||||
#else
|
||||
return UTF16ToString(UnsafeNativeMethods.sqlite3_column_database_name16(stmt._sqlite_stmt, index), -1);
|
||||
#endif
|
||||
@@ -132,6 +136,8 @@ namespace Mono.Data.Sqlite
|
||||
#if !SQLITE_STANDARD
|
||||
int len;
|
||||
return UTF16ToString(UnsafeNativeMethods.sqlite3_column_table_name16_interop(stmt._sqlite_stmt, index, out len), len);
|
||||
#elif MONOTOUCH
|
||||
throw new NotImplementedException ();
|
||||
#else
|
||||
return UTF16ToString(UnsafeNativeMethods.sqlite3_column_table_name16(stmt._sqlite_stmt, index), -1);
|
||||
#endif
|
||||
|
||||
@@ -200,6 +200,8 @@ namespace Mono.Data.Sqlite
|
||||
#endif
|
||||
internal static extern IntPtr sqlite3_bind_parameter_name(IntPtr stmt, int index);
|
||||
|
||||
// Apple does not include those symbols in it's libsqlite3
|
||||
#if !MONOTOUCH
|
||||
#if !PLATFORM_COMPACTFRAMEWORK
|
||||
[DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
#else
|
||||
@@ -213,6 +215,7 @@ namespace Mono.Data.Sqlite
|
||||
[DllImport(SQLITE_DLL)]
|
||||
#endif
|
||||
internal static extern IntPtr sqlite3_column_database_name16(IntPtr stmt, int index);
|
||||
#endif
|
||||
|
||||
#if !PLATFORM_COMPACTFRAMEWORK
|
||||
[DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
@@ -242,6 +245,7 @@ namespace Mono.Data.Sqlite
|
||||
#endif
|
||||
internal static extern IntPtr sqlite3_column_name16(IntPtr stmt, int index);
|
||||
|
||||
#if !MONOTOUCH
|
||||
#if !PLATFORM_COMPACTFRAMEWORK
|
||||
[DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
#else
|
||||
@@ -269,6 +273,7 @@ namespace Mono.Data.Sqlite
|
||||
[DllImport(SQLITE_DLL)]
|
||||
#endif
|
||||
internal static extern IntPtr sqlite3_column_table_name16(IntPtr stmt, int index);
|
||||
#endif // !MONOTOUCH
|
||||
|
||||
#if !PLATFORM_COMPACTFRAMEWORK
|
||||
[DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
@@ -646,6 +651,7 @@ namespace Mono.Data.Sqlite
|
||||
#endif
|
||||
internal static extern void sqlite3_result_text16(IntPtr context, string strName, int nLen, IntPtr pvReserved);
|
||||
|
||||
#if !MONOTOUCH
|
||||
#if !PLATFORM_COMPACTFRAMEWORK
|
||||
[DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
#else
|
||||
@@ -659,6 +665,7 @@ namespace Mono.Data.Sqlite
|
||||
[DllImport(SQLITE_DLL)]
|
||||
#endif
|
||||
internal static extern int sqlite3_rekey(IntPtr db, byte[] key, int keylen);
|
||||
#endif
|
||||
|
||||
#if !PLATFORM_COMPACTFRAMEWORK
|
||||
[DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||
|
||||
@@ -10,3 +10,5 @@ EXTRA_DISTFILES = README.md
|
||||
|
||||
include ../../build/library.make
|
||||
|
||||
$(the_lib): ../Mono.Security/Makefile
|
||||
|
||||
+69
-52
@@ -33,12 +33,13 @@ using System.Security.Authentication;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Security.Principal;
|
||||
using System.Security.Cryptography;
|
||||
using Mono.Security.Interface;
|
||||
using MSI = Mono.Security.Interface;
|
||||
|
||||
namespace Mono.Security.Providers.DotNet
|
||||
{
|
||||
class DotNetSslStreamImpl : MonoSslStream
|
||||
class DotNetSslStreamImpl : MSI.IMonoSslStream
|
||||
{
|
||||
DotNetTlsProvider provider;
|
||||
SslStream impl;
|
||||
|
||||
internal SslStream Impl {
|
||||
@@ -49,218 +50,219 @@ namespace Mono.Security.Providers.DotNet
|
||||
}
|
||||
|
||||
public DotNetSslStreamImpl (
|
||||
Stream innerStream, bool leaveInnerStreamOpen,
|
||||
Stream innerStream, bool leaveInnerStreamOpen, DotNetTlsProvider provider,
|
||||
RemoteCertificateValidationCallback userCertificateValidationCallback,
|
||||
LocalCertificateSelectionCallback userCertificateSelectionCallback)
|
||||
{
|
||||
this.provider = provider;
|
||||
impl = new SslStream (
|
||||
innerStream, leaveInnerStreamOpen,
|
||||
userCertificateValidationCallback,
|
||||
userCertificateSelectionCallback);
|
||||
}
|
||||
|
||||
public override void AuthenticateAsClient (string targetHost)
|
||||
public void AuthenticateAsClient (string targetHost)
|
||||
{
|
||||
Impl.AuthenticateAsClient (targetHost);
|
||||
}
|
||||
|
||||
public override void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
|
||||
public void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
|
||||
{
|
||||
Impl.AuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation);
|
||||
}
|
||||
|
||||
public override IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState)
|
||||
public IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState)
|
||||
{
|
||||
return Impl.BeginAuthenticateAsClient (targetHost, asyncCallback, asyncState);
|
||||
}
|
||||
|
||||
public override IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object 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 override void EndAuthenticateAsClient (IAsyncResult asyncResult)
|
||||
public void EndAuthenticateAsClient (IAsyncResult asyncResult)
|
||||
{
|
||||
Impl.EndAuthenticateAsClient (asyncResult);
|
||||
}
|
||||
|
||||
public override void AuthenticateAsServer (X509Certificate serverCertificate)
|
||||
public void AuthenticateAsServer (X509Certificate serverCertificate)
|
||||
{
|
||||
Impl.AuthenticateAsServer (serverCertificate);
|
||||
}
|
||||
|
||||
public override void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
|
||||
public void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
|
||||
{
|
||||
Impl.AuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
|
||||
}
|
||||
|
||||
public override IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState)
|
||||
public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState)
|
||||
{
|
||||
return Impl.BeginAuthenticateAsServer (serverCertificate, asyncCallback, asyncState);
|
||||
}
|
||||
|
||||
public override IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object 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 override void EndAuthenticateAsServer (IAsyncResult asyncResult)
|
||||
public void EndAuthenticateAsServer (IAsyncResult asyncResult)
|
||||
{
|
||||
Impl.EndAuthenticateAsServer (asyncResult);
|
||||
}
|
||||
|
||||
public override Task AuthenticateAsClientAsync (string targetHost)
|
||||
public Task AuthenticateAsClientAsync (string targetHost)
|
||||
{
|
||||
return Impl.AuthenticateAsClientAsync (targetHost);
|
||||
}
|
||||
|
||||
public override Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
|
||||
public Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
|
||||
{
|
||||
return Impl.AuthenticateAsClientAsync (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation);
|
||||
}
|
||||
|
||||
public override Task AuthenticateAsServerAsync (X509Certificate serverCertificate)
|
||||
public Task AuthenticateAsServerAsync (X509Certificate serverCertificate)
|
||||
{
|
||||
return Impl.AuthenticateAsServerAsync (serverCertificate);
|
||||
}
|
||||
|
||||
public override Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
|
||||
public Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
|
||||
{
|
||||
return Impl.AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
|
||||
}
|
||||
|
||||
public override void Flush ()
|
||||
public void Flush ()
|
||||
{
|
||||
Impl.Flush ();
|
||||
}
|
||||
|
||||
public override int Read (byte[] buffer, int offset, int count)
|
||||
public int Read (byte[] buffer, int offset, int count)
|
||||
{
|
||||
return Impl.Read (buffer, offset, count);
|
||||
}
|
||||
|
||||
public override void Write (byte[] buffer)
|
||||
public void Write (byte[] buffer)
|
||||
{
|
||||
Impl.Write (buffer);
|
||||
}
|
||||
|
||||
public override void Write (byte[] buffer, int offset, int count)
|
||||
public void Write (byte[] buffer, int offset, int count)
|
||||
{
|
||||
Impl.Write (buffer, offset, count);
|
||||
}
|
||||
|
||||
public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
|
||||
public IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
|
||||
{
|
||||
return Impl.BeginRead (buffer, offset, count, asyncCallback, asyncState);
|
||||
}
|
||||
|
||||
public override int EndRead (IAsyncResult asyncResult)
|
||||
public int EndRead (IAsyncResult asyncResult)
|
||||
{
|
||||
return Impl.EndRead (asyncResult);
|
||||
}
|
||||
|
||||
public override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
|
||||
public IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
|
||||
{
|
||||
return Impl.BeginWrite (buffer, offset, count, asyncCallback, asyncState);
|
||||
}
|
||||
|
||||
public override void EndWrite (IAsyncResult asyncResult)
|
||||
public void EndWrite (IAsyncResult asyncResult)
|
||||
{
|
||||
Impl.EndWrite (asyncResult);
|
||||
}
|
||||
|
||||
public override TransportContext TransportContext {
|
||||
public TransportContext TransportContext {
|
||||
get { throw new NotSupportedException (); }
|
||||
}
|
||||
|
||||
public override bool IsAuthenticated {
|
||||
public bool IsAuthenticated {
|
||||
get { return Impl.IsAuthenticated; }
|
||||
}
|
||||
|
||||
public override bool IsMutuallyAuthenticated {
|
||||
public bool IsMutuallyAuthenticated {
|
||||
get { return Impl.IsMutuallyAuthenticated; }
|
||||
}
|
||||
|
||||
public override bool IsEncrypted {
|
||||
public bool IsEncrypted {
|
||||
get { return Impl.IsEncrypted; }
|
||||
}
|
||||
|
||||
public override bool IsSigned {
|
||||
public bool IsSigned {
|
||||
get { return Impl.IsSigned; }
|
||||
}
|
||||
|
||||
public override bool IsServer {
|
||||
public bool IsServer {
|
||||
get { return Impl.IsServer; }
|
||||
}
|
||||
|
||||
public override CipherAlgorithmType CipherAlgorithm {
|
||||
public CipherAlgorithmType CipherAlgorithm {
|
||||
get { return Impl.CipherAlgorithm; }
|
||||
}
|
||||
|
||||
public override int CipherStrength {
|
||||
public int CipherStrength {
|
||||
get { return Impl.CipherStrength; }
|
||||
}
|
||||
|
||||
public override HashAlgorithmType HashAlgorithm {
|
||||
public HashAlgorithmType HashAlgorithm {
|
||||
get { return Impl.HashAlgorithm; }
|
||||
}
|
||||
|
||||
public override int HashStrength {
|
||||
public int HashStrength {
|
||||
get { return Impl.HashStrength; }
|
||||
}
|
||||
|
||||
public override ExchangeAlgorithmType KeyExchangeAlgorithm {
|
||||
public ExchangeAlgorithmType KeyExchangeAlgorithm {
|
||||
get { return Impl.KeyExchangeAlgorithm; }
|
||||
}
|
||||
|
||||
public override int KeyExchangeStrength {
|
||||
public int KeyExchangeStrength {
|
||||
get { return KeyExchangeStrength; }
|
||||
}
|
||||
|
||||
public override bool CanRead {
|
||||
public bool CanRead {
|
||||
get { return Impl.CanRead; }
|
||||
}
|
||||
|
||||
public override bool CanTimeout {
|
||||
public bool CanTimeout {
|
||||
get { return Impl.CanTimeout; }
|
||||
}
|
||||
|
||||
public override bool CanWrite {
|
||||
public bool CanWrite {
|
||||
get { return Impl.CanWrite; }
|
||||
}
|
||||
|
||||
public override long Length {
|
||||
public long Length {
|
||||
get { return Impl.Length; }
|
||||
}
|
||||
|
||||
public override long Position {
|
||||
public long Position {
|
||||
get { return Impl.Position; }
|
||||
}
|
||||
|
||||
public override void SetLength (long value)
|
||||
public void SetLength (long value)
|
||||
{
|
||||
Impl.SetLength (value);
|
||||
}
|
||||
|
||||
public override AuthenticatedStream AuthenticatedStream {
|
||||
public AuthenticatedStream AuthenticatedStream {
|
||||
get { return Impl; }
|
||||
}
|
||||
|
||||
public override int ReadTimeout {
|
||||
public int ReadTimeout {
|
||||
get { return Impl.ReadTimeout; }
|
||||
set { Impl.ReadTimeout = value; }
|
||||
}
|
||||
|
||||
public override int WriteTimeout {
|
||||
public int WriteTimeout {
|
||||
get { return Impl.WriteTimeout; }
|
||||
set { Impl.WriteTimeout = value; }
|
||||
}
|
||||
|
||||
public override bool CheckCertRevocationStatus {
|
||||
public bool CheckCertRevocationStatus {
|
||||
get { return Impl.CheckCertRevocationStatus; }
|
||||
}
|
||||
|
||||
public override X509Certificate InternalLocalCertificate {
|
||||
public X509Certificate InternalLocalCertificate {
|
||||
get {
|
||||
try {
|
||||
return LocalCertificate;
|
||||
@@ -270,25 +272,40 @@ namespace Mono.Security.Providers.DotNet
|
||||
}
|
||||
}
|
||||
|
||||
public override X509Certificate LocalCertificate {
|
||||
public X509Certificate LocalCertificate {
|
||||
get { return Impl.LocalCertificate; }
|
||||
}
|
||||
|
||||
public override X509Certificate RemoteCertificate {
|
||||
public X509Certificate RemoteCertificate {
|
||||
get { return Impl.RemoteCertificate; }
|
||||
}
|
||||
|
||||
public override SslProtocols SslProtocol {
|
||||
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");
|
||||
}
|
||||
|
||||
protected override void Dispose (bool disposing)
|
||||
public void Dispose ()
|
||||
{
|
||||
Dispose (true);
|
||||
GC.SuppressFinalize (this);
|
||||
}
|
||||
|
||||
protected void Dispose (bool disposing)
|
||||
{
|
||||
if (impl != null && disposing) {
|
||||
impl.Dispose ();
|
||||
|
||||
+18
-4
@@ -40,15 +40,29 @@ namespace Mono.Security.Providers.DotNet
|
||||
*/
|
||||
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; }
|
||||
}
|
||||
|
||||
public override bool SupportsTlsContext {
|
||||
internal override bool SupportsTlsContext {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
@@ -56,7 +70,7 @@ namespace Mono.Security.Providers.DotNet
|
||||
get { return (SslProtocols)ServicePointManager.SecurityProtocol; }
|
||||
}
|
||||
|
||||
public override MonoSslStream CreateSslStream (
|
||||
public override IMonoSslStream CreateSslStream (
|
||||
Stream innerStream, bool leaveInnerStreamOpen,
|
||||
MonoTlsSettings settings = null)
|
||||
{
|
||||
@@ -71,10 +85,10 @@ namespace Mono.Security.Providers.DotNet
|
||||
selection_callback = ConvertCallback (settings.ClientCertificateSelectionCallback);
|
||||
}
|
||||
|
||||
return new DotNetSslStreamImpl (innerStream, leaveInnerStreamOpen, validation_callback, selection_callback);
|
||||
return new DotNetSslStreamImpl (innerStream, leaveInnerStreamOpen, this, validation_callback, selection_callback);
|
||||
}
|
||||
|
||||
public override IMonoTlsContext CreateTlsContext (
|
||||
internal override IMonoTlsContext CreateTlsContext (
|
||||
string hostname, bool serverMode, TlsProtocols protocolFlags,
|
||||
X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
|
||||
bool remoteCertRequired, MonoEncryptionPolicy encryptionPolicy,
|
||||
|
||||
@@ -18,3 +18,4 @@ EXTRA_DISTFILES = README.md
|
||||
|
||||
include ../../build/library.make
|
||||
|
||||
$(the_lib): ../Mono.Security/Makefile
|
||||
+1
@@ -30,3 +30,4 @@
|
||||
../System/Mono.Net.Security/IMonoTlsProvider.cs
|
||||
../System/Mono.Net.Security/MonoTlsProviderFactory.cs
|
||||
../System/Mono.Net.Security/MonoTlsProviderWrapper.cs
|
||||
|
||||
@@ -45,3 +45,4 @@ using System.Runtime.InteropServices;
|
||||
[assembly: NeutralResourcesLanguage ("en-US")]
|
||||
|
||||
[assembly: InternalsVisibleTo ("Mono.Security.Providers.NewTls, PublicKey=002400000480000094000000060200000024000052534131000400001100000003336d6aed41624ca156ab579881fe90a576f1dfec48378fc94e4e440f4556776224e2d70c18996d91f36227f539fdb44340e07651f1455a489b29a7e6219a8f85e52b0f8588b4f8a857746a8468d37b556223d1452f3fcbaf0f269cdf1900ceb68f69485dc5887750d19571030c732331e00387d9b813a9ad52891087301793")]
|
||||
[assembly: InternalsVisibleTo ("Mono.Security.Providers.NewTls, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
|
||||
@@ -0,0 +1,12 @@
|
||||
thisdir = class/Mono.Security.Providers.NewTls
|
||||
SUBDIRS =
|
||||
include ../../build/rules.make
|
||||
|
||||
LIBRARY = Mono.Security.Providers.NewTls.dll
|
||||
LIB_MCS_FLAGS = -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -r:System.dll \
|
||||
-r:NewSystemSource=Mono.Security.Providers.NewSystemSource.dll -r:Mono.Security.dll
|
||||
|
||||
include ../../build/library.make
|
||||
|
||||
$(the_lib): ../Mono.Security/Makefile
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
./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
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// ITlsContext.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// ITlsContext.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// 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 ();
|
||||
}
|
||||
}
|
||||
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
//
|
||||
// MonoNewTlsStream.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// 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; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
//
|
||||
// MonoNewTlsStreamFactory.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
//
|
||||
// NewTlsProvider.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+221
@@ -0,0 +1,221 @@
|
||||
//
|
||||
// TlsContextWrapper.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// 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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
//
|
||||
// TlsProviderFactory.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// 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 });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// AssemblyInfo.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// 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")]
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
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
|
||||
+1
@@ -0,0 +1 @@
|
||||
#include mobile_Mono.Security.Providers.NewTls.dll.sources
|
||||
@@ -8,3 +8,5 @@ LIB_MCS_FLAGS = -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -d:SECURITY
|
||||
|
||||
include ../../build/library.make
|
||||
|
||||
$(the_lib): ../Mono.Security/Makefile
|
||||
|
||||
+20
-6
@@ -30,12 +30,22 @@ using System.Net.Security;
|
||||
using System.Security.Authentication;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using Mono.Security.Interface;
|
||||
using Mono.Net.Security;
|
||||
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; }
|
||||
}
|
||||
@@ -44,7 +54,11 @@ namespace Mono.Security.Providers.OldTls
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public override bool SupportsTlsContext {
|
||||
public override bool SupportsConnectionInfo {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
internal override bool SupportsTlsContext {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
@@ -52,15 +66,15 @@ namespace Mono.Security.Providers.OldTls
|
||||
get { return SslProtocols.Tls; }
|
||||
}
|
||||
|
||||
public override MonoSslStream CreateSslStream (
|
||||
public override IMonoSslStream CreateSslStream (
|
||||
Stream innerStream, bool leaveInnerStreamOpen,
|
||||
MonoTlsSettings settings = null)
|
||||
{
|
||||
var impl = new LegacySslStream (innerStream, leaveInnerStreamOpen, settings);
|
||||
return new MonoSslStreamImpl (impl);
|
||||
var impl = new MNS.Private.LegacySslStream (innerStream, leaveInnerStreamOpen, this, settings);
|
||||
return new MNS.Private.MonoSslStreamImpl (impl);
|
||||
}
|
||||
|
||||
public override IMonoTlsContext CreateTlsContext (
|
||||
internal override IMonoTlsContext CreateTlsContext (
|
||||
string hostname, bool serverMode, TlsProtocols protocolFlags,
|
||||
X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
|
||||
bool remoteCertRequired, MonoEncryptionPolicy encryptionPolicy,
|
||||
|
||||
@@ -60,6 +60,13 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyDelaySign (true)]
|
||||
[assembly: AssemblyKeyFile ("../mono.pub")]
|
||||
|
||||
#if MOBILE
|
||||
#if NET_2_1
|
||||
[assembly: InternalsVisibleTo ("System, PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]
|
||||
#else
|
||||
[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")]
|
||||
@@ -5,7 +5,7 @@ include ../../build/rules.make
|
||||
LIBRARY = Mono.Security.dll
|
||||
LOCAL_MCS_FLAGS = -lib:$(the_libdir_base)bare
|
||||
LIB_REFS = System
|
||||
LIB_MCS_FLAGS = -unsafe -nowarn:1030
|
||||
LIB_MCS_FLAGS = -unsafe -nowarn:1030,3009
|
||||
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:169,219,618,672
|
||||
|
||||
include ../../build/library.make
|
||||
@@ -18,3 +18,8 @@ $(the_libdir_base)bare/System.dll:
|
||||
.NOTPARALLEL: $(the_libdir_base)bare/System.dll
|
||||
|
||||
EXTRA_DISTFILES = Mono.Security.Interface/README.md
|
||||
|
||||
#
|
||||
# Update this comment to trigger a build in System
|
||||
# +2
|
||||
#
|
||||
@@ -77,7 +77,7 @@ namespace Mono.Security.Authenticode {
|
||||
public string Hash {
|
||||
get {
|
||||
if (hash == null)
|
||||
hash = "MD5";
|
||||
hash = "SHA1";
|
||||
return hash;
|
||||
}
|
||||
set {
|
||||
|
||||
@@ -0,0 +1,277 @@
|
||||
//
|
||||
// Alert.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// 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;
|
||||
|
||||
namespace Mono.Security.Interface
|
||||
{
|
||||
#region Enumerations
|
||||
|
||||
public enum AlertLevel : byte
|
||||
{
|
||||
Warning = 1,
|
||||
Fatal = 2
|
||||
}
|
||||
|
||||
public enum AlertDescription : byte
|
||||
{
|
||||
CloseNotify = 0,
|
||||
UnexpectedMessage = 10,
|
||||
BadRecordMAC = 20,
|
||||
DecryptionFailed_RESERVED = 21,
|
||||
RecordOverflow = 22,
|
||||
DecompressionFailure = 30,
|
||||
HandshakeFailure = 40,
|
||||
NoCertificate_RESERVED = 41, // should be used in SSL3
|
||||
BadCertificate = 42,
|
||||
UnsupportedCertificate = 43,
|
||||
CertificateRevoked = 44,
|
||||
CertificateExpired = 45,
|
||||
CertificateUnknown = 46,
|
||||
IlegalParameter = 47,
|
||||
UnknownCA = 48,
|
||||
AccessDenied = 49,
|
||||
DecodeError = 50,
|
||||
DecryptError = 51,
|
||||
ExportRestriction = 60,
|
||||
ProtocolVersion = 70,
|
||||
InsuficientSecurity = 71,
|
||||
InternalError = 80,
|
||||
UserCancelled = 90,
|
||||
NoRenegotiation = 100,
|
||||
UnsupportedExtension = 110
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public class Alert
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private AlertLevel level;
|
||||
private AlertDescription description;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
public AlertLevel Level
|
||||
{
|
||||
get { return this.level; }
|
||||
}
|
||||
|
||||
public AlertDescription Description
|
||||
{
|
||||
get { return this.description; }
|
||||
}
|
||||
|
||||
public string Message
|
||||
{
|
||||
get { return Alert.GetAlertMessage(this.description); }
|
||||
}
|
||||
|
||||
public bool IsWarning
|
||||
{
|
||||
get { return this.level == AlertLevel.Warning ? true : false; }
|
||||
}
|
||||
|
||||
/*
|
||||
public bool IsFatal
|
||||
{
|
||||
get { return this.level == AlertLevel.Fatal ? true : false; }
|
||||
}
|
||||
*/
|
||||
|
||||
public bool IsCloseNotify
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.IsWarning &&
|
||||
this.description == AlertDescription.CloseNotify)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public Alert(AlertDescription description)
|
||||
{
|
||||
this.description = description;
|
||||
this.inferAlertLevel();
|
||||
}
|
||||
|
||||
public Alert(
|
||||
AlertLevel level,
|
||||
AlertDescription description)
|
||||
{
|
||||
this.level = level;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void inferAlertLevel()
|
||||
{
|
||||
switch (description)
|
||||
{
|
||||
case AlertDescription.CloseNotify:
|
||||
case AlertDescription.NoRenegotiation:
|
||||
case AlertDescription.UserCancelled:
|
||||
this.level = AlertLevel.Warning;
|
||||
break;
|
||||
|
||||
case AlertDescription.AccessDenied:
|
||||
case AlertDescription.BadCertificate:
|
||||
case AlertDescription.BadRecordMAC:
|
||||
case AlertDescription.CertificateExpired:
|
||||
case AlertDescription.CertificateRevoked:
|
||||
case AlertDescription.CertificateUnknown:
|
||||
case AlertDescription.DecodeError:
|
||||
case AlertDescription.DecompressionFailure:
|
||||
case AlertDescription.DecryptError:
|
||||
case AlertDescription.DecryptionFailed_RESERVED:
|
||||
case AlertDescription.ExportRestriction:
|
||||
case AlertDescription.HandshakeFailure:
|
||||
case AlertDescription.IlegalParameter:
|
||||
case AlertDescription.InsuficientSecurity:
|
||||
case AlertDescription.InternalError:
|
||||
case AlertDescription.ProtocolVersion:
|
||||
case AlertDescription.RecordOverflow:
|
||||
case AlertDescription.UnexpectedMessage:
|
||||
case AlertDescription.UnknownCA:
|
||||
case AlertDescription.UnsupportedCertificate:
|
||||
case AlertDescription.UnsupportedExtension:
|
||||
default:
|
||||
this.level = AlertLevel.Fatal;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return string.Format ("[Alert: {0}:{1}]", Level, Description);
|
||||
}
|
||||
|
||||
#region Static Methods
|
||||
|
||||
public static string GetAlertMessage(AlertDescription description)
|
||||
{
|
||||
#if (DEBUG)
|
||||
switch (description)
|
||||
{
|
||||
case AlertDescription.AccessDenied:
|
||||
return "An inappropriate message was received.";
|
||||
|
||||
case AlertDescription.BadCertificate:
|
||||
return "TLSCiphertext decrypted in an invalid way.";
|
||||
|
||||
case AlertDescription.BadRecordMAC:
|
||||
return "Record with an incorrect MAC.";
|
||||
|
||||
case AlertDescription.CertificateExpired:
|
||||
return "Certificate has expired or is not currently valid";
|
||||
|
||||
case AlertDescription.CertificateRevoked:
|
||||
return "Certificate was revoked by its signer.";
|
||||
|
||||
case AlertDescription.CertificateUnknown:
|
||||
return "Certificate Unknown.";
|
||||
|
||||
case AlertDescription.CloseNotify:
|
||||
return "Connection closed";
|
||||
|
||||
case AlertDescription.DecodeError:
|
||||
return "A message could not be decoded because some field was out of the specified range or the length of the message was incorrect.";
|
||||
|
||||
case AlertDescription.DecompressionFailure:
|
||||
return "The decompression function received improper input (e.g. data that would expand to excessive length).";
|
||||
|
||||
case AlertDescription.DecryptError:
|
||||
return "TLSCiphertext decrypted in an invalid way: either it wasn`t an even multiple of the block length or its padding values, when checked, weren`t correct.";
|
||||
|
||||
case AlertDescription.DecryptionFailed_RESERVED:
|
||||
return "Handshake cryptographic operation failed, including being unable to correctly verify a signature, decrypt a key exchange, or validate finished message.";
|
||||
|
||||
case AlertDescription.ExportRestriction:
|
||||
return "Negotiation not in compliance with export restrictions was detected.";
|
||||
|
||||
case AlertDescription.HandshakeFailure:
|
||||
return "Unable to negotiate an acceptable set of security parameters given the options available.";
|
||||
|
||||
case AlertDescription.IlegalParameter:
|
||||
return "A field in the handshake was out of range or inconsistent with other fields.";
|
||||
|
||||
case AlertDescription.InsuficientSecurity:
|
||||
return "Negotiation has failed specifically because the server requires ciphers more secure than those supported by the client.";
|
||||
|
||||
case AlertDescription.InternalError:
|
||||
return "Internal error unrelated to the peer or the correctness of the protocol makes it impossible to continue.";
|
||||
|
||||
case AlertDescription.NoRenegotiation:
|
||||
return "Invalid renegotiation.";
|
||||
|
||||
case AlertDescription.ProtocolVersion:
|
||||
return "Unsupported protocol version.";
|
||||
|
||||
case AlertDescription.RecordOverflow:
|
||||
return "Invalid length on TLSCiphertext record or TLSCompressed record.";
|
||||
|
||||
case AlertDescription.UnexpectedMessage:
|
||||
return "Invalid message received.";
|
||||
|
||||
case AlertDescription.UnknownCA:
|
||||
return "CA can't be identified as a trusted CA.";
|
||||
|
||||
case AlertDescription.UnsupportedCertificate:
|
||||
return "Certificate was of an unsupported type.";
|
||||
|
||||
case AlertDescription.UserCancelled:
|
||||
return "Handshake cancelled by user.";
|
||||
|
||||
case AlertDescription.UnsupportedExtension:
|
||||
return "Unsupported extension.";
|
||||
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
#else
|
||||
return "The authentication or decryption has failed.";
|
||||
#endif
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
//
|
||||
// BufferOffsetSize.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// Copyright (c) 2014-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;
|
||||
|
||||
namespace Mono.Security.Interface
|
||||
{
|
||||
public class BufferOffsetSize : SecretParameters, IBufferOffsetSize
|
||||
{
|
||||
public byte[] Buffer {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public int Offset {
|
||||
get;
|
||||
internal set;
|
||||
}
|
||||
|
||||
public int Size {
|
||||
get { return EndOffset - Offset; }
|
||||
}
|
||||
|
||||
public int EndOffset {
|
||||
get;
|
||||
internal set;
|
||||
}
|
||||
|
||||
public BufferOffsetSize (byte[] buffer, int offset, int size)
|
||||
{
|
||||
Buffer = buffer;
|
||||
Offset = offset;
|
||||
EndOffset = offset + size;
|
||||
}
|
||||
|
||||
public BufferOffsetSize (byte[] buffer)
|
||||
: this (buffer, 0, buffer.Length)
|
||||
{
|
||||
}
|
||||
|
||||
public BufferOffsetSize (int size)
|
||||
: this (new byte [size])
|
||||
{
|
||||
}
|
||||
|
||||
public byte[] GetBuffer ()
|
||||
{
|
||||
var copy = new byte [Size];
|
||||
Array.Copy (Buffer, Offset, copy, 0, Size);
|
||||
return copy;
|
||||
}
|
||||
|
||||
public void TruncateTo (int newSize)
|
||||
{
|
||||
if (newSize > Size)
|
||||
throw new ArgumentException ("newSize");
|
||||
EndOffset = Offset + newSize;
|
||||
}
|
||||
|
||||
protected void SetBuffer (byte[] buffer, int offset, int size)
|
||||
{
|
||||
Buffer = buffer;
|
||||
Offset = offset;
|
||||
EndOffset = offset + size;
|
||||
}
|
||||
|
||||
protected override void Clear ()
|
||||
{
|
||||
Buffer = null;
|
||||
Offset = EndOffset = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ using Mono.Net.Security;
|
||||
|
||||
namespace Mono.Security.Interface
|
||||
{
|
||||
#if (!MONOTOUCH && !MONODROID) || INSIDE_SYSTEM
|
||||
public class ValidationResult
|
||||
{
|
||||
bool trusted;
|
||||
@@ -52,12 +51,11 @@ namespace Mono.Security.Interface
|
||||
this.policy_errors = policy_errors;
|
||||
}
|
||||
|
||||
internal ValidationResult (bool trusted, bool user_defined, int error_code)
|
||||
internal ValidationResult (bool trusted, bool user_denied, int error_code)
|
||||
{
|
||||
this.trusted = trusted;
|
||||
this.user_denied = user_denied;
|
||||
this.error_code = error_code;
|
||||
this.policy_errors = policy_errors;
|
||||
}
|
||||
|
||||
public bool Trusted {
|
||||
@@ -86,13 +84,24 @@ namespace Mono.Security.Interface
|
||||
get;
|
||||
}
|
||||
|
||||
X509Certificate SelectClientCertificate (
|
||||
/*
|
||||
* Returns `true` if a client certificate has been selected (which could be `null`).
|
||||
*/
|
||||
bool SelectClientCertificate (
|
||||
string targetHost, X509CertificateCollection localCertificates, X509Certificate remoteCertificate,
|
||||
string[] acceptableIssuers);
|
||||
string[] acceptableIssuers, out X509Certificate clientCertificate);
|
||||
|
||||
ValidationResult ValidateChain (string targetHost, X509CertificateCollection certificates);
|
||||
/*
|
||||
* If @serverMode is true, then we're a server and want to validate a certificate that we received from a client.
|
||||
*/
|
||||
ValidationResult ValidateCertificate (string targetHost, bool serverMode, X509CertificateCollection certificates);
|
||||
|
||||
ValidationResult ValidateClientCertificate (X509CertificateCollection certificates);
|
||||
/*
|
||||
* On OS X and Mobile, the @chain will be initialized with the @certificates, but not actually built.
|
||||
*/
|
||||
bool InvokeSystemValidator (
|
||||
string targetHost, bool serverMode, X509CertificateCollection certificates,
|
||||
X509Chain chain, ref MonoSslPolicyErrors errors, ref int status11);
|
||||
}
|
||||
|
||||
public static class CertificateValidationHelper
|
||||
@@ -128,15 +137,25 @@ namespace Mono.Security.Interface
|
||||
get { return supportsTrustAnchors; }
|
||||
}
|
||||
|
||||
internal static ICertificateValidator GetDefaultValidator (MonoTlsSettings settings)
|
||||
static ICertificateValidator GetDefaultValidator (MonoTlsProvider provider, MonoTlsSettings settings)
|
||||
{
|
||||
return (ICertificateValidator)NoReflectionHelper.GetDefaultCertificateValidator (settings);
|
||||
return (ICertificateValidator)NoReflectionHelper.GetDefaultCertificateValidator (provider, settings);
|
||||
}
|
||||
|
||||
/*
|
||||
* Internal API, intended to be used by MonoTlsProvider implementations.
|
||||
*/
|
||||
public static ICertificateValidator GetValidator (MonoTlsProvider provider, MonoTlsSettings settings)
|
||||
{
|
||||
return GetDefaultValidator (provider, settings);
|
||||
}
|
||||
|
||||
/*
|
||||
* Use this overloaded version in user code.
|
||||
*/
|
||||
public static ICertificateValidator GetValidator (MonoTlsSettings settings)
|
||||
{
|
||||
return GetDefaultValidator (settings);
|
||||
return GetDefaultValidator (null, settings);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
+20
-22
@@ -1,16 +1,21 @@
|
||||
//
|
||||
//
|
||||
// CipherAlgorithmType.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// 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
|
||||
@@ -18,24 +23,17 @@
|
||||
// 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.Runtime.CompilerServices;
|
||||
|
||||
[assembly: AssemblyTitle ("System.IO.Compression.dll")]
|
||||
[assembly: AssemblyDescription ("System.IO.Compression.dll")]
|
||||
[assembly: AssemblyDefaultAlias ("System.IO.Compression.dll")]
|
||||
[assembly: AssemblyCompany ("Xamarin, Inc.")]
|
||||
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
|
||||
[assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
|
||||
[assembly: AssemblyVersion ("4.0.0.0")]
|
||||
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
|
||||
[assembly: AssemblyFileVersion ("4.0.0.0")]
|
||||
[assembly: AssemblyDelaySign (true)]
|
||||
[assembly: AssemblyKeyFile ("../../msfinal.pub")]
|
||||
|
||||
[assembly: ReferenceAssembly]
|
||||
|
||||
|
||||
namespace Mono.Security.Interface
|
||||
{
|
||||
public enum CipherAlgorithmType
|
||||
{
|
||||
None,
|
||||
Aes128,
|
||||
Aes256,
|
||||
AesGcm128,
|
||||
AesGcm256
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,398 @@
|
||||
//
|
||||
// CipherSuiteCode.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// 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;
|
||||
|
||||
namespace Mono.Security.Interface
|
||||
{
|
||||
/// <summary>
|
||||
/// RFC 2246 A.5
|
||||
/// </summary>
|
||||
public enum CipherSuiteCode : ushort
|
||||
{
|
||||
TLS_NULL_WITH_NULL_NULL = 0x0000,
|
||||
TLS_RSA_WITH_NULL_MD5 = 0x0001,
|
||||
TLS_RSA_WITH_NULL_SHA = 0x0002,
|
||||
TLS_RSA_EXPORT_WITH_RC4_40_MD5 = 0x0003,
|
||||
TLS_RSA_WITH_RC4_128_MD5 = 0x0004,
|
||||
TLS_RSA_WITH_RC4_128_SHA = 0x0005,
|
||||
TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = 0x0006,
|
||||
TLS_RSA_WITH_IDEA_CBC_SHA = 0x0007,
|
||||
TLS_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x0008,
|
||||
TLS_RSA_WITH_DES_CBC_SHA = 0x0009,
|
||||
TLS_RSA_WITH_3DES_EDE_CBC_SHA = 0x000A,
|
||||
TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x000B,
|
||||
TLS_DH_DSS_WITH_DES_CBC_SHA = 0x000C,
|
||||
TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = 0x000D,
|
||||
TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x000E,
|
||||
TLS_DH_RSA_WITH_DES_CBC_SHA = 0x000F,
|
||||
TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = 0x0010,
|
||||
TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x0011,
|
||||
TLS_DHE_DSS_WITH_DES_CBC_SHA = 0x0012,
|
||||
TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 0x0013,
|
||||
TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x0014,
|
||||
TLS_DHE_RSA_WITH_DES_CBC_SHA = 0x0015,
|
||||
TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x0016,
|
||||
TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 = 0x0017,
|
||||
TLS_DH_anon_WITH_RC4_128_MD5 = 0x0018,
|
||||
TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA = 0x0019,
|
||||
TLS_DH_anon_WITH_DES_CBC_SHA = 0x001A,
|
||||
TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = 0x001B,
|
||||
|
||||
/*
|
||||
* Note: The cipher suite values { 0x00, 0x1C } and { 0x00, 0x1D } are reserved to avoid
|
||||
* collision with Fortezza-based cipher suites in SSL 3.
|
||||
*/
|
||||
|
||||
/*
|
||||
* RFC 3268
|
||||
*/
|
||||
TLS_RSA_WITH_AES_128_CBC_SHA = 0x002F,
|
||||
TLS_DH_DSS_WITH_AES_128_CBC_SHA = 0x0030,
|
||||
TLS_DH_RSA_WITH_AES_128_CBC_SHA = 0x0031,
|
||||
TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 0x0032,
|
||||
TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 0x0033,
|
||||
TLS_DH_anon_WITH_AES_128_CBC_SHA = 0x0034,
|
||||
TLS_RSA_WITH_AES_256_CBC_SHA = 0x0035,
|
||||
TLS_DH_DSS_WITH_AES_256_CBC_SHA = 0x0036,
|
||||
TLS_DH_RSA_WITH_AES_256_CBC_SHA = 0x0037,
|
||||
TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 0x0038,
|
||||
TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 0x0039,
|
||||
TLS_DH_anon_WITH_AES_256_CBC_SHA = 0x003A,
|
||||
|
||||
/*
|
||||
* RFC 5932
|
||||
*/
|
||||
TLS_RSA_WITH_CAMELLIA_128_CBC_SHA = 0x0041,
|
||||
TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA = 0x0042,
|
||||
TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA = 0x0043,
|
||||
TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA = 0x0044,
|
||||
TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA = 0x0045,
|
||||
TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA = 0x0046,
|
||||
|
||||
TLS_RSA_WITH_CAMELLIA_256_CBC_SHA = 0x0084,
|
||||
TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA = 0x0085,
|
||||
TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA = 0x0086,
|
||||
TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA = 0x0087,
|
||||
TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA = 0x0088,
|
||||
TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA = 0x0089,
|
||||
|
||||
TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BA,
|
||||
TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BB,
|
||||
TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BC,
|
||||
TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BD,
|
||||
TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BE,
|
||||
TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BF,
|
||||
|
||||
TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C0,
|
||||
TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C1,
|
||||
TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C2,
|
||||
TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C3,
|
||||
TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C4,
|
||||
TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C5,
|
||||
|
||||
/*
|
||||
* RFC 4162
|
||||
*/
|
||||
TLS_RSA_WITH_SEED_CBC_SHA = 0x0096,
|
||||
TLS_DH_DSS_WITH_SEED_CBC_SHA = 0x0097,
|
||||
TLS_DH_RSA_WITH_SEED_CBC_SHA = 0x0098,
|
||||
TLS_DHE_DSS_WITH_SEED_CBC_SHA = 0x0099,
|
||||
TLS_DHE_RSA_WITH_SEED_CBC_SHA = 0x009A,
|
||||
TLS_DH_anon_WITH_SEED_CBC_SHA = 0x009B,
|
||||
|
||||
/*
|
||||
* RFC 4279
|
||||
*/
|
||||
TLS_PSK_WITH_RC4_128_SHA = 0x008A,
|
||||
TLS_PSK_WITH_3DES_EDE_CBC_SHA = 0x008B,
|
||||
TLS_PSK_WITH_AES_128_CBC_SHA = 0x008C,
|
||||
TLS_PSK_WITH_AES_256_CBC_SHA = 0x008D,
|
||||
TLS_DHE_PSK_WITH_RC4_128_SHA = 0x008E,
|
||||
TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA = 0x008F,
|
||||
TLS_DHE_PSK_WITH_AES_128_CBC_SHA = 0x0090,
|
||||
TLS_DHE_PSK_WITH_AES_256_CBC_SHA = 0x0091,
|
||||
TLS_RSA_PSK_WITH_RC4_128_SHA = 0x0092,
|
||||
TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA = 0x0093,
|
||||
TLS_RSA_PSK_WITH_AES_128_CBC_SHA = 0x0094,
|
||||
TLS_RSA_PSK_WITH_AES_256_CBC_SHA = 0x0095,
|
||||
|
||||
/*
|
||||
* RFC 4492
|
||||
*/
|
||||
TLS_ECDH_ECDSA_WITH_NULL_SHA = 0xC001,
|
||||
TLS_ECDH_ECDSA_WITH_RC4_128_SHA = 0xC002,
|
||||
TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA = 0xC003,
|
||||
TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA = 0xC004,
|
||||
TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA = 0xC005,
|
||||
TLS_ECDHE_ECDSA_WITH_NULL_SHA = 0xC006,
|
||||
TLS_ECDHE_ECDSA_WITH_RC4_128_SHA = 0xC007,
|
||||
TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA = 0xC008,
|
||||
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = 0xC009,
|
||||
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = 0xC00A,
|
||||
TLS_ECDH_RSA_WITH_NULL_SHA = 0xC00B,
|
||||
TLS_ECDH_RSA_WITH_RC4_128_SHA = 0xC00C,
|
||||
TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA = 0xC00D,
|
||||
TLS_ECDH_RSA_WITH_AES_128_CBC_SHA = 0xC00E,
|
||||
TLS_ECDH_RSA_WITH_AES_256_CBC_SHA = 0xC00F,
|
||||
TLS_ECDHE_RSA_WITH_NULL_SHA = 0xC010,
|
||||
TLS_ECDHE_RSA_WITH_RC4_128_SHA = 0xC011,
|
||||
TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA = 0xC012,
|
||||
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = 0xC013,
|
||||
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = 0xC014,
|
||||
TLS_ECDH_anon_WITH_NULL_SHA = 0xC015,
|
||||
TLS_ECDH_anon_WITH_RC4_128_SHA = 0xC016,
|
||||
TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA = 0xC017,
|
||||
TLS_ECDH_anon_WITH_AES_128_CBC_SHA = 0xC018,
|
||||
TLS_ECDH_anon_WITH_AES_256_CBC_SHA = 0xC019,
|
||||
|
||||
/*
|
||||
* RFC 4785
|
||||
*/
|
||||
TLS_PSK_WITH_NULL_SHA = 0x002C,
|
||||
TLS_DHE_PSK_WITH_NULL_SHA = 0x002D,
|
||||
TLS_RSA_PSK_WITH_NULL_SHA = 0x002E,
|
||||
|
||||
/*
|
||||
* RFC 5054
|
||||
*/
|
||||
TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA = 0xC01A,
|
||||
TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA = 0xC01B,
|
||||
TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA = 0xC01C,
|
||||
TLS_SRP_SHA_WITH_AES_128_CBC_SHA = 0xC01D,
|
||||
TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA = 0xC01E,
|
||||
TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA = 0xC01F,
|
||||
TLS_SRP_SHA_WITH_AES_256_CBC_SHA = 0xC020,
|
||||
TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA = 0xC021,
|
||||
TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA = 0xC022,
|
||||
|
||||
/*
|
||||
* RFC 5246
|
||||
*/
|
||||
TLS_RSA_WITH_NULL_SHA256 = 0x003B,
|
||||
TLS_RSA_WITH_AES_128_CBC_SHA256 = 0x003C,
|
||||
TLS_RSA_WITH_AES_256_CBC_SHA256 = 0x003D,
|
||||
TLS_DH_DSS_WITH_AES_128_CBC_SHA256 = 0x003E,
|
||||
TLS_DH_RSA_WITH_AES_128_CBC_SHA256 = 0x003F,
|
||||
TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = 0x0040,
|
||||
TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 0x0067,
|
||||
TLS_DH_DSS_WITH_AES_256_CBC_SHA256 = 0x0068,
|
||||
TLS_DH_RSA_WITH_AES_256_CBC_SHA256 = 0x0069,
|
||||
TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = 0x006A,
|
||||
TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 0x006B,
|
||||
TLS_DH_anon_WITH_AES_128_CBC_SHA256 = 0x006C,
|
||||
TLS_DH_anon_WITH_AES_256_CBC_SHA256 = 0x006D,
|
||||
|
||||
/*
|
||||
* RFC 5288
|
||||
*/
|
||||
TLS_RSA_WITH_AES_128_GCM_SHA256 = 0x009C,
|
||||
TLS_RSA_WITH_AES_256_GCM_SHA384 = 0x009D,
|
||||
TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = 0x009E,
|
||||
TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = 0x009F,
|
||||
TLS_DH_RSA_WITH_AES_128_GCM_SHA256 = 0x00A0,
|
||||
TLS_DH_RSA_WITH_AES_256_GCM_SHA384 = 0x00A1,
|
||||
TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 = 0x00A2,
|
||||
TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 = 0x00A3,
|
||||
TLS_DH_DSS_WITH_AES_128_GCM_SHA256 = 0x00A4,
|
||||
TLS_DH_DSS_WITH_AES_256_GCM_SHA384 = 0x00A5,
|
||||
TLS_DH_anon_WITH_AES_128_GCM_SHA256 = 0x00A6,
|
||||
TLS_DH_anon_WITH_AES_256_GCM_SHA384 = 0x00A7,
|
||||
|
||||
/*
|
||||
* RFC 5289
|
||||
*/
|
||||
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC023,
|
||||
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC024,
|
||||
TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC025,
|
||||
TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC026,
|
||||
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = 0xC027,
|
||||
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = 0xC028,
|
||||
TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 = 0xC029,
|
||||
TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 = 0xC02A,
|
||||
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02B,
|
||||
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02C,
|
||||
TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02D,
|
||||
TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02E,
|
||||
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = 0xC02F,
|
||||
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = 0xC030,
|
||||
TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 = 0xC031,
|
||||
TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 = 0xC032,
|
||||
|
||||
/*
|
||||
* RFC 5487
|
||||
*/
|
||||
TLS_PSK_WITH_AES_128_GCM_SHA256 = 0x00A8,
|
||||
TLS_PSK_WITH_AES_256_GCM_SHA384 = 0x00A9,
|
||||
TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 = 0x00AA,
|
||||
TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 = 0x00AB,
|
||||
TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 = 0x00AC,
|
||||
TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 = 0x00AD,
|
||||
TLS_PSK_WITH_AES_128_CBC_SHA256 = 0x00AE,
|
||||
TLS_PSK_WITH_AES_256_CBC_SHA384 = 0x00AF,
|
||||
TLS_PSK_WITH_NULL_SHA256 = 0x00B0,
|
||||
TLS_PSK_WITH_NULL_SHA384 = 0x00B1,
|
||||
TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 = 0x00B2,
|
||||
TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 = 0x00B3,
|
||||
TLS_DHE_PSK_WITH_NULL_SHA256 = 0x00B4,
|
||||
TLS_DHE_PSK_WITH_NULL_SHA384 = 0x00B5,
|
||||
TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 = 0x00B6,
|
||||
TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 = 0x00B7,
|
||||
TLS_RSA_PSK_WITH_NULL_SHA256 = 0x00B8,
|
||||
TLS_RSA_PSK_WITH_NULL_SHA384 = 0x00B9,
|
||||
|
||||
/*
|
||||
* RFC 5489
|
||||
*/
|
||||
TLS_ECDHE_PSK_WITH_RC4_128_SHA = 0xC033,
|
||||
TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA = 0xC034,
|
||||
TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA = 0xC035,
|
||||
TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA = 0xC036,
|
||||
TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 = 0xC037,
|
||||
TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 = 0xC038,
|
||||
TLS_ECDHE_PSK_WITH_NULL_SHA = 0xC039,
|
||||
TLS_ECDHE_PSK_WITH_NULL_SHA256 = 0xC03A,
|
||||
TLS_ECDHE_PSK_WITH_NULL_SHA384 = 0xC03B,
|
||||
|
||||
/*
|
||||
* RFC 5746
|
||||
*/
|
||||
TLS_EMPTY_RENEGOTIATION_INFO_SCSV = 0x00FF,
|
||||
|
||||
/*
|
||||
* RFC 6367
|
||||
*/
|
||||
TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 = 0xC072,
|
||||
TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 = 0xC073,
|
||||
TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 = 0xC074,
|
||||
TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 = 0xC075,
|
||||
TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 = 0xC076,
|
||||
TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 = 0xC077,
|
||||
TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 = 0xC078,
|
||||
TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 = 0xC079,
|
||||
|
||||
TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC07A,
|
||||
TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC07B,
|
||||
TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC07C,
|
||||
TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC07D,
|
||||
TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC07E,
|
||||
TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC07F,
|
||||
TLS_DHE_DSS_WITH_CAMELLIA_128_GCM_SHA256 = 0xC080,
|
||||
TLS_DHE_DSS_WITH_CAMELLIA_256_GCM_SHA384 = 0xC081,
|
||||
TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256 = 0xC082,
|
||||
TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384 = 0xC083,
|
||||
TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256 = 0xC084,
|
||||
TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384 = 0xC085,
|
||||
TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC086,
|
||||
TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC087,
|
||||
TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC088,
|
||||
TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC089,
|
||||
TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC08A,
|
||||
TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC08B,
|
||||
TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC08C,
|
||||
TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC08D,
|
||||
|
||||
TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 = 0xC08E,
|
||||
TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 = 0xC08F,
|
||||
TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 = 0xC090,
|
||||
TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 = 0xC091,
|
||||
TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 = 0xC092,
|
||||
TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 = 0xC093,
|
||||
TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 = 0xC094,
|
||||
TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 = 0xC095,
|
||||
TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 = 0xC096,
|
||||
TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 = 0xC097,
|
||||
TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 = 0xC098,
|
||||
TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 = 0xC099,
|
||||
TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 = 0xC09A,
|
||||
TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 = 0xC09B,
|
||||
|
||||
/*
|
||||
* RFC 6655
|
||||
*/
|
||||
TLS_RSA_WITH_AES_128_CCM = 0xC09C,
|
||||
TLS_RSA_WITH_AES_256_CCM = 0xC09D,
|
||||
TLS_DHE_RSA_WITH_AES_128_CCM = 0xC09E,
|
||||
TLS_DHE_RSA_WITH_AES_256_CCM = 0xC09F,
|
||||
TLS_RSA_WITH_AES_128_CCM_8 = 0xC0A0,
|
||||
TLS_RSA_WITH_AES_256_CCM_8 = 0xC0A1,
|
||||
TLS_DHE_RSA_WITH_AES_128_CCM_8 = 0xC0A2,
|
||||
TLS_DHE_RSA_WITH_AES_256_CCM_8 = 0xC0A3,
|
||||
TLS_PSK_WITH_AES_128_CCM = 0xC0A4,
|
||||
TLS_PSK_WITH_AES_256_CCM = 0xC0A5,
|
||||
TLS_DHE_PSK_WITH_AES_128_CCM = 0xC0A6,
|
||||
TLS_DHE_PSK_WITH_AES_256_CCM = 0xC0A7,
|
||||
TLS_PSK_WITH_AES_128_CCM_8 = 0xC0A8,
|
||||
TLS_PSK_WITH_AES_256_CCM_8 = 0xC0A9,
|
||||
TLS_PSK_DHE_WITH_AES_128_CCM_8 = 0xC0AA,
|
||||
TLS_PSK_DHE_WITH_AES_256_CCM_8 = 0xC0AB,
|
||||
|
||||
/*
|
||||
* draft-agl-tls-chacha20poly1305-04
|
||||
*/
|
||||
TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = 0xCC13,
|
||||
TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 = 0xCC14,
|
||||
TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = 0xCC15,
|
||||
|
||||
/*
|
||||
* draft-josefsson-salsa20-tls-04
|
||||
*/
|
||||
TLS_RSA_WITH_ESTREAM_SALSA20_SHA1 = 0xE410,
|
||||
TLS_RSA_WITH_SALSA20_SHA1 = 0xE411,
|
||||
TLS_ECDHE_RSA_WITH_ESTREAM_SALSA20_SHA1 = 0xE412,
|
||||
TLS_ECDHE_RSA_WITH_SALSA20_SHA1 = 0xE413,
|
||||
TLS_ECDHE_ECDSA_WITH_ESTREAM_SALSA20_SHA1 = 0xE414,
|
||||
TLS_ECDHE_ECDSA_WITH_SALSA20_SHA1 = 0xE415,
|
||||
TLS_PSK_WITH_ESTREAM_SALSA20_SHA1 = 0xE416,
|
||||
TLS_PSK_WITH_SALSA20_SHA1 = 0xE417,
|
||||
TLS_ECDHE_PSK_WITH_ESTREAM_SALSA20_SHA1 = 0xE418,
|
||||
TLS_ECDHE_PSK_WITH_SALSA20_SHA1 = 0xE419,
|
||||
TLS_RSA_PSK_WITH_ESTREAM_SALSA20_SHA1 = 0xE41A,
|
||||
TLS_RSA_PSK_WITH_SALSA20_SHA1 = 0xE41B,
|
||||
TLS_DHE_PSK_WITH_ESTREAM_SALSA20_SHA1 = 0xE41C,
|
||||
TLS_DHE_PSK_WITH_SALSA20_SHA1 = 0xE41D,
|
||||
TLS_DHE_RSA_WITH_ESTREAM_SALSA20_SHA1 = 0xE41E,
|
||||
TLS_DHE_RSA_WITH_SALSA20_SHA1 = 0xE41F,
|
||||
|
||||
/*
|
||||
* draft-ietf-tls-downgrade-scsv-00
|
||||
*/
|
||||
TLS_FALLBACK_SCSV = 0x5600,
|
||||
|
||||
/*
|
||||
public static bool IsScsv (int cipherSuite)
|
||||
{
|
||||
switch (cipherSuite) {
|
||||
case TLS_EMPTY_RENEGOTIATION_INFO_SCSV:
|
||||
case TLS_FALLBACK_SCSV:
|
||||
return true,
|
||||
default:
|
||||
return false,
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
+20
-13
@@ -1,16 +1,21 @@
|
||||
//
|
||||
//
|
||||
// ExchangeAlgorithmType.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// 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
|
||||
@@ -18,14 +23,16 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.Compression.CompressionLevel))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.Compression.CompressionMode))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.Compression.DeflateStream))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.Compression.GZipStream))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.Compression.ZipArchive))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.Compression.ZipArchiveEntry))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.IO.Compression.ZipArchiveMode))]
|
||||
|
||||
using System;
|
||||
|
||||
namespace Mono.Security.Interface
|
||||
{
|
||||
public enum ExchangeAlgorithmType
|
||||
{
|
||||
None,
|
||||
Dhe,
|
||||
Rsa,
|
||||
EcDhe
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// HashAlgorithmType.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// 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.
|
||||
|
||||
namespace Mono.Security.Interface
|
||||
{
|
||||
public enum HashAlgorithmType
|
||||
{
|
||||
// These values refer to the @HashAlgorithm enumeration in the TLS 1.2 spec.
|
||||
None = 0,
|
||||
Md5 = 1,
|
||||
Sha1 = 2,
|
||||
Sha224 = 3,
|
||||
Sha256 = 4,
|
||||
Sha384 = 5,
|
||||
Sha512 = 6,
|
||||
Unknown = 255,
|
||||
|
||||
// Mono-specific addition, allowing us to reuse it IHashAlgorithm API for TLS 1.0 / 1.1.
|
||||
Md5Sha1 = 254
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
//
|
||||
// IMonoSslStream.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// 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 SSA = System.Security.Authentication;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Security.Principal;
|
||||
using System.Security.Cryptography;
|
||||
using Mono.Net.Security;
|
||||
|
||||
namespace Mono.Security.Interface
|
||||
{
|
||||
public interface IMonoSslStream : IDisposable
|
||||
{
|
||||
void AuthenticateAsClient (string targetHost);
|
||||
|
||||
void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SSA.SslProtocols enabledSslProtocols, bool checkCertificateRevocation);
|
||||
|
||||
IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState);
|
||||
|
||||
IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SSA.SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState);
|
||||
|
||||
void EndAuthenticateAsClient (IAsyncResult asyncResult);
|
||||
|
||||
void AuthenticateAsServer (X509Certificate serverCertificate);
|
||||
|
||||
void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SSA.SslProtocols enabledSslProtocols, bool checkCertificateRevocation);
|
||||
|
||||
IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState);
|
||||
|
||||
IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SSA.SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState);
|
||||
|
||||
void EndAuthenticateAsServer (IAsyncResult asyncResult);
|
||||
|
||||
Task AuthenticateAsClientAsync (string targetHost);
|
||||
|
||||
Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SSA.SslProtocols enabledSslProtocols, bool checkCertificateRevocation);
|
||||
|
||||
Task AuthenticateAsServerAsync (X509Certificate serverCertificate);
|
||||
|
||||
Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SSA.SslProtocols enabledSslProtocols, bool checkCertificateRevocation);
|
||||
|
||||
void Flush ();
|
||||
|
||||
int Read (byte[] buffer, int offset, int count);
|
||||
|
||||
void Write (byte[] buffer);
|
||||
|
||||
void Write (byte[] buffer, int offset, int count);
|
||||
|
||||
IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState);
|
||||
|
||||
int EndRead (IAsyncResult asyncResult);
|
||||
|
||||
IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState);
|
||||
|
||||
void EndWrite (IAsyncResult asyncResult);
|
||||
|
||||
TransportContext TransportContext {
|
||||
get;
|
||||
}
|
||||
|
||||
bool IsAuthenticated {
|
||||
get;
|
||||
}
|
||||
|
||||
bool IsMutuallyAuthenticated {
|
||||
get;
|
||||
}
|
||||
|
||||
bool IsEncrypted {
|
||||
get;
|
||||
}
|
||||
|
||||
bool IsSigned {
|
||||
get;
|
||||
}
|
||||
|
||||
bool IsServer {
|
||||
get;
|
||||
}
|
||||
|
||||
SSA.CipherAlgorithmType CipherAlgorithm {
|
||||
get;
|
||||
}
|
||||
|
||||
int CipherStrength {
|
||||
get;
|
||||
}
|
||||
|
||||
SSA.HashAlgorithmType HashAlgorithm {
|
||||
get;
|
||||
}
|
||||
|
||||
int HashStrength {
|
||||
get;
|
||||
}
|
||||
|
||||
SSA.ExchangeAlgorithmType KeyExchangeAlgorithm {
|
||||
get;
|
||||
}
|
||||
|
||||
int KeyExchangeStrength {
|
||||
get;
|
||||
}
|
||||
|
||||
bool CanRead {
|
||||
get;
|
||||
}
|
||||
|
||||
bool CanTimeout {
|
||||
get;
|
||||
}
|
||||
|
||||
bool CanWrite {
|
||||
get;
|
||||
}
|
||||
|
||||
long Length {
|
||||
get;
|
||||
}
|
||||
|
||||
long Position {
|
||||
get;
|
||||
}
|
||||
|
||||
void SetLength (long value);
|
||||
|
||||
AuthenticatedStream AuthenticatedStream {
|
||||
get;
|
||||
}
|
||||
|
||||
int ReadTimeout {
|
||||
get; set;
|
||||
}
|
||||
|
||||
int WriteTimeout {
|
||||
get; set;
|
||||
}
|
||||
|
||||
bool CheckCertRevocationStatus {
|
||||
get;
|
||||
}
|
||||
|
||||
X509Certificate InternalLocalCertificate {
|
||||
get;
|
||||
}
|
||||
|
||||
X509Certificate LocalCertificate {
|
||||
get;
|
||||
}
|
||||
|
||||
X509Certificate RemoteCertificate {
|
||||
get;
|
||||
}
|
||||
|
||||
SSA.SslProtocols SslProtocol {
|
||||
get;
|
||||
}
|
||||
|
||||
MonoTlsProvider Provider {
|
||||
get;
|
||||
}
|
||||
|
||||
|
||||
MonoTlsConnectionInfo GetConnectionInfo ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace Mono.Security.Interface
|
||||
{
|
||||
public interface IMonoTlsContext : IDisposable
|
||||
interface IMonoTlsContext : IDisposable
|
||||
{
|
||||
bool IsServer {
|
||||
get;
|
||||
|
||||
@@ -1,198 +0,0 @@
|
||||
//
|
||||
// MonoSslStream.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// 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 Mono.Net.Security;
|
||||
|
||||
namespace Mono.Security.Interface
|
||||
{
|
||||
public abstract class MonoSslStream
|
||||
{
|
||||
public abstract void AuthenticateAsClient (string targetHost);
|
||||
|
||||
public abstract void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation);
|
||||
|
||||
public abstract IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState);
|
||||
|
||||
public abstract IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState);
|
||||
|
||||
public abstract void EndAuthenticateAsClient (IAsyncResult asyncResult);
|
||||
|
||||
public abstract void AuthenticateAsServer (X509Certificate serverCertificate);
|
||||
|
||||
public abstract void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation);
|
||||
|
||||
public abstract IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState);
|
||||
|
||||
public abstract IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState);
|
||||
|
||||
public abstract void EndAuthenticateAsServer (IAsyncResult asyncResult);
|
||||
|
||||
public abstract Task AuthenticateAsClientAsync (string targetHost);
|
||||
|
||||
public abstract Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation);
|
||||
|
||||
public abstract Task AuthenticateAsServerAsync (X509Certificate serverCertificate);
|
||||
|
||||
public abstract Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation);
|
||||
|
||||
public abstract void Flush ();
|
||||
|
||||
public abstract int Read (byte[] buffer, int offset, int count);
|
||||
|
||||
public abstract void Write (byte[] buffer);
|
||||
|
||||
public abstract void Write (byte[] buffer, int offset, int count);
|
||||
|
||||
public abstract IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState);
|
||||
|
||||
public abstract int EndRead (IAsyncResult asyncResult);
|
||||
|
||||
public abstract IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState);
|
||||
|
||||
public abstract void EndWrite (IAsyncResult asyncResult);
|
||||
|
||||
public abstract TransportContext TransportContext {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract bool IsAuthenticated {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract bool IsMutuallyAuthenticated {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract bool IsEncrypted {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract bool IsSigned {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract bool IsServer {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract CipherAlgorithmType CipherAlgorithm {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract int CipherStrength {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract HashAlgorithmType HashAlgorithm {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract int HashStrength {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract ExchangeAlgorithmType KeyExchangeAlgorithm {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract int KeyExchangeStrength {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract bool CanRead {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract bool CanTimeout {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract bool CanWrite {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract long Length {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract long Position {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract void SetLength (long value);
|
||||
|
||||
public abstract AuthenticatedStream AuthenticatedStream {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract int ReadTimeout {
|
||||
get; set;
|
||||
}
|
||||
|
||||
public abstract int WriteTimeout {
|
||||
get; set;
|
||||
}
|
||||
|
||||
public abstract bool CheckCertRevocationStatus {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract X509Certificate InternalLocalCertificate {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract X509Certificate LocalCertificate {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract X509Certificate RemoteCertificate {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract SslProtocols SslProtocol {
|
||||
get;
|
||||
}
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
Dispose (true);
|
||||
GC.SuppressFinalize (this);
|
||||
}
|
||||
|
||||
protected virtual void Dispose (bool disposing)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,20 +24,35 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace Mono.Security.Interface
|
||||
{
|
||||
public class MonoTlsConnectionInfo
|
||||
{
|
||||
public short CipherSuiteCode {
|
||||
public CipherSuiteCode CipherSuiteCode {
|
||||
get; set;
|
||||
}
|
||||
|
||||
public TlsProtocols ProtocolVersion {
|
||||
get; set;
|
||||
}
|
||||
|
||||
public CipherAlgorithmType CipherAlgorithmType {
|
||||
get; set;
|
||||
}
|
||||
|
||||
public HashAlgorithmType HashAlgorithmType {
|
||||
get; set;
|
||||
}
|
||||
|
||||
public ExchangeAlgorithmType ExchangeAlgorithmType {
|
||||
get; set;
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return string.Format ("[MonoTlsConnectionInfo: {0}:{1}]", ProtocolVersion, CipherSuiteCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,6 +72,18 @@ namespace Mono.Security.Interface
|
||||
|
||||
public abstract class MonoTlsProvider
|
||||
{
|
||||
internal MonoTlsProvider ()
|
||||
{
|
||||
}
|
||||
|
||||
public abstract Guid ID {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract string Name {
|
||||
get;
|
||||
}
|
||||
|
||||
#region SslStream
|
||||
|
||||
/*
|
||||
@@ -83,6 +95,13 @@ namespace Mono.Security.Interface
|
||||
get;
|
||||
}
|
||||
|
||||
/*
|
||||
* Does this provider support IMonoSslStream.GetConnectionInfo() ?
|
||||
*/
|
||||
public abstract bool SupportsConnectionInfo {
|
||||
get;
|
||||
}
|
||||
|
||||
/*
|
||||
* Whether or not this TLS Provider supports Mono-specific extensions
|
||||
* (via @MonoTlsSettings).
|
||||
@@ -96,26 +115,55 @@ namespace Mono.Security.Interface
|
||||
}
|
||||
|
||||
/*
|
||||
* Obtain a @MonoSslStream instance.
|
||||
* Obtain a @IMonoSslStream instance.
|
||||
*
|
||||
*/
|
||||
public abstract MonoSslStream CreateSslStream (
|
||||
public abstract IMonoSslStream CreateSslStream (
|
||||
Stream innerStream, bool leaveInnerStreamOpen,
|
||||
MonoTlsSettings settings = null);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Certificate Validation
|
||||
|
||||
/*
|
||||
* Allows a TLS provider to provide a custom system certificiate validator.
|
||||
*/
|
||||
public virtual bool HasCustomSystemCertificateValidator {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
/*
|
||||
* If @serverMode is true, then we're a server and want to validate a certificate
|
||||
* that we received from a client.
|
||||
*
|
||||
* On OS X and Mobile, the @chain will be initialized with the @certificates, but not actually built.
|
||||
*
|
||||
* Returns `true` if certificate validation has been performed and `false` to invoke the
|
||||
* default system validator.
|
||||
*/
|
||||
public virtual bool InvokeSystemCertificateValidator (
|
||||
ICertificateValidator validator, string targetHost, bool serverMode,
|
||||
X509CertificateCollection certificates, X509Chain chain, out bool success,
|
||||
ref MonoSslPolicyErrors errors, ref int status11)
|
||||
{
|
||||
success = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Manged SSPI
|
||||
|
||||
/*
|
||||
* The managed SSPI implementation from the new TLS code.
|
||||
*/
|
||||
|
||||
public abstract bool SupportsTlsContext {
|
||||
internal abstract bool SupportsTlsContext {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract IMonoTlsContext CreateTlsContext (
|
||||
internal abstract IMonoTlsContext CreateTlsContext (
|
||||
string hostname, bool serverMode, TlsProtocols protocolFlags,
|
||||
X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
|
||||
bool remoteCertRequired, MonoEncryptionPolicy encryptionPolicy,
|
||||
|
||||
@@ -25,8 +25,9 @@
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
using System.Net;
|
||||
using Mono.Net.Security;
|
||||
using System.Net.Security;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using Mono.Net.Security;
|
||||
|
||||
namespace Mono.Security.Interface
|
||||
{
|
||||
@@ -35,7 +36,7 @@ namespace Mono.Security.Interface
|
||||
*
|
||||
* Keep in sync with System/Mono.Net.Security/MonoTlsProviderFactory.cs.
|
||||
*/
|
||||
public static class MonoTlsProviderFactory
|
||||
public static partial class MonoTlsProviderFactory
|
||||
{
|
||||
/*
|
||||
* Returns the currently installed @MonoTlsProvider, falling back to the default one.
|
||||
@@ -71,14 +72,14 @@ namespace Mono.Security.Interface
|
||||
}
|
||||
|
||||
/*
|
||||
* Installs a custom TLS Provider.
|
||||
* Selects the default TLS Provider.
|
||||
*
|
||||
* May only be called at application startup and will throw
|
||||
* @InvalidOperationException if a provider has already been installed.
|
||||
*/
|
||||
public static void InstallProvider (MonoTlsProvider provider)
|
||||
public static void SetDefaultProvider (string name)
|
||||
{
|
||||
NoReflectionHelper.InstallProvider (provider);
|
||||
NoReflectionHelper.SetDefaultProvider (name);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -93,10 +94,15 @@ namespace Mono.Security.Interface
|
||||
return NoReflectionHelper.CreateHttpsRequest (requestUri, provider, settings);
|
||||
}
|
||||
|
||||
public static HttpListener CreateHttpListener (X509Certificate2 certificate, MonoTlsProvider provider = null, MonoTlsSettings settings = null)
|
||||
public static HttpListener CreateHttpListener (X509Certificate certificate, MonoTlsProvider provider = null, MonoTlsSettings settings = null)
|
||||
{
|
||||
return (HttpListener)NoReflectionHelper.CreateHttpListener (certificate, provider, settings);
|
||||
}
|
||||
|
||||
public static IMonoSslStream GetMonoSslStream (SslStream stream)
|
||||
{
|
||||
return (IMonoSslStream)NoReflectionHelper.GetMonoSslStream (stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace Mono.Security.Interface
|
||||
@@ -81,14 +82,40 @@ namespace Mono.Security.Interface
|
||||
get; set;
|
||||
}
|
||||
|
||||
public CipherSuiteCode[] EnabledCiphers {
|
||||
get; set;
|
||||
}
|
||||
|
||||
bool cloned = false;
|
||||
bool checkCertName = true;
|
||||
bool checkCertRevocationStatus = false;
|
||||
bool useServicePointManagerCallback = false;
|
||||
bool useServicePointManagerCallback = true;
|
||||
bool skipSystemValidators = false;
|
||||
bool callbackNeedsChain = true;
|
||||
ICertificateValidator certificateValidator;
|
||||
|
||||
public MonoTlsSettings ()
|
||||
{
|
||||
}
|
||||
|
||||
static MonoTlsSettings defaultSettings;
|
||||
|
||||
public static MonoTlsSettings DefaultSettings {
|
||||
get {
|
||||
if (defaultSettings == null)
|
||||
Interlocked.CompareExchange (ref defaultSettings, new MonoTlsSettings (), null);
|
||||
return defaultSettings;
|
||||
}
|
||||
set {
|
||||
defaultSettings = value ?? new MonoTlsSettings ();
|
||||
}
|
||||
}
|
||||
|
||||
public static MonoTlsSettings CopyDefaultSettings ()
|
||||
{
|
||||
return DefaultSettings.Clone ();
|
||||
}
|
||||
|
||||
#region Private APIs
|
||||
|
||||
/*
|
||||
@@ -101,7 +128,6 @@ namespace Mono.Security.Interface
|
||||
[Obsolete ("Do not use outside System.dll!")]
|
||||
public ICertificateValidator CertificateValidator {
|
||||
get { return certificateValidator; }
|
||||
set { certificateValidator = value; }
|
||||
}
|
||||
|
||||
[Obsolete ("Do not use outside System.dll!")]
|
||||
@@ -112,22 +138,32 @@ namespace Mono.Security.Interface
|
||||
return this;
|
||||
}
|
||||
|
||||
var copy = new MonoTlsSettings ();
|
||||
copy.RemoteCertificateValidationCallback = RemoteCertificateValidationCallback;
|
||||
copy.ClientCertificateSelectionCallback = ClientCertificateSelectionCallback;
|
||||
copy.checkCertName = checkCertName;
|
||||
copy.checkCertRevocationStatus = checkCertRevocationStatus;
|
||||
copy.UseServicePointManagerCallback = useServicePointManagerCallback;
|
||||
copy.skipSystemValidators = skipSystemValidators;
|
||||
copy.callbackNeedsChain = callbackNeedsChain;
|
||||
copy.UserSettings = UserSettings;
|
||||
var copy = new MonoTlsSettings (this);
|
||||
copy.certificateValidator = validator;
|
||||
copy.EnabledProtocols = EnabledProtocols;
|
||||
copy.TrustAnchors = TrustAnchors;
|
||||
copy.cloned = true;
|
||||
return copy;
|
||||
}
|
||||
|
||||
public MonoTlsSettings Clone ()
|
||||
{
|
||||
return new MonoTlsSettings (this);
|
||||
}
|
||||
|
||||
MonoTlsSettings (MonoTlsSettings other)
|
||||
{
|
||||
RemoteCertificateValidationCallback = other.RemoteCertificateValidationCallback;
|
||||
ClientCertificateSelectionCallback = other.ClientCertificateSelectionCallback;
|
||||
checkCertName = other.checkCertName;
|
||||
checkCertRevocationStatus = other.checkCertRevocationStatus;
|
||||
UseServicePointManagerCallback = other.useServicePointManagerCallback;
|
||||
skipSystemValidators = other.skipSystemValidators;
|
||||
callbackNeedsChain = other.callbackNeedsChain;
|
||||
UserSettings = other.UserSettings;
|
||||
EnabledProtocols = other.EnabledProtocols;
|
||||
EnabledCiphers = other.EnabledCiphers;
|
||||
TrustAnchors = other.TrustAnchors;
|
||||
cloned = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// SecretParameters.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// Copyright (c) 2014-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;
|
||||
|
||||
namespace Mono.Security.Interface
|
||||
{
|
||||
public abstract class SecretParameters : IDisposable
|
||||
{
|
||||
protected abstract void Clear ();
|
||||
|
||||
bool disposed;
|
||||
|
||||
protected void CheckDisposed ()
|
||||
{
|
||||
if (disposed)
|
||||
throw new ObjectDisposedException (GetType ().Name);
|
||||
}
|
||||
|
||||
protected static void Clear (byte[] array)
|
||||
{
|
||||
Array.Clear (array, 0, array.Length);
|
||||
}
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
Dispose (true);
|
||||
GC.SuppressFinalize (this);
|
||||
}
|
||||
|
||||
void Dispose (bool disposing)
|
||||
{
|
||||
if (!disposed) {
|
||||
disposed = true;
|
||||
Clear ();
|
||||
}
|
||||
}
|
||||
|
||||
~SecretParameters ()
|
||||
{
|
||||
Dispose (false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
//
|
||||
// SecureBuffer.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// Copyright (c) 2014-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;
|
||||
|
||||
namespace Mono.Security.Interface
|
||||
{
|
||||
public class SecureBuffer : SecretParameters, IBufferOffsetSize
|
||||
{
|
||||
byte[] buffer;
|
||||
|
||||
public byte[] Buffer {
|
||||
get {
|
||||
CheckDisposed ();
|
||||
return buffer;
|
||||
}
|
||||
}
|
||||
|
||||
public int Size {
|
||||
get {
|
||||
CheckDisposed ();
|
||||
return buffer != null ? buffer.Length : 0;
|
||||
}
|
||||
}
|
||||
|
||||
int IBufferOffsetSize.Offset {
|
||||
get { return 0; }
|
||||
}
|
||||
|
||||
public SecureBuffer (int size)
|
||||
{
|
||||
buffer = new byte [size];
|
||||
}
|
||||
|
||||
public SecureBuffer (byte[] buffer)
|
||||
{
|
||||
this.buffer = buffer;
|
||||
}
|
||||
|
||||
public byte[] StealBuffer ()
|
||||
{
|
||||
CheckDisposed ();
|
||||
var retval = this.buffer;
|
||||
this.buffer = null;
|
||||
return retval;
|
||||
}
|
||||
|
||||
public static SecureBuffer CreateCopy (byte[] buffer)
|
||||
{
|
||||
var copy = new byte [buffer.Length];
|
||||
Array.Copy (buffer, copy, buffer.Length);
|
||||
return new SecureBuffer (copy);
|
||||
}
|
||||
|
||||
protected override void Clear ()
|
||||
{
|
||||
if (buffer != null) {
|
||||
Array.Clear (buffer, 0, buffer.Length);
|
||||
buffer = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,334 @@
|
||||
//
|
||||
// TlsBuffer.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// Copyright (c) 2014-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;
|
||||
|
||||
namespace Mono.Security.Interface
|
||||
{
|
||||
public class TlsBuffer : SecretParameters
|
||||
{
|
||||
public int Position {
|
||||
get; set;
|
||||
}
|
||||
|
||||
public int Remaining {
|
||||
get { return Size - (Position - Offset); }
|
||||
}
|
||||
|
||||
public byte[] Buffer {
|
||||
get { return innerBuffer.Buffer; }
|
||||
}
|
||||
|
||||
public int Offset {
|
||||
get { return innerBuffer.Offset; }
|
||||
}
|
||||
|
||||
public int Size {
|
||||
get { return innerBuffer.Size; }
|
||||
}
|
||||
|
||||
public int EndOffset {
|
||||
get { return Offset + Size; }
|
||||
}
|
||||
|
||||
IBufferOffsetSize innerBuffer;
|
||||
|
||||
protected TlsBuffer ()
|
||||
: this (null, 0, 0)
|
||||
{
|
||||
}
|
||||
|
||||
public TlsBuffer (IBufferOffsetSize bos)
|
||||
{
|
||||
innerBuffer = bos;
|
||||
Position = bos.Offset;
|
||||
}
|
||||
|
||||
public TlsBuffer (byte[] buffer, int offset, int size)
|
||||
: this (new BufferOffsetSize (buffer, offset, size))
|
||||
{
|
||||
}
|
||||
|
||||
public TlsBuffer (byte[] buffer)
|
||||
: this (buffer, 0, buffer.Length)
|
||||
{
|
||||
}
|
||||
|
||||
public TlsBuffer (int size)
|
||||
: this (new byte [size], 0, size)
|
||||
{
|
||||
}
|
||||
|
||||
public byte ReadByte ()
|
||||
{
|
||||
if (Position >= EndOffset)
|
||||
throw new TlsException (AlertDescription.DecodeError, "Buffer overflow");
|
||||
return Buffer [Position++];
|
||||
}
|
||||
|
||||
public short ReadInt16 ()
|
||||
{
|
||||
if (Position + 1 >= EndOffset)
|
||||
throw new TlsException (AlertDescription.DecodeError, "Buffer overflow");
|
||||
var retval = (short)(Buffer [Position] << 8 | Buffer [Position + 1]);
|
||||
Position += 2;
|
||||
return retval;
|
||||
}
|
||||
|
||||
public int ReadInt24 ()
|
||||
{
|
||||
if (Position + 2 >= EndOffset)
|
||||
throw new TlsException (AlertDescription.DecodeError, "Buffer overflow");
|
||||
var retval = ((Buffer [Position] << 16) | (Buffer [Position+1] << 8) | Buffer [Position+2]);
|
||||
Position += 3;
|
||||
return retval;
|
||||
}
|
||||
|
||||
public int ReadInt32 ()
|
||||
{
|
||||
if (Position + 3 >= EndOffset)
|
||||
throw new TlsException (AlertDescription.DecodeError, "Buffer overflow");
|
||||
var retval = ((Buffer [Position] << 24) | (Buffer [Position+1] << 16) | (Buffer [Position+2] << 8) | Buffer [Position+3]);
|
||||
Position += 4;
|
||||
return retval;
|
||||
}
|
||||
|
||||
public TlsBuffer ReadBuffer (int length)
|
||||
{
|
||||
if (Position + length > EndOffset)
|
||||
throw new TlsException (AlertDescription.DecodeError, "Buffer overflow");
|
||||
var retval = new TlsBuffer (Buffer, Position, length);
|
||||
Position += length;
|
||||
return retval;
|
||||
}
|
||||
|
||||
public IBufferOffsetSize GetRemaining ()
|
||||
{
|
||||
return new BufferOffsetSize (Buffer, Position, Remaining);
|
||||
}
|
||||
|
||||
protected virtual void MakeRoomInternal (int size)
|
||||
{
|
||||
if (Position + size > EndOffset)
|
||||
throw new TlsException (AlertDescription.DecodeError, "Buffer overflow");
|
||||
}
|
||||
|
||||
public void Write (byte value)
|
||||
{
|
||||
MakeRoomInternal (1);
|
||||
Buffer [Position++] = value;
|
||||
}
|
||||
|
||||
public void Write (short value)
|
||||
{
|
||||
MakeRoomInternal (2);
|
||||
WriteInt16 (Buffer, Position, value);
|
||||
Position += 2;
|
||||
}
|
||||
|
||||
public static void WriteInt16 (byte[] buffer, int offset, short value)
|
||||
{
|
||||
buffer[offset] = ((byte)(value >> 8));
|
||||
buffer[offset+1] = ((byte)value);
|
||||
}
|
||||
|
||||
public void Write (int value)
|
||||
{
|
||||
MakeRoomInternal (4);
|
||||
WriteInt32 (Buffer, Position, value);
|
||||
Position += 4;
|
||||
}
|
||||
|
||||
public void WriteInt24 (int value)
|
||||
{
|
||||
MakeRoomInternal (3);
|
||||
WriteInt24 (Buffer, Position, value);
|
||||
Position += 3;
|
||||
}
|
||||
|
||||
#pragma warning disable 3001
|
||||
public void Write (ulong value)
|
||||
#pragma warning restore 3001
|
||||
{
|
||||
MakeRoomInternal (8);
|
||||
WriteInt64 (Buffer, Position, value);
|
||||
Position += 8;
|
||||
}
|
||||
|
||||
public static void WriteInt24 (byte[] buffer, int offset, int value)
|
||||
{
|
||||
buffer[offset] = ((byte)(value >> 16));
|
||||
buffer[offset+1] = ((byte)(value >> 8));
|
||||
buffer[offset+2] = ((byte)value);
|
||||
}
|
||||
|
||||
public static void WriteInt32 (byte[] buffer, int offset, int value)
|
||||
{
|
||||
buffer[offset] = ((byte)(value >> 24));
|
||||
buffer[offset+1] = ((byte)(value >> 16));
|
||||
buffer[offset+2] = ((byte)(value >> 8));
|
||||
buffer[offset+3] = ((byte)value);
|
||||
}
|
||||
|
||||
#pragma warning disable 3001
|
||||
public static void WriteInt64 (byte[] buffer, int offset, ulong value)
|
||||
#pragma warning restore 3001
|
||||
{
|
||||
buffer[offset] = (byte) (value >> 56);
|
||||
buffer[offset+1] = (byte) (value >> 48);
|
||||
buffer[offset+2] = (byte) (value >> 40);
|
||||
buffer[offset+3] = (byte) (value >> 32);
|
||||
buffer[offset+4] = (byte) (value >> 24);
|
||||
buffer[offset+5] = (byte) (value >> 16);
|
||||
buffer[offset+6] = (byte) (value >> 8);
|
||||
buffer[offset+7] = (byte) value;
|
||||
}
|
||||
|
||||
public void Write (byte[] buffer)
|
||||
{
|
||||
Write (buffer, 0, buffer.Length);
|
||||
}
|
||||
|
||||
public void Write (byte[] buffer, int offset, int size)
|
||||
{
|
||||
MakeRoomInternal (size);
|
||||
Array.Copy (buffer, offset, Buffer, Position, size);
|
||||
Position += size;
|
||||
}
|
||||
|
||||
public void Write (IBufferOffsetSize buffer)
|
||||
{
|
||||
Write (buffer.Buffer, buffer.Offset, buffer.Size);
|
||||
}
|
||||
|
||||
public SecureBuffer ReadSecureBuffer (int count)
|
||||
{
|
||||
return new SecureBuffer (ReadBytes (count));
|
||||
}
|
||||
|
||||
public byte[] ReadBytes (int count)
|
||||
{
|
||||
if (Position + count > EndOffset)
|
||||
throw new TlsException (AlertDescription.DecodeError, "Buffer overflow");
|
||||
var retval = new byte [count];
|
||||
Array.Copy (Buffer, Position, retval, 0, count);
|
||||
Position += count;
|
||||
return retval;
|
||||
}
|
||||
|
||||
internal static bool Compare (SecureBuffer buffer1, SecureBuffer buffer2)
|
||||
{
|
||||
if (buffer1 == null || buffer2 == null)
|
||||
return false;
|
||||
|
||||
if (buffer1.Size != buffer2.Size)
|
||||
return false;
|
||||
|
||||
for (int i = 0; i < buffer1.Size; i++) {
|
||||
if (buffer1.Buffer [i] != buffer2.Buffer [i])
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool Compare (IBufferOffsetSize buffer1, IBufferOffsetSize buffer2)
|
||||
{
|
||||
if (buffer1 == null || buffer2 == null)
|
||||
return false;
|
||||
|
||||
if (buffer1.Size != buffer2.Size)
|
||||
return false;
|
||||
|
||||
for (int i = 0; i < buffer1.Size; i++) {
|
||||
if (buffer1.Buffer [buffer1.Offset + i] != buffer2.Buffer [buffer2.Offset + i])
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool Compare (byte[] buffer1, byte[] buffer2)
|
||||
{
|
||||
if (buffer1 == null || buffer2 == null)
|
||||
return false;
|
||||
|
||||
return Compare (buffer1, 0, buffer1.Length, buffer2, 0, buffer2.Length);
|
||||
}
|
||||
|
||||
public static bool Compare (byte[] buffer1, int offset1, int size1, byte[] buffer2, int offset2, int size2)
|
||||
{
|
||||
if (buffer1 == null || buffer2 == null)
|
||||
return false;
|
||||
|
||||
if (size1 != size2)
|
||||
return false;
|
||||
|
||||
for (int i = 0; i < size1; i++) {
|
||||
if (buffer1 [offset1 + i] != buffer2 [offset2 + i])
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
public static int ConstantTimeCompare (byte[] buffer1, int offset1, int size1, byte[] buffer2, int offset2, int size2)
|
||||
{
|
||||
int status = 0;
|
||||
int effectiveSize;
|
||||
if (size1 < size2) {
|
||||
status--;
|
||||
effectiveSize = size1;
|
||||
} else if (size2 < size1) {
|
||||
status--;
|
||||
effectiveSize = size2;
|
||||
} else {
|
||||
effectiveSize = size1;
|
||||
}
|
||||
|
||||
for (int i = 0; i < effectiveSize; i++) {
|
||||
if (buffer1 [offset1 + i] != buffer2 [offset2 + i])
|
||||
status--;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
protected void SetBuffer (byte[] buffer, int offset, int size)
|
||||
{
|
||||
innerBuffer = new BufferOffsetSize (buffer, offset, size);
|
||||
}
|
||||
|
||||
protected override void Clear ()
|
||||
{
|
||||
var disposable = innerBuffer as IDisposable;
|
||||
if (disposable != null)
|
||||
disposable.Dispose ();
|
||||
innerBuffer = null;
|
||||
Position = 0;
|
||||
}
|
||||
|
||||
public static readonly byte[] EmptyArray = new byte [0];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// TlsException.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// 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.Text;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Mono.Security.Interface
|
||||
{
|
||||
public sealed class TlsException : Exception
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private Alert alert;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
public Alert Alert {
|
||||
get { return this.alert; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public TlsException (Alert alert)
|
||||
: this (alert, alert.Description.ToString())
|
||||
{
|
||||
}
|
||||
|
||||
public TlsException (Alert alert, string message)
|
||||
: base (message)
|
||||
{
|
||||
this.alert = alert;
|
||||
}
|
||||
|
||||
public TlsException (AlertLevel level, AlertDescription description)
|
||||
: this (new Alert (level, description))
|
||||
{
|
||||
}
|
||||
|
||||
public TlsException (AlertDescription description)
|
||||
: this (new Alert (description))
|
||||
{
|
||||
}
|
||||
|
||||
public TlsException (AlertDescription description, string message)
|
||||
: this (new Alert (description), message)
|
||||
{
|
||||
}
|
||||
|
||||
public TlsException (AlertDescription description, string format, params object[] args)
|
||||
: this (new Alert (description), string.Format (format, args))
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
//
|
||||
// TlsMultiBuffer.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// Copyright (c) 2014-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;
|
||||
|
||||
namespace Mono.Security.Interface
|
||||
{
|
||||
public class TlsMultiBuffer
|
||||
{
|
||||
MemoryChunk first, last;
|
||||
|
||||
private class MemoryChunk : BufferOffsetSize
|
||||
{
|
||||
public MemoryChunk next;
|
||||
|
||||
public MemoryChunk (byte[] buffer, int offset, int size)
|
||||
: base (buffer, offset, size)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsEmpty {
|
||||
get { return first == null; }
|
||||
}
|
||||
|
||||
public bool IsSingle {
|
||||
get { return first != null && first.next == null; }
|
||||
}
|
||||
|
||||
public void Add (TlsBuffer buffer)
|
||||
{
|
||||
Add (buffer.Buffer, buffer.Offset, buffer.Size);
|
||||
}
|
||||
|
||||
public void Add (byte[] buffer)
|
||||
{
|
||||
Add (buffer, 0, buffer.Length);
|
||||
}
|
||||
|
||||
public void Add (byte[] buffer, int offset, int size)
|
||||
{
|
||||
var chunk = new MemoryChunk (buffer, offset, size);
|
||||
if (last == null)
|
||||
first = last = chunk;
|
||||
else {
|
||||
last.next = chunk;
|
||||
last = chunk;
|
||||
}
|
||||
}
|
||||
|
||||
public BufferOffsetSize[] GetBufferArray ()
|
||||
{
|
||||
int count = 0;
|
||||
for (var ptr = first; ptr != null; ptr = ptr.next)
|
||||
count++;
|
||||
var array = new BufferOffsetSize [count];
|
||||
count = 0;
|
||||
for (var ptr = first; ptr != null; ptr = ptr.next)
|
||||
array [count++] = ptr;
|
||||
return array;
|
||||
}
|
||||
|
||||
public void Clear ()
|
||||
{
|
||||
for (var ptr = first; ptr != null; ptr = ptr.next)
|
||||
ptr.Dispose ();
|
||||
first = last = null;
|
||||
}
|
||||
|
||||
public BufferOffsetSize GetBuffer ()
|
||||
{
|
||||
int totalSize = 0;
|
||||
for (var ptr = first; ptr != null; ptr = ptr.next)
|
||||
totalSize += ptr.Size;
|
||||
|
||||
var outBuffer = new BufferOffsetSize (new byte [totalSize]);
|
||||
int offset = 0;
|
||||
for (var ptr = first; ptr != null; ptr = ptr.next) {
|
||||
Buffer.BlockCopy (ptr.Buffer, ptr.Offset, outBuffer.Buffer, offset, ptr.Size);
|
||||
offset += ptr.Size;
|
||||
}
|
||||
return outBuffer;
|
||||
}
|
||||
|
||||
public BufferOffsetSize StealBuffer ()
|
||||
{
|
||||
if (IsSingle) {
|
||||
var retval = first;
|
||||
first = last = null;
|
||||
return retval;
|
||||
}
|
||||
|
||||
return GetBuffer ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// TlsProtocolCode.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// 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;
|
||||
|
||||
namespace Mono.Security.Interface
|
||||
{
|
||||
public enum TlsProtocolCode : short
|
||||
{
|
||||
Tls10 = 0x301,
|
||||
Tls11 = 0x302,
|
||||
Tls12 = 0x303
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,29 @@
|
||||
//
|
||||
// TlsProtocols.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// 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;
|
||||
|
||||
namespace Mono.Security.Interface
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace Mono.Security.Protocol.Ntlm {
|
||||
public Type3Message (Type2Message type2) : base (3)
|
||||
{
|
||||
_type2 = type2;
|
||||
_level = DefaultAuthLevel;
|
||||
_level = NtlmSettings.DefaultAuthLevel;
|
||||
_challenge = (byte[]) type2.Nonce.Clone ();
|
||||
|
||||
_domain = type2.TargetName;
|
||||
@@ -269,11 +269,13 @@ namespace Mono.Security.Protocol.Ntlm {
|
||||
throw new InvalidOperationException (
|
||||
"Refusing to use legacy-mode LM/NTLM authentication " +
|
||||
"unless explicitly enabled using DefaultAuthLevel.");
|
||||
|
||||
|
||||
#pragma warning disable 618
|
||||
using (var legacy = new ChallengeResponse (_password, _challenge)) {
|
||||
lm = legacy.LM;
|
||||
ntlm = legacy.NT;
|
||||
}
|
||||
#pragma warning restore 618
|
||||
} else {
|
||||
ChallengeResponse2.Compute (_type2, _level, _username, _password, _domain, out lm, out ntlm);
|
||||
}
|
||||
|
||||
+2
@@ -131,6 +131,7 @@ namespace Mono.Security.Protocol.Tls.Handshake.Client
|
||||
|
||||
private X509Certificate FindParentCertificate (X509Certificate cert)
|
||||
{
|
||||
#pragma warning disable 618
|
||||
// This certificate is the root certificate
|
||||
if (cert.GetName () == cert.GetIssuerName ())
|
||||
return null;
|
||||
@@ -140,6 +141,7 @@ namespace Mono.Security.Protocol.Tls.Handshake.Client
|
||||
return certificate;
|
||||
}
|
||||
return null;
|
||||
#pragma warning restore 618
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -597,7 +597,7 @@ namespace Mono.Security.Protocol.Tls
|
||||
try {
|
||||
SendAlert(alert);
|
||||
} catch (Exception alertEx) {
|
||||
ex = new IOException (string.Format ("Error while sending TLS Alert ({0}:{1}): {2}", alert.Level, alert.Description, ex), ex);
|
||||
ex = new IOException (string.Format ("Error while sending TLS Alert ({0}:{1}): {2}", alert.Level, alert.Description, ex), alertEx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -132,7 +132,6 @@ namespace Mono.Security.Protocol.Tls
|
||||
throw new TlsException(AlertDescription.UnexpectedMessage, String.Format(CultureInfo.CurrentUICulture,
|
||||
"Unknown server handshake message received ({0})",
|
||||
type.ToString()));
|
||||
break;
|
||||
}
|
||||
throw new TlsException (AlertDescription.HandshakeFailiure, String.Format ("Protocol error, unexpected protocol transition from {0} to {1}", last, type));
|
||||
}
|
||||
|
||||
@@ -430,6 +430,10 @@ namespace Mono.Security.X509 {
|
||||
|
||||
public string Password {
|
||||
set {
|
||||
// Clear old password.
|
||||
if (_password != null)
|
||||
Array.Clear (_password, 0, _password.Length);
|
||||
_password = null;
|
||||
if (value != null) {
|
||||
if (value.Length > 0) {
|
||||
int size = value.Length;
|
||||
@@ -447,9 +451,6 @@ namespace Mono.Security.X509 {
|
||||
// double-byte (Unicode) NULL (0x00) - see bug #79617
|
||||
_password = new byte[2];
|
||||
}
|
||||
} else {
|
||||
// no password
|
||||
_password = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,13 +135,26 @@
|
||||
./Mono.Xml/MiniParser.cs
|
||||
./Mono.Xml/SecurityParser.cs
|
||||
|
||||
./Mono.Security.Interface/Alert.cs
|
||||
./Mono.Security.Interface/CertificateValidationHelper.cs
|
||||
./Mono.Security.Interface/CipherAlgorithmType.cs
|
||||
./Mono.Security.Interface/CipherSuiteCode.cs
|
||||
./Mono.Security.Interface/ExchangeAlgorithmType.cs
|
||||
./Mono.Security.Interface/HashAlgorithmType.cs
|
||||
./Mono.Security.Interface/IBufferOffsetSize.cs
|
||||
./Mono.Security.Interface/IMonoTlsEventSink.cs
|
||||
./Mono.Security.Interface/IMonoTlsContext.cs
|
||||
./Mono.Security.Interface/MonoSslStream.cs
|
||||
./Mono.Security.Interface/IMonoSslStream.cs
|
||||
./Mono.Security.Interface/MonoTlsConnectionInfo.cs
|
||||
./Mono.Security.Interface/MonoTlsProvider.cs
|
||||
./Mono.Security.Interface/MonoTlsProviderFactory.cs
|
||||
./Mono.Security.Interface/MonoTlsSettings.cs
|
||||
./Mono.Security.Interface/TlsException.cs
|
||||
./Mono.Security.Interface/TlsProtocolCode.cs
|
||||
./Mono.Security.Interface/TlsProtocols.cs
|
||||
|
||||
./Mono.Security.Interface/BufferOffsetSize.cs
|
||||
./Mono.Security.Interface/SecretParameters.cs
|
||||
./Mono.Security.Interface/SecureBuffer.cs
|
||||
./Mono.Security.Interface/TlsBuffer.cs
|
||||
./Mono.Security.Interface/TlsMultiBuffer.cs
|
||||
@@ -0,0 +1,138 @@
|
||||
./Assembly/AssemblyInfo.cs
|
||||
../../build/common/Consts.cs
|
||||
../../build/common/Locale.cs
|
||||
./Mono.Math/BigInteger.cs
|
||||
./Mono.Math.Prime/ConfidenceFactor.cs
|
||||
./Mono.Math.Prime/PrimalityTests.cs
|
||||
./Mono.Math.Prime.Generator/NextPrimeFinder.cs
|
||||
./Mono.Math.Prime.Generator/PrimeGeneratorBase.cs
|
||||
./Mono.Math.Prime.Generator/SequentialSearchPrimeGeneratorBase.cs
|
||||
./Mono.Security/ASN1.cs
|
||||
./Mono.Security/ASN1Convert.cs
|
||||
./Mono.Security/BitConverterLE.cs
|
||||
./Mono.Security/PKCS7.cs
|
||||
./Mono.Security/StrongName.cs
|
||||
./Mono.Security.Authenticode/AuthenticodeBase.cs
|
||||
./Mono.Security.Authenticode/AuthenticodeDeformatter.cs
|
||||
./Mono.Security.Authenticode/AuthenticodeFormatter.cs
|
||||
./Mono.Security.Authenticode/SoftwarePublisherCertificate.cs
|
||||
./Mono.Security.Authenticode/PrivateKey.cs
|
||||
./Mono.Security.Cryptography/CryptoConvert.cs
|
||||
./Mono.Security.Cryptography/CryptoTools.cs
|
||||
./Mono.Security.Cryptography/DHKeyGeneration.cs
|
||||
./Mono.Security.Cryptography/DHParameters.cs
|
||||
./Mono.Security.Cryptography/DiffieHellman.cs
|
||||
./Mono.Security.Cryptography/DiffieHellmanManaged.cs
|
||||
./Mono.Security.Cryptography/KeyPairPersistence.cs
|
||||
./Mono.Security.Cryptography/MD2.cs
|
||||
./Mono.Security.Cryptography/MD4.cs
|
||||
./Mono.Security.Cryptography/PKCS1.cs
|
||||
./Mono.Security.Cryptography/PKCS8.cs
|
||||
./Mono.Security.Cryptography/RC4.cs
|
||||
./Mono.Security.Cryptography/RSAManaged.cs
|
||||
./Mono.Security.Cryptography/SHA224.cs
|
||||
./Mono.Security.Cryptography/SymmetricTransform.cs
|
||||
./Mono.Security.X509/PKCS12.cs
|
||||
./Mono.Security.X509/X501Name.cs
|
||||
./Mono.Security.X509/X509Builder.cs
|
||||
./Mono.Security.X509/X509Certificate.cs
|
||||
./Mono.Security.X509/X509CertificateCollection.cs
|
||||
./Mono.Security.X509/X509CertificateBuilder.cs
|
||||
./Mono.Security.X509/X509Chain.cs
|
||||
./Mono.Security.X509/X509ChainStatusFlags.cs
|
||||
./Mono.Security.X509/X509CRL.cs
|
||||
./Mono.Security.X509/X509Extension.cs
|
||||
./Mono.Security.X509/X509Extensions.cs
|
||||
./Mono.Security.X509/X509Store.cs
|
||||
./Mono.Security.X509/X509StoreManager.cs
|
||||
./Mono.Security.X509/X509Stores.cs
|
||||
./Mono.Security.X509/X520Attributes.cs
|
||||
./Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtension.cs
|
||||
./Mono.Security.X509.Extensions/BasicConstraintsExtension.cs
|
||||
./Mono.Security.X509.Extensions/CRLDistributionPointsExtension.cs
|
||||
./Mono.Security.X509.Extensions/CertificatePoliciesExtension.cs
|
||||
./Mono.Security.X509.Extensions/ExtendedKeyUsageExtension.cs
|
||||
./Mono.Security.X509.Extensions/GeneralNames.cs
|
||||
./Mono.Security.X509.Extensions/KeyAttributesExtension.cs
|
||||
./Mono.Security.X509.Extensions/KeyUsageExtension.cs
|
||||
./Mono.Security.X509.Extensions/NetscapeCertTypeExtension.cs
|
||||
./Mono.Security.X509.Extensions/PrivateKeyUsagePeriodExtension.cs
|
||||
./Mono.Security.X509.Extensions/SubjectAltNameExtension.cs
|
||||
./Mono.Security.X509.Extensions/SubjectKeyIdentifierExtension.cs
|
||||
./Mono.Security.Cryptography/TlsHMAC.cs
|
||||
./Mono.Security.Cryptography/MD5SHA1.cs
|
||||
./Mono.Security.Protocol.Ntlm/ChallengeResponse.cs
|
||||
./Mono.Security.Protocol.Ntlm/ChallengeResponse2.cs
|
||||
./Mono.Security.Protocol.Ntlm/MessageBase.cs
|
||||
./Mono.Security.Protocol.Ntlm/NtlmAuthLevel.cs
|
||||
./Mono.Security.Protocol.Ntlm/NtlmFlags.cs
|
||||
./Mono.Security.Protocol.Ntlm/NtlmSettings.cs
|
||||
./Mono.Security.Protocol.Ntlm/Type1Message.cs
|
||||
./Mono.Security.Protocol.Ntlm/Type2Message.cs
|
||||
./Mono.Security.Protocol.Ntlm/Type3Message.cs
|
||||
./Mono.Security.Protocol.Tls/Alert.cs
|
||||
./Mono.Security.Protocol.Tls/CipherAlgorithmType.cs
|
||||
./Mono.Security.Protocol.Tls/CipherSuite.cs
|
||||
./Mono.Security.Protocol.Tls/CipherSuiteCollection.cs
|
||||
./Mono.Security.Protocol.Tls/CipherSuiteFactory.cs
|
||||
./Mono.Security.Protocol.Tls/ClientContext.cs
|
||||
./Mono.Security.Protocol.Tls/ClientRecordProtocol.cs
|
||||
./Mono.Security.Protocol.Tls/ClientSessionCache.cs
|
||||
./Mono.Security.Protocol.Tls/ContentType.cs
|
||||
./Mono.Security.Protocol.Tls/Context.cs
|
||||
./Mono.Security.Protocol.Tls/DebugHelper.cs
|
||||
./Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs
|
||||
./Mono.Security.Protocol.Tls/HandshakeState.cs
|
||||
./Mono.Security.Protocol.Tls/HashAlgorithmType.cs
|
||||
./Mono.Security.Protocol.Tls/HttpsClientStream.cs
|
||||
./Mono.Security.Protocol.Tls/RecordProtocol.cs
|
||||
./Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs
|
||||
./Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs
|
||||
./Mono.Security.Protocol.Tls/SecurityCompressionType.cs
|
||||
./Mono.Security.Protocol.Tls/SecurityParameters.cs
|
||||
./Mono.Security.Protocol.Tls/SecurityProtocolType.cs
|
||||
./Mono.Security.Protocol.Tls/ServerContext.cs
|
||||
./Mono.Security.Protocol.Tls/ServerRecordProtocol.cs
|
||||
./Mono.Security.Protocol.Tls/SslClientStream.cs
|
||||
./Mono.Security.Protocol.Tls/SslCipherSuite.cs
|
||||
./Mono.Security.Protocol.Tls/SslHandshakeHash.cs
|
||||
./Mono.Security.Protocol.Tls/SslServerStream.cs
|
||||
./Mono.Security.Protocol.Tls/SslStreamBase.cs
|
||||
./Mono.Security.Protocol.Tls/TlsCipherSuite.cs
|
||||
./Mono.Security.Protocol.Tls/TlsClientSettings.cs
|
||||
./Mono.Security.Protocol.Tls/TlsException.cs
|
||||
./Mono.Security.Protocol.Tls/TlsServerSettings.cs
|
||||
./Mono.Security.Protocol.Tls/TlsStream.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs
|
||||
./Mono.Xml/MiniParser.cs
|
||||
./Mono.Xml/SecurityParser.cs
|
||||
|
||||
./Mono.Security.Interface/BufferOffsetSize.cs
|
||||
./Mono.Security.Interface/SecretParameters.cs
|
||||
./Mono.Security.Interface/SecureBuffer.cs
|
||||
./Mono.Security.Interface/TlsBuffer.cs
|
||||
./Mono.Security.Interface/TlsMultiBuffer.cs
|
||||
@@ -0,0 +1,5 @@
|
||||
#include mobile_Mono.Security.dll.sources
|
||||
./Mono.Security.Cryptography/ARC4Managed.cs
|
||||
./Mono.Security.Cryptography/MD2Managed.cs
|
||||
./Mono.Security.Cryptography/MD4Managed.cs
|
||||
./Mono.Security.Cryptography/SHA224Managed.cs
|
||||
@@ -1,138 +1,5 @@
|
||||
./Assembly/AssemblyInfo.cs
|
||||
../../build/common/Consts.cs
|
||||
../../build/common/Locale.cs
|
||||
./Mono.Math/BigInteger.cs
|
||||
./Mono.Math.Prime/ConfidenceFactor.cs
|
||||
./Mono.Math.Prime/PrimalityTests.cs
|
||||
./Mono.Math.Prime.Generator/NextPrimeFinder.cs
|
||||
./Mono.Math.Prime.Generator/PrimeGeneratorBase.cs
|
||||
./Mono.Math.Prime.Generator/SequentialSearchPrimeGeneratorBase.cs
|
||||
./Mono.Security/ASN1.cs
|
||||
./Mono.Security/ASN1Convert.cs
|
||||
./Mono.Security/BitConverterLE.cs
|
||||
./Mono.Security/PKCS7.cs
|
||||
./Mono.Security/StrongName.cs
|
||||
./Mono.Security.Authenticode/AuthenticodeBase.cs
|
||||
./Mono.Security.Authenticode/AuthenticodeDeformatter.cs
|
||||
./Mono.Security.Authenticode/AuthenticodeFormatter.cs
|
||||
./Mono.Security.Authenticode/SoftwarePublisherCertificate.cs
|
||||
./Mono.Security.Authenticode/PrivateKey.cs
|
||||
#include mobile_Mono.Security.dll.sources
|
||||
./Mono.Security.Cryptography/ARC4Managed.cs
|
||||
./Mono.Security.Cryptography/CryptoConvert.cs
|
||||
./Mono.Security.Cryptography/CryptoTools.cs
|
||||
./Mono.Security.Cryptography/DHKeyGeneration.cs
|
||||
./Mono.Security.Cryptography/DHParameters.cs
|
||||
./Mono.Security.Cryptography/DiffieHellman.cs
|
||||
./Mono.Security.Cryptography/DiffieHellmanManaged.cs
|
||||
./Mono.Security.Cryptography/KeyPairPersistence.cs
|
||||
./Mono.Security.Cryptography/MD2.cs
|
||||
./Mono.Security.Cryptography/MD2Managed.cs
|
||||
./Mono.Security.Cryptography/MD4.cs
|
||||
./Mono.Security.Cryptography/MD4Managed.cs
|
||||
./Mono.Security.Cryptography/PKCS1.cs
|
||||
./Mono.Security.Cryptography/PKCS8.cs
|
||||
./Mono.Security.Cryptography/RC4.cs
|
||||
./Mono.Security.Cryptography/RSAManaged.cs
|
||||
./Mono.Security.Cryptography/SHA224.cs
|
||||
./Mono.Security.Cryptography/SHA224Managed.cs
|
||||
./Mono.Security.Cryptography/SymmetricTransform.cs
|
||||
./Mono.Security.X509/PKCS12.cs
|
||||
./Mono.Security.X509/X501Name.cs
|
||||
./Mono.Security.X509/X509Builder.cs
|
||||
./Mono.Security.X509/X509Certificate.cs
|
||||
./Mono.Security.X509/X509CertificateCollection.cs
|
||||
./Mono.Security.X509/X509CertificateBuilder.cs
|
||||
./Mono.Security.X509/X509Chain.cs
|
||||
./Mono.Security.X509/X509ChainStatusFlags.cs
|
||||
./Mono.Security.X509/X509CRL.cs
|
||||
./Mono.Security.X509/X509Extension.cs
|
||||
./Mono.Security.X509/X509Extensions.cs
|
||||
./Mono.Security.X509/X509Store.cs
|
||||
./Mono.Security.X509/X509StoreManager.cs
|
||||
./Mono.Security.X509/X509Stores.cs
|
||||
./Mono.Security.X509/X520Attributes.cs
|
||||
./Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtension.cs
|
||||
./Mono.Security.X509.Extensions/BasicConstraintsExtension.cs
|
||||
./Mono.Security.X509.Extensions/CRLDistributionPointsExtension.cs
|
||||
./Mono.Security.X509.Extensions/CertificatePoliciesExtension.cs
|
||||
./Mono.Security.X509.Extensions/ExtendedKeyUsageExtension.cs
|
||||
./Mono.Security.X509.Extensions/GeneralNames.cs
|
||||
./Mono.Security.X509.Extensions/KeyAttributesExtension.cs
|
||||
./Mono.Security.X509.Extensions/KeyUsageExtension.cs
|
||||
./Mono.Security.X509.Extensions/NetscapeCertTypeExtension.cs
|
||||
./Mono.Security.X509.Extensions/PrivateKeyUsagePeriodExtension.cs
|
||||
./Mono.Security.X509.Extensions/SubjectAltNameExtension.cs
|
||||
./Mono.Security.X509.Extensions/SubjectKeyIdentifierExtension.cs
|
||||
./Mono.Security.Cryptography/TlsHMAC.cs
|
||||
./Mono.Security.Cryptography/MD5SHA1.cs
|
||||
./Mono.Security.Protocol.Ntlm/ChallengeResponse.cs
|
||||
./Mono.Security.Protocol.Ntlm/ChallengeResponse2.cs
|
||||
./Mono.Security.Protocol.Ntlm/MessageBase.cs
|
||||
./Mono.Security.Protocol.Ntlm/NtlmAuthLevel.cs
|
||||
./Mono.Security.Protocol.Ntlm/NtlmFlags.cs
|
||||
./Mono.Security.Protocol.Ntlm/NtlmSettings.cs
|
||||
./Mono.Security.Protocol.Ntlm/Type1Message.cs
|
||||
./Mono.Security.Protocol.Ntlm/Type2Message.cs
|
||||
./Mono.Security.Protocol.Ntlm/Type3Message.cs
|
||||
./Mono.Security.Protocol.Tls/Alert.cs
|
||||
./Mono.Security.Protocol.Tls/CipherAlgorithmType.cs
|
||||
./Mono.Security.Protocol.Tls/CipherSuite.cs
|
||||
./Mono.Security.Protocol.Tls/CipherSuiteCollection.cs
|
||||
./Mono.Security.Protocol.Tls/CipherSuiteFactory.cs
|
||||
./Mono.Security.Protocol.Tls/ClientContext.cs
|
||||
./Mono.Security.Protocol.Tls/ClientRecordProtocol.cs
|
||||
./Mono.Security.Protocol.Tls/ClientSessionCache.cs
|
||||
./Mono.Security.Protocol.Tls/ContentType.cs
|
||||
./Mono.Security.Protocol.Tls/Context.cs
|
||||
./Mono.Security.Protocol.Tls/DebugHelper.cs
|
||||
./Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs
|
||||
./Mono.Security.Protocol.Tls/HandshakeState.cs
|
||||
./Mono.Security.Protocol.Tls/HashAlgorithmType.cs
|
||||
./Mono.Security.Protocol.Tls/HttpsClientStream.cs
|
||||
./Mono.Security.Protocol.Tls/RecordProtocol.cs
|
||||
./Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs
|
||||
./Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs
|
||||
./Mono.Security.Protocol.Tls/SecurityCompressionType.cs
|
||||
./Mono.Security.Protocol.Tls/SecurityParameters.cs
|
||||
./Mono.Security.Protocol.Tls/SecurityProtocolType.cs
|
||||
./Mono.Security.Protocol.Tls/ServerContext.cs
|
||||
./Mono.Security.Protocol.Tls/ServerRecordProtocol.cs
|
||||
./Mono.Security.Protocol.Tls/SslClientStream.cs
|
||||
./Mono.Security.Protocol.Tls/SslCipherSuite.cs
|
||||
./Mono.Security.Protocol.Tls/SslHandshakeHash.cs
|
||||
./Mono.Security.Protocol.Tls/SslServerStream.cs
|
||||
./Mono.Security.Protocol.Tls/SslStreamBase.cs
|
||||
./Mono.Security.Protocol.Tls/TlsCipherSuite.cs
|
||||
./Mono.Security.Protocol.Tls/TlsClientSettings.cs
|
||||
./Mono.Security.Protocol.Tls/TlsException.cs
|
||||
./Mono.Security.Protocol.Tls/TlsServerSettings.cs
|
||||
./Mono.Security.Protocol.Tls/TlsStream.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs
|
||||
./Mono.Xml/MiniParser.cs
|
||||
./Mono.Xml/SecurityParser.cs
|
||||
|
||||
./Mono.Security.Interface/CertificateValidationHelper.cs
|
||||
@@ -1,134 +1 @@
|
||||
./Assembly/AssemblyInfo.cs
|
||||
../../build/common/Consts.cs
|
||||
../../build/common/Locale.cs
|
||||
./Mono.Math/BigInteger.cs
|
||||
./Mono.Math.Prime/ConfidenceFactor.cs
|
||||
./Mono.Math.Prime/PrimalityTests.cs
|
||||
./Mono.Math.Prime.Generator/NextPrimeFinder.cs
|
||||
./Mono.Math.Prime.Generator/PrimeGeneratorBase.cs
|
||||
./Mono.Math.Prime.Generator/SequentialSearchPrimeGeneratorBase.cs
|
||||
./Mono.Security/ASN1.cs
|
||||
./Mono.Security/ASN1Convert.cs
|
||||
./Mono.Security/BitConverterLE.cs
|
||||
./Mono.Security/PKCS7.cs
|
||||
./Mono.Security/StrongName.cs
|
||||
./Mono.Security.Authenticode/AuthenticodeBase.cs
|
||||
./Mono.Security.Authenticode/AuthenticodeDeformatter.cs
|
||||
./Mono.Security.Authenticode/AuthenticodeFormatter.cs
|
||||
./Mono.Security.Authenticode/SoftwarePublisherCertificate.cs
|
||||
./Mono.Security.Authenticode/PrivateKey.cs
|
||||
./Mono.Security.Cryptography/CryptoConvert.cs
|
||||
./Mono.Security.Cryptography/CryptoTools.cs
|
||||
./Mono.Security.Cryptography/DHKeyGeneration.cs
|
||||
./Mono.Security.Cryptography/DHParameters.cs
|
||||
./Mono.Security.Cryptography/DiffieHellman.cs
|
||||
./Mono.Security.Cryptography/DiffieHellmanManaged.cs
|
||||
./Mono.Security.Cryptography/KeyPairPersistence.cs
|
||||
./Mono.Security.Cryptography/MD2.cs
|
||||
./Mono.Security.Cryptography/MD4.cs
|
||||
./Mono.Security.Cryptography/PKCS1.cs
|
||||
./Mono.Security.Cryptography/PKCS8.cs
|
||||
./Mono.Security.Cryptography/RC4.cs
|
||||
./Mono.Security.Cryptography/RSAManaged.cs
|
||||
./Mono.Security.Cryptography/SHA224.cs
|
||||
./Mono.Security.Cryptography/SymmetricTransform.cs
|
||||
./Mono.Security.X509/PKCS12.cs
|
||||
./Mono.Security.X509/X501Name.cs
|
||||
./Mono.Security.X509/X509Builder.cs
|
||||
./Mono.Security.X509/X509Certificate.cs
|
||||
./Mono.Security.X509/X509CertificateCollection.cs
|
||||
./Mono.Security.X509/X509CertificateBuilder.cs
|
||||
./Mono.Security.X509/X509Chain.cs
|
||||
./Mono.Security.X509/X509ChainStatusFlags.cs
|
||||
./Mono.Security.X509/X509CRL.cs
|
||||
./Mono.Security.X509/X509Extension.cs
|
||||
./Mono.Security.X509/X509Extensions.cs
|
||||
./Mono.Security.X509/X509Store.cs
|
||||
./Mono.Security.X509/X509StoreManager.cs
|
||||
./Mono.Security.X509/X509Stores.cs
|
||||
./Mono.Security.X509/X520Attributes.cs
|
||||
./Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtension.cs
|
||||
./Mono.Security.X509.Extensions/BasicConstraintsExtension.cs
|
||||
./Mono.Security.X509.Extensions/CRLDistributionPointsExtension.cs
|
||||
./Mono.Security.X509.Extensions/CertificatePoliciesExtension.cs
|
||||
./Mono.Security.X509.Extensions/ExtendedKeyUsageExtension.cs
|
||||
./Mono.Security.X509.Extensions/GeneralNames.cs
|
||||
./Mono.Security.X509.Extensions/KeyAttributesExtension.cs
|
||||
./Mono.Security.X509.Extensions/KeyUsageExtension.cs
|
||||
./Mono.Security.X509.Extensions/NetscapeCertTypeExtension.cs
|
||||
./Mono.Security.X509.Extensions/PrivateKeyUsagePeriodExtension.cs
|
||||
./Mono.Security.X509.Extensions/SubjectAltNameExtension.cs
|
||||
./Mono.Security.X509.Extensions/SubjectKeyIdentifierExtension.cs
|
||||
./Mono.Security.Cryptography/TlsHMAC.cs
|
||||
./Mono.Security.Cryptography/MD5SHA1.cs
|
||||
./Mono.Security.Protocol.Ntlm/ChallengeResponse.cs
|
||||
./Mono.Security.Protocol.Ntlm/ChallengeResponse2.cs
|
||||
./Mono.Security.Protocol.Ntlm/MessageBase.cs
|
||||
./Mono.Security.Protocol.Ntlm/NtlmAuthLevel.cs
|
||||
./Mono.Security.Protocol.Ntlm/NtlmFlags.cs
|
||||
./Mono.Security.Protocol.Ntlm/NtlmSettings.cs
|
||||
./Mono.Security.Protocol.Ntlm/Type1Message.cs
|
||||
./Mono.Security.Protocol.Ntlm/Type2Message.cs
|
||||
./Mono.Security.Protocol.Ntlm/Type3Message.cs
|
||||
./Mono.Security.Protocol.Tls/Alert.cs
|
||||
./Mono.Security.Protocol.Tls/CipherAlgorithmType.cs
|
||||
./Mono.Security.Protocol.Tls/CipherSuite.cs
|
||||
./Mono.Security.Protocol.Tls/CipherSuiteCollection.cs
|
||||
./Mono.Security.Protocol.Tls/CipherSuiteFactory.cs
|
||||
./Mono.Security.Protocol.Tls/ClientContext.cs
|
||||
./Mono.Security.Protocol.Tls/ClientRecordProtocol.cs
|
||||
./Mono.Security.Protocol.Tls/ClientSessionCache.cs
|
||||
./Mono.Security.Protocol.Tls/ContentType.cs
|
||||
./Mono.Security.Protocol.Tls/Context.cs
|
||||
./Mono.Security.Protocol.Tls/DebugHelper.cs
|
||||
./Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs
|
||||
./Mono.Security.Protocol.Tls/HandshakeState.cs
|
||||
./Mono.Security.Protocol.Tls/HashAlgorithmType.cs
|
||||
./Mono.Security.Protocol.Tls/HttpsClientStream.cs
|
||||
./Mono.Security.Protocol.Tls/RecordProtocol.cs
|
||||
./Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs
|
||||
./Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs
|
||||
./Mono.Security.Protocol.Tls/SecurityCompressionType.cs
|
||||
./Mono.Security.Protocol.Tls/SecurityParameters.cs
|
||||
./Mono.Security.Protocol.Tls/SecurityProtocolType.cs
|
||||
./Mono.Security.Protocol.Tls/ServerContext.cs
|
||||
./Mono.Security.Protocol.Tls/ServerRecordProtocol.cs
|
||||
./Mono.Security.Protocol.Tls/SslClientStream.cs
|
||||
./Mono.Security.Protocol.Tls/SslCipherSuite.cs
|
||||
./Mono.Security.Protocol.Tls/SslHandshakeHash.cs
|
||||
./Mono.Security.Protocol.Tls/SslServerStream.cs
|
||||
./Mono.Security.Protocol.Tls/SslStreamBase.cs
|
||||
./Mono.Security.Protocol.Tls/TlsCipherSuite.cs
|
||||
./Mono.Security.Protocol.Tls/TlsClientSettings.cs
|
||||
./Mono.Security.Protocol.Tls/TlsException.cs
|
||||
./Mono.Security.Protocol.Tls/TlsServerSettings.cs
|
||||
./Mono.Security.Protocol.Tls/TlsStream.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs
|
||||
./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs
|
||||
./Mono.Xml/MiniParser.cs
|
||||
./Mono.Xml/SecurityParser.cs
|
||||
|
||||
./Mono.Security.Interface/CertificateValidationHelper.cs
|
||||
#include mobile_Mono.Security.dll.sources
|
||||
@@ -1,11 +1,2 @@
|
||||
#include monotouch_Mono.Security.dll.sources
|
||||
|
||||
./Mono.Security.Interface/IBufferOffsetSize.cs
|
||||
./Mono.Security.Interface/IMonoTlsEventSink.cs
|
||||
./Mono.Security.Interface/IMonoTlsContext.cs
|
||||
./Mono.Security.Interface/MonoSslStream.cs
|
||||
./Mono.Security.Interface/MonoTlsConnectionInfo.cs
|
||||
./Mono.Security.Interface/MonoTlsProvider.cs
|
||||
./Mono.Security.Interface/MonoTlsProviderFactory.cs
|
||||
./Mono.Security.Interface/MonoTlsSettings.cs
|
||||
./Mono.Security.Interface/TlsProtocols.cs
|
||||
@@ -277,6 +277,10 @@ namespace MonoTests.System.Linq.Expressions
|
||||
[Test]
|
||||
public void NegateDecimal ()
|
||||
{
|
||||
// Make sure the negate method is not linked away
|
||||
decimal d1 = 1;
|
||||
decimal d2 = -d1;
|
||||
|
||||
var d = Expression.Parameter (typeof (decimal), "l");
|
||||
|
||||
var meth = typeof (decimal).GetMethod ("op_UnaryNegation", new [] { typeof (decimal) });
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#include monotouch_System.Core.dll.sources
|
||||
@@ -0,0 +1 @@
|
||||
#include monotouch_System.Core.dll.sources
|
||||
@@ -0,0 +1,94 @@
|
||||
// help building System.Data without win32-specific p/invokes
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
internal static partial class Bid {
|
||||
internal enum ApiGroup : uint {
|
||||
Pooling = 0x00001000,
|
||||
Correlation = 0x00040000,
|
||||
}
|
||||
|
||||
internal static bool AdvancedOn {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
internal static bool IsOn (ApiGroup flag)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
[Conditional ("BID")]
|
||||
internal static void Trace (params object[] a)
|
||||
{
|
||||
}
|
||||
|
||||
[Conditional ("BID")]
|
||||
internal static void PoolerTrace (params object[] a)
|
||||
{
|
||||
}
|
||||
|
||||
// out method can't be conditional
|
||||
internal static void ScopeEnter (out IntPtr p, params object[] a)
|
||||
{
|
||||
p = IntPtr.Zero;
|
||||
}
|
||||
|
||||
[Conditional ("BID")]
|
||||
internal static void ScopeLeave (ref IntPtr a)
|
||||
{
|
||||
}
|
||||
|
||||
// out method can't be conditional
|
||||
internal static void PoolerScopeEnter (out IntPtr p, string a, System.Int32 b)
|
||||
{
|
||||
p = IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
[ConditionalAttribute ("CODE_ANALYSIS")]
|
||||
[AttributeUsage (AttributeTargets.Method)]
|
||||
internal sealed class BidMethodAttribute : Attribute {
|
||||
}
|
||||
|
||||
[ConditionalAttribute ("CODE_ANALYSIS")]
|
||||
[AttributeUsage (AttributeTargets.Parameter | AttributeTargets.Method, AllowMultiple=true)]
|
||||
internal sealed class BidArgumentTypeAttribute : Attribute {
|
||||
internal BidArgumentTypeAttribute (Type bidArgumentType)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
namespace System.Data.Common {
|
||||
|
||||
internal static class UnsafeNativeMethods {
|
||||
|
||||
// note: likely unreachable code - as this never worked on mono
|
||||
internal static int lstrlenW (IntPtr p)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
static internal int CreateWellKnownSid (int sidType, byte[] domainSid, byte[] resultSid, ref uint resultSidLength )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
static internal bool CheckTokenMembership (IntPtr tokenHandle, byte[] sidToCheck, out bool isMember)
|
||||
{
|
||||
isMember = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
static internal bool GetTokenInformation (IntPtr tokenHandle, uint token_class, IntPtr tokenStruct, uint tokenInformationLength, ref uint tokenString)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static internal bool ConvertSidToStringSidW (IntPtr sid, out IntPtr stringSid)
|
||||
{
|
||||
stringSid = IntPtr.Zero;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -983,6 +983,7 @@ table was set.
|
||||
eventWriter.WriteLine (" add a column with an empty name.");
|
||||
|
||||
AssertEquals (result.Replace ("\r\n", "\n"), eventWriter.ToString ().Replace ("\r\n", "\n"));
|
||||
GC.KeepAlive (dv);
|
||||
}
|
||||
|
||||
public class ComplexEventSequence1View : DataView
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
../../../external/referencesource/System.Data/bid/inc/cs/bidPrivateBase.cs
|
||||
MobileStubs.cs
|
||||
|
||||
../../../external/referencesource/System.Data/Microsoft/SqlServer/Server/SqlTriggerContext.cs
|
||||
|
||||
@@ -66,7 +66,6 @@
|
||||
../../../external/referencesource/System.Data/System/Data/Common/ObjectStorage.cs
|
||||
../../../external/referencesource/System.Data/System/Data/Common/RowUpdatedEventArgs.cs
|
||||
../../../external/referencesource/System.Data/System/Data/Common/RowUpdatingEventArgs.cs
|
||||
../../../external/referencesource/System.Data/System/Data/Common/SafeNativeMethods.cs
|
||||
../../../external/referencesource/System.Data/System/Data/Common/SByteStorage.cs
|
||||
../../../external/referencesource/System.Data/System/Data/Common/SchemaTableColumn.cs
|
||||
../../../external/referencesource/System.Data/System/Data/Common/SchemaTableOptionalColumn.cs
|
||||
@@ -91,12 +90,10 @@
|
||||
../../../external/referencesource/System.Data/System/Data/Common/SQLTypes/SqlXmlStorage.cs
|
||||
../../../external/referencesource/System.Data/System/Data/Common/StringStorage.cs
|
||||
../../../external/referencesource/System.Data/System/Data/Common/SupportedJoinOperators.cs
|
||||
../../../external/referencesource/System.Data/System/Data/Common/System.Data_BID.cs
|
||||
../../../external/referencesource/System.Data/System/Data/Common/TimeSpanStorage.cs
|
||||
../../../external/referencesource/System.Data/System/Data/Common/UInt16Storage.cs
|
||||
../../../external/referencesource/System.Data/System/Data/Common/UInt32Storage.cs
|
||||
../../../external/referencesource/System.Data/System/Data/Common/UInt64Storage.cs
|
||||
../../../external/referencesource/System.Data/System/Data/Common/UnsafeNativeMethods.cs
|
||||
../../../external/referencesource/System.Data/System/Data/ConflictOptions.cs
|
||||
../../../external/referencesource/System.Data/System/Data/ConnectionState.cs
|
||||
../../../external/referencesource/System.Data/System/Data/ConstraintCollection.cs
|
||||
@@ -193,24 +190,13 @@
|
||||
../../../external/referencesource/System.Data/System/Data/PrimaryKeyTypeConverter.cs
|
||||
../../../external/referencesource/System.Data/System/Data/PropertyCollection.cs
|
||||
../../../external/referencesource/System.Data/System/Data/ProviderBase/DataReaderContainer.cs
|
||||
../../../external/referencesource/System.Data/System/Data/ProviderBase/DbBuffer.cs
|
||||
../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionClosed.cs
|
||||
../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionFactory.cs
|
||||
# ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionHelper.cs
|
||||
../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionInternal.cs
|
||||
../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolAuthenticationContext.cs
|
||||
../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolAuthenticationContextKey.cs
|
||||
../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPool.cs
|
||||
../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolGroup.cs
|
||||
../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolGroupProviderInfo.cs
|
||||
../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolIdentity.cs
|
||||
../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolOptions.cs
|
||||
../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolProviderInfo.cs
|
||||
../../../external/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataCollectionNames.cs
|
||||
../../../external/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataColumnNames.cs
|
||||
../../../external/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataFactory.cs
|
||||
# ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbParameterCollectionHelper.cs
|
||||
# ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbParameterHelper.cs
|
||||
../../../external/referencesource/System.Data/System/Data/ProviderBase/DbReferenceCollection.cs
|
||||
../../../external/referencesource/System.Data/System/Data/ProviderBase/SchemaMapping.cs
|
||||
../../../external/referencesource/System.Data/System/Data/ProviderBase/TimeoutTimer.cs
|
||||
|
||||
@@ -38,8 +38,10 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.Drawing
|
||||
{
|
||||
#if !MONOTOUCH && !MONOMAC
|
||||
[TypeConverter(typeof(ColorConverter))]
|
||||
[Editor ("System.Drawing.Design.ColorEditor, " + Consts.AssemblySystem_Drawing_Design, typeof (System.Drawing.Design.UITypeEditor))]
|
||||
#endif
|
||||
[Serializable]
|
||||
public struct Color {
|
||||
|
||||
|
||||
@@ -210,6 +210,7 @@ namespace System.Drawing {
|
||||
0xFF316AC5, /* 174 - MenuHighlight */
|
||||
};
|
||||
|
||||
#if !MONOTOUCH && !MONOMAC
|
||||
static KnownColors ()
|
||||
{
|
||||
if (GDIPlus.RunningOnWindows ()) {
|
||||
@@ -264,6 +265,7 @@ namespace System.Drawing {
|
||||
ArgbValues [(int)KnownColor.MenuBar] = GetSysColor (GetSysColorIndex.COLOR_MENUBAR);
|
||||
ArgbValues [(int)KnownColor.MenuHighlight] = GetSysColor (GetSysColorIndex.COLOR_MENUHIGHLIGHT);
|
||||
}
|
||||
#endif
|
||||
|
||||
public static Color FromKnownColor (KnownColor kc)
|
||||
{
|
||||
|
||||
@@ -40,7 +40,9 @@ namespace System.Drawing
|
||||
{
|
||||
[Serializable]
|
||||
[ComVisible (true)]
|
||||
#if !MONOTOUCH && !MONOMAC
|
||||
[TypeConverter (typeof (PointConverter))]
|
||||
#endif
|
||||
public struct Point
|
||||
{
|
||||
// Private x and y coordinate fields.
|
||||
|
||||
@@ -39,7 +39,9 @@ namespace System.Drawing
|
||||
{
|
||||
[Serializable]
|
||||
[ComVisible (true)]
|
||||
#if !MONOTOUCH && !MONOMAC
|
||||
[TypeConverter (typeof (RectangleConverter))]
|
||||
#endif
|
||||
public struct Rectangle
|
||||
{
|
||||
private int x, y, width, height;
|
||||
|
||||
@@ -40,7 +40,9 @@ namespace System.Drawing
|
||||
{
|
||||
[Serializable]
|
||||
[ComVisible (true)]
|
||||
#if !MONOTOUCH && !MONOMAC
|
||||
[TypeConverter (typeof (SizeConverter))]
|
||||
#endif
|
||||
public struct Size
|
||||
{
|
||||
|
||||
|
||||
@@ -40,7 +40,9 @@ namespace System.Drawing
|
||||
{
|
||||
[Serializable]
|
||||
[ComVisible (true)]
|
||||
#if !MONOTOUCH && !MONOMAC
|
||||
[TypeConverter (typeof (SizeFConverter))]
|
||||
#endif
|
||||
public struct SizeF
|
||||
{
|
||||
// Private height and width fields.
|
||||
|
||||
@@ -33,7 +33,7 @@ using System.IO;
|
||||
|
||||
namespace System.Net.Http
|
||||
{
|
||||
public class HttpClient : HttpMessageInvoker
|
||||
public partial class HttpClient : HttpMessageInvoker
|
||||
{
|
||||
static readonly TimeSpan TimeoutDefault = TimeSpan.FromSeconds (100);
|
||||
|
||||
@@ -44,10 +44,12 @@ namespace System.Net.Http
|
||||
long buffer_size;
|
||||
TimeSpan timeout;
|
||||
|
||||
#if !XAMARIN_MODERN
|
||||
public HttpClient ()
|
||||
: this (new HttpClientHandler (), true)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
public HttpClient (HttpMessageHandler handler)
|
||||
: this (handler, true)
|
||||
|
||||
+14
-12
@@ -469,8 +469,13 @@ namespace System.Runtime.Serialization
|
||||
PrimitiveDataContract primitiveContract = PrimitiveDataContract.GetPrimitiveDataContract(memberType);
|
||||
if (primitiveContract != null && !writeXsiType)
|
||||
primitiveContract.XmlFormatContentWriterMethod.Invoke (writer, new object [] {memberValue});
|
||||
else
|
||||
InternalSerialize(XmlFormatGeneratorStatics.InternalSerializeMethod, () => memberValue, memberType, writeXsiType);
|
||||
else {
|
||||
// InternalSerialize(XmlFormatGeneratorStatics.InternalSerializeMethod, () => memberValue, memberType, writeXsiType);
|
||||
var typeHandleValue = Type.GetTypeHandle (memberValue);
|
||||
var isDeclaredType = typeHandleValue.Equals (CodeInterpreter.ConvertValue (memberValue, memberType, Globals.TypeOfObject));
|
||||
|
||||
ctx.InternalSerialize (writer, memberValue, isDeclaredType, writeXsiType, DataContract.GetId (memberType.TypeHandle), memberType.TypeHandle);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -500,22 +505,19 @@ namespace System.Runtime.Serialization
|
||||
if (isNull2) {
|
||||
XmlFormatGeneratorStatics.WriteNullMethod.Invoke (ctx, new object [] {writer, memberType, DataContract.IsTypeSerializable(memberType)});
|
||||
} else {
|
||||
InternalSerialize((isNullableOfT ? XmlFormatGeneratorStatics.InternalSerializeMethod : XmlFormatGeneratorStatics.InternalSerializeReferenceMethod),
|
||||
() => memberValue, memberType, writeXsiType);
|
||||
var typeHandleValue = Type.GetTypeHandle (memberValue);
|
||||
var isDeclaredType = typeHandleValue.Equals (CodeInterpreter.ConvertValue (memberValue, memberType, Globals.TypeOfObject));
|
||||
if (isNullableOfT)
|
||||
ctx.InternalSerialize (writer, memberValue, isDeclaredType, writeXsiType, DataContract.GetId (memberType.TypeHandle), memberType.TypeHandle);
|
||||
else
|
||||
ctx.InternalSerializeReference (writer, memberValue, isDeclaredType, writeXsiType, DataContract.GetId (memberType.TypeHandle), memberType.TypeHandle);
|
||||
//InternalSerialize((isNullableOfT ? XmlFormatGeneratorStatics.InternalSerializeMethod : XmlFormatGeneratorStatics.InternalSerializeReferenceMethod), () => memberValue, memberType, writeXsiType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void InternalSerialize (MethodInfo methodInfo, Func<object> memberValue, Type memberType, bool writeXsiType)
|
||||
{
|
||||
var v = memberValue ();
|
||||
var typeHandleValue = Type.GetTypeHandle (v);
|
||||
var isDeclaredType = typeHandleValue.Equals (CodeInterpreter.ConvertValue (v, memberType, Globals.TypeOfObject));
|
||||
methodInfo.Invoke (ctx, new object [] {writer, memberValue != null ? v : null, isDeclaredType, writeXsiType, DataContract.GetId (memberType.TypeHandle), memberType.TypeHandle});
|
||||
}
|
||||
|
||||
object UnwrapNullableObject(Func<object> memberValue, ref Type memberType, out bool isNull)// Leaves !HasValue on stack
|
||||
{
|
||||
object v = memberValue ();
|
||||
|
||||
@@ -8,6 +8,7 @@ System.Runtime.Serialization/Bug2843Test.cs
|
||||
System.Runtime.Serialization/Bug3258Test.cs
|
||||
System.Runtime.Serialization/Bug242Test.cs
|
||||
System.Runtime.Serialization/Bug695203Test.cs
|
||||
System.Runtime.Serialization/Bug36100.cs
|
||||
System.Runtime.Serialization/DataContractResolverTest.cs
|
||||
System.Runtime.Serialization/DataContractSerializerTest_DuplicateQName.cs
|
||||
System.Runtime.Serialization/DataContractSerializerTest_NullableWithDictionary.cs
|
||||
|
||||
+14381
File diff suppressed because it is too large.
Load diff
Loaded 100 of 365 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user