Compare commits

..
519 changed files with 11011 additions and 13782 deletions

No files matched your search

+3
View File
@@ -26,6 +26,9 @@
[submodule "external/nuget-buildtasks"]
path = external/nuget-buildtasks
url = git://github.com/mono/NuGet.BuildTasks
[submodule "external/buildtools"]
path = external/buildtools
url = git://github.com/mono/buildtools.git
[submodule "external/cecil-legacy"]
path = external/cecil-legacy
url = git://github.com/mono/cecil.git
+6 -1
View File
@@ -50,9 +50,14 @@ noinst_DATA = mono-uninstalled.pc
DISTCLEANFILES= mono-uninstalled.pc
# building with monolite
mcslib = $(mcs_topdir)/class/lib
monolite_url = https://download.mono-project.com/monolite/monolite-$(MONO_CORLIB_VERSION)-latest.tar.gz
.PHONY: get-monolite-latest
get-monolite-latest:
$(MAKE) -C $(mcs_topdir)/class get-monolite-latest
-rm -fr $(mcslib)/monolite/$(MONO_CORLIB_VERSION)
-mkdir -p $(mcslib)/monolite
cd $(mcslib) && { (wget -O- $(monolite_url) || curl -L $(monolite_url)) | gzip -d | tar xf - ; }
cd $(mcslib) && mv -f monolite-* monolite/$(MONO_CORLIB_VERSION)
if BITCODE
BITCODE_CHECK=yes
+179 -16
View File
@@ -1,7 +1,7 @@
# Process this file with autoconf to produce a configure script.
#AC_PREREQ([2.62])
AC_INIT(mono, [5.4.1],
AC_INIT(mono, [5.3.0],
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
AC_CONFIG_SRCDIR([README.md])
@@ -40,8 +40,8 @@ MONO_VERSION_BUILD=`echo $VERSION | cut -d . -f 3`
# This can be reset to 0 when Mono's version number is bumped
# since it's part of the corlib version (the prefix '1' in the full
# version number is to ensure the number isn't treated as octal in C)
MONO_CORLIB_COUNTER=3
MONO_CORLIB_VERSION=`printf "1%02d%02d%02d%03d" $MONO_VERSION_MAJOR $MONO_VERSION_MINOR 0 $MONO_CORLIB_COUNTER`
MONO_CORLIB_COUNTER=1
MONO_CORLIB_VERSION=`printf "1%02d%02d%02d%03d" $MONO_VERSION_MAJOR $MONO_VERSION_MINOR $MONO_VERSION_BUILD $MONO_CORLIB_COUNTER`
AC_DEFINE_UNQUOTED(MONO_CORLIB_VERSION,$MONO_CORLIB_VERSION,[Version of the corlib-runtime interface])
AC_SUBST(MONO_CORLIB_VERSION)
@@ -264,8 +264,17 @@ case "$host" in
with_sgen_default_concurrent=yes
;;
*-*-nacl*)
echo "nacl no longer supported."
exit 1
CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
if test "x$disable_munmap" != "xyes"; then
CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
fi
libmono_cflags="-D_REENTRANT"
libdl=
libgc_threads=pthreads
use_sigposix=yes
ikvm_native=no
AC_DEFINE(DISABLE_SOCKETS,1,[Disable sockets support])
AC_DEFINE(DISABLE_ATTACH, 1, [Disable agent attach support])
;;
*-*-hpux*)
CPPFLAGS="$CPPFLAGS -DGC_HPUX_THREADS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_REENTRANT"
@@ -734,6 +743,10 @@ fi
AM_CONDITIONAL(DISABLE_LIBRARIES, test x$enable_libraries = xno)
case $host in
*nacl* ) with_shared_mono=yes;;
esac
if test "x$host_win32" = "xyes"; then
# Boehm GC requires the runtime to be in its own dll
with_static_mono=no
@@ -1358,6 +1371,8 @@ AC_TRY_COMPILE([
AC_DEFINE_UNQUOTED(MONO_ZERO_LEN_ARRAY, 1, [Length of zero length arrays])
])
AC_CHECK_HEADERS(nacl/nacl_dyncode.h)
dnl ***********************************
dnl *** Checks for signals
dnl ***********************************
@@ -2205,11 +2220,13 @@ if test x$host_win32 = xno; then
dnl **********************************
dnl *** epoll ***
dnl **********************************
AC_CHECK_HEADERS(sys/epoll.h)
haveepoll=no
AC_CHECK_FUNCS(epoll_ctl, [haveepoll=yes], )
if test "x$haveepoll" = "xyes" -a "x$ac_cv_header_sys_epoll_h" = "xyes"; then
AC_DEFINE(HAVE_EPOLL, 1, [epoll supported])
if test "x$ac_cv_header_nacl_nacl_dyncode_h" = "xno"; then
AC_CHECK_HEADERS(sys/epoll.h)
haveepoll=no
AC_CHECK_FUNCS(epoll_ctl, [haveepoll=yes], )
if test "x$haveepoll" = "xyes" -a "x$ac_cv_header_sys_epoll_h" = "xyes"; then
AC_DEFINE(HAVE_EPOLL, 1, [epoll supported])
fi
fi
havekqueue=no
@@ -2842,6 +2859,40 @@ fi
AM_CONDITIONAL(ENABLE_DTRACE, [test x$enable_dtrace = xyes])
AM_CONDITIONAL(DTRACE_G_REQUIRED, [test x$dtrace_g = xyes])
dnl **************
dnl *** NaCl ***
dnl **************
AC_ARG_ENABLE(nacl_codegen, [ --enable-nacl-codegen Enable Native Client code generation], enable_nacl_codegen=$enableval, enable_nacl_codegen=no)
AC_ARG_ENABLE(nacl_gc, [ --enable-nacl-gc Enable Native Client garbage collection], enable_nacl_gc=$enableval, enable_nacl_gc=no)
AM_CONDITIONAL(NACL_CODEGEN, test x$enable_nacl_codegen != xno)
dnl
dnl Hack to use system mono for operations in build/install not allowed in NaCl.
dnl
nacl_self_host=""
if test "x$ac_cv_header_nacl_nacl_dyncode_h" = "xyes"; then
nacl_self_host="nacl_self_host"
fi
AC_SUBST(nacl_self_host)
if test "x$enable_nacl_codegen" = "xyes"; then
MONO_NACL_ALIGN_MASK_OFF=1
AC_DEFINE(TARGET_NACL, 1, [...])
AC_DEFINE(__native_client_codegen__, 1, [...])
fi
if test "x$enable_nacl_gc" = "xyes"; then
if test "x$TARGET" = "xAMD64" -o "x$TARGET" = "xX86"; then
INSTRUMENT_CFLAG="-finstrument-for-thread-suspension"
else
# Not yet implemented
INSTRUMENT_CFLAG=""
fi
CPPFLAGS="$CPPFLAGS $INSTRUMENT_CFLAG -D__native_client_gc__"
fi
AC_SUBST(MONO_NACL_ALIGN_MASK_OFF)
dnl **************************
dnl *** AOT cross offsets ***
dnl **************************
@@ -3104,6 +3155,12 @@ case "$host" in
mingw*)
;;
esac
case "$host" in
x86_64-*-nacl*)
AC_DEFINE(__mono_ilp32__, 1, [64 bit mode with 4 byte longs and pointers])
sizeof_register=8
;;
esac
;;
sparc*-*-*)
if test "x$ac_cv_sizeof_void_p" = "x8"; then
@@ -3184,6 +3241,13 @@ case "$host" in
ACCESS_UNALIGNED="no"
CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
;;
# TODO: make proper support for NaCl host.
# arm*-*nacl)
# TARGET=ARM;
# arch_target=arm;
# ACCESS_UNALIGNED="no"
# AOT_SUPPORTED="no"
# ;;
aarch64-*)
# https://lkml.org/lkml/2012/7/15/133
TARGET=ARM64
@@ -3202,6 +3266,77 @@ case "$host" in
;;
esac
COREFX_PAL_SUPPORTED=no
COREFX_PAL_ARCH=
COREFX_PAL_OS=
case "$host" in
i*86-*-linux*)
COREFX_PAL_SUPPORTED=yes
COREFX_PAL_ARCH=x86
COREFX_PAL_OS=Linux
;;
i*86-*-darwin*)
COREFX_PAL_SUPPORTED=yes
COREFX_PAL_ARCH=x86
COREFX_PAL_OS=OSX
;;
i*86-*-freebsd*|i*86-*-kfreebsd-gnu*)
COREFX_PAL_SUPPORTED=yes
COREFX_PAL_ARCH=x86
COREFX_PAL_OS=FreeBSD
;;
x86_64-*-linux*|amd64-*-linux*)
COREFX_PAL_SUPPORTED=yes
COREFX_PAL_ARCH=x64
COREFX_PAL_OS=Linux
;;
x86_64-*-darwin*|amd64-*-darwin*)
COREFX_PAL_SUPPORTED=yes
COREFX_PAL_ARCH=x64
COREFX_PAL_OS=OSX
;;
x86_64-*-freebsd*|amd64-*-freebsd*|x86_64-*-kfreebsd-gnu*|amd64-*-kfreebsd-gnu*)
COREFX_PAL_SUPPORTED=yes
COREFX_PAL_ARCH=x64
COREFX_PAL_OS=FreeBSD
;;
arm*-*-darwin*)
COREFX_PAL_SUPPORTED=yes
COREFX_PAL_ARCH=arm
COREFX_PAL_OS=OSX
;;
arm*-*-linux*)
COREFX_PAL_SUPPORTED=yes
COREFX_PAL_ARCH=arm
COREFX_PAL_OS=Linux
;;
arm*-*-freebsd*|arm*-*-kfreebsd-gnu*)
COREFX_PAL_SUPPORTED=yes
COREFX_PAL_ARCH=arm
COREFX_PAL_OS=FreeBSD
;;
aarch64-*-darwin*)
COREFX_PAL_SUPPORTED=yes
COREFX_PAL_ARCH=arm64
COREFX_PAL_OS=OSX
;;
aarch64-*-linux*)
COREFX_PAL_SUPPORTED=yes
COREFX_PAL_ARCH=arm64
COREFX_PAL_OS=Linux
;;
aarch64-*-freebsd*|aarch64-*-kfreebsd-gnu*)
COREFX_PAL_SUPPORTED=yes
COREFX_PAL_ARCH=arm64
COREFX_PAL_OS=FreeBSD
;;
esac
AM_CONDITIONAL(COREFX_PAL_SUPPORTED, [test x$COREFX_PAL_SUPPORTED = xyes])
AC_SUBST(COREFX_PAL_ARCH)
AC_SUBST(COREFX_PAL_OS)
HOST=$TARGET
if test "x$host" != "x$target"; then
@@ -3244,6 +3379,38 @@ if test "x$host" != "x$target"; then
sizeof_register=8
target_byte_order=G_BIG_ENDIAN
;;
x86_64-*-nacl)
TARGET=AMD64
arch_target=amd64
AC_DEFINE(TARGET_AMD64, 1, [...])
AC_DEFINE(__mono_ilp32__, 1, [64 bit mode with 4 byte longs and pointers])
sizeof_register=8
;;
# TODO: make proper support for NaCl target.
# arm*-*nacl)
# TARGET=ARM
# arch_target=arm
# AC_DEFINE(TARGET_ARM, 1, [...])
# ACCESS_UNALIGNED="no"
# sizeof_register=4
# CPPFLAGS="$CPPFLAGS \
# -D__ARM_EABI__ \
# -D__arm__ \
# -D__portable_native_client__ \
# -Dtimezone=_timezone \
# -DDISABLE_SOCKETS \
# -DDISABLE_ATTACH \
# -DUSE_NEWLIB"
# Can't use tls, since it depends on the runtime detection of tls offsets
# in mono-compiler.h
# with_tls=pthread
# ;;
i686-*-nacl)
TARGET=X86
arch_target=x86
AC_DEFINE(TARGET_X86, 1, [...])
sizeof_register=4
;;
arm*-linux-*)
TARGET=ARM;
arch_target=arm;
@@ -3534,11 +3701,6 @@ fi
AM_CONDITIONAL(ENABLE_INTERPRETER, [test x$enable_interpreter = xyes])
if test "x$enable_interpreter" = "xyes" || test "x$mono_feature_disable_jit" != "xyes"; then
AC_DEFINE(HAVE_ONLINE_VES, 1, [Some VES is available at runtime])
fi
AM_CONDITIONAL(HAVE_ONLINE_VES, [test x$enable_interpreter = xyes] || [test x$mono_feature_disable_jit != xyes])
dnl
dnl Simple Generational checks (sgen)
@@ -4140,7 +4302,7 @@ AC_SUBST(mono_build_root)
mono_runtime=mono/mini/mono
AC_SUBST(mono_runtime)
CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.2.3.1/tools/csc.exe
CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.2.1.0/tools/csc.exe
if test $csc_compiler = mcs; then
CSC=$mcs_topdir/class/lib/build/mcs.exe
@@ -4335,6 +4497,7 @@ scripts/mono-find-provides
scripts/mono-find-requires
mono/Makefile
mono/btls/Makefile
mono/pal/Makefile
mono/utils/Makefile
mono/metadata/Makefile
mono/dis/Makefile
+1
View File
@@ -12,6 +12,7 @@
<dllmap dll="db2cli" target="libdb2_36@libsuffix@" os="!windows"/>
<dllmap dll="MonoPosixHelper" target="$mono_libdir/libMonoPosixHelper@libsuffix@" os="!windows" />
<dllmap dll="libmono-btls-shared" target="$mono_libdir/libmono-btls-shared@libsuffix@" os="!windows" />
<dllmap dll="System.Native" target="$mono_libdir/System.Native@libsuffix@" os="!windows" />
<dllmap dll="i:msvcrt" target="@LIBC@" os="!windows"/>
<dllmap dll="i:msvcrt.dll" target="@LIBC@" os="!windows"/>
<dllmap dll="sqlite" target="@SQLITE@" os="!windows"/>
+1 -1
View File
@@ -32,7 +32,7 @@ typedef signed @GSIZE@ gssize;
#define G_HAVE_ISO_VARARGS
#endif
#if defined (HOST_WATCHOS)
#if defined (__native_client__) || defined (HOST_WATCHOS)
#undef G_BREAKPOINT
#define G_BREAKPOINT()
#endif
+10
View File
@@ -154,6 +154,15 @@ g_file_open_tmp (const gchar *tmpl, gchar **name_used, GError **error)
gchar *
g_get_current_dir (void)
{
#ifdef __native_client__
char *buffer;
if ((buffer = g_getenv("NACL_PWD"))) {
buffer = g_strdup(buffer);
} else {
buffer = g_strdup(".");
}
return buffer;
#else
int s = 32;
char *buffer = NULL, *r;
gboolean fail;
@@ -172,4 +181,5 @@ g_get_current_dir (void)
* so we return the buffer here since it has a pointer to the valid string
*/
return buffer;
#endif
}
Vendored Submodule
+1
Submodule external/buildtools added at b5cc6e6ab5.
+1 -1
+1 -1
+1 -1
+1 -1
+1 -1
+1 -1
-10
View File
@@ -181,16 +181,6 @@ Gives the path for the temporary LLVM bitcode file created during AOT.
.I info
Print the architecture the AOT in this copy of Mono targets and quit.
.TP
.I interp
Generates all required wrappers, so that it is possible to run --interpreter without
any code generation at runtime. This option only makes sense with \fBmscorlib.dll\fR.
Embedders can set
.nf
mono_jit_set_aot_mode (MONO_AOT_MODE_INTERP);
.fi
.ne
.TP
.I ld-flags
Additional flags to pass to the C linker (if the current AOT mode calls for invoking it).
.TP
+3 -1
View File
@@ -1,5 +1,7 @@
This list of authors is outdated. For a full list of contributors
check out the git history.
see:
http://www.go-mono.com/archive/mono-1.0.html
C# Compiler:
Miguel de Icaza ([email protected])
+340 -1
View File
@@ -1 +1,340 @@
See LICENSE file in the project root for full license information.
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
+477 -1
View File
@@ -1 +1,477 @@
Please see http://www.mono-project.com/community/contributing/coding-guidelines/ for latest guidelines.
* Coding Style for the Mono C# source code.
* Class Libraries and Assembly Layout
The class libraries are grouped together in the assemblies
they belong.
Each directory here represents an assembly, and inside each
directory we divide the code based on the namespace they
implement.
In addition, each assembly directory contains a Test directory
that holds the NUnit tests for that assembly.
We use a new build system which is described by various README
files in mcs/build
The build process typically builds an assembly, but in some
cases it also builds special versions of the assemblies
intended to be used for testing.
* Missing implementation bits
If you implement a class and you are missing implementation bits,
please use the attribute [MonoTODO]. This attribute can be used
to programatically generate our status web pages:
[MonoTODO("My Function is not available on Mono")]
int MyFunction ()
{
throw new NotImplementedException ();
}
Ideally, write a human description of the reason why there is
a MonoTODO, this will be useful in the future for our
automated tools that can assist in developers porting their code.
* Tagging buggy code
If there is a bug in your implementation tag the problem by using
the word "FIXME" in the code, together with a description of the
problem.
Do not use XXX or obscure descriptions, because otherwise people
will not be able to understand what you mean.
* Tagging Problematic specs.
If the documentation and the Microsoft implementation do
differ (you wrote a test case to prove this), I suggest that you edit
the file `mcs/class/doc/API-notes' so we can keep track of these problems
and submit our comments to ECMA or Microsoft and seek clarification.
Sometimes the documentation might be buggy, and sometimes the implementation
might be buggy. Lets try to identify and pinpoint which one
is the correct one.
Sometimes the specification will be lame (consider Version.ToString (fieldCount)
where there is no way of knowing how many fields are available, making the API
not only stupid, but leading to unreliable code).
In those cases, use the keyword "LAMESPEC".
* Coding considerations and style.
In order to keep the code consistent, please use the following
conventions. From here on `good' and `bad' are used to attribute
things that would make the coding style match, or not match. It is not
a judgement call on your coding abilities, but more of a style and
look call. Please try to follow these guidelines to ensure prettiness.
Use 8 space tabs for writing your code (hopefully we can keep
this consistent). If you are modifying someone else's code, try
to keep the coding style similar.
Since we are using 8-space tabs, you might want to consider the Linus
Torvals trick to reduce code nesting. Many times in a loop, you will
find yourself doing a test, and if the test is true, you will nest.
Many times this can be changed. Example:
for (i = 0; i < 10; i++) {
if (something (i)) {
do_more ();
}
}
This take precious space, instead write it like this:
for (i = 0; i < 10; i++) {
if (!something (i))
continue;
do_more ();
}
* Performance and readability
It is more important to be correct than to be fast.
It is more important to be maintainable than to be fast.
Fast code that is difficult to maintain is likely going to
be looked down upon.
* Style Guidelines
* Use a space before an opening parenthesis when calling
functions, or indexing, like this:
method (a);
b [10];
* Do not put a space after the opening parenthesis and the
closing one, ie:
good: method (a); array [10];
bad: method ( a ); array[ 10 ];
* Inside a code block, put the opening brace on the same line
as the statement:
good:
if (a) {
code ();
code ();
}
bad:
if (a)
{
code ();
code ();
}
* Avoid using unnecessary open/close braces, vertical space
is usually limited:
good:
if (a)
code ();
bad:
if (a) {
code ();
}
* When defining a method, use the C style for brace placement,
that means, use a new line for the brace, like this:
good:
void Method ()
{
}
bad:
void Method () {
}
* Properties and indexers are an exception, keep the
brace on the same line as the property declaration.
Rationale: this makes it visually
simple to distinguish them.
good:
int Property {
get {
return value;
}
}
bad:
int Property
{
get {
return value;
}
}
Notice how the accessor "get" also keeps its brace on the same
line.
For very small properties, you can compress things:
ok:
int Property {
get { return value; }
set { x = value; }
}
* Use white space in expressions liberally, except in the presence
of parenthesis:
good:
if (a + 5 > method (blah () + 4))
bad:
if (a+5>method(blah()+4))
* For any new files, please use a descriptive introduction, like
this:
//
// System.Comment.cs: Handles comments in System files.
//
// Author:
// Juan Perez ([email protected])
//
// (C) 2002 Address, Inc (http://www.address.com)
//
* If you are modyfing someone else's code, and your contribution
is significant, please add yourself to the Authors list.
* Switch statements have the case at the same indentation as the
switch:
switch (x) {
case 'a':
...
case 'b':
...
}
* Argument names should use the camel casing for
identifiers, like this:
good:
void Method (string myArgument)
bad:
void Method (string lpstrArgument)
void Method (string my_string)
* Empty methods: They should have the body of code using two
lines, in consistency with the rest:
good:
void EmptyMethod ()
{
}
bad:
void EmptyMethod () {}
void EmptyMethod ()
{}
* Line length: The line length for C# source code is 134 columns.
If your function declaration arguments go beyond
this point, please align your arguments to match the
opening brace, like this:
void Function (int arg, string argb,
int argc)
{
}
When invoking functions, the rule is different, the
arguments are not aligned with the previous
argument, instead they begin at the tabbed position,
like this:
void M ()
{
MethodCall ("Very long string that will force",
"Next argument on the 8-tab pos",
"Just like this one")
}
* Variable declaration indentation.
Sometimes it is convenient to indent the variables to make the code
look pretier, but do not add gratuitous space, try to use the minimally
necessary space, for example:
Good:
void Method ()
{
string b;
int a;
byte c;
}
Bad:
void Method ()
{
string b;
int a;
byte c;
}
* Braces and the `else' clause
If there are braces closing or opening next to the else clause,
they go on the same line as the word `else', for example:
Good:
if (..) {
} else {
}
Bad:
if (..) {
}
else {
}
Bad:
if (..) {
} else
{
}
Bad:
if (..) {
}
else
{
}
* RCS and CVS tags
Some users like to use the special RCS/CVS tags in their
source code: $id$, $log$ and so on.
The use of these is not permitted on the Mono source code
repository. This metadata belongs on a ChangeLog or in the
SVN metadata.
* File formats
Historically our repository has used a mix of line-endings,
this is a mistake that we are trying hard to fix.
For existing files, please make sure that you do not convert
the file, as that causes us to loose precious history (the
full file is commited).
For new files that you create, please make sure that you use
Subversion's support for mapping the line endings
automatically, after adding your file:
$ svn add file.cs
Execute this command:
$ svn propset svn:eol-style native file.cs
Which will make the file automatically receive the proper
treatment from that point on.
Please verify before commiting that your changes wont loose
history, you can do this by running:
$ svn diff
And examining the output.
* Warnings
Avoid commiting code with warnings to the repository, the use
of #pragmas to disable warnings is strongly discouraged, but
can be used on unique cases. Please justify the use of the
warning ignore clause on a comment.
Do not commit changes to the Makefiles that removes warnings,
if anything warnings should be eliminated one at a time, and
if not possible, they must be flagged.
* Examples:
class X : Y {
bool Method (int argument_1, int argument_2)
{
if (argument_1 == argument_2)
throw new Exception (Locale.GetText ("They are equal!");
if (argument_1 < argument_2) {
if (argument_1 * 3 > 4)
return true;
else
return false;
}
//
// This sample helps keep your sanity while using 8-spaces for tabs
//
VeryLongIdentifierWhichTakesManyArguments (
Argument1, Argument2, Argument3,
NestedCallHere (
MoreNested));
}
bool MyProperty {
get {
return x;
}
set {
x = value;
}
}
void AnotherMethod ()
{
if ((a + 5) != 4) {
}
while (blah) {
if (a)
continue;
b++;
}
}
}
* Conditional compilation
Ideally we would not need conditional compilation, and the use
of #ifdef is strongly discouraged. But due to our support for
old C# 1.0 compilers we have to use it in a few places.
Try to avoid negative tests that have an else clause, for
example:
#if !NET_2_0
CODE_FOR_1_0
#else
CODE_FOR_2_0
#endif
Instead use:
#if NET_2_0
CODE_FOR_2_0
#else
CODE_FOR_1_0
#endif
When a major feature differs across compilation targets, try
to factor out the code into a separate class, a helper class
or a separate file, and include that in your profile while
surrounding that helper file/class with the ifdefs to reduce
the amount of ifdefs in the code.
For instance, this is used for some parts of Grasshopper where
the code is ifdefed out, when large parts of a file would have
been ifdefed out, we moved the code into a MyOtherFile.jvm.cs
For 2.0 classes, this is even simpler as code can be trivially
factored out into
MyHelperClass.cli.cs
MyHelperClass.jvm.cs
By using partial classes.
+108 -4
View File
@@ -23,7 +23,7 @@ compilers and tools.
* *
*********************************************************************
If you only want to build a snapshot or a fresh checkout of the
If you only want to build a snapshot or a fresh CVS checkout of the
sources, you should go into the `mono' sibling directory and issue the
make command, like this:
@@ -35,6 +35,72 @@ make command, like this:
The compilation is bundled with the build due to dependencies on the
class libraries on the runtime.
Build Features for Developers of Mono.
======================================
These instructions apply to both Linux and Windows. To build this
package, you must already have a C# compiler installed. This means
that to build on Linux, you need to get a distribution of the MCS
binaries; these are called monocharges. They can be found at
www.go-mono.com/daily. On Windows, you can just use the
Microsoft compiler. You also need GNU make to build the software (on
Windows, you will need for example the Cygwin environment setup).
You can customize your MCS configuration by using:
./configure [--prefix=PREFIX] [--profile=PROFILE]
If you do not run the above, the defaults are /usr/local for the
prefix, and `default' for the profile.
To build the compiler and class libraries, run:
make
The libraries will be placed in the directory class/lib/ and the mcs
compiler executable in mcs/.
To install them, run the following:
make install
If you get "corlib out of sync" errors, try
make PROFILE="atomic"
A better alternative would be to fire off a 'make' from a sibling or
parent 'mono/' tree.
Troubleshooting
===============
We try to maintain the CVS tree such that it is bootstrapable from the
latest released version of mono and mcs. Occasionally, something in the
compiler or runtime changes enough that an existing installation cannot
complete a bootstrap from cvs. In this case, go to
http://go-mono.com/daily and download a monocharge or monolite tarball.
Unpack and copy the .dlls to $prefix/lib and .exes to $prefix/bin/.
Then you should be able to complete the build normally (i.e. using make
bootstrap).
wget http://go-mono.com/daily/monolite-20040505.tar.gz
tar -zxvf monolite-20040505.tar.gz
cd monolite-20040505
env prefix=/usr/local sh recharge.sh
Monocharges
===========
If you are tracking Mono's development, you may sometimes need to share
the compiled libraries with others, you can do:
make monocharge
Or a light version, which contains only the essential libraries and
results in a much smaller file:
make monocharge-lite
Configuration
=============
@@ -44,15 +110,48 @@ place your configuration options in build/config.make
A list of variables that control the build are listed in the file
build/config-default.make.
Build profiles? What?
======================
Don't worry about them too much. If you're wondering which to use:
use the default if you can (that's why it's the default!) and use
the atomic if you have to.
The default profile uses the C# compiler and class libaries as they
are built. This lets you build MCS without needing to have already
installed it, but can fail if the libraries change significantly.
(This is the source of the dreaded "corlib out of sync" warning, most
of the time.)
The atomic profile tries to use the system compiler and preexisting
MCS libraries. New libaries are built against this constant reference
point, so if a newly built library has a binary incompatibility, the
rest of your build can proceed.
If you want to always use the atomic profile, run this command:
./configure --profile=atomic
More About the Build System
===========================
More information is found in build/README.*. Here's a quick rundown
of the features:
* Unified build system for Windows and Linux. Windows is still
fairly untested, but "should work." Unfortunately I don't
have a Windows machine to test on, but Gonzalo can get
corlib to build I think and that's about as complicated as
it gets.
* Profile support. 'make PROFILE=profilename' or 'export
PROFILE=profilename ; make' will work. Profiles are defined
in build/profiles/profilename.make ;
in build/profiles/profilename.make ; right now there isn't
too much going on. The 'bootstrap' profile will build the
way makefile.gnu did on Linux, by setting MONO_PATH and
using mcs/mcs.exe; the default profile will build against
the existing system libraries and compile with 'mcs', which
should reduce a lot of 'corlib out of sync' warnings.
* Important variables are shared among makefiles now; you can
edit build/config.make (see build/config-default.make for a
@@ -65,11 +164,16 @@ of the features:
* Test libraries now live in class/Library/Library_test.dll,
not class/Library/Test. 'make test' will build the test DLL,
'make run-test' will actually run the nunit tests.
'make run-test' will actually run the nunit tests. Set the
variable TEST_HARNESS to run with a program other than
nunit-console (for example, nunit-gtk).
* Standardized recursive targets: all, clean, install, test,
run-test. Read build/README.makefiles for definitions of
what they should do
* (Relatively) sane 'make dist' target; 'make distcheck'
support;
support; cute 'make monocharge' and 'make monocharge-lite'
targets. They're made possible because 'make install' now
supports DESTDIR a la automake, which I'm sure someone cares
about.
+25 -2
View File
@@ -95,7 +95,8 @@ DISTFILES = \
mkinstalldirs \
MonoIcon.png \
README \
ScalableMonoIcon.svg
ScalableMonoIcon.svg \
winexe.in
dist-local: dist-default
@@ -137,12 +138,34 @@ distcheck: dist-tarball
rm -f before.list after.list distdist.list ; \
rm -rf $(package) InstallTest
monocharge:
chargedir=monocharge-`date -u +%Y%m%d` ; \
mkdir "$$chargedir" ; \
DESTDIR=`cd "$$chargedir" && pwd` ; \
$(MAKE) install DESTDIR="$$DESTDIR" || exit 1 ; \
tar cvjf "$$chargedir".tar.bz2 "$$chargedir" ; \
rm -rf "$$chargedir"
# A bare-bones monocharge.
monocharge-lite:
chargedir=monocharge-lite-`date -u +%Y%m%d` ; \
mkdir "$$chargedir" ; \
DESTDIR=`cd "$$chargedir" && pwd` ; \
$(MAKE) -C mcs install DESTDIR="$$DESTDIR" || exit 1; \
$(MAKE) -C class/corlib install DESTDIR="$$DESTDIR" || exit 1; \
$(MAKE) -C class/System install DESTDIR="$$DESTDIR" || exit 1; \
$(MAKE) -C class/System.XML install DESTDIR="$$DESTDIR" || exit 1; \
$(MAKE) -C class/Mono.CSharp.Debugger install DESTDIR="$$DESTDIR" || exit 1; \
tar cvjf "$$chargedir".tar.bz2 "$$chargedir" ; \
rm -rf "$$chargedir"
# Targets for creating API diffs of the framework
MONO_API_SNAPSHOT_PATH := $(topdir)../external/api-snapshot/
GENAPI := $(MONO_API_SNAPSHOT_PATH)tools/genapi/GenAPI.exe
MONO_API_SNAPSHOT_PROFILE_PATH := $(MONO_API_SNAPSHOT_PATH)profiles/$(PROFILE)/
MONO_API_ASSEMBLIES_IGNORED := $(addprefix $(topdir)class/lib/$(PROFILE)/, Mono.CSharp.dll SystemWebTestShim.dll standalone-runner-support.dll nunit.core.dll nunit.core.extensions.dll nunit.core.interfaces.dll nunit.framework.dll nunit.framework.extensions.dll nunit.mocks.dll nunit.util.dll nunit-console-runner.dll nunitlite.dll)
MONO_API_ASSEMBLIES_IGNORED := $(addprefix $(topdir)class/lib/$(PROFILE)/, SystemWebTestShim.dll standalone-runner-support.dll nunit.core.dll nunit.core.extensions.dll nunit.core.interfaces.dll nunit.framework.dll nunit.framework.extensions.dll nunit.mocks.dll nunit.util.dll nunit-console-runner.dll nunitlite.dll)
MONO_API_ASSEMBLIES := $(filter-out $(MONO_API_ASSEMBLIES_IGNORED), $(wildcard $(topdir)class/lib/$(PROFILE)/*.dll)) $(wildcard $(topdir)class/lib/$(PROFILE)/Facades/*.dll)
MONO_API_ASSEMBLIES_CS := $(MONO_API_ASSEMBLIES:$(topdir)class/lib/$(PROFILE)/%.dll=$(MONO_API_SNAPSHOT_PROFILE_PATH)%.cs)
+19 -20
View File
@@ -19,34 +19,31 @@ package module which drives the compilation of this directory.
class/
The class libraries.
docs/
Some notes on the compiler and the class libraries.
errors/
Sample programs that should generate errors by the C# compiler.
ilasm/
The IL assembler.
jay/
Yacc-based parser generator.
mcs/
The Mono C# compiler
nunit24/
An old copy of the NUnit 2.4 library that we ship for historical reasons.
packages/
Integrates some packages from NuGet (like Roslyn) into the build system.
tests/
Regression test suite for the C# compiler
docs/
Some notes on the compiler and the class libraries.
nant/
A copy of nant source code, used during the build process
on Windows.
tools/
Various small development tools: CorCompare used to compare
two assemblies for differences in the API; csharp is a C# REPL;
cil-strip trims IL from assemblies.
two assemblies for differences in the API; TypeReflector is
a tool used to introspect types from assemblies from the
command line; MonoStyle helps you keep your code indendented
with the Mono programming style.
* Building Individual Directories
=================================
@@ -54,14 +51,14 @@ package module which drives the compilation of this directory.
You can build individual components in the hierarchy by running the command
"make", and to install it use "make install".
By default, the 4.x profile is built, if you want to build other profiles,
By default, the 2.x profile is built, if you want to build the net 1.1 profile,
use the following command:
make PROFILE=<profilename>
make PROFILE=net_1_1
And to install:
make PROFILE=<profilename> install
make PROFILE=net_1_1 install
To turn on verbose mode in the build (for example to diagnose a
problem), you can use the V=1 flag, like this:
@@ -71,14 +68,16 @@ problem), you can use the V=1 flag, like this:
* Running Unit tests
====================
You can run unit tests in individual components by running the command:
You can run unit tests in individual components by running the command
"make run-test". If you want to run tests for a different profile (say
'net_1_1')
make run-test
make run-test PROFILE=net_1_1
If you want to only run the tests in a single fixture (say
'MonoTests.System.TypeTest'), you can use
make run-test TEST_FIXTURE=System.TypeTest
make run-test TEST_HARNESS_FLAGS=/fixture:MonoTests.System.TypeTest
* Acknowledgements
==================
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\ExtensionPack\MSBuild.ExtensionPack.tasks"/>
<Target Name="Build">
<Copy SourceFiles="common\Consts.cs.in" DestinationFiles="common\Consts.cs"/>
<MSBuild.ExtensionPack.FileSystem.File TaskAction="Replace" RegexPattern="@MONO_VERSION@" Replacement="2.7.0.0" Files="common\Consts.cs"/>
</Target>
</Project>
+2
View File
@@ -0,0 +1,2 @@
/Mono.Common.targets -crlf
/Mono.Default.targets -crlf
+28
View File
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\ExtensionPack\MSBuild.ExtensionPack.tasks"/>
<PropertyGroup Condition=" '$(USE_MONO_COMPILER)' == '1' ">
<CscToolExe>gmcs.bat</CscToolExe>
<CscToolPath>C:\MonoExperimental2.5.0\bin</CscToolPath>
</PropertyGroup>
<PropertyGroup Condition=" ('$(Configuration)' == 'basic' Or '$(Configuration)' == 'basic_XML_DEP') ">
<OutputPath Condition=" '$(OutputPath)' == '' ">$(MSBuildProjectDirectory)\..\lib\basic\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'net_2_0_bootstrap' ">
<OutputPath Condition=" '$(OutputPath)' == '' ">$(MSBuildProjectDirectory)\..\lib\net_2_0_bootstrap\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<OutputPath Condition=" '$(OutputPath)' == '' ">$(MSBuildProjectDirectory)\..\lib\$(Configuration)\</OutputPath>
</PropertyGroup>
<Target Name="SetupProject">
<Copy SourceFiles="$(ResponseFile)" DestinationFiles="$(ResponseFile).msbuild"/>
<MSBuild.ExtensionPack.FileSystem.File TaskAction="Replace" RegexPattern="/" Replacement="\" Files="$(ResponseFile).msbuild"/>
<MakeDir Directories="$(OutputDirectory)"/>
</Target>
<PropertyGroup Condition=" '$(ResponseFile)' == '' ">
<ResponseFile>$(MSBuildProjectName).dll.sources</ResponseFile>
</PropertyGroup>
<PropertyGroup>
<CompilerResponseFile>$(ResponseFile).msbuild</CompilerResponseFile>
</PropertyGroup>
</Project>
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">net_2_0</Configuration>
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
</PropertyGroup>
</Project>
+5 -5
View File
@@ -1,6 +1,6 @@
# -*- makefile -*-
monolite_path := $(topdir)/class/lib/monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)
monolite_path := $(topdir)/class/lib/monolite/$(MONO_CORLIB_VERSION)
with_mono_path_monolite = MONO_PATH="$(monolite_path)$(PLATFORM_PATH_SEPARATOR)$(monolite_path)/Facades$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH"
@@ -90,7 +90,7 @@ ifdef use_monolite
do-get-monolite:
do-profile-check-monolite:
@echo "*** The contents of your 'monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)' directory may be out-of-date" 1>&2
@echo "*** The contents of your 'monolite/$(MONO_CORLIB_VERSION)' directory may be out-of-date" 1>&2
@echo "*** You may want to try 'make get-monolite-latest'" 1>&2
rm -f $(monolite_flag)
exit 1
@@ -98,12 +98,12 @@ do-profile-check-monolite:
else
do-get-monolite:
@echo "*** Downloading bootstrap required 'monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)'" 1>&2
$(MAKE) $(MAKE_Q) -C $(topdir)/class get-monolite-latest
@echo "*** Downloading bootstrap required 'monolite/$(MONO_CORLIB_VERSION)'" 1>&2
$(MAKE) $(MAKE_Q) -C $(mono_build_root) get-monolite-latest
do-profile-check-monolite: $(depsdir)/.stamp
@echo "*** The runtime '$(PROFILE_RUNTIME)' doesn't appear to be usable." 1>&2
@echo "*** Trying the 'monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)' directory." 1>&2
@echo "*** Trying the 'monolite/$(MONO_CORLIB_VERSION)' directory." 1>&2
@echo dummy > $(monolite_flag)
$(MAKE) do-profile-check
+1 -3
View File
@@ -6,14 +6,12 @@ BUILD_TOOLS_PROFILE = basic
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_CSC)
MCS = $(BOOTSTRAP_MCS)
PLATFORMS = darwin linux win32
# nuttzing!
profile-check:
@:
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/mscorlib.dll
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES)
NO_SIGN_ASSEMBLY = yes
-2
View File
@@ -2,8 +2,6 @@
include $(topdir)/build/profiles/net_4_x.make
PLATFORMS:=
PARENT_PROFILE = ../net_4_x$(if $(PROFILE_PLATFORM),-$(PROFILE_PLATFORM))/
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/net_4_x$(if $(PROFILE_PLATFORM),-$(PROFILE_PLATFORM))/mscorlib.dll
PROFILE_MCS_FLAGS += -d:XBUILD_12
+7 -5
View File
@@ -20,10 +20,9 @@ TEST_RUNTIME_WRAPPERS_PATH = $(shell dirname $(RUNTIME))/_tmpinst/bin
ifndef NO_TEST
test_nunit_lib = nunitlite.dll
xunit_core := xunit.core xunit.abstractions xunit.assert Xunit.NetCore.Extensions
xunit_core := xunit.core xunit.abstractions xunit.assert
xunit_deps := System.Runtime
xunit_src := $(patsubst %,$(topdir)/../external/xunit-binaries/%,BenchmarkAttribute.cs BenchmarkDiscover.cs)
xunit_class_deps :=
xunit_class_deps := Xunit.NetCore.Extensions
xunit_libs_ref = $(patsubst %,-r:$(topdir)/../external/xunit-binaries/%.dll,$(xunit_core))
xunit_libs_ref += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/Facades/%.dll,$(xunit_deps))
@@ -90,6 +89,9 @@ endif
tests_CLEAN_FILES += $(topdir)/build/deps/nunit-$(PROFILE).stamp
$(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)Xunit.NetCore.Extensions.dll:
$(MAKE) -C $(topdir)/class/Xunit.NetCore.Extensions
endif
test_assemblies :=
@@ -220,8 +222,8 @@ run-xunit-test-lib: xunit-test-local
$$ok
@rm -f xunit.execution.desktop.dll
$(xunit_test_lib): $(the_assembly) $(xtest_response) $(xunit_libs_dep) $(xunit_src)
$(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response) $(xunit_src)
$(xunit_test_lib): $(the_assembly) $(xtest_response) $(xunit_libs_dep)
$(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response)
xtest_response_preprocessed = $(xtest_response)_preprocessed
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyCompany ("Xamarin, Inc.")]
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
[assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
[assembly: AssemblyVersion ("4.2.1.0")]
[assembly: AssemblyVersion ("4.1.0.0")]
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
[assembly: AssemblyFileVersion ("4.0.0.0")]
@@ -21,159 +21,39 @@
//
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.DBNull))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.AcceptRejectRule))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.CommandBehavior))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.CommandType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.CatalogLocation))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DataAdapter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DataColumnMapping))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DataColumnMappingCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DataTableMapping))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DataTableMappingCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbColumn))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbCommand))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbCommandBuilder))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbConnection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbConnectionStringBuilder))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbDataAdapter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbDataReader))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbDataReaderExtensions))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbDataRecord))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbDataSourceEnumerator))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbEnumerator))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbMetaDataCollectionNames))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbMetaDataColumnNames))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbParameter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbParameterCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbProviderFactory))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbProviderSpecificTypePropertyAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.DbTransaction))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.GroupByBehavior))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.IDbColumnSchemaGenerator))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.IdentifierCase))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.RowUpdatedEventArgs))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.RowUpdatingEventArgs))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.SchemaTableColumn))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.SchemaTableOptionalColumn))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Common.SupportedJoinOperators))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.ConflictOption))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.ConnectionState))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Constraint))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.ConstraintCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.ConstraintException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DBConcurrencyException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataColumn))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataColumnChangeEventArgs))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataColumnChangeEventHandler))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataColumnCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRelation))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRelationCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRow))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRowAction))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRowBuilder))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRowChangeEventArgs))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRowChangeEventHandler))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRowCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRowState))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRowVersion))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataRowView))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataSet))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataSetDateTime))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataSysDescriptionAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataTable))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataTableClearEventArgs))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataTableClearEventHandler))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataTableCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataTableNewRowEventArgs))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataTableNewRowEventHandler))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataTableReader))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataView))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataViewManager))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataViewRowState))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataViewSetting))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DataViewSettingCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DbType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DeletedRowInaccessibleException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.DuplicateNameException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.EvaluateException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.FillErrorEventArgs))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.FillErrorEventHandler))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.ForeignKeyConstraint))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IColumnMapping))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IColumnMappingCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDataAdapter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDataParameter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDataParameterCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDataReader))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDataRecord))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDbCommand))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDbConnection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDbDataAdapter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDbDataParameter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IDbTransaction))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.ITableMapping))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.ITableMappingCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.InRowChangingEventException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.InternalDataCollectionBase))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.InvalidConstraintException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.InvalidExpressionException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.IsolationLevel))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.KeyRestrictionBehavior))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.LoadOption))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.MappingType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.MergeFailedEventArgs))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.MergeFailedEventHandler))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.MissingMappingAction))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.MissingPrimaryKeyException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.MissingSchemaAction))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.NoNullAllowedException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.ParameterDirection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.PropertyCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.ReadOnlyException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.RowNotInTableException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.Rule))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SchemaSerializationMode))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SchemaType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SerializationFormat))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlDbType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.INullable))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlAlreadyFilledException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlBinary))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlBoolean))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlByte))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlBytes))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlChars))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlCompareOptions))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlDateTime))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlDecimal))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlDouble))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlGuid))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlInt16))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlInt32))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlInt64))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlMoney))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlNotFilledException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlNullValueException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlSingle))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlString))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlTruncateException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlTypeException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.SqlXml))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlTypes.StorageState))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.StateChangeEventArgs))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.StateChangeEventHandler))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.StatementCompletedEventArgs))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.StatementCompletedEventHandler))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.StatementType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.StrongTypingException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SyntaxErrorException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.UniqueConstraint))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.UpdateRowSource))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.UpdateStatus))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.VersionNotFoundException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.XmlReadMode))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.XmlWriteMode))]
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyCompany ("Xamarin, Inc.")]
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
[assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
[assembly: AssemblyVersion ("4.1.1.0")]
[assembly: AssemblyVersion ("4.0.2.0")]
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
[assembly: AssemblyFileVersion ("4.0.0.0")]
@@ -22,19 +22,4 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.StackFrame))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.StackTrace))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.ISymbolBinder))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.ISymbolBinder1))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.ISymbolDocument))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.ISymbolDocumentWriter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.ISymbolMethod))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.ISymbolNamespace))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.ISymbolReader))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.ISymbolScope))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.ISymbolVariable))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.ISymbolWriter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.SymAddressKind))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.SymDocumentType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.SymLanguageType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.SymLanguageVendor))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.SymbolToken))]
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyCompany ("Xamarin, Inc.")]
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")]
[assembly: AssemblyVersion ("4.2.1.0")]
[assembly: AssemblyVersion ("4.1.0.0")]
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
[assembly: AssemblyFileVersion ("4.0.0.0")]
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyCompany ("Xamarin, Inc.")]
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
[assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
[assembly: AssemblyVersion ("4.1.1.0")]
[assembly: AssemblyVersion ("4.0.1.0")]
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
[assembly: AssemblyFileVersion ("4.0.0.0")]
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyCompany ("Xamarin, Inc.")]
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
[assembly: AssemblyCopyright ("Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)")]
[assembly: AssemblyVersion ("4.0.1.0")]
[assembly: AssemblyVersion ("4.0.0.0")]
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
[assembly: AssemblyFileVersion ("4.0.0.0")]
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyCompany ("Xamarin, Inc.")]
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
[assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
[assembly: AssemblyVersion ("4.2.1.0")]
[assembly: AssemblyVersion ("4.1.0.0")]
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
[assembly: AssemblyFileVersion ("4.0.0.0")]
@@ -27,7 +27,6 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.LingerOption))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.MulticastOption))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.NetworkStream))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.ProtocolFamily))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.ProtocolType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.SelectMode))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.SendPacketsElement))]
@@ -39,7 +39,7 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyCompany ("Xamarin, Inc.")]
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
[assembly: AssemblyCopyright ("Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)")]
[assembly: AssemblyVersion ("4.0.3.0")]
[assembly: AssemblyVersion ("4.0.1.0")]
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
[assembly: AssemblyFileVersion ("4.0.0.0")]
@@ -12,7 +12,7 @@ LIBRARY = System.Runtime.InteropServices.RuntimeInformation.dll
RESX_RESOURCE_STRING = ../../../../external/corefx/src/System.Runtime.InteropServices.RuntimeInformation/src/Resources/Strings.resx
KEY_FILE = ../../msfinal.pub
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699,436
SIGN_FLAGS = /delaysign /keyfile:$(KEY_FILE) /nowarn:1616,1699
LIB_REFS = System
LIB_MCS_FLAGS = $(SIGN_FLAGS) /unsafe
@@ -35,9 +35,12 @@ namespace System.Runtime.InteropServices
{
public static class RuntimeInformation
{
[DllImport ("__Internal")]
extern static string mono_get_runtime_build_info ();
public static string FrameworkDescription {
get {
return "Mono " + Mono.Runtime.GetDisplayName ();
return mono_get_runtime_build_info ();
}
}
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyCompany ("Xamarin, Inc.")]
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
[assembly: AssemblyCopyright ("Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)")]
[assembly: AssemblyVersion ("4.2.1.0")]
[assembly: AssemblyVersion ("4.1.1.0")]
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
[assembly: AssemblyFileVersion ("4.0.0.0")]
@@ -25,11 +25,7 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.DataContractAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.DataMemberAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.EnumMemberAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.ExportOptions))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.ExtensionDataObject))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.IExtensibleDataObject))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.IgnoreDataMemberAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.InvalidDataContractException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.KnownTypeAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.OnDeserializedAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.OnDeserializingAttribute))]
@@ -37,13 +33,4 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.OnSerializingAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.SerializationException))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.StreamingContext))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.StreamingContextStates))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.XmlSerializableServices))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.XPathQueryGenerator))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.XsdDataContractExporter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.IFragmentCapableXmlDictionaryWriter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.IStreamProvider))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.IXmlBinaryReaderInitializer))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.IXmlBinaryWriterInitializer))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.IXmlTextReaderInitializer))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Xml.IXmlTextWriterInitializer))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.InvalidDataContractException))]
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyCompany ("Xamarin, Inc.")]
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
[assembly: AssemblyCopyright ("Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)")]
[assembly: AssemblyVersion ("4.3.1.0")]
[assembly: AssemblyVersion ("4.2.0.0")]
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
[assembly: AssemblyFileVersion ("4.0.0.0")]
@@ -21,55 +21,27 @@
//
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Aes))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.AesManaged))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.AsymmetricKeyExchangeDeformatter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.AsymmetricKeyExchangeFormatter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.AsymmetricSignatureDeformatter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.AsymmetricSignatureFormatter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CryptoConfig))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.DeriveBytes))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.DES))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.DSA))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.DSAParameters))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.DSASignatureDeformatter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.DSASignatureFormatter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ECCurve))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ECDiffieHellmanPublicKey))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ECDsa))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ECParameters))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ECPoint))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.HMACMD5))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.HMACSHA1))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.HMACSHA256))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.HMACSHA384))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.HMACSHA512))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.MaskGenerationMethod))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.MD5))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.PKCS1MaskGenerationMethod))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RandomNumberGenerator))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RC2))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Rfc2898DeriveBytes))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Rijndael))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RijndaelManaged))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSA))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSAEncryptionPadding))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSAEncryptionPaddingMode))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSAOAEPKeyExchangeDeformatter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSAOAEPKeyExchangeFormatter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSAParameters))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSAPKCS1KeyExchangeDeformatter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSAPKCS1KeyExchangeFormatter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSAPKCS1SignatureDeformatter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSAPKCS1SignatureFormatter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSASignaturePadding))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSASignaturePaddingMode))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.SHA1))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.SHA1Managed))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.SHA256))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.SHA256Managed))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.SHA384))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.SHA384Managed))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.SHA512))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.SHA512Managed))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.SignatureDescription))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.TripleDES))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ECCurve))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ECParameters))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ECPoint))]
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyCompany ("Xamarin, Inc.")]
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
[assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
[assembly: AssemblyVersion ("4.1.1.0")]
[assembly: AssemblyVersion ("4.0.0.0")]
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
[assembly: AssemblyFileVersion ("4.0.0.0")]
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyCompany ("Xamarin, Inc.")]
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
[assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
[assembly: AssemblyVersion ("4.1.1.0")]
[assembly: AssemblyVersion ("4.0.1.0")]
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
[assembly: AssemblyFileVersion ("4.0.0.0")]
@@ -22,6 +22,5 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.IOCompletionCallback))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.NativeOverlapped))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Overlapped))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.PreAllocatedOverlapped))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.ThreadPoolBoundHandle))]
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyCompany ("Xamarin, Inc.")]
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
[assembly: AssemblyCopyright ("Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)")]
[assembly: AssemblyVersion ("4.0.3.0")]
[assembly: AssemblyVersion ("4.0.1.0")]
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
[assembly: AssemblyFileVersion ("4.0.0.0")]
@@ -30,7 +30,7 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyCompany ("Xamarin, Inc.")]
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
[assembly: AssemblyCopyright ("Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)")]
[assembly: AssemblyVersion ("4.1.1.0")]
[assembly: AssemblyVersion ("4.0.1.0")]
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
[assembly: AssemblyFileVersion ("4.0.0.0")]
+25 -1
View File
@@ -1 +1,25 @@
See LICENSE file in the project root for full license information.
The MIT X11 License covers most of the class libraries in the Mono
project. Some third party libraries come from different projects, and
are licensed under their own terms.
Copyright (c) 2001, 2002, 2003 The Mono Project
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.
+8 -25
View File
@@ -381,7 +381,8 @@ DISTFILES = \
MicrosoftAjaxLibrary/License.htm \
test-helpers/NetworkHelpers.cs \
test-helpers/SocketResponder.cs \
$(foreach HOST_PLATFORM,darwin linux win32,lib/$(monolite_dir)/mcs.exe $(monolite_files))
lib/$(monolite_dir)/mcs.exe \
$(monolite_files)
.PHONY: all-local $(STD_TARGETS:=-local)
all-local $(STD_TARGETS:=-local):
@@ -389,7 +390,7 @@ all-local $(STD_TARGETS:=-local):
all-local-aot:
monolite_dir = monolite-$(HOST_PLATFORM)/$(MONO_CORLIB_VERSION)
monolite_dir := monolite/$(MONO_CORLIB_VERSION)
# Files needed to bootstrap C# compiler
build_files = mscorlib.dll System.dll System.Xml.dll Mono.Security.dll System.Core.dll System.Security.dll System.Configuration.dll \
@@ -412,42 +413,24 @@ lib/$(monolite_dir)/Facades:
$(monolite_files): | lib/$(monolite_dir)
$(monolite_files): | lib/$(monolite_dir)/Facades
$(monolite_files): lib/$(monolite_dir)/%: lib/build-$(HOST_PLATFORM)/%
$(monolite_files): lib/$(monolite_dir)/%: lib/build/%
cp -p $< $@
lib/$(monolite_dir)/mcs.exe:
$(MAKE) -C ../mcs PROFILE=build
cp -p lib/build-$(HOST_PLATFORM)/mcs.exe lib/$(monolite_dir)
cp -p lib/build/mcs.exe lib/$(monolite_dir)
$(build_files:%=lib/build-$(HOST_PLATFORM)/%):
$(build_files:%=lib/build/%):
cd $(topdir) && $(MAKE) profile-do--build--all NO_DIR_CHECK=1 SKIP_AOT=1
dist-monolite: $(monolite_files) lib/$(monolite_dir)/mcs.exe
dist-monolite-all-platforms:
$(MAKE) dist-monolite HOST_PLATFORM=darwin
$(MAKE) dist-monolite HOST_PLATFORM=linux
$(MAKE) dist-monolite HOST_PLATFORM=win32
package-monolite-latest:
MONOLITE=monolite-$(HOST_PLATFORM)-$(MONO_CORLIB_VERSION)-latest; \
MONOLITE=monolite-$(MONO_CORLIB_VERSION)-latest; \
$(MAKE) dist-monolite monolite_dir=$$MONOLITE; \
tar zcvpf $$MONOLITE.tar.gz --directory=lib $$MONOLITE/
package-monolite-latest-all-platforms:
$(MAKE) package-monolite-latest HOST_PLATFORM=darwin
$(MAKE) package-monolite-latest HOST_PLATFORM=linux
$(MAKE) package-monolite-latest HOST_PLATFORM=win32
monolite_url = https://download.mono-project.com/monolite/monolite-$(BUILD_PLATFORM)-$(MONO_CORLIB_VERSION)-latest.tar.gz
get-monolite-latest:
-rm -fr lib/monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)
-mkdir -p lib/monolite-$(BUILD_PLATFORM)
cd lib && { (wget -O- $(monolite_url) || curl -L $(monolite_url)) | gzip -d | tar xf - ; }
cd lib && mv -f monolite-$(BUILD_PLATFORM)-$(MONO_CORLIB_VERSION)-latest monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)
dist-default: dist-monolite-all-platforms
dist-default: dist-monolite
dist-local: dist-default
@@ -58,6 +58,9 @@ corefx/SR.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Conversions.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/COperators.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Declarations/AggregateDeclaration.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Declarations/Declaration.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Declarations/GlobalAttributeDeclaration.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Declarations/NamespaceDeclaration.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ExplicitConversion.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ExpressionBinder.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ExpressionKind.cs
@@ -88,6 +91,7 @@ corefx/SR.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/EventSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/FieldSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/IndexerSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/LabelSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/LocalVariableSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/MethodOrPropertySymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/MethodSymbol.cs
@@ -105,11 +109,13 @@ corefx/SR.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/SymbolTable.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/SymFactory.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/SymFactoryBase.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/TransparentIdentifierMemberSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/TypeParameterSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/UnresolvedAggregateSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/VariableSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ArrayIndex.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ArrayInitialization.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ArrayLength.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Assignment.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/BinaryOperator.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Block.cs
@@ -119,6 +125,7 @@ corefx/SR.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Class.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/CompoundOperator.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Concatenate.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ConditionalOperator.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Constant.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Event.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/EXPR.cs
@@ -228,7 +228,7 @@ namespace MonoTests.Mono.Options
e.Run = (args) => e.CommandSet.Out.WriteLine (string.Join (" ", args));
var o = new StringWriter ();
var c = new CommandSet ("set", output:o, error: Console.Error) {
var c = new CommandSet ("set", output:o) {
e,
};
Assert.AreEqual (0, c.Run (new [] { "help", "echo" }));
@@ -56,7 +56,7 @@ namespace MonoTests.Mono.Options
c, v => { string ignore = v.OptionValues [0]; });
c.Option = p [0];
Utils.AssertException (typeof(ArgumentOutOfRangeException),
$"Specified argument was out of the range of valid values.{Environment.NewLine}Parameter name: index",
"Specified argument was out of the range of valid values.\nParameter name: index",
c, v => { string ignore = v.OptionValues [2]; });
c.OptionName = "-a";
Utils.AssertException (typeof(OptionException),
@@ -374,10 +374,10 @@ namespace MonoTests.Mono.Options
p, v => { v.Parse (_("-a", "-b")); });
Assert.AreEqual (a, "-b");
Utils.AssertException (typeof(ArgumentNullException),
$"Value cannot be null.{Environment.NewLine}Parameter name: option",
"Value cannot be null.\nParameter name: option",
p, v => { v.Add ((Option) null); });
Utils.AssertException (typeof(ArgumentNullException),
$"Value cannot be null.{Environment.NewLine}Parameter name: header",
"Value cannot be null.\nParameter name: header",
p, v => { v.Add ((string) null); });
// bad type
@@ -394,10 +394,10 @@ namespace MonoTests.Mono.Options
p, v => { v.Parse (_("-cz", "extra")); });
Utils.AssertException (typeof(ArgumentNullException),
$"Value cannot be null.{Environment.NewLine}Parameter name: action",
"Value cannot be null.\nParameter name: action",
p, v => { v.Add ("foo", (Action<string>) null); });
Utils.AssertException (typeof(ArgumentException),
$"Cannot provide maxValueCount of 2 for OptionValueType.None.{Environment.NewLine}Parameter name: maxValueCount",
"Cannot provide maxValueCount of 2 for OptionValueType.None.\nParameter name: maxValueCount",
p, v => { v.Add ("foo", (k, val) => {/* ignore */}); });
}
@@ -772,7 +772,7 @@ namespace MonoTests.Mono.Options
Utils.AssertException (typeof(ArgumentException), "prototypes must be null!",
p, v => { v.Add ("N|NUM=", (int n) => {}); });
Utils.AssertException (typeof(ArgumentNullException),
$"Value cannot be null.{Environment.NewLine}Parameter name: option",
"Value cannot be null.\nParameter name: option",
p, v => { v.GetOptionForName (null); });
}
@@ -66,60 +66,60 @@ namespace MonoTests.Mono.Options
{
object p = null;
Utils.AssertException (typeof(ArgumentNullException),
$"Value cannot be null.{Environment.NewLine}Parameter name: prototype",
"Value cannot be null.\nParameter name: prototype",
p, v => { new DefaultOption (null, null); });
Utils.AssertException (typeof(ArgumentException),
$"Cannot be the empty string.{Environment.NewLine}Parameter name: prototype",
"Cannot be the empty string.\nParameter name: prototype",
p, v => { new DefaultOption ("", null); });
Utils.AssertException (typeof(ArgumentException),
$"Empty option names are not supported.{Environment.NewLine}Parameter name: prototype",
"Empty option names are not supported.\nParameter name: prototype",
p, v => { new DefaultOption ("a|b||c=", null); });
Utils.AssertException (typeof(ArgumentException),
$"Conflicting option types: '=' vs. ':'.{Environment.NewLine}Parameter name: prototype",
"Conflicting option types: '=' vs. ':'.\nParameter name: prototype",
p, v => { new DefaultOption ("a=|b:", null); });
Utils.AssertException (typeof(ArgumentException),
$"The default option handler '<>' cannot require values.{Environment.NewLine}Parameter name: prototype",
"The default option handler '<>' cannot require values.\nParameter name: prototype",
p, v => { new DefaultOption ("<>=", null); });
Utils.AssertException (typeof(ArgumentException),
$"The default option handler '<>' cannot require values.{Environment.NewLine}Parameter name: prototype",
"The default option handler '<>' cannot require values.\nParameter name: prototype",
p, v => { new DefaultOption ("<>:", null); });
Utils.AssertException (null, null,
p, v => { new DefaultOption ("t|<>=", null, 1); });
Utils.AssertException (typeof(ArgumentException),
$"The default option handler '<>' cannot require values.{Environment.NewLine}Parameter name: prototype",
"The default option handler '<>' cannot require values.\nParameter name: prototype",
p, v => { new DefaultOption ("t|<>=", null, 2); });
Utils.AssertException (null, null,
p, v => { new DefaultOption ("a|b=", null, 2); });
Utils.AssertException (typeof(ArgumentOutOfRangeException),
$"Specified argument was out of the range of valid values.{Environment.NewLine}Parameter name: maxValueCount",
"Specified argument was out of the range of valid values.\nParameter name: maxValueCount",
p, v => { new DefaultOption ("a", null, -1); });
Utils.AssertException (typeof(ArgumentException),
"Cannot provide maxValueCount of 0 for OptionValueType.Required or " +
$"OptionValueType.Optional.{Environment.NewLine}Parameter name: maxValueCount",
"OptionValueType.Optional.\nParameter name: maxValueCount",
p, v => { new DefaultOption ("a=", null, 0); });
Utils.AssertException (typeof(ArgumentException),
"Ill-formed name/value separator found in \"a={\"." + Environment.NewLine + "Parameter name: prototype",
"Ill-formed name/value separator found in \"a={\".\nParameter name: prototype",
p, v => { new DefaultOption ("a={", null); });
Utils.AssertException (typeof(ArgumentException),
"Ill-formed name/value separator found in \"a=}\"." + Environment.NewLine + "Parameter name: prototype",
"Ill-formed name/value separator found in \"a=}\".\nParameter name: prototype",
p, v => { new DefaultOption ("a=}", null); });
Utils.AssertException (typeof(ArgumentException),
"Ill-formed name/value separator found in \"a={{}}\"." + Environment.NewLine + "Parameter name: prototype",
"Ill-formed name/value separator found in \"a={{}}\".\nParameter name: prototype",
p, v => { new DefaultOption ("a={{}}", null); });
Utils.AssertException (typeof(ArgumentException),
"Ill-formed name/value separator found in \"a={}}\"." + Environment.NewLine + "Parameter name: prototype",
"Ill-formed name/value separator found in \"a={}}\".\nParameter name: prototype",
p, v => { new DefaultOption ("a={}}", null); });
Utils.AssertException (typeof(ArgumentException),
"Ill-formed name/value separator found in \"a={}{\"." + Environment.NewLine + "Parameter name: prototype",
"Ill-formed name/value separator found in \"a={}{\".\nParameter name: prototype",
p, v => { new DefaultOption ("a={}{", null); });
Utils.AssertException (typeof(ArgumentException),
$"Cannot provide key/value separators for Options taking 1 value(s).{Environment.NewLine}Parameter name: prototype",
"Cannot provide key/value separators for Options taking 1 value(s).\nParameter name: prototype",
p, v => { new DefaultOption ("a==", null); });
Utils.AssertException (typeof(ArgumentException),
$"Cannot provide key/value separators for Options taking 1 value(s).{Environment.NewLine}Parameter name: prototype",
"Cannot provide key/value separators for Options taking 1 value(s).\nParameter name: prototype",
p, v => { new DefaultOption ("a={}", null); });
Utils.AssertException (typeof(ArgumentException),
$"Cannot provide key/value separators for Options taking 1 value(s).{Environment.NewLine}Parameter name: prototype",
"Cannot provide key/value separators for Options taking 1 value(s).\nParameter name: prototype",
p, v => { new DefaultOption ("a=+-*/", null); });
Utils.AssertException (null, null,
p, v => { new DefaultOption ("a", null, 0); });
+2 -11
View File
@@ -34,16 +34,9 @@ using System.Reflection;
using System.Runtime.InteropServices;
using System.Security.Permissions;
#if MONO_POSIX_NETSTANDARD_BUILD
[assembly: AssemblyVersion ("1.0.0.0")]
[assembly: AssemblyTitle("Mono.Posix.NETStandard.dll")]
#else
[assembly: AssemblyVersion (Consts.FxVersion)]
[assembly: AssemblyTitle("Mono.Posix.dll")]
#endif
[assembly: AssemblyTitle("Mono.Posix.dll")]
[assembly: AssemblyDescription("Unix Integration Classes")]
[assembly: CLSCompliant (true)]
@@ -55,11 +48,9 @@ using System.Security.Permissions;
*/
#if !MONO_POSIX_NETSTANDARD_BUILD
// We are using ../Open.snk for MONO_POSIX_NETSTANDARD_BUILD
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../mono.pub")]
#endif
/*
* TODO:
*
@@ -1,35 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AssemblyName>Mono.Posix.NETStandard</AssemblyName>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<EnableDefaultItems>false</EnableDefaultItems>
<SignAssembly>true</SignAssembly>
<DelaySign>true</DelaySign>
<AssemblyOriginatorKeyFile>..\Open.snk</AssemblyOriginatorKeyFile>
<!--<BaseIntermediateOutputPath>obj-netstandard2.0</BaseIntermediateOutputPath>
<IntermediateOutputPath>obj-netstandard2.0</IntermediateOutputPath>-->
</PropertyGroup>
<PropertyGroup>
<DefineConstants>$(DefineConstants);MONO_POSIX_NETSTANDARD_BUILD</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(ForceUseLibC)' == 'true'">
<DefineConstants>$(DefineConstants);FORCE_USE_LIBC_NOT_MSVC</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include=".\Assembly\**\*.cs" />
<Compile Include=".\Mono.Posix\**\*.cs" />
<Compile Include=".\Mono.Unix\**\*.cs" />
<Compile Include=".\Mono.Unix.Native\**\*.cs" />
<Compile Include="..\..\build\common\Locale.cs" />
<Compile Remove=".\Mono.Unix.Native\CdeclFunction.cs" />
</ItemGroup>
</Project>
@@ -309,7 +309,6 @@ namespace Mono.Unix.Native {
public delegate void SignalHandler (int signal);
#if !NETSTANDARD2_0
internal class XPrintfFunctions
{
internal delegate object XPrintf (object[] parameters);
@@ -336,7 +335,6 @@ namespace Mono.Unix.Native {
syslog = new XPrintf (_syslog.Invoke);
}
}
#endif
//
// Convention: Functions that are part of the C standard library go here.
@@ -380,11 +378,7 @@ namespace Mono.Unix.Native {
//
public class Stdlib
{
#if FORCE_USE_LIBC_NOT_MSVC
internal const string LIBC = "c";
#else
internal const string LIBC = "msvcrt";
#endif
internal const string MPH = "MonoPosixHelper";
// It is possible for Mono.Posix and MonoPosixHelper to get out of sync,
@@ -777,7 +771,6 @@ namespace Mono.Unix.Native {
return sys_fprintf (stream, "%s", message);
}
#if !NETSTANDARD2_0
[Obsolete ("Not necessarily portable due to cdecl restrictions.\n" +
"Use fprintf (IntPtr, string) instead.")]
public static int fprintf (IntPtr stream, string format, params object[] parameters)
@@ -788,7 +781,6 @@ namespace Mono.Unix.Native {
Array.Copy (parameters, 0, _parameters, 2, parameters.Length);
return (int) XPrintfFunctions.fprintf (_parameters);
}
#endif
/* SKIP: fscanf(3) */
@@ -801,7 +793,6 @@ namespace Mono.Unix.Native {
return sys_printf ("%s", message);
}
#if !NETSTANDARD2_0
[Obsolete ("Not necessarily portable due to cdecl restrictions.\n" +
"Use printf (string) instead.")]
public static int printf (string format, params object[] parameters)
@@ -811,7 +802,6 @@ namespace Mono.Unix.Native {
Array.Copy (parameters, 0, _parameters, 1, parameters.Length);
return (int) XPrintfFunctions.printf (_parameters);
}
#endif
/* SKIP: scanf(3) */
@@ -833,7 +823,6 @@ namespace Mono.Unix.Native {
return sys_snprintf (s, (ulong) s.Capacity, "%s", message);
}
#if !NETSTANDARD2_0
[CLSCompliant (false)]
[Obsolete ("Not necessarily portable due to cdecl restrictions.\n" +
"Use snprintf (StringBuilder, string) instead.")]
@@ -864,7 +853,6 @@ namespace Mono.Unix.Native {
Array.Copy (parameters, 0, _parameters, 3, parameters.Length);
return (int) XPrintfFunctions.snprintf (_parameters);
}
#endif
/*
* SKIP:
@@ -4387,7 +4387,6 @@ namespace Mono.Unix.Native {
return UnixMarshal.EscapeFormatString (message, new char[]{'m'});
}
#if !NETSTANDARD2_0
[Obsolete ("Not necessarily portable due to cdecl restrictions.\n" +
"Use syslog(SyslogFacility, SyslogLevel, string) instead.")]
public static int syslog (SyslogFacility facility, SyslogLevel level,
@@ -4416,7 +4415,6 @@ namespace Mono.Unix.Native {
Array.Copy (parameters, 0, _parameters, 2, parameters.Length);
return (int) XPrintfFunctions.syslog (_parameters);
}
#endif
[DllImport (MPH, SetLastError=true,
EntryPoint="Mono_Posix_Syscall_closelog")]
+7 -25
View File
@@ -300,35 +300,17 @@ public class UnixEncoding : Encoding
throw new ArgumentOutOfRangeException ("byteIndex", _("ArgRange_Array"));
}
unsafe {
fixed (char* p = s) {
fixed (byte* b = bytes) {
return GetBytes (p + charIndex, charCount, b + byteIndex, bytes.Length - byteIndex);
}
}
}
}
public unsafe override int GetBytes(char* chars, int charCount, byte* bytes, int byteCount)
{
if (bytes == null || chars == null)
throw new ArgumentNullException (bytes == null ? "bytes" : "chars");
if (charCount < 0 || byteCount < 0)
throw new ArgumentOutOfRangeException (charCount < 0 ? "charCount" : "byteCount");
// Convert the characters into bytes.
char ch;
int length = byteCount;
int length = bytes.Length;
uint pair;
int posn = 0;
int charIndex = 0;
int posn = byteIndex;
while (charCount > 0) {
// Fetch the next UTF-16 character pair value.
ch = chars [charIndex++];
ch = s[charIndex++];
if (ch >= '\uD800' && ch <= '\uDBFF' && charCount > 1) {
// This may be the start of a surrogate pair.
pair = (uint)(chars[charIndex]);
pair = (uint)(s[charIndex]);
if (pair >= (uint)0xDC00 && pair <= (uint)0xDFFF) {
pair = (pair - (uint)0xDC00) +
((((uint)ch) - (uint)0xD800) << 10) +
@@ -344,7 +326,7 @@ public class UnixEncoding : Encoding
}
charCount -= 2;
if (charCount >= 0) {
bytes[posn++] = (byte)chars [charIndex++];
bytes[posn++] = (byte) s [charIndex++];
}
continue;
} else {
@@ -383,7 +365,7 @@ public class UnixEncoding : Encoding
}
// Return the final count to the caller.
return posn;
return posn - byteIndex;
}
// Internal version of "GetCharCount" which can handle a rolling
@@ -412,7 +394,7 @@ public class UnixEncoding : Encoding
uint leftSoFar = (leftOverCount & (uint)0x0F);
uint leftSize = ((leftOverCount >> 4) & (uint)0x0F);
while (count > 0) {
ch = (uint)(bytes [index++]);
ch = (uint)(bytes[index++]);
++next_raw;
--count;
if (leftSize == 0) {
+15 -30
View File
@@ -325,42 +325,27 @@ namespace Mono.Unix {
if (encoding == null)
throw new ArgumentNullException ("encoding");
if (index < 0 || count < 0)
throw new ArgumentOutOfRangeException ((index < 0 ? "index" : "count"),
"Non - negative number required.");
int min_byte_count = encoding.GetMaxByteCount(1);
char[] copy = s.ToCharArray (index, count);
byte[] marshal = new byte [encoding.GetByteCount (copy) + min_byte_count];
if (s.Length - index < count)
throw new ArgumentOutOfRangeException ("s", "Index and count must refer to a location within the string.");
int bytes_copied = encoding.GetBytes (copy, 0, copy.Length, marshal, 0);
int null_terminator_count = encoding.GetMaxByteCount (1);
int length_without_null = encoding.GetByteCount (s);
int marshalLength = checked (length_without_null + null_terminator_count);
if (bytes_copied != (marshal.Length-min_byte_count))
throw new NotSupportedException ("encoding.GetBytes() doesn't equal encoding.GetByteCount()!");
IntPtr mem = AllocHeap (marshalLength);
IntPtr mem = AllocHeap (marshal.Length);
if (mem == IntPtr.Zero)
throw new UnixIOException (Native.Errno.ENOMEM);
unsafe {
fixed (char* p = s) {
byte* marshal = (byte*)mem;
int bytes_copied;
try {
bytes_copied = encoding.GetBytes (p + index, count, marshal, marshalLength);
} catch {
FreeHeap (mem);
throw;
}
if (bytes_copied != length_without_null) {
FreeHeap (mem);
throw new NotSupportedException ("encoding.GetBytes() doesn't equal encoding.GetByteCount()!");
}
marshal += length_without_null;
for (int i = 0; i < null_terminator_count; ++i)
marshal[i] = 0;
}
bool copied = false;
try {
Marshal.Copy (marshal, 0, mem, marshal.Length);
copied = true;
}
finally {
if (!copied)
FreeHeap (mem);
}
return mem;
@@ -56,7 +56,7 @@ namespace MonoTests.Mono.Unix.Native {
Assert.IsFalse (NativeConvert.ToSignum (st.signalReceived) == Signum.SIGURG,
"#IH: Signal Handler invoked when it should have been removed!");
}
#if !NETCOREAPP2_0
[Test]
// MSVCRT.DLL doesn't export snprintf(3).
[Category ("NotDotNet")]
@@ -92,7 +92,6 @@ namespace MonoTests.Mono.Unix.Native {
Assert.AreEqual (s.ToString(), expected,
"#SNPF: printf of many builtin types failed");
}
#endif
}
}
@@ -86,8 +86,6 @@ namespace Mono.Security.Interface
void EndWrite (IAsyncResult asyncResult);
Task ShutdownAsync ();
TransportContext TransportContext {
get;
}
@@ -27,7 +27,6 @@ Mono.Security.Cryptography/PKCS8Test.cs
Mono.Security.Cryptography/RSAManagedTest.cs
Mono.Security.Cryptography/SHA224ManagedTest.cs
Mono.Security.Cryptography/SHA224Test.cs
Mono.Security.Interface/TestProvider.cs
Mono.Security.Protocol.Ntlm/ChallengeResponseTest.cs
Mono.Security.Protocol.Ntlm/MessageBaseTest.cs
Mono.Security.Protocol.Ntlm/Type1MessageTest.cs
@@ -1,47 +0,0 @@
//
// TestProvider.cs
//
// Author:
// Martin Baulig <[email protected]>
//
// Copyright (c) 2017 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.Security.Cryptography;
using System.Text;
using Mono.Security;
using Mono.Security.Interface;
using NUnit.Framework;
namespace MonoTests.Mono.Security
{
[TestFixture]
public class TestProvider
{
[Test]
public void GetProvider ()
{
var provider = MonoTlsProviderFactory.GetProvider ();
Assert.IsNotNull (provider, "TLS Provider");
}
}
}
+257 -1
View File
@@ -35,6 +35,15 @@ testing.
of comments in the source code for that purpose, and if the
problem requires to be followed up on, file a bug.
* Supporting .NET 1.2, .NET 1.1 and .NET 1.0 builds
The defines NET_1_1 and NET_2_0 are used to include
features. When NET_2_0 is defined, it also implies that the
NET_1_1 is defined.
To have code which is only available in an old version, use ONLY_1_0,
ONLY_1_1
* Tagging buggy code
If there is a bug in your implementation tag the problem by using
@@ -60,8 +69,255 @@ testing.
not only stupid, but leading to unreliable code).
In those cases, use the keyword "LAMESPEC".
* Coding considerations and style.
In order to keep the code consistent, please use the following
conventions: http://www.mono-project.com/community/contributing/coding-guidelines/
conventions. From here on `good' and `bad' are used to attribute
things that would make the coding style match, or not match. It is not
a judgement call on your coding abilities, but more of a style and
look call. Please try to follow these guidelines to ensure prettiness.
Use 8 space tabs for writing your code (hopefully we can keep
this consistent). If you are modifying someone else's code, try
to keep the coding style similar.
Since we are using 8-space tabs, you might want to consider the Linus
Torvals trick to reduce code nesting. Many times in a loop, you will
find yourself doing a test, and if the test is true, you will nest.
Many times this can be changed. Example:
for (i = 0; i < 10; i++) {
if (something (i)) {
do_more ();
}
}
This take precious space, instead write it like this:
for (i = 0; i < 10; i++) {
if (!something (i))
continue;
do_more ();
}
A few guidelines:
* Use a space before an opening parenthesis when calling
functions, or indexing, like this:
method (a);
b [10];
* Do not put a space after the opening parenthesis and the
closing one, ie:
good: method (a); array [10];
bad: method ( a ); array[ 10 ];
* Inside a code block, put the opening brace on the same line
as the statement:
good:
if (a) {
code ();
code ();
}
bad:
if (a)
{
code ();
code ();
}
* Avoid using unnecessary open/close braces, vertical space
is usually limited:
good:
if (a)
code ();
bad:
if (a) {
code ();
}
* When defining a method, use the C style for brace placement,
that means, use a new line for the brace, like this:
good:
void Method ()
{
}
bad:
void Method () {
}
* Properties and indexers are an exception, keep the
brace on the same line as the property declaration.
Rationale: this makes it visually
simple to distinguish them.
good:
int Property {
get {
return value;
}
}
bad:
int Property
{
get {
return value;
}
}
Notice how the accessor "get" also keeps its brace on the same
line.
For very small properties, you can compress things:
ok:
int Property {
get { return value; }
set { x = value; }
}
* Use white space in expressions liberally, except in the presence
of parenthesis:
good:
if (a + 5 > method (blah () + 4))
bad:
if (a+5>method(blah()+4))
* For any new files, please use a descriptive introduction, like
this:
//
// System.Comment.cs: Handles comments in System files.
//
// Author:
// Juan Perez ([email protected])
//
// (C) 2002 Address, Inc (http://www.address.com)
//
* If you are modyfing someone else's code, and your contribution
is significant, please add yourself to the Authors list.
* Switch statements have the case at the same indentation as the
switch:
switch (x) {
case 'a':
...
case 'b':
...
}
* Argument names should use the camel casing for
identifiers, like this:
good:
void Method (string myArgument)
bad:
void Method (string lpstrArgument)
void Method (string my_string)
* Empty methods: They should have the body of code using two
lines, in consistency with the rest:
good:
void EmptyMethod ()
{
}
bad:
void EmptyMethod () {}
void EmptyMethod ()
{}
* Line length: The line length for C# source code is 134 columns.
If your function declaration arguments go beyond
this point, please align your arguments to match the
opening brace, like this:
void Function (int arg, string argb,
int argc)
{
}
When invoking functions, the rule is different, the
arguments are not aligned with the previous
argument, instead they begin at the tabbed position,
like this:
void M ()
{
MethodCall ("Very long string that will force",
"Next argument on the 8-tab pos",
"Just like this one")
}
Here are a couple of examples:
class X : Y {
bool Method (int argument_1, int argument_2)
{
if (argument_1 == argument_2)
throw new Exception (Locale.GetText ("They are equal!");
if (argument_1 < argument_2) {
if (argument_1 * 3 > 4)
return true;
else
return false;
}
//
// This sample helps keep your sanity while using 8-spaces for tabs
//
VeryLongIdentifierWhichTakesManyArguments (
Argument1, Argument2, Argument3,
NestedCallHere (
MoreNested));
}
bool MyProperty {
get {
return x;
}
set {
x = value;
}
}
void AnotherMethod ()
{
if ((a + 5) != 4) {
}
while (blah) {
if (a)
continue;
b++;
}
}
}
@@ -310,20 +310,19 @@ namespace System.IO.MemoryMappedFiles
[MonoLimitation ("Named mappings scope is process local")]
public static MemoryMappedFile OpenExisting (string mapName)
{
return OpenExisting (mapName, MemoryMappedFileRights.ReadWrite);
throw new NotImplementedException ();
}
[MonoLimitation ("Named mappings scope is process local")]
public static MemoryMappedFile OpenExisting (string mapName, MemoryMappedFileRights desiredAccessRights)
{
return OpenExisting (mapName, desiredAccessRights, HandleInheritability.None);
throw new NotImplementedException ();
}
[MonoLimitation ("Named mappings scope is process local")]
public static MemoryMappedFile OpenExisting (string mapName, MemoryMappedFileRights desiredAccessRights, HandleInheritability inheritability)
{
// FIXME: Actually use desiredAccessRights
return CoreShmCreate (mapName, 0, MemoryMappedFileAccess.ReadWrite, MemoryMappedFileOptions.None, null, inheritability, FileMode.Open);
throw new NotImplementedException ();
}
public MemoryMappedViewStream CreateViewStream ()
@@ -394,9 +393,10 @@ namespace System.IO.MemoryMappedFiles
throw new NotImplementedException ();
}
[MonoTODO]
public SafeMemoryMappedFileHandle SafeMemoryMappedFileHandle {
get {
return handle;
throw new NotImplementedException ();
}
}
@@ -301,12 +301,9 @@ namespace MonoTests.System.IO.MemoryMappedFiles {
var name = MkNamedMapping ();
using (var m0 = MemoryMappedFile.CreateNew(name, 4096, MemoryMappedFileAccess.ReadWrite)) {
using (var m1 = MemoryMappedFile.CreateOrOpen (name, 4096, MemoryMappedFileAccess.ReadWrite)) {
using (var m2 = MemoryMappedFile.OpenExisting (name)) {
using (MemoryMappedViewAccessor v0 = m0.CreateViewAccessor (), v1 = m1.CreateViewAccessor (), v2 = m2.CreateViewAccessor ()) {
v0.Write (10, 0x12345);
Assert.AreEqual (0x12345, v1.ReadInt32 (10));
Assert.AreEqual (0x12345, v2.ReadInt32 (10));
}
using (MemoryMappedViewAccessor v0 = m0.CreateViewAccessor (), v1 = m1.CreateViewAccessor ()) {
v0.Write (10, 0x12345);
Assert.AreEqual (0x12345, v1.ReadInt32 (10));
}
}
}
@@ -469,13 +466,5 @@ namespace MonoTests.System.IO.MemoryMappedFiles {
}
}
}
[Test]
public void OpenExistingWithNoExistingThrows()
{
Assert.Throws<FileNotFoundException>(() => {
MemoryMappedFile.OpenExisting (MkNamedMapping ());
});
}
}
}
@@ -0,0 +1 @@
@@ -0,0 +1 @@
@@ -0,0 +1 @@
@@ -375,9 +375,8 @@ namespace System.Net.Http
wrequest.ResendContentFactory = content.CopyTo;
using (var stream = await wrequest.GetRequestStreamAsync ().ConfigureAwait (false)) {
await request.Content.CopyToAsync (stream).ConfigureAwait (false);
}
var stream = await wrequest.GetRequestStreamAsync ().ConfigureAwait (false);
await request.Content.CopyToAsync (stream).ConfigureAwait (false);
} else if (HttpMethod.Post.Equals (request.Method) || HttpMethod.Put.Equals (request.Method) || HttpMethod.Delete.Equals (request.Method)) {
// Explicitly set this to make sure we're sending a "Content-Length: 0" header.
// This fixes the issue that's been reported on the forums:
+1 -1
View File
@@ -6,7 +6,7 @@ LIBRARY = System.Numerics.dll
LIB_REFS = System
LIB_MCS_FLAGS = /unsafe
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
XTEST_LIB_REFS = System Facades/System.Threading.Tasks Facades/System.Runtime.InteropServices.RuntimeInformation System.Core System.Numerics.Vectors Microsoft.CSharp
XTEST_LIB_REFS = System Facades/System.Threading.Tasks System.Runtime.InteropServices.RuntimeInformation System.Core System.Numerics.Vectors Microsoft.CSharp
XTEST_LIB_FLAGS = -unsafe
RESX_RESOURCE_STRING = \
@@ -1,4 +1,3 @@
../../../external/corefx/src/Common/tests/System/AssertExtensions.cs
../../../external/corefx/src/Common/tests/System/PlatformDetection.cs
# ../../../external/corefx/src/System.Runtime.Numerics/tests/*.cs
@@ -58,13 +58,13 @@ namespace MonoTests.System.ServiceProcess
static ServiceInfo DISK_DRIVER_SERVICE = new ServiceInfo { ServiceName = "disk", DisplayName = "Disk Driver", ServiceType = ServiceType.KernelDriver };
static ServiceInfo ROUTING_AND_REMOTE_ACCESS_SERVICE = new ServiceInfo { ServiceName = "RemoteAccess", DisplayName = "Routing and Remote Access", DependedOn = new [] { "bfe", "http", "rasman", "rpcss" } };
static ServiceInfo SECONDARY_LOGON_SERVICE = new ServiceInfo { ServiceName = "seclogon", DisplayName = "Secondary Logon", Dependents = new [] { "te.service" } };
static ServiceInfo SECURITY_ACCOUNTS_MANAGER_SERVICE = new ServiceInfo { ServiceName = "SamSs", DisplayName = "Security Accounts Manager", Dependents = new [] { "ktmrm", "lanmanserver", "msdtc" }, DependedOn = new [] { "rpcss" } };
static ServiceInfo SECURITY_ACCOUNTS_MANAGER_SERVICE = new ServiceInfo { ServiceName = "SamSs", DisplayName = "Security Accounts Manager", Dependents = new [] { "browser", "ktmrm", "lanmanserver", "msdtc" }, DependedOn = new [] { "rpcss" } };
static ServiceInfo COMPLUS_EVENTSYSTEM_SERVICE = new ServiceInfo { ServiceName = "EventSystem", DisplayName = "COM+ Event System", ServiceType = ServiceType.Win32ShareProcess, Dependents = new [] { "comsysapp", "sens" }, DependedOn = new [] { "rpcss" } };
static ServiceInfo WINDOWS_IMAGE_ACQUISITION_SERVICE = new ServiceInfo { ServiceName = "stisvc", DisplayName = "Windows Image Acquisition (WIA)", ServiceType = ServiceType.Win32OwnProcess, DependedOn = new [] { "rpcss" } };
static ServiceInfo WINDOWS_SEARCH_SERVICE = new ServiceInfo { ServiceName = "WSearch", DisplayName = "Windows Search", ServiceType = ServiceType.Win32OwnProcess, Dependents = new [] { "wmpnetworksvc", "workfolderssvc" }, DependedOn = new [] { "rpcss" } };
static ServiceInfo WINDOWS_TIME_SERVICE = new ServiceInfo { ServiceName = "W32Time", DisplayName = "Windows Time" };
static ServiceInfo WINDOWS_UPDATE_SERVICE = new ServiceInfo { ServiceName = "wuauserv", DisplayName = "Windows Update", DependedOn = new [] { "rpcss" } };
static ServiceInfo WORKSTATION_SERVICE = new ServiceInfo { ServiceName = "LanmanWorkstation", DisplayName = "Workstation", Dependents = new [] { "netlogon", "sessionenv" }, DependedOn = new [] { "bowser", "mrxsmb20", "nsi" } };
static ServiceInfo WORKSTATION_SERVICE = new ServiceInfo { ServiceName = "LanmanWorkstation", DisplayName = "Workstation", Dependents = new [] { "browser", "netlogon", "sessionenv" }, DependedOn = new [] { "bowser", "mrxsmb20", "nsi" } };
// A service which is expected to be disabled by default on all supported Windows versions.
static ServiceInfo DISABLED_SERVICE = ROUTING_AND_REMOTE_ACCESS_SERVICE;
@@ -36,11 +36,7 @@ namespace Mono.AppleTls
*/
var certificate2 = certificate as X509Certificate2;
if (certificate2 != null)
#if MONOTOUCH
return SecIdentity.Import (certificate2);
#else
return SecImportExport.ItemImport (certificate2);
#endif
/*
* Reading Certificates from the Mac Keychain
@@ -133,28 +129,28 @@ namespace Mono.AppleTls
targetHost = targetHost.Substring (0, pos);
}
using (var policy = SecPolicy.CreateSslPolicy (!serverMode, targetHost))
using (var trust = new SecTrust (certificates, policy)) {
if (validator.Settings.TrustAnchors != null) {
var status = trust.SetAnchorCertificates (validator.Settings.TrustAnchors);
if (status != SecStatusCode.Success)
throw new InvalidOperationException (status.ToString ());
trust.SetAnchorCertificatesOnly (false);
}
var policy = SecPolicy.CreateSslPolicy (!serverMode, targetHost);
var trust = new SecTrust (certificates, policy);
if (validator.Settings.CertificateValidationTime != null) {
var status = trust.SetVerifyDate (validator.Settings.CertificateValidationTime.Value);
if (status != SecStatusCode.Success)
throw new InvalidOperationException (status.ToString ());
}
var result = trust.Evaluate ();
if (result == SecTrustResult.Unspecified || result == SecTrustResult.Proceed)
return true;
errors |= MonoSslPolicyErrors.RemoteCertificateChainErrors;
return false;
if (validator.Settings.TrustAnchors != null) {
var status = trust.SetAnchorCertificates (validator.Settings.TrustAnchors);
if (status != SecStatusCode.Success)
throw new InvalidOperationException (status.ToString ());
trust.SetAnchorCertificatesOnly (false);
}
if (validator.Settings.CertificateValidationTime != null) {
var status = trust.SetVerifyDate (validator.Settings.CertificateValidationTime.Value);
if (status != SecStatusCode.Success)
throw new InvalidOperationException (status.ToString ());
}
var result = trust.Evaluate ();
if (result == SecTrustResult.Unspecified)
return true;
errors |= MonoSslPolicyErrors.RemoteCertificateChainErrors;
return false;
}
}
}
@@ -235,41 +235,32 @@ namespace Mono.AppleTls
*
*/
var trust = GetPeerTrust (!IsServer);
X509CertificateCollection certificates;
if (trust == null || trust.Count == 0) {
remoteCertificate = null;
if (!IsServer)
throw new TlsException (AlertDescription.CertificateUnknown);
certificates = null;
} else {
if (trust.Count > 1)
Debug ("WARNING: Got multiple certificates in SecTrust!");
certificates = new X509CertificateCollection ();
for (int i = 0; i < trust.Count; i++)
certificates.Add (trust [(IntPtr)i].ToX509Certificate ());
remoteCertificate = certificates [0];
Debug ("Got peer trust: {0}", remoteCertificate);
}
bool ok;
SecTrust trust = null;
X509CertificateCollection certificates = null;
try {
trust = GetPeerTrust (!IsServer);
if (trust == null || trust.Count == 0) {
remoteCertificate = null;
if (!IsServer)
throw new TlsException (AlertDescription.CertificateUnknown);
certificates = null;
} else {
if (trust.Count > 1)
Debug ("WARNING: Got multiple certificates in SecTrust!");
certificates = new X509CertificateCollection ();
for (int i = 0; i < trust.Count; i++)
certificates.Add (trust.GetCertificate (i));
remoteCertificate = new X509Certificate (certificates [0]);
Debug ("Got peer trust: {0}", remoteCertificate);
}
ok = ValidateCertificate (certificates);
} catch (Exception ex) {
Debug ("Certificate validation failed: {0}", ex);
throw new TlsException (AlertDescription.CertificateUnknown, "Certificate validation threw exception.");
} finally {
if (trust != null)
trust.Dispose ();
if (certificates != null) {
for (int i = 0; i < certificates.Count; i++)
certificates [i].Dispose ();
}
}
if (!ok)
@@ -674,7 +665,7 @@ namespace Mono.AppleTls
if (value == IntPtr.Zero)
throw new TlsException (AlertDescription.CertificateUnknown);
}
return (value == IntPtr.Zero) ? null : new SecTrust (value, true);
return (value == IntPtr.Zero) ? null : new SecTrust (value);
}
#endregion
@@ -857,12 +848,12 @@ namespace Mono.AppleTls
[DllImport (SecurityLibrary)]
extern static /* OSStatus */ SslStatus SSLClose (/* SSLContextRef */ IntPtr context);
public override void Shutdown ()
public override void Close ()
{
if (Interlocked.Exchange (ref pendingIO, 1) == 1)
throw new InvalidOperationException ();
Debug ("Shutdown");
Debug ("Close");
lastException = null;
@@ -871,7 +862,7 @@ namespace Mono.AppleTls
return;
var status = SSLClose (Handle);
Debug ("Shutdown done: {0}", status);
Debug ("Close done: {0}", status);
CheckStatusAndThrow (status);
} finally {
closed = true;
@@ -38,12 +38,12 @@ namespace Mono.AppleTls
}
protected override MNS.MobileTlsContext CreateContext (
bool serverMode, string targetHost, SslProtocols enabledProtocols,
X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
bool askForClientCert)
MNS.MobileAuthenticatedStream parent, bool serverMode, string targetHost,
SslProtocols enabledProtocols, X509Certificate serverCertificate,
X509CertificateCollection clientCertificates, bool askForClientCert)
{
return new AppleTlsContext (
this, serverMode, targetHost,
parent, serverMode, targetHost,
enabledProtocols, serverCertificate,
clientCertificates, askForClientCert);
}
@@ -67,7 +67,6 @@ namespace Mono.AppleTls {
return code;
}
#if !MONOTOUCH
[DllImport (AppleTlsContext.SecurityLibrary)]
extern static SecStatusCode SecItemImport (
/* CFDataRef */ IntPtr importedData,
@@ -218,7 +217,6 @@ namespace Mono.AppleTls {
IntPtr keyUsage;
IntPtr keyAttributes;
}
#endif
}
}
#endif
-13
View File
@@ -66,8 +66,6 @@ namespace Mono.AppleTls {
foreach (var certificate in certificates)
array [i++] = new SecCertificate (certificate);
Initialize (array, policy);
for (i = 0; i < array.Length; i++)
array [i].Dispose ();
}
void Initialize (SecCertificate[] array, SecPolicy policy)
@@ -124,17 +122,6 @@ namespace Mono.AppleTls {
}
}
internal X509Certificate GetCertificate (int index)
{
if (handle == IntPtr.Zero)
throw new ObjectDisposedException ("SecTrust");
if (index < 0 || index >= Count)
throw new ArgumentOutOfRangeException ("index");
var ptr = SecTrustGetCertificateAtIndex (handle, (IntPtr)index);
return new X509Certificate (ptr);
}
[DllImport (AppleTlsContext.SecurityLibrary)]
extern static SecStatusCode /* OSStatus */ SecTrustSetAnchorCertificates (IntPtr /* SecTrustRef */ trust, IntPtr /* CFArrayRef */ anchorCertificates);
+21 -9
View File
@@ -316,9 +316,6 @@ namespace Mono.Btls
if (status == MonoBtlsSslError.WantRead) {
wantMore = true;
return 0;
} else if (status == MonoBtlsSslError.ZeroReturn) {
wantMore = false;
return size;
} else if (status != MonoBtlsSslError.None) {
throw GetException (status);
}
@@ -361,11 +358,26 @@ namespace Mono.Btls
}
}
public override void Shutdown ()
public override void Close ()
{
Debug ("Shutdown!");
// ssl.SetQuietShutdown ();
ssl.Shutdown ();
Debug ("Close!");
if (ssl != null) {
ssl.Dispose ();
ssl = null;
}
if (ctx != null) {
ctx.Dispose ();
ctx = null;
}
if (bio != null) {
bio.Dispose ();
bio = null;
}
if (errbio != null) {
errbio.Dispose ();
errbio = null;
}
}
void Dispose<T> (ref T disposable)
@@ -385,12 +397,12 @@ namespace Mono.Btls
{
try {
if (disposing) {
Dispose (ref ssl);
Dispose (ref ctx);
Dispose (ref remoteCertificate);
Dispose (ref nativeServerCertificate);
Dispose (ref nativeClientCertificate);
Dispose (ref clientCertificate);
Dispose (ref ctx);
Dispose (ref ssl);
Dispose (ref bio);
Dispose (ref errbio);
}
@@ -102,20 +102,6 @@ namespace Mono.Btls
CheckError (ret == 1, callerName);
}
protected internal void CheckLastError ([CallerMemberName] string callerName = null)
{
var error = Interlocked.Exchange (ref lastError, null);
if (error == null)
return;
string message;
if (callerName != null)
message = string.Format ("Caught unhandled exception in {0}.{1}.", GetType ().Name, callerName);
else
message = string.Format ("Caught unhandled exception.");
throw new MonoBtlsException (message, error);
}
[DllImport (BTLS_DYLIB)]
extern static void mono_btls_free (IntPtr data);
+10 -38
View File
@@ -47,7 +47,6 @@ namespace Mono.Btls
protected override bool ReleaseHandle ()
{
mono_btls_ssl_destroy (handle);
handle = IntPtr.Zero;
return true;
}
}
@@ -79,12 +78,6 @@ namespace Mono.Btls
[DllImport (BTLS_DYLIB)]
extern static void mono_btls_ssl_close (IntPtr handle);
[DllImport (BTLS_DYLIB)]
extern static int mono_btls_ssl_shutdown (IntPtr handle);
[DllImport (BTLS_DYLIB)]
extern static void mono_btls_ssl_set_quiet_shutdown (IntPtr handle, int mode);
[DllImport (BTLS_DYLIB)]
extern static void mono_btls_ssl_set_bio (IntPtr handle, IntPtr bio);
@@ -138,7 +131,6 @@ namespace Mono.Btls
return new BoringSslHandle (handle);
}
MonoBtlsBio bio;
PrintErrorsCallbackFunc printErrorsFunc;
IntPtr printErrorsFuncPtr;
@@ -156,7 +148,6 @@ namespace Mono.Btls
public void SetBio (MonoBtlsBio bio)
{
CheckThrow ();
this.bio = bio;
mono_btls_ssl_set_bio (
Handle.DangerousGetHandle (),
bio.Handle.DangerousGetHandle ());
@@ -173,17 +164,18 @@ namespace Mono.Btls
errors = null;
}
if (errors != null)
if (errors != null) {
Console.Error.WriteLine ("ERROR: {0} failed: {1}", callerName, errors);
throw new MonoBtlsException ("{0} failed: {1}.", callerName, errors);
else
} else {
Console.Error.WriteLine ("ERROR: {0} failed.", callerName);
throw new MonoBtlsException ("{0} failed.", callerName);
}
}
MonoBtlsSslError GetError (int ret_code)
{
CheckThrow ();
bio.CheckLastError ();
var error = mono_btls_ssl_get_error (
Handle.DangerousGetHandle (), ret_code);
return (MonoBtlsSslError)error;
@@ -295,20 +287,15 @@ namespace Mono.Btls
var ret = mono_btls_ssl_read (
Handle.DangerousGetHandle (), data, dataSize);
if (ret > 0) {
if (ret >= 0) {
dataSize = ret;
return MonoBtlsSslError.None;
}
var error = GetError (ret);
if (ret == 0 && error == MonoBtlsSslError.Syscall) {
// End-of-stream
dataSize = 0;
return MonoBtlsSslError.None;
}
var error = mono_btls_ssl_get_error (
Handle.DangerousGetHandle (), ret);
dataSize = 0;
return error;
return (MonoBtlsSslError)error;
}
public MonoBtlsSslError Write (IntPtr data, ref int dataSize)
@@ -429,24 +416,9 @@ namespace Mono.Btls
return Marshal.PtrToStringAnsi (namePtr);
}
public void Shutdown ()
{
CheckThrow ();
var ret = mono_btls_ssl_shutdown (Handle.DangerousGetHandle ());
if (ret < 0)
throw ThrowError ();
}
public void SetQuietShutdown ()
{
CheckThrow ();
mono_btls_ssl_set_quiet_shutdown (Handle.DangerousGetHandle (), 1);
}
protected override void Close ()
{
if (!Handle.IsInvalid)
mono_btls_ssl_close (Handle.DangerousGetHandle ());
mono_btls_ssl_close (Handle.DangerousGetHandle ());
}
}
}
+4 -4
View File
@@ -53,12 +53,12 @@ namespace Mono.Btls
}
protected override MNS.MobileTlsContext CreateContext (
bool serverMode, string targetHost, SslProtocols enabledProtocols,
X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
bool askForClientCert)
MNS.MobileAuthenticatedStream parent, bool serverMode, string targetHost,
SslProtocols enabledProtocols, X509Certificate serverCertificate,
X509CertificateCollection clientCertificates, bool askForClientCert)
{
return new MonoBtlsContext (
this, serverMode, targetHost,
parent, serverMode, targetHost,
enabledProtocols, serverCertificate,
clientCertificates, askForClientCert);
}
@@ -11,14 +11,14 @@ using System;
using System.IO;
using System.Net;
using System.Net.Security;
using System.Security.Authentication;
using SD = System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using System.Runtime.ExceptionServices;
namespace Mono.Net.Security
{
delegate AsyncOperationStatus AsyncOperation (AsyncProtocolRequest asyncRequest, AsyncOperationStatus status);
class BufferOffsetSize
{
public byte[] Buffer;
@@ -37,13 +37,6 @@ namespace Mono.Net.Security
public BufferOffsetSize (byte[] buffer, int offset, int size)
{
if (buffer == null)
throw new ArgumentNullException (nameof (buffer));
if (offset < 0)
throw new ArgumentOutOfRangeException (nameof (offset));
if (size < 0 || offset + size > buffer.Length)
throw new ArgumentOutOfRangeException (nameof (size));
Buffer = buffer;
Offset = offset;
Size = size;
@@ -61,7 +54,7 @@ namespace Mono.Net.Security
public readonly int InitialSize;
public BufferOffsetSize2 (int size)
: base (new byte[size], 0, 0)
: base (new byte [size], 0, 0)
{
InitialSize = size;
}
@@ -70,7 +63,7 @@ namespace Mono.Net.Security
{
Offset = Size = 0;
TotalBytes = 0;
Buffer = new byte[InitialSize];
Buffer = new byte [InitialSize];
Complete = false;
}
@@ -81,11 +74,11 @@ namespace Mono.Net.Security
int missing = size - Remaining;
if (Offset == 0 && Size == 0) {
Buffer = new byte[size];
Buffer = new byte [size];
return;
}
var buffer = new byte[Buffer.Length + missing];
var buffer = new byte [Buffer.Length + missing];
Buffer.CopyTo (buffer, 0);
Buffer = buffer;
}
@@ -98,296 +91,201 @@ namespace Mono.Net.Security
}
}
enum AsyncOperationStatus
{
enum AsyncOperationStatus {
NotStarted,
Initialize,
Continue,
Running,
Complete,
WantRead,
WantWrite,
ReadDone,
Complete
FinishWrite
}
class AsyncProtocolResult
class AsyncProtocolRequest
{
public int UserResult {
get;
}
public ExceptionDispatchInfo Error {
get;
}
public readonly MobileAuthenticatedStream Parent;
public readonly BufferOffsetSize UserBuffer;
public AsyncProtocolResult (int result)
{
UserResult = result;
}
public AsyncProtocolResult (ExceptionDispatchInfo error)
{
Error = error;
}
}
abstract class AsyncProtocolRequest
{
public MobileAuthenticatedStream Parent {
get;
}
public bool RunSynchronously {
get;
}
public int ID => ++next_id;
public string Name => GetType ().Name;
public int UserResult {
get;
protected set;
}
int Started;
int RequestedSize;
int WriteRequested;
readonly object locker = new object ();
public int CurrentSize;
public int UserResult;
AsyncOperation Operation;
int Status;
public readonly int ID = ++next_id;
static int next_id;
public AsyncProtocolRequest (MobileAuthenticatedStream parent, bool sync)
public readonly LazyAsyncResult UserAsyncResult;
public AsyncProtocolRequest (MobileAuthenticatedStream parent, LazyAsyncResult lazyResult, BufferOffsetSize userBuffer = null)
{
Parent = parent;
RunSynchronously = sync;
UserAsyncResult = lazyResult;
UserBuffer = userBuffer;
}
public bool CompleteWithError (Exception ex)
{
Status = (int)AsyncOperationStatus.Complete;
if (UserAsyncResult == null)
return true;
if (!UserAsyncResult.InternalPeekCompleted)
UserAsyncResult.InvokeCallback (ex);
return false;
}
[SD.Conditional ("MARTIN_DEBUG")]
protected void Debug (string message, params object[] args)
{
Parent.Debug ("{0}({1}:{2}): {3}", Name, Parent.ID, ID, string.Format (message, args));
Parent.Debug ("AsyncProtocolRequest({0}:{1}): {2}", Parent.ID, ID, string.Format (message, args));
}
internal void RequestRead (int size)
{
lock (locker) {
var oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.WantRead, (int)AsyncOperationStatus.Running);
Debug ("RequestRead: {0} {1}", oldStatus, size);
if (oldStatus == AsyncOperationStatus.Running)
RequestedSize = size;
else if (oldStatus == AsyncOperationStatus.WantRead)
RequestedSize += size;
Debug ("RequestRead: {0}", size);
}
else if (oldStatus != AsyncOperationStatus.WantWrite)
throw new InvalidOperationException ();
}
internal void ResetRead ()
{
var oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.Complete, (int)AsyncOperationStatus.WantRead);
Debug ("ResetRead: {0} {1}", oldStatus, Status);
}
internal void ResetWrite ()
{
var oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.Complete, (int)AsyncOperationStatus.WantWrite);
Debug ("ResetWrite: {0} {1}", oldStatus, Status);
}
internal void RequestWrite ()
{
WriteRequested = 1;
var oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.WantWrite, (int)AsyncOperationStatus.Running);
Debug ("RequestWrite: {0} {1}", oldStatus, Status);
if (oldStatus == AsyncOperationStatus.Running)
return;
else if (oldStatus != AsyncOperationStatus.WantRead && oldStatus != AsyncOperationStatus.WantWrite)
throw new InvalidOperationException ();
}
internal async Task<AsyncProtocolResult> StartOperation (CancellationToken cancellationToken)
internal void StartOperation (AsyncOperation operation)
{
Debug ("Start Operation: {0}", this);
if (Interlocked.CompareExchange (ref Started, 1, 0) != 0)
Debug ("Start Operation: {0} {1}", Status, operation);
if (Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.Initialize, (int)AsyncOperationStatus.NotStarted) != (int)AsyncOperationStatus.NotStarted)
throw new InvalidOperationException ();
Operation = operation;
if (UserAsyncResult == null) {
StartOperation ();
return;
}
ThreadPool.QueueUserWorkItem (_ => StartOperation ());
}
void StartOperation ()
{
try {
await ProcessOperation (cancellationToken).ConfigureAwait (false);
return new AsyncProtocolResult (UserResult);
ProcessOperation ();
if (UserAsyncResult != null && !UserAsyncResult.InternalPeekCompleted)
UserAsyncResult.InvokeCallback (UserResult);
} catch (Exception ex) {
var info = Parent.SetException (MobileAuthenticatedStream.GetSSPIException (ex));
return new AsyncProtocolResult (info);
if (UserAsyncResult == null)
throw;
if (!UserAsyncResult.InternalPeekCompleted)
UserAsyncResult.InvokeCallback (ex);
}
}
async Task ProcessOperation (CancellationToken cancellationToken)
void ProcessOperation ()
{
var status = AsyncOperationStatus.Initialize;
while (status != AsyncOperationStatus.Complete) {
cancellationToken.ThrowIfCancellationRequested ();
AsyncOperationStatus status;
do {
status = (AsyncOperationStatus)Interlocked.Exchange (ref Status, (int)AsyncOperationStatus.Running);
Debug ("ProcessOperation: {0}", status);
var ret = await InnerRead (cancellationToken).ConfigureAwait (false);
if (ret != null) {
if (ret == 0) {
// End-of-stream
Debug ("END OF STREAM!");
status = AsyncOperationStatus.ReadDone;
} else if (ret < 0) {
// remote prematurely closed connection.
throw new IOException ("Remote prematurely closed connection.");
status = ProcessOperation (status);
Debug ("ProcessOperation done: {0}", status);
AsyncOperationStatus oldStatus;
if (status == AsyncOperationStatus.Complete) {
oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.FinishWrite, (int)AsyncOperationStatus.WantWrite);
if (oldStatus == AsyncOperationStatus.WantWrite) {
// We are done, but still need to flush the write queue.
status = AsyncOperationStatus.FinishWrite;
continue;
}
}
Debug ("ProcessOperation run: {0}", status);
oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)status, (int)AsyncOperationStatus.Running);
Debug ("ProcessOperation done: {0} -> {1}", oldStatus, status);
AsyncOperationStatus newStatus;
switch (status) {
case AsyncOperationStatus.Initialize:
case AsyncOperationStatus.Continue:
case AsyncOperationStatus.ReadDone:
newStatus = Run (status);
break;
default:
throw new InvalidOperationException ();
if (oldStatus != AsyncOperationStatus.Running) {
if (status == oldStatus || status == AsyncOperationStatus.Continue || status == AsyncOperationStatus.Complete)
status = oldStatus;
else
throw new InvalidOperationException ();
}
if (Interlocked.Exchange (ref WriteRequested, 0) != 0) {
// Flush the write queue.
await Parent.InnerWrite (RunSynchronously, cancellationToken);
}
Debug ("ProcessOperation done: {0} -> {1}", status, newStatus);
status = newStatus;
}
} while (status != AsyncOperationStatus.Complete);
}
async Task<int?> InnerRead (CancellationToken cancellationToken)
AsyncOperationStatus ProcessOperation (AsyncOperationStatus status)
{
int? totalRead = null;
var requestedSize = Interlocked.Exchange (ref RequestedSize, 0);
while (requestedSize > 0) {
Debug ("ProcessOperation - read inner: {0}", requestedSize);
var ret = await Parent.InnerRead (RunSynchronously, requestedSize, cancellationToken).ConfigureAwait (false);
Debug ("ProcessOperation - read inner done: {0} - {1}", requestedSize, ret);
if (ret <= 0)
return ret;
if (ret > requestedSize)
if (status == AsyncOperationStatus.WantRead) {
if (RequestedSize < 0)
throw new InvalidOperationException ();
else if (RequestedSize == 0)
return AsyncOperationStatus.Continue;
totalRead += ret;
requestedSize -= ret;
var newRequestedSize = Interlocked.Exchange (ref RequestedSize, 0);
requestedSize += newRequestedSize;
}
Debug ("ProcessOperation - read inner: {0}", RequestedSize);
var ret = Parent.InnerRead (RequestedSize);
Debug ("ProcessOperation - read inner done: {0} - {1}", RequestedSize, ret);
return totalRead;
}
if (ret < 0)
return AsyncOperationStatus.ReadDone;
/*
* This will operate on the internal buffers and never block.
*/
protected abstract AsyncOperationStatus Run (AsyncOperationStatus status);
RequestedSize -= ret;
public override string ToString ()
{
return string.Format ("[{0}]", Name);
}
}
class AsyncHandshakeRequest : AsyncProtocolRequest
{
public AsyncHandshakeRequest (MobileAuthenticatedStream parent, bool sync)
: base (parent, sync)
{
}
protected override AsyncOperationStatus Run (AsyncOperationStatus status)
{
return Parent.ProcessHandshake (status);
}
}
abstract class AsyncReadOrWriteRequest : AsyncProtocolRequest
{
protected BufferOffsetSize UserBuffer {
get;
}
protected int CurrentSize {
get; set;
}
public AsyncReadOrWriteRequest (MobileAuthenticatedStream parent, bool sync, byte[] buffer, int offset, int size)
: base (parent, sync)
{
UserBuffer = new BufferOffsetSize (buffer, offset, size);
}
public override string ToString ()
{
return string.Format ("[{0}: {1}]", Name, UserBuffer);
}
}
class AsyncReadRequest : AsyncReadOrWriteRequest
{
public AsyncReadRequest (MobileAuthenticatedStream parent, bool sync, byte[] buffer, int offset, int size)
: base (parent, sync, buffer, offset, size)
{
}
protected override AsyncOperationStatus Run (AsyncOperationStatus status)
{
Debug ("ProcessRead - read user: {0} {1}", this, status);
var (ret, wantMore) = Parent.ProcessRead (UserBuffer);
Debug ("ProcessRead - read user done: {0} - {1} {2}", this, ret, wantMore);
if (ret < 0) {
UserResult = -1;
return AsyncOperationStatus.Complete;
}
CurrentSize += ret;
UserBuffer.Offset += ret;
UserBuffer.Size -= ret;
Debug ("Process Read - read user done #1: {0} - {1} {2}", this, CurrentSize, wantMore);
if (wantMore && CurrentSize == 0)
if (ret == 0 || RequestedSize == 0)
return AsyncOperationStatus.Continue;
else
return AsyncOperationStatus.WantRead;
} else if (status == AsyncOperationStatus.WantWrite) {
Debug ("ProcessOperation - want write");
Parent.InnerWrite ();
Debug ("ProcessOperation - want write done");
return AsyncOperationStatus.Continue;
UserResult = CurrentSize;
return AsyncOperationStatus.Complete;
}
}
class AsyncWriteRequest : AsyncReadOrWriteRequest
{
public AsyncWriteRequest (MobileAuthenticatedStream parent, bool sync, byte[] buffer, int offset, int size)
: base (parent, sync, buffer, offset, size)
{
}
protected override AsyncOperationStatus Run (AsyncOperationStatus status)
{
Debug ("ProcessWrite - write user: {0} {1}", this, status);
if (UserBuffer.Size == 0) {
UserResult = CurrentSize;
} else if (status == AsyncOperationStatus.Initialize || status == AsyncOperationStatus.Continue) {
Debug ("ProcessOperation - continue");
status = Operation (this, status);
Debug ("ProcessOperation - continue done: {0}", status);
return status;
} else if (status == AsyncOperationStatus.ReadDone) {
Debug ("ProcessOperation - read done");
status = Operation (this, status);
Debug ("ProcessOperation - read done: {0}", status);
return status;
} else if (status == AsyncOperationStatus.FinishWrite) {
Debug ("ProcessOperation - finish write");
Parent.InnerWrite ();
Debug ("ProcessOperation - finish write done");
return AsyncOperationStatus.Complete;
}
var (ret, wantMore) = Parent.ProcessWrite (UserBuffer);
Debug ("ProcessWrite - write user done: {0} - {1} {2}", this, ret, wantMore);
if (ret < 0) {
UserResult = -1;
return AsyncOperationStatus.Complete;
}
CurrentSize += ret;
UserBuffer.Offset += ret;
UserBuffer.Size -= ret;
if (wantMore)
return AsyncOperationStatus.Continue;
UserResult = CurrentSize;
return AsyncOperationStatus.Complete;
throw new InvalidOperationException ();
}
}
class AsyncShutdownRequest : AsyncProtocolRequest
{
public AsyncShutdownRequest (MobileAuthenticatedStream parent)
: base (parent, false)
{
}
protected override AsyncOperationStatus Run (AsyncOperationStatus status)
{
return Parent.ProcessShutdown (status);
}
}
}
#endif
@@ -575,11 +575,6 @@ namespace Mono.Net.Security.Private
#region IMonoSslStream
Task IMonoSslStream.ShutdownAsync ()
{
return Task.CompletedTask;
}
AuthenticatedStream IMonoSslStream.AuthenticatedStream {
get { return this; }
}
@@ -23,7 +23,6 @@ using System.IO;
using System.Net;
using System.Net.Security;
using System.Globalization;
using System.Security.Authentication;
using System.Runtime.ExceptionServices;
using System.Threading;
using System.Threading.Tasks;
@@ -37,13 +36,8 @@ namespace Mono.Net.Security
{
abstract class MobileAuthenticatedStream : AuthenticatedStream, MSI.IMonoSslStream
{
/*
* This is intentionally called `xobileTlsContext'. It is a "dangerous" object
* that must not be touched outside the `ioLock' and we need to be very careful
* where we access it.
*/
MobileTlsContext xobileTlsContext;
ExceptionDispatchInfo lastException;
Exception lastException;
AsyncProtocolRequest asyncHandshakeRequest;
AsyncProtocolRequest asyncReadRequest;
@@ -53,12 +47,11 @@ namespace Mono.Net.Security
object ioLock = new object ();
int closeRequested;
bool shutdown;
static int uniqueNameInteger = 123;
public MobileAuthenticatedStream (Stream innerStream, bool leaveInnerStreamOpen, SslStream owner,
MSI.MonoTlsSettings settings, MSI.MonoTlsProvider provider)
MSI.MonoTlsSettings settings, MSI.MonoTlsProvider provider)
: base (innerStream, leaveInnerStreamOpen)
{
SslStream = owner;
@@ -85,47 +78,42 @@ namespace Mono.Net.Security
get { return xobileTlsContext != null; }
}
internal void CheckThrow (bool authSuccessCheck, bool shutdownCheck = false)
internal MobileTlsContext Context {
get {
CheckThrow (true);
return xobileTlsContext;
}
}
internal void CheckThrow (bool authSuccessCheck)
{
if (closeRequested != 0)
throw new InvalidOperationException ("Stream is closed.");
if (lastException != null)
lastException.Throw ();
throw lastException;
if (authSuccessCheck && !IsAuthenticated)
throw new InvalidOperationException (SR.net_auth_noauth);
if (shutdownCheck && shutdown)
throw new InvalidOperationException (SR.net_ssl_io_already_shutdown);
throw new InvalidOperationException ("Must be authenticated.");
}
internal static Exception GetSSPIException (Exception e)
Exception SetException (Exception e)
{
if (e is OperationCanceledException || e is IOException || e is ObjectDisposedException || e is AuthenticationException)
return e;
return new AuthenticationException (SR.net_auth_SSPI, e);
e = SetException_internal (e);
if (e != null && xobileTlsContext != null)
xobileTlsContext.Dispose ();
return e;
}
internal static Exception GetIOException (Exception e, string message)
Exception SetException_internal (Exception e)
{
if (e is OperationCanceledException || e is IOException || e is ObjectDisposedException || e is AuthenticationException)
return e;
return new IOException (message, e);
}
internal ExceptionDispatchInfo SetException (Exception e)
{
var info = ExceptionDispatchInfo.Capture (e);
var old = Interlocked.CompareExchange (ref lastException, info, null);
return old ?? info;
if (lastException == null)
lastException = e;
return lastException;
}
SslProtocols DefaultProtocols {
get { return SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls; }
}
enum OperationType {
Read,
Write,
Shutdown
}
public void AuthenticateAsClient (string targetHost)
{
AuthenticateAsClient (targetHost, new X509CertificateCollection (), DefaultProtocols, false);
@@ -133,8 +121,8 @@ namespace Mono.Net.Security
public void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
{
var task = ProcessAuthentication (true, false, targetHost, enabledSslProtocols, null, clientCertificates, false);
task.Wait ();
ValidateCreateContext (false, targetHost, enabledSslProtocols, null, clientCertificates, false);
ProcessAuthentication (null);
}
public IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState)
@@ -144,13 +132,15 @@ namespace Mono.Net.Security
public IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
{
var task = ProcessAuthentication (false, false, targetHost, enabledSslProtocols, null, clientCertificates, false);
return TaskToApm.Begin (task, asyncCallback, asyncState);
ValidateCreateContext (false, targetHost, enabledSslProtocols, null, clientCertificates, false);
var result = new LazyAsyncResult (this, asyncState, asyncCallback);
ProcessAuthentication (result);
return result;
}
public void EndAuthenticateAsClient (IAsyncResult asyncResult)
{
TaskToApm.End (asyncResult);
EndProcessAuthentication (asyncResult);
}
public void AuthenticateAsServer (X509Certificate serverCertificate)
@@ -160,8 +150,8 @@ namespace Mono.Net.Security
public void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
{
var task = ProcessAuthentication (true, true, string.Empty, enabledSslProtocols, serverCertificate, null, clientCertificateRequired);
task.Wait ();
ValidateCreateContext (true, string.Empty, enabledSslProtocols, serverCertificate, null, clientCertificateRequired);
ProcessAuthentication (null);
}
public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState)
@@ -171,214 +161,218 @@ namespace Mono.Net.Security
public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
{
var task = ProcessAuthentication (false, true, string.Empty, enabledSslProtocols, serverCertificate, null, clientCertificateRequired);
return TaskToApm.Begin (task, asyncCallback, asyncState);
ValidateCreateContext (true, string.Empty, enabledSslProtocols, serverCertificate, null, clientCertificateRequired);
var result = new LazyAsyncResult (this, asyncState, asyncCallback);
ProcessAuthentication (result);
return result;
}
public void EndAuthenticateAsServer (IAsyncResult asyncResult)
{
TaskToApm.End (asyncResult);
EndProcessAuthentication (asyncResult);
}
public Task AuthenticateAsClientAsync (string targetHost)
{
return ProcessAuthentication (false, false, targetHost, DefaultProtocols, null, null, false);
return Task.Factory.FromAsync (BeginAuthenticateAsClient, EndAuthenticateAsClient, targetHost, null);
}
public Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
{
return ProcessAuthentication (false, false, targetHost, enabledSslProtocols, null, clientCertificates, false);
return Task.Factory.FromAsync ((callback, state) => BeginAuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation, callback, state), EndAuthenticateAsClient, null);
}
public Task AuthenticateAsServerAsync (X509Certificate serverCertificate)
{
return AuthenticateAsServerAsync (serverCertificate, false, DefaultProtocols, false);
return Task.Factory.FromAsync (BeginAuthenticateAsServer, EndAuthenticateAsServer, serverCertificate, null);
}
public Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
{
return ProcessAuthentication (false, true, string.Empty, enabledSslProtocols, serverCertificate, null, clientCertificateRequired);
}
public Task ShutdownAsync ()
{
Debug ("ShutdownAsync");
/*
* SSLClose() is a little bit tricky as it might attempt to send a close_notify alert
* and thus call our write callback.
*
* It is also not thread-safe with SSLRead() or SSLWrite(), so we need to take the I/O lock here.
*/
var asyncRequest = new AsyncShutdownRequest (this);
var task = StartOperation (OperationType.Shutdown, asyncRequest, CancellationToken.None);
return task;
return Task.Factory.FromAsync ((callback, state) => BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation, callback, state), EndAuthenticateAsServer, null);
}
public AuthenticatedStream AuthenticatedStream {
get { return this; }
}
async Task ProcessAuthentication (
bool runSynchronously, bool serverMode, string targetHost, SslProtocols enabledProtocols,
X509Certificate serverCertificate, X509CertificateCollection clientCertificates, bool clientCertRequired)
internal void ProcessAuthentication (LazyAsyncResult lazyResult)
{
var asyncRequest = new AsyncProtocolRequest (this, lazyResult);
if (Interlocked.CompareExchange (ref asyncHandshakeRequest, asyncRequest, null) != null)
throw new InvalidOperationException ("Invalid nested call.");
try {
if (lastException != null)
throw lastException;
if (xobileTlsContext == null)
throw new InvalidOperationException ();
readBuffer.Reset ();
writeBuffer.Reset ();
try {
asyncRequest.StartOperation (ProcessHandshake);
} catch (Exception ex) {
ExceptionDispatchInfo.Capture (SetException (ex)).Throw ();
}
} finally {
if (lazyResult == null || lastException != null) {
readBuffer.Reset ();
writeBuffer.Reset ();
asyncHandshakeRequest = null;
}
}
}
internal void EndProcessAuthentication (IAsyncResult result)
{
if (result == null)
throw new ArgumentNullException ("asyncResult");
var lazyResult = (LazyAsyncResult)result;
if (Interlocked.Exchange (ref asyncHandshakeRequest, null) == null)
throw new InvalidOperationException ("Invalid end call.");
lazyResult.InternalWaitForCompletion ();
readBuffer.Reset ();
writeBuffer.Reset ();
var e = lazyResult.Result as Exception;
if (e != null)
ExceptionDispatchInfo.Capture (SetException (e)).Throw ();
}
internal void ValidateCreateContext (bool serverMode, string targetHost, SslProtocols enabledProtocols, X509Certificate serverCertificate, X509CertificateCollection clientCertificates, bool clientCertRequired)
{
if (xobileTlsContext != null)
throw new InvalidOperationException ();
if (serverMode) {
if (serverCertificate == null)
throw new ArgumentException (nameof (serverCertificate));
} else {
throw new ArgumentException ("serverCertificate");
} else {
if (targetHost == null)
throw new ArgumentException (nameof (targetHost));
throw new ArgumentException ("targetHost");
if (targetHost.Length == 0)
targetHost = "?" + Interlocked.Increment (ref uniqueNameInteger).ToString (NumberFormatInfo.InvariantInfo);
}
if (lastException != null)
lastException.Throw ();
var asyncRequest = new AsyncHandshakeRequest (this, runSynchronously);
if (Interlocked.CompareExchange (ref asyncHandshakeRequest, asyncRequest, null) != null)
throw new InvalidOperationException ("Invalid nested call.");
// Make sure no other async requests can be started during the handshake.
if (Interlocked.CompareExchange (ref asyncReadRequest, asyncRequest, null) != null)
throw new InvalidOperationException ("Invalid nested call.");
if (Interlocked.CompareExchange (ref asyncWriteRequest, asyncRequest, null) != null)
throw new InvalidOperationException ("Invalid nested call.");
AsyncProtocolResult result;
try {
lock (ioLock) {
if (xobileTlsContext != null)
throw new InvalidOperationException ();
readBuffer.Reset ();
writeBuffer.Reset ();
xobileTlsContext = CreateContext (
serverMode, targetHost, enabledProtocols, serverCertificate,
clientCertificates, clientCertRequired);
}
try {
result = await asyncRequest.StartOperation (CancellationToken.None).ConfigureAwait (false);
} catch (Exception ex) {
result = new AsyncProtocolResult (SetException (GetSSPIException (ex)));
}
} finally {
lock (ioLock) {
readBuffer.Reset ();
writeBuffer.Reset ();
asyncWriteRequest = null;
asyncReadRequest = null;
asyncHandshakeRequest = null;
}
}
if (result.Error != null)
result.Error.Throw ();
xobileTlsContext = CreateContext (this, serverMode, targetHost, enabledProtocols, serverCertificate, clientCertificates, clientCertRequired);
}
protected abstract MobileTlsContext CreateContext (
bool serverMode, string targetHost, SSA.SslProtocols enabledProtocols,
X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
bool askForClientCert);
MobileAuthenticatedStream parent, bool serverMode, string targetHost,
SSA.SslProtocols enabledProtocols, X509Certificate serverCertificate,
X509CertificateCollection clientCertificates, bool askForClientCert);
public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
{
var asyncRequest = new AsyncReadRequest (this, false, buffer, offset, count);
var task = StartOperation (OperationType.Read, asyncRequest, CancellationToken.None);
return TaskToApm.Begin (task, asyncCallback, asyncState);
return BeginReadOrWrite (ref asyncReadRequest, ref readBuffer, ProcessRead, new BufferOffsetSize (buffer, offset, count), asyncCallback, asyncState);
}
public override int EndRead (IAsyncResult asyncResult)
{
return TaskToApm.End<int> (asyncResult);
return (int)EndReadOrWrite (asyncResult, ref asyncReadRequest);
}
public override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
{
var asyncRequest = new AsyncWriteRequest (this, false, buffer, offset, count);
var task = StartOperation (OperationType.Write, asyncRequest, CancellationToken.None);
return TaskToApm.Begin (task, asyncCallback, asyncState);
return BeginReadOrWrite (ref asyncWriteRequest, ref writeBuffer, ProcessWrite, new BufferOffsetSize (buffer, offset, count), asyncCallback, asyncState);
}
public override void EndWrite (IAsyncResult asyncResult)
{
TaskToApm.End (asyncResult);
EndReadOrWrite (asyncResult, ref asyncWriteRequest);
}
public override int Read (byte[] buffer, int offset, int count)
{
var asyncRequest = new AsyncReadRequest (this, true, buffer, offset, count);
var task = StartOperation (OperationType.Read, asyncRequest, CancellationToken.None);
return task.Result;
return ProcessReadOrWrite (ref asyncReadRequest, ref readBuffer, ProcessRead, new BufferOffsetSize (buffer, offset, count), null);
}
public void Write (byte[] buffer)
{
Write (buffer, 0, buffer.Length);
}
public override void Write (byte[] buffer, int offset, int count)
{
var asyncRequest = new AsyncWriteRequest (this, true, buffer, offset, count);
var task = StartOperation (OperationType.Write, asyncRequest, CancellationToken.None);
task.Wait ();
ProcessReadOrWrite (ref asyncWriteRequest, ref writeBuffer, ProcessWrite, new BufferOffsetSize (buffer, offset, count), null);
}
public override Task<int> ReadAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken)
IAsyncResult BeginReadOrWrite (ref AsyncProtocolRequest nestedRequest, ref BufferOffsetSize2 internalBuffer, AsyncOperation operation, BufferOffsetSize userBuffer, AsyncCallback asyncCallback, object asyncState)
{
var asyncRequest = new AsyncReadRequest (this, false, buffer, offset, count);
return StartOperation (OperationType.Read, asyncRequest, cancellationToken);
LazyAsyncResult lazyResult = new LazyAsyncResult (this, asyncState, asyncCallback);
ProcessReadOrWrite (ref nestedRequest, ref internalBuffer, operation, userBuffer, lazyResult);
return lazyResult;
}
public override Task WriteAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken)
object EndReadOrWrite (IAsyncResult asyncResult, ref AsyncProtocolRequest nestedRequest)
{
var asyncRequest = new AsyncWriteRequest (this, false, buffer, offset, count);
return StartOperation (OperationType.Write, asyncRequest, cancellationToken);
}
if (asyncResult == null)
throw new ArgumentNullException("asyncResult");
async Task<int> StartOperation (OperationType type, AsyncProtocolRequest asyncRequest, CancellationToken cancellationToken)
{
CheckThrow (true, type != OperationType.Read);
Debug ("StartOperationAsync: {0} {1}", asyncRequest, type);
var lazyResult = (LazyAsyncResult)asyncResult;
if (type == OperationType.Read) {
if (Interlocked.CompareExchange (ref asyncReadRequest, asyncRequest, null) != null)
throw new InvalidOperationException ("Invalid nested call.");
} else {
if (Interlocked.CompareExchange (ref asyncWriteRequest, asyncRequest, null) != null)
throw new InvalidOperationException ("Invalid nested call.");
if (Interlocked.Exchange (ref nestedRequest, null) == null)
throw new InvalidOperationException ("Invalid end call.");
// No "artificial" timeouts implemented so far, InnerStream controls timeout.
lazyResult.InternalWaitForCompletion ();
Debug ("EndReadOrWrite");
var e = lazyResult.Result as Exception;
if (e != null) {
var ioEx = e as IOException;
if (ioEx != null)
throw ioEx;
throw new IOException ("read failed", e);
}
AsyncProtocolResult result;
return lazyResult.Result;
}
int ProcessReadOrWrite (ref AsyncProtocolRequest nestedRequest, ref BufferOffsetSize2 internalBuffer, AsyncOperation operation, BufferOffsetSize userBuffer, LazyAsyncResult lazyResult)
{
if (userBuffer == null || userBuffer.Buffer == null)
throw new ArgumentNullException ("buffer");
if (userBuffer.Offset < 0)
throw new ArgumentOutOfRangeException ("offset");
if (userBuffer.Size < 0 || userBuffer.Offset + userBuffer.Size > userBuffer.Buffer.Length)
throw new ArgumentOutOfRangeException ("count");
CheckThrow (true);
var name = internalBuffer == readBuffer ? "read" : "write";
Debug ("ProcessReadOrWrite: {0} {1}", name, userBuffer);
var asyncRequest = new AsyncProtocolRequest (this, lazyResult, userBuffer);
return StartOperation (ref nestedRequest, ref internalBuffer, operation, asyncRequest, name);
}
int StartOperation (ref AsyncProtocolRequest nestedRequest, ref BufferOffsetSize2 internalBuffer, AsyncOperation operation, AsyncProtocolRequest asyncRequest, string name)
{
if (Interlocked.CompareExchange (ref nestedRequest, asyncRequest, null) != null)
throw new InvalidOperationException ("Invalid nested call.");
bool failed = false;
try {
lock (ioLock) {
if (type == OperationType.Read)
readBuffer.Reset ();
else
writeBuffer.Reset ();
}
result = await asyncRequest.StartOperation (cancellationToken).ConfigureAwait (false);
internalBuffer.Reset ();
asyncRequest.StartOperation (operation);
return asyncRequest.UserResult;
} catch (Exception e) {
var info = SetException (GetIOException (e, asyncRequest.Name + " failed"));
result = new AsyncProtocolResult (info);
failed = true;
if (e is IOException)
throw;
throw new IOException (name + " failed", e);
} finally {
lock (ioLock) {
if (type == OperationType.Read) {
readBuffer.Reset ();
asyncReadRequest = null;
} else {
writeBuffer.Reset ();
asyncWriteRequest = null;
}
if (asyncRequest.UserAsyncResult == null || failed) {
internalBuffer.Reset ();
nestedRequest = null;
}
}
if (result.Error != null)
result.Error.Throw ();
return result.UserResult;
}
static int nextId;
@@ -390,31 +384,26 @@ namespace Mono.Net.Security
Console.Error.WriteLine ("MobileAuthenticatedStream({0}): {1}", ID, string.Format (message, args));
}
#region Called back from native code via SslConnection
#region Called back from native code via SslConnection
/*
* Called from within SSLRead() and SSLHandshake(). We only access tha managed byte[] here.
*/
internal int InternalRead (byte[] buffer, int offset, int size, out bool outWantMore)
internal int InternalRead (byte[] buffer, int offset, int size, out bool wantMore)
{
try {
Debug ("InternalRead: {0} {1} {2} {3} {4}", offset, size,
asyncHandshakeRequest != null ? "handshake" : "",
asyncReadRequest != null ? "async" : "",
readBuffer != null ? readBuffer.ToString () : "");
Debug ("InternalRead: {0} {1} {2} {3}", offset, size, asyncReadRequest != null, readBuffer != null);
var asyncRequest = asyncHandshakeRequest ?? asyncReadRequest;
var (ret, wantMore) = InternalRead (asyncRequest, readBuffer, buffer, offset, size);
outWantMore = wantMore;
return ret;
return InternalRead (asyncRequest, readBuffer, buffer, offset, size, out wantMore);
} catch (Exception ex) {
Debug ("InternalRead failed: {0}", ex);
SetException (GetIOException (ex, "InternalRead() failed"));
outWantMore = false;
SetException_internal (ex);
wantMore = false;
return -1;
}
}
(int, bool) InternalRead (AsyncProtocolRequest asyncRequest, BufferOffsetSize internalBuffer, byte[] buffer, int offset, int size)
int InternalRead (AsyncProtocolRequest asyncRequest, BufferOffsetSize internalBuffer, byte[] buffer, int offset, int size, out bool wantMore)
{
if (asyncRequest == null)
throw new InvalidOperationException ();
@@ -433,10 +422,11 @@ namespace Mono.Net.Security
* native function again.
*/
if (internalBuffer.Size == 0 && !internalBuffer.Complete) {
Debug ("InternalRead #1: {0} {1} {2}", internalBuffer.Offset, internalBuffer.TotalBytes, size);
Debug ("InternalRead #1: {0} {1}", internalBuffer.Offset, internalBuffer.TotalBytes);
internalBuffer.Offset = internalBuffer.Size = 0;
asyncRequest.RequestRead (size);
return (0, true);
wantMore = true;
return 0;
}
/*
@@ -451,7 +441,8 @@ namespace Mono.Net.Security
Buffer.BlockCopy (internalBuffer.Buffer, internalBuffer.Offset, buffer, offset, len);
internalBuffer.Offset += len;
internalBuffer.Size -= len;
return (len, !internalBuffer.Complete && len < size);
wantMore = !internalBuffer.Complete && len < size;
return len;
}
/*
@@ -465,7 +456,7 @@ namespace Mono.Net.Security
return InternalWrite (asyncRequest, writeBuffer, buffer, offset, size);
} catch (Exception ex) {
Debug ("InternalWrite failed: {0}", ex);
SetException (GetIOException (ex, "InternalWrite() failed"));
SetException_internal (ex);
return false;
}
}
@@ -520,30 +511,22 @@ namespace Mono.Net.Security
return true;
}
#endregion
#endregion
#region Inner Stream
#region Inner Stream
/*
* Read / write data from the inner stream; we're only called from managed code and only manipulate
* the internal buffers.
*/
internal async Task<int> InnerRead (bool sync, int requestedSize, CancellationToken cancellationToken)
internal int InnerRead (int requestedSize)
{
cancellationToken.ThrowIfCancellationRequested ();
Debug ("InnerRead: {0} {1} {2} {3}", readBuffer.Offset, readBuffer.Size, readBuffer.Remaining, requestedSize);
var len = System.Math.Min (readBuffer.Remaining, requestedSize);
if (len == 0)
throw new InvalidOperationException ();
Task<int> task;
if (sync)
task = Task.Run (() => InnerStream.Read (readBuffer.Buffer, readBuffer.EndOffset, len));
else
task = InnerStream.ReadAsync (readBuffer.Buffer, readBuffer.EndOffset, len, cancellationToken);
var ret = await task.ConfigureAwait (false);
var ret = InnerStream.Read (readBuffer.Buffer, readBuffer.EndOffset, len);
Debug ("InnerRead done: {0} {1} - {2}", readBuffer.Remaining, len, ret);
if (ret >= 0) {
@@ -566,126 +549,165 @@ namespace Mono.Net.Security
return ret;
}
internal async Task InnerWrite (bool sync, CancellationToken cancellationToken)
internal void InnerWrite ()
{
cancellationToken.ThrowIfCancellationRequested ();
Debug ("InnerWrite: {0} {1}", writeBuffer.Offset, writeBuffer.Size);
if (writeBuffer.Size == 0)
return;
Task task;
if (sync)
task = Task.Run (() => InnerStream.Write (writeBuffer.Buffer, writeBuffer.Offset, writeBuffer.Size));
else
task = InnerStream.WriteAsync (writeBuffer.Buffer, writeBuffer.Offset, writeBuffer.Size);
await task.ConfigureAwait (false);
writeBuffer.TotalBytes += writeBuffer.Size;
writeBuffer.Offset = writeBuffer.Size = 0;
InnerFlush ();
}
#endregion
internal void InnerFlush ()
{
if (writeBuffer.Size > 0) {
InnerStream.Write (writeBuffer.Buffer, writeBuffer.Offset, writeBuffer.Size);
writeBuffer.TotalBytes += writeBuffer.Size;
writeBuffer.Offset = writeBuffer.Size = 0;
}
}
#region Main async I/O loop
#endregion
internal AsyncOperationStatus ProcessHandshake (AsyncOperationStatus status)
#region Main async I/O loop
AsyncOperationStatus ProcessHandshake (AsyncProtocolRequest asyncRequest, AsyncOperationStatus status)
{
Debug ("ProcessHandshake: {0}", status);
lock (ioLock) {
/*
* The first time we're called (AsyncOperationStatus.Initialize), we need to setup the SslContext and
* start the handshake.
*/
if (status == AsyncOperationStatus.Initialize) {
xobileTlsContext.StartHandshake ();
return AsyncOperationStatus.Continue;
} else if (status == AsyncOperationStatus.ReadDone) {
throw new IOException (SR.net_auth_eof);
} else if (status != AsyncOperationStatus.Continue) {
throw new InvalidOperationException ();
}
/*
* The first time we're called (AsyncOperationStatus.Initialize), we need to setup the SslContext and
* start the handshake.
*/
if (status == AsyncOperationStatus.Initialize) {
xobileTlsContext.StartHandshake ();
return AsyncOperationStatus.Continue;
} else if (status == AsyncOperationStatus.ReadDone) {
// remote prematurely closed connection.
throw new IOException ("Remote prematurely closed connection.");
} else if (status != AsyncOperationStatus.Continue) {
throw new InvalidOperationException ();
}
/*
* SSLHandshake() will return repeatedly with 'SslStatus.WouldBlock', we then need
* to take care of I/O and call it again.
*/
if (!xobileTlsContext.ProcessHandshake ()) {
/*
* SSLHandshake() will return repeatedly with 'SslStatus.WouldBlock', we then need
* to take care of I/O and call it again.
*/
if (xobileTlsContext.ProcessHandshake ()) {
xobileTlsContext.FinishHandshake ();
* Flush the internal write buffer.
*/
InnerFlush ();
return AsyncOperationStatus.Continue;
}
xobileTlsContext.FinishHandshake ();
return AsyncOperationStatus.Complete;
}
AsyncOperationStatus ProcessRead (AsyncProtocolRequest asyncRequest, AsyncOperationStatus status)
{
Debug ("ProcessRead - read user: {0} {1}", status, asyncRequest.UserBuffer);
int ret;
bool wantMore;
lock (ioLock) {
ret = Context.Read (asyncRequest.UserBuffer.Buffer, asyncRequest.UserBuffer.Offset, asyncRequest.UserBuffer.Size, out wantMore);
}
Debug ("ProcessRead - read user done: {0} - {1} {2}", asyncRequest.UserBuffer, ret, wantMore);
if (ret < 0) {
asyncRequest.UserResult = -1;
return AsyncOperationStatus.Complete;
}
asyncRequest.CurrentSize += ret;
asyncRequest.UserBuffer.Offset += ret;
asyncRequest.UserBuffer.Size -= ret;
Debug ("Process Read - read user done #1: {0} - {1} {2}", asyncRequest.UserBuffer, asyncRequest.CurrentSize, wantMore);
if (wantMore && asyncRequest.CurrentSize == 0)
return AsyncOperationStatus.WantRead;
asyncRequest.ResetRead ();
asyncRequest.UserResult = asyncRequest.CurrentSize;
return AsyncOperationStatus.Complete;
}
AsyncOperationStatus ProcessWrite (AsyncProtocolRequest asyncRequest, AsyncOperationStatus status)
{
Debug ("ProcessWrite - write user: {0} {1}", status, asyncRequest.UserBuffer);
if (asyncRequest.UserBuffer.Size == 0) {
asyncRequest.UserResult = asyncRequest.CurrentSize;
return AsyncOperationStatus.Complete;
}
int ret;
bool wantMore;
lock (ioLock) {
ret = Context.Write (asyncRequest.UserBuffer.Buffer, asyncRequest.UserBuffer.Offset, asyncRequest.UserBuffer.Size, out wantMore);
}
Debug ("ProcessWrite - write user done: {0} - {1} {2}", asyncRequest.UserBuffer, ret, wantMore);
if (ret < 0) {
asyncRequest.UserResult = -1;
return AsyncOperationStatus.Complete;
}
asyncRequest.CurrentSize += ret;
asyncRequest.UserBuffer.Offset += ret;
asyncRequest.UserBuffer.Size -= ret;
if (wantMore || writeBuffer.Size > 0)
return AsyncOperationStatus.WantWrite;
asyncRequest.ResetWrite ();
asyncRequest.UserResult = asyncRequest.CurrentSize;
return AsyncOperationStatus.Complete;
}
AsyncOperationStatus ProcessClose (AsyncProtocolRequest asyncRequest, AsyncOperationStatus status)
{
Debug ("ProcessClose: {0}", status);
lock (ioLock) {
if (xobileTlsContext == null)
return AsyncOperationStatus.Complete;
}
xobileTlsContext.Close ();
xobileTlsContext = null;
return AsyncOperationStatus.Continue;
}
}
internal (int, bool) ProcessRead (BufferOffsetSize userBuffer)
AsyncOperationStatus ProcessFlush (AsyncProtocolRequest asyncRequest, AsyncOperationStatus status)
{
lock (ioLock) {
// This operates on the internal buffer and will never block.
var ret = xobileTlsContext.Read (userBuffer.Buffer, userBuffer.Offset, userBuffer.Size, out bool wantMore);
return (ret, wantMore);
}
Debug ("ProcessFlush: {0}", status);
return AsyncOperationStatus.Complete;
}
internal (int, bool) ProcessWrite (BufferOffsetSize userBuffer)
{
lock (ioLock) {
// This operates on the internal buffer and will never block.
var ret = xobileTlsContext.Write (userBuffer.Buffer, userBuffer.Offset, userBuffer.Size, out bool wantMore);
return (ret, wantMore);
}
}
internal AsyncOperationStatus ProcessShutdown (AsyncOperationStatus status)
{
Debug ("ProcessShutdown: {0}", status);
lock (ioLock) {
xobileTlsContext.Shutdown ();
shutdown = true;
return AsyncOperationStatus.Complete;
}
}
#endregion
#endregion
public override bool IsServer {
get {
CheckThrow (false);
return xobileTlsContext != null && xobileTlsContext.IsServer;
}
get { return xobileTlsContext != null && xobileTlsContext.IsServer; }
}
public override bool IsAuthenticated {
get {
lock (ioLock) {
// Don't use CheckThrow(), we want to return false if we're not authenticated.
return xobileTlsContext != null && lastException == null && xobileTlsContext.IsAuthenticated;
}
}
get { return xobileTlsContext != null && lastException == null && xobileTlsContext.IsAuthenticated; }
}
public override bool IsMutuallyAuthenticated {
get {
lock (ioLock) {
// Don't use CheckThrow() here.
if (!IsAuthenticated)
return false;
if ((xobileTlsContext.IsServer ? xobileTlsContext.LocalServerCertificate : xobileTlsContext.LocalClientCertificate) == null)
return false;
return xobileTlsContext.IsRemoteCertificateAvailable;
}
return IsAuthenticated &&
(Context.IsServer? Context.LocalServerCertificate: Context.LocalClientCertificate) != null &&
Context.IsRemoteCertificateAvailable;
}
}
protected override void Dispose (bool disposing)
{
try {
lastException = new ObjectDisposedException ("MobileAuthenticatedStream");
lock (ioLock) {
Debug ("Dispose: {0}", xobileTlsContext != null);
lastException = ExceptionDispatchInfo.Capture (new ObjectDisposedException ("MobileAuthenticatedStream"));
if (xobileTlsContext != null) {
xobileTlsContext.Dispose ();
xobileTlsContext = null;
@@ -698,53 +720,26 @@ namespace Mono.Net.Security
public override void Flush ()
{
// Write() automatically flushes the underlying stream.
CheckThrow (true);
var asyncRequest = new AsyncProtocolRequest (this, null);
StartOperation (ref asyncWriteRequest, ref writeBuffer, ProcessFlush, asyncRequest, "flush");
}
public SslProtocols SslProtocol {
get {
lock (ioLock) {
CheckThrow (true);
return (SslProtocols)xobileTlsContext.NegotiatedProtocol;
}
}
}
public X509Certificate RemoteCertificate {
get {
lock (ioLock) {
CheckThrow (true);
return xobileTlsContext.RemoteCertificate;
}
}
}
public X509Certificate LocalCertificate {
get {
lock (ioLock) {
CheckThrow (true);
return InternalLocalCertificate;
}
}
}
public X509Certificate InternalLocalCertificate {
get {
lock (ioLock) {
CheckThrow (false);
if (xobileTlsContext == null)
return null;
return xobileTlsContext.IsServer ? xobileTlsContext.LocalServerCertificate : xobileTlsContext.LocalClientCertificate;
}
}
}
public MSI.MonoTlsConnectionInfo GetConnectionInfo ()
public override void Close ()
{
lock (ioLock) {
CheckThrow (true);
return xobileTlsContext.ConnectionInfo;
}
/*
* SSLClose() is a little bit tricky as it might attempt to send a close_notify alert
* and thus call our write callback.
*
* It is also not thread-safe with SSLRead() or SSLWrite(), so we need to take the I/O lock here.
*/
if (Interlocked.Exchange (ref closeRequested, 1) == 1)
return;
if (xobileTlsContext == null)
return;
var asyncRequest = new AsyncProtocolRequest (this, null);
StartOperation (ref asyncWriteRequest, ref writeBuffer, ProcessClose, asyncRequest, "close");
}
//
@@ -774,7 +769,7 @@ namespace Mono.Net.Security
}
public override bool CanWrite {
get { return IsAuthenticated & InnerStream.CanWrite && !shutdown; }
get { return IsAuthenticated & InnerStream.CanWrite; }
}
public override bool CanSeek {
@@ -808,10 +803,46 @@ namespace Mono.Net.Security
set { InnerStream.WriteTimeout = value; }
}
public SslProtocols SslProtocol {
get {
CheckThrow (true);
return (SslProtocols)Context.NegotiatedProtocol;
}
}
public X509Certificate RemoteCertificate {
get {
CheckThrow (true);
return Context.RemoteCertificate;
}
}
public X509Certificate LocalCertificate {
get {
CheckThrow (true);
return InternalLocalCertificate;
}
}
public X509Certificate InternalLocalCertificate {
get {
CheckThrow (false);
if (!HasContext)
return null;
return Context.IsServer ? Context.LocalServerCertificate : Context.LocalClientCertificate;
}
}
public MSI.MonoTlsConnectionInfo GetConnectionInfo ()
{
CheckThrow (true);
return Context.ConnectionInfo;
}
public SSA.CipherAlgorithmType CipherAlgorithm {
get {
CheckThrow (true);
var info = GetConnectionInfo ();
var info = Context.ConnectionInfo;
if (info == null)
return SSA.CipherAlgorithmType.None;
switch (info.CipherAlgorithmType) {
@@ -830,7 +861,7 @@ namespace Mono.Net.Security
public SSA.HashAlgorithmType HashAlgorithm {
get {
CheckThrow (true);
var info = GetConnectionInfo ();
var info = Context.ConnectionInfo;
if (info == null)
return SSA.HashAlgorithmType.None;
switch (info.HashAlgorithmType) {
@@ -852,7 +883,7 @@ namespace Mono.Net.Security
public SSA.ExchangeAlgorithmType KeyExchangeAlgorithm {
get {
CheckThrow (true);
var info = GetConnectionInfo ();
var info = Context.ConnectionInfo;
if (info == null)
return SSA.ExchangeAlgorithmType.None;
switch (info.ExchangeAlgorithmType) {
@@ -867,7 +898,7 @@ namespace Mono.Net.Security
}
}
#region Need to Implement
#region Need to Implement
public int CipherStrength {
get {
throw new NotImplementedException ();
@@ -889,7 +920,7 @@ namespace Mono.Net.Security
}
}
#endregion
#endregion
}
}
#endif
@@ -169,7 +169,7 @@ namespace Mono.Net.Security
public abstract int Write (byte[] buffer, int offset, int count, out bool wantMore);
public abstract void Shutdown ();
public abstract void Close ();
protected bool ValidateCertificate (X509Certificate leaf, X509Chain chain)
{
@@ -83,8 +83,6 @@ namespace Mono.Net.Security
if (initialized)
return;
InitializeProviderRegistration ();
MSI.MonoTlsProvider provider;
try {
provider = CreateDefaultProviderImpl ();
-2
View File
@@ -9,8 +9,6 @@ partial class SR
{
public const string mono_net_io_shutdown = "mono_net_io_shutdown";
public const string mono_net_io_renegotiate = "mono_net_io_renegotiate";
public const string net_ssl_io_already_shutdown = "Write operations are not allowed after the channel was shutdown.";
public const string net_log_set_socketoption_reuseport_default_on = "net_log_set_socketoption_reuseport_default_on";
public const string net_log_set_socketoption_reuseport_not_supported = "net_log_set_socketoption_reuseport_not_supported";
@@ -46,7 +46,6 @@ namespace System.ComponentModel
case 32: /* ERROR_SHARING_VIOLATION */ return "Sharing violation";
case 33: /* ERROR_LOCK_VIOLATION */ return "Lock violation";
case 50: /* ERROR_NOT_SUPPORTED */ return "Operation not supported";
case 55: /* ERROR_DEV_NOT_EXIST */ return "Device does not exist";
case 87: /* ERROR_INVALID_PARAMETER */ return "Invalid parameter";
case 120: /* ERROR_CALL_NOT_IMPLEMENTED */ return "Call not implemented";
case 123: /* ERROR_INVALID_NAME */ return "Invalid name";
@@ -143,6 +142,7 @@ namespace System.ComponentModel
case 52: /* ERROR_DUP_NAME */ return "Duplicate name";
case 53: /* ERROR_BAD_NETPATH */ return "Bad netpath";
case 54: /* ERROR_NETWORK_BUSY */ return "Network busy";
case 55: /* ERROR_DEV_NOT_EXIST */ return "Device does not exist";
case 56: /* ERROR_TOO_MANY_CMDS */ return "Too many commands";
case 57: /* ERROR_ADAP_HDW_ERR */ return "ADAP HDW error";
case 58: /* ERROR_BAD_NET_RESP */ return "Bad net response";
@@ -61,10 +61,8 @@ namespace System.Net.Configuration
properties = new ConfigurationPropertyCollection ();
properties.Add (bypassListProp);
properties.Add (enabledProp);
properties.Add (moduleProp);
properties.Add (proxyProp);
properties.Add (useDefaultCredentialsProp);
}
public DefaultProxySection ()
@@ -62,7 +62,6 @@ namespace System.Net.Configuration
properties = new ConfigurationPropertyCollection ();
properties.Add (autoDetectProp);
properties.Add (bypassOnLocalProp);
properties.Add (proxyAddressProp);
properties.Add (scriptLocationProp);
Loaded 100 of 519 files, more files were not shown because too many files have changed in this diff. Show more