mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 01:41:18 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
77769615db | ||
|
|
df7816daf4 | ||
|
|
5d03a6fe11 | ||
|
|
4a2a26ce69 | ||
|
|
c8cfa8f284 | ||
|
|
6f0bf73005 | ||
|
|
fdbba4a34e | ||
|
|
1278c2f35e | ||
|
|
8199a27e28 | ||
|
|
9b3e6f4700 | ||
|
|
8487188883 | ||
|
|
f2379f2d66 | ||
|
|
db04a05e04 | ||
|
|
d06686c425 | ||
|
|
2ff898859b | ||
|
|
b27b2d7f61 | ||
|
|
13fc6948f3 | ||
|
|
2517534847 | ||
|
|
c6890f410c | ||
|
|
b33fa1d00e | ||
|
|
8a687a4044 | ||
|
|
44703b3ecc | ||
|
|
0ac7105edd | ||
|
|
147ecc0ac3 | ||
|
|
e7b4669bc9 | ||
|
|
fc145be98c | ||
|
|
adebac056a | ||
|
|
f7f561703a | ||
|
|
b5b50eefe7 | ||
|
|
cec38fcfc8 | ||
|
|
0761b0ee55 | ||
|
|
0c45a74a96 | ||
|
|
d5f5f3762f | ||
|
|
f1bdf8a93d | ||
|
|
3fdc3c84b2 | ||
|
|
846a5d41ee | ||
|
|
c8b96661d3 | ||
|
|
db584480ff | ||
|
|
0686e1435b | ||
|
|
5ef6ad0ef7 | ||
|
|
36073a0c74 | ||
|
|
e65846bfd3 | ||
|
|
0011444f0b | ||
|
|
4c93e382f5 | ||
|
|
8b72dbb708 | ||
|
|
1e2d68b92c | ||
|
|
e55302cb08 | ||
|
|
ef8188a08d | ||
|
|
01be275ad7 | ||
|
|
f9e5a6d2b2 | ||
|
|
a979811c63 | ||
|
|
455cf7d3b1 | ||
|
|
2edccc52a7 | ||
|
|
2b0e9bfe7a | ||
|
|
d56ea8a520 | ||
|
|
4e15267c70 | ||
|
|
fe455fcb34 | ||
|
|
64bfc6c000 | ||
|
|
0fd24828b1 | ||
|
|
03e8e8e56f | ||
|
|
db8ee7ad92 | ||
|
|
a83bdec08e | ||
|
|
f323b29968 | ||
|
|
360e64d261 | ||
|
|
a1351981f6 | ||
|
|
2cc08cae73 | ||
|
|
0a51d89c42 | ||
|
|
f7df632ff0 | ||
|
|
694c3ef470 | ||
|
|
00cb738f63 | ||
|
|
1ff24a77be | ||
|
|
5f80ec8d77 | ||
|
|
1ae385b59e | ||
|
|
b61db514ab | ||
|
|
68a4b43536 | ||
|
|
a36cb75039 | ||
|
|
c721d4ce2a | ||
|
|
2c3a70016b | ||
|
|
cafdade424 | ||
|
|
43cfe8ecfe | ||
|
|
bcee9454e9 | ||
|
|
e283c45cc0 | ||
|
|
828af02bdf | ||
|
|
ff68a657fa | ||
|
|
eb6a6bae1e | ||
|
|
e8046e3848 | ||
|
|
ade2f9239a | ||
|
|
ac8a9a9eab | ||
|
|
12c92be908 | ||
|
|
b951ebb775 | ||
|
|
47262ff08a | ||
|
|
17a925ca25 | ||
|
|
a2bb316900 | ||
|
|
cbc3a80a27 | ||
|
|
2538b65b30 | ||
|
|
5d83bf4c65 | ||
|
|
37c475126d | ||
|
|
50d4fc360c | ||
|
|
159160da7b | ||
|
|
25b7c45431 | ||
|
|
3e0d18cb7b | ||
|
|
8228edb9a2 | ||
|
|
c823f329f1 | ||
|
|
bb4cd21233 | ||
|
|
7327c13535 | ||
|
|
7eb7a82f09 | ||
|
|
94ad23218f |
No files matched your search
+2
-1
@@ -116,6 +116,8 @@
|
||||
|
||||
/mono/sgen @BrzVlad @lambdageek
|
||||
|
||||
/mono/tools/offsets-tool @lewurm @rolfbjarne
|
||||
|
||||
/mono/utils @vargaz @lewurm @lambdageek
|
||||
/mono/utils/atomic* @lewurm @vargaz
|
||||
/mono/utils/mono-hwcap* @lewurm @vargaz
|
||||
@@ -156,6 +158,5 @@
|
||||
/tools @lambdageek @vargaz
|
||||
/tools/locale-builder @marek-safar @egorbo
|
||||
/tools/nuget-hash-extractor @marek-safar @radical @akoeplinger
|
||||
/tools/offsets-tool @lewurm @rolfbjarne
|
||||
/tools/pedump @lambdageek @lewurm
|
||||
/tools/sgen @brzvlad @vargaz @naricc
|
||||
@@ -139,8 +139,6 @@ llvm/usr/
|
||||
sdks/builds/llvm-*/
|
||||
sdks/builds/android-*/
|
||||
mcs/build/compiler-server.log
|
||||
tools/offsets-tool-py/offtool/
|
||||
tools/offsets-tool-py/clang/__pycache__
|
||||
|
||||
##############################################################################
|
||||
# Arcade output directories
|
||||
|
||||
@@ -3,6 +3,7 @@ ACLOCAL_AMFLAGS = -I m4
|
||||
AM_CFLAGS = $(WERROR_CFLAGS)
|
||||
|
||||
SUBDIRS = @MONO_SUBDIRS@
|
||||
noinst_SUBDIRS = @MONO_NOINST_SUBDIRS@
|
||||
DIST_SUBDIRS = $(SUBDIRS) m4 netcore netcore/corerun
|
||||
|
||||
if !ENABLE_NETCORE
|
||||
@@ -93,6 +94,11 @@ mcs-do-compiler-tests:
|
||||
bootstrap-world: compiler-tests
|
||||
$(MAKE) install
|
||||
|
||||
install:
|
||||
for mydir in $(filter-out $(noinst_SUBDIRS),$(SUBDIRS)); do \
|
||||
(cd $${mydir} && ${MAKE} install) \
|
||||
done
|
||||
|
||||
update-csproj:
|
||||
-rm msvc/scripts/order
|
||||
-rm msvc/scripts/order.xml
|
||||
|
||||
+23
-10
@@ -4,7 +4,7 @@
|
||||
# This line is parsed by tools besides autoconf, such as msvc/mono.winconfig.targets.
|
||||
# It should remain in the format they expect.
|
||||
#
|
||||
AC_INIT(mono, [6.9.0],
|
||||
AC_INIT(mono, [6.10.0],
|
||||
[https://github.com/mono/mono/issues/new])
|
||||
|
||||
AC_CONFIG_SRCDIR([Makefile.am])
|
||||
@@ -605,6 +605,7 @@ AC_CHECK_TOOL(CC, gcc, gcc)
|
||||
AC_PROG_CC
|
||||
AC_CHECK_TOOL(CXX, g++, g++)
|
||||
AC_PROG_CXX
|
||||
AM_PATH_PYTHON([3.2])
|
||||
AM_PROG_AS
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_AWK
|
||||
@@ -2926,6 +2927,23 @@ if test x$host_win32 = xno; then
|
||||
])
|
||||
fi
|
||||
|
||||
dnl ********************************
|
||||
dnl *** Checks for sys_signame ***
|
||||
dnl ********************************
|
||||
AC_MSG_CHECKING(for sys_signame)
|
||||
AC_TRY_LINK([
|
||||
#include <signal.h>
|
||||
], [
|
||||
const char *signame = sys_signame[0];
|
||||
], [
|
||||
# Yes, we have it...
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SYSSIGNAME, 1, [Have sys_signame])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
|
||||
dnl ********************************
|
||||
dnl *** Checks for semaphore lib ***
|
||||
dnl ********************************
|
||||
@@ -2937,13 +2955,6 @@ if test x$host_win32 = xno; then
|
||||
AC_SEARCH_LIBS(shm_open, pthread rt posix4)
|
||||
AC_CHECK_FUNCS(shm_open)
|
||||
|
||||
dnl ********************************
|
||||
dnl *** Checks for gettext lib ***
|
||||
dnl ********************************
|
||||
# This is needed for some hackery for AIX;
|
||||
# Mono itself doesn't use it, but DllMap includes it
|
||||
AC_SEARCH_LIBS([gettext], [intl])
|
||||
|
||||
dnl ********************************
|
||||
dnl *** Checks for timezone stuff **
|
||||
dnl ********************************
|
||||
@@ -6052,8 +6063,8 @@ fi
|
||||
AC_SUBST(mono_runtime)
|
||||
AC_SUBST(mono_runtime_wrapper)
|
||||
|
||||
CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.3.0/csc.exe
|
||||
VBCS_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.3.0/VBCSCompiler.exe
|
||||
CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.6.0/csc.exe
|
||||
VBCS_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.6.0/VBCSCompiler.exe
|
||||
|
||||
if test $csc_compiler = mcs; then
|
||||
CSC=$mcs_topdir/class/lib/build/mcs.exe
|
||||
@@ -6268,9 +6279,11 @@ else
|
||||
fi
|
||||
|
||||
MONO_SUBDIRS="mk po $mono_subdirs_libgc llvm mono $mono_subdirs_ikvm_native $mono_subdirs_support data runtime scripts man samples $mono_subdirs_tools $mono_subdirs_docs msvc acceptance-tests"
|
||||
MONO_NOINST_SUBDIRS="$mono_subdirs_libgc"
|
||||
fi
|
||||
|
||||
AC_SUBST(MONO_SUBDIRS)
|
||||
AC_SUBST(MONO_NOINST_SUBDIRS)
|
||||
|
||||
AC_CONFIG_COMMANDS([quiet-libtool], [sed -e 's/echo "copying selected/# "copying selected/g' < libtool > libtool.tmp && mv libtool.tmp libtool && chmod a+x libtool; sed -e 's/$ECHO "copying selected/# "copying selected/g' < libtool > libtool.tmp && mv libtool.tmp libtool && chmod a+x libtool])
|
||||
AC_CONFIG_COMMANDS([nolock-libtool], [sed -e 's/lock_old_archive_extraction=yes/lock_old_archive_extraction=no/g' < libtool > libtool.tmp && mv libtool.tmp libtool && chmod a+x libtool])
|
||||
|
||||
Vendored
+1
-1
Submodule external/api-snapshot updated: 53a841ffd6...8ea1d663da.
Vendored
+1
-1
Submodule external/bockbuild updated: c9d4ecdba4...f44d61c9bc.
Vendored
+1
-1
Submodule external/corefx updated: 1cdb9c2094...033b184219.
Vendored
+1
-1
Submodule external/linker updated: e8d054bf32...4279148ff2.
Vendored
+1
-1
Submodule external/nunit-lite updated: 5406f2a7a0...26dbdb9a88.
Vendored
+1
-1
Submodule external/roslyn-binaries updated: e8390db828...8867d9ad53.
+7
-1
@@ -1496,6 +1496,9 @@ scanning is available.
|
||||
\fBno-managed-allocator\fR
|
||||
Disables the managed allocator.
|
||||
.TP
|
||||
\fBmanaged-allocator\fR
|
||||
Enables the managed allocator.
|
||||
.TP
|
||||
\fBcheck-scan-starts\fR
|
||||
If set, does a plausibility check on the scan_starts before and after each collection
|
||||
.TP
|
||||
@@ -1521,7 +1524,10 @@ sgen-gc.c. You can then use this command to explore the output
|
||||
\fBnursery-canaries\fR
|
||||
If set, objects allocated in the nursery are suffixed with a canary (guard)
|
||||
word, which is checked on each minor collection. Can be used to detect/debug
|
||||
heap corruption issues.
|
||||
heap corruption issues. This disables the usage of the managed allocator,
|
||||
because allocation from full aot code is inconsistent with this option. If
|
||||
the application is guaranteed not to use aot code, the managed allocator can
|
||||
be enabled back with managed-allocator option.
|
||||
|
||||
.TP
|
||||
\fBdo-not-finalize(=\fIclasses\fB)\fR
|
||||
|
||||
+71
-40
@@ -89,26 +89,32 @@ endif
|
||||
test_lib = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_test.dll)
|
||||
test_lib_output = $(test_lib_dir)/$(test_lib)
|
||||
|
||||
test_sourcefile_base_excludes = $(test_lib).exclude.sources
|
||||
test_library = $(ASSEMBLY:$(ASSEMBLY_EXT)=)_test$(ASSEMBLY_EXT)
|
||||
test_response = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(test_library).response
|
||||
test_makefrag = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(test_library).makefrag
|
||||
|
||||
test_pdb = $(test_lib:.dll=.pdb)
|
||||
test_flags = $(test_nunit_ref) $(TEST_MCS_FLAGS) $(TEST_LIB_MCS_FLAGS)
|
||||
ifndef NO_BUILD
|
||||
test_flags += -r:$(the_assembly)
|
||||
test_assembly_dep = $(the_assembly)
|
||||
endif
|
||||
tests_CLEAN_FILES += $(test_lib_output) $(test_lib_output:$(ASSEMBLY_EXT)=.pdb)
|
||||
|
||||
tests_CLEAN_FILES += $(test_lib_output) $(test_response) $(test_makefrag)
|
||||
|
||||
xtest_sourcefile_base = $(PROFILE_PLATFORM)_$(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.sources)
|
||||
xtest_sourcefile_base_excludes_full = $(PROFILE_PLATFORM)_$(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.exclude.sources)
|
||||
xtest_sourcefile_base_excludes = $(xtest_sourcefile_base_excludes_full:_%=%)
|
||||
|
||||
xunit_test_lib = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xunit-test.dll)
|
||||
xtest_lib_output = $(test_lib_dir)/$(xunit_test_lib)
|
||||
|
||||
xtest_response = $(depsdir)/$(xunit_test_lib).response
|
||||
xtest_makefrag = $(depsdir)/$(xunit_test_lib).makefrag
|
||||
xtest_flags = -r:$(the_assembly) $(xunit_libs_ref) $(XTEST_MCS_FLAGS) $(XTEST_LIB_MCS_FLAGS) /unsafe
|
||||
xtest_library = $(ASSEMBLY:$(ASSEMBLY_EXT)=)_xtest$(ASSEMBLY_EXT)
|
||||
xtest_response = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(xtest_library).response
|
||||
xtest_makefrag = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(xtest_library).makefrag
|
||||
xtest_flags = $(xunit_libs_ref) $(XTEST_MCS_FLAGS) $(XTEST_LIB_MCS_FLAGS) /unsafe
|
||||
|
||||
ifndef NO_BUILD
|
||||
xtest_flags += -r:$(the_assembly)
|
||||
xtest_assembly_dep = $(the_assembly)
|
||||
endif
|
||||
|
||||
ifeq ($(wildcard $(xtest_sourcefile_base)),)
|
||||
xtest_sourcefile_base = $(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.sources)
|
||||
@@ -140,6 +146,10 @@ test_assemblies :=
|
||||
ifdef HAVE_CS_TESTS
|
||||
test_assemblies += $(test_lib_output)
|
||||
|
||||
ifdef TEST_SPLIT_ASSEMBLIES
|
||||
test_assemblies += $(test_lib_output:.dll=.part1.dll) $(test_lib_output:.dll=.part2.dll) $(test_lib_output:.dll=.part3.dll)
|
||||
endif
|
||||
|
||||
check: run-test
|
||||
test-local: $(test_assemblies) $(test_lib_dir)/nunit-excludes.txt
|
||||
run-test-local: run-test-lib
|
||||
@@ -262,44 +272,42 @@ endif
|
||||
TEST_FILES =
|
||||
|
||||
ifdef HAVE_CS_TESTS
|
||||
TEST_FILES += `sed -e '/^$$/d' -e 's,^../,,' -e '/^\#.*$$/d' -et -e 's,^,Test/,' $(test_sourcefile_base)`
|
||||
endif
|
||||
|
||||
ifdef HAVE_CS_TESTS
|
||||
TEST_FILES += `sed -e '/^$$/d' -e 's,^../,,' -e '/^\#.*$$/d' -et -e 's,^,Test/,' $(test_sourcefile_base)`
|
||||
|
||||
$(test_lib_dir):
|
||||
mkdir -p $@
|
||||
|
||||
test_library = $(ASSEMBLY:$(ASSEMBLY_EXT)=)_test$(ASSEMBLY_EXT)
|
||||
|
||||
test_sourcefile = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(test_library).sources
|
||||
$(test_sourcefile): $(test_sourcefile_base) $(wildcard *_test.dll.sources) $(wildcard *_test.dll.exclude.sources) $(depsdir)/.stamp
|
||||
$(GENSOURCES) --basedir:./Test --strict --platformsdir:$(topdir)/build "$@" "$(test_library)" "$(PROFILE_PLATFORM)" "$(PROFILE)"
|
||||
|
||||
test_response = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(test_library).response
|
||||
$(test_response): $(test_sourcefile) $(topdir)/build/tests.make $(depsdir)/.stamp
|
||||
$(PLATFORM_CHANGE_SEPARATOR_CMD) <$(test_sourcefile) >$@
|
||||
|
||||
test_makefrag = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(test_library).makefrag
|
||||
$(test_makefrag): $(test_sourcefile) $(topdir)/build/tests.make $(depsdir)/.stamp
|
||||
@echo Creating $@ ...
|
||||
@sed 's,^,$(build_lib): ,' $< >$@
|
||||
@if test ! -f $(test_sourcefile).makefrag; then :; else \
|
||||
cat $(test_sourcefile).makefrag >> $@ ; \
|
||||
echo '$@: $(test_sourcefile).makefrag' >> $@; \
|
||||
echo '$(test_sourcefile).makefrag:' >> $@; fi
|
||||
|
||||
$(test_lib_output): $(test_assembly_dep) $(test_response) $(test_nunit_dep) $(test_lib_output).nunitlite.config | $(test_lib_dir)
|
||||
$(TEST_COMPILE) $(LIBRARY_FLAGS) -target:library -out:$@ $(test_flags) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS) @$(test_response)
|
||||
|
||||
tests_CLEAN_FILES += $(test_sourcefile) $(test_response) $(test_makefrag)
|
||||
ifdef TEST_SPLIT_ASSEMBLIES
|
||||
$(test_lib_output:.dll=.part1.dll): $(test_lib_output) $(test_response).part1
|
||||
$(TEST_COMPILE) $(LIBRARY_FLAGS) -target:library -out:$@ $(test_flags) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS) @$(test_response).part1
|
||||
|
||||
$(test_lib_output:.dll=.part2.dll): $(test_lib_output) $(test_response).part2
|
||||
$(TEST_COMPILE) $(LIBRARY_FLAGS) -target:library -out:$@ $(test_flags) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS) @$(test_response).part2
|
||||
|
||||
$(test_lib_output:.dll=.part3.dll): $(test_lib_output) $(test_response).part3
|
||||
ifneq ($(wildcard $(test_response).part3),)
|
||||
$(TEST_COMPILE) $(LIBRARY_FLAGS) -target:library -out:$@ $(test_flags) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS) @$(test_response).part3
|
||||
endif
|
||||
|
||||
# part3 is optional so we need this empty target to silence make if it doesn't exist
|
||||
$(test_response).part3: ;
|
||||
|
||||
tests_CLEAN_FILES += $(test_response).part1 $(test_response).part2 $(test_response).part3
|
||||
endif
|
||||
|
||||
$(test_response): $(test_sourcefile_base) $(wildcard *_test.dll.sources) $(wildcard *_test.dll.exclude.sources) $(topdir)/build/tests.make $(depsdir)/.stamp
|
||||
$(GENSOURCES) --basedir:./Test --strict --platformsdir:$(topdir)/build "$@" "$(test_library)" "$(PROFILE_PLATFORM)" "$(PROFILE)"
|
||||
|
||||
$(test_makefrag): $(test_response)
|
||||
@echo Creating $@ ...
|
||||
@sed 's,^,$(test_lib_output) $(test_lib_output:.dll=.part1.dll) $(test_lib_output:.dll=.part2.dll) $(test_lib_output:.dll=.part3.dll): ,' $< >$@
|
||||
|
||||
-include $(test_makefrag)
|
||||
|
||||
build-test-lib: $(test_lib_output)
|
||||
@echo Building testing lib
|
||||
|
||||
endif
|
||||
|
||||
@@ -336,8 +344,15 @@ ifdef COVERAGE
|
||||
XTEST_COVERAGE_FLAGS = -O=-aot --profile=coverage:output=$(topdir)/class/lib/$(PROFILE_DIRECTORY)/coverage_xunit_$(ASSEMBLY).xml
|
||||
endif
|
||||
|
||||
xtest_assemblies += $(xtest_lib_output)
|
||||
|
||||
ifdef XTEST_SPLIT_ASSEMBLIES
|
||||
xtest_assemblies += $(xtest_lib_output:.dll=.part1.dll) $(xtest_lib_output:.dll=.part2.dll) $(xtest_lib_output:.dll=.part3.dll)
|
||||
endif
|
||||
|
||||
|
||||
check: run-xunit-test-local
|
||||
xunit-test-local: $(xtest_lib_output) $(test_lib_dir)/xunit-excludes.txt $(test_lib_dir)/Xunit.NetCore.Extensions.dll $(test_lib_dir)/xunit.execution.dotnet.dll
|
||||
xunit-test-local: $(xtest_assemblies) $(test_lib_dir)/xunit-excludes.txt $(test_lib_dir)/Xunit.NetCore.Extensions.dll $(test_lib_dir)/xunit.execution.dotnet.dll
|
||||
run-xunit-test-local: run-xunit-test-lib
|
||||
|
||||
$(test_lib_dir)/xunit-excludes.txt: $(topdir)/build/tests.make | $(test_lib_dir)
|
||||
@@ -360,19 +375,35 @@ run-xunit-test-lib: xunit-test-local
|
||||
$(XTEST_REMOTE_EXECUTOR): $(topdir)/../external/corefx/src/Common/tests/System/Diagnostics/RemoteExecutorConsoleApp/RemoteExecutorConsoleApp.cs | $(test_lib_dir)
|
||||
$(TEST_COMPILE) -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll $< -out:$@
|
||||
|
||||
$(xtest_lib_output): $(the_assembly) $(xtest_response) $(xunit_libs_dep) $(xunit_src) $(XTEST_REMOTE_EXECUTOR) | $(test_lib_dir)
|
||||
$(xtest_lib_output): $(xtest_assembly_dep) $(xtest_response) $(xunit_libs_dep) $(xunit_src) $(XTEST_REMOTE_EXECUTOR) | $(test_lib_dir)
|
||||
$(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response) $(xunit_src)
|
||||
|
||||
xtest_response_preprocessed = $(xtest_response)_preprocessed
|
||||
ifdef XTEST_SPLIT_ASSEMBLIES
|
||||
$(xtest_lib_output:.dll=.part1.dll): $(xtest_lib_output) $(xtest_response).part1
|
||||
$(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response).part1 $(xunit_src)
|
||||
|
||||
$(xtest_lib_output:.dll=.part2.dll): $(xtest_lib_output) $(xtest_response).part2
|
||||
$(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response).part2 $(xunit_src)
|
||||
|
||||
$(xtest_lib_output:.dll=.part3.dll): $(xtest_lib_output) $(xtest_response).part3
|
||||
ifneq ($(wildcard $(xtest_response).part3),)
|
||||
$(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response).part3 $(xunit_src)
|
||||
endif
|
||||
|
||||
# part3 is optional so we need this empty target to silence make if it doesn't exist
|
||||
$(xtest_response).part3: ;
|
||||
|
||||
xtests_CLEAN_FILES += $(xtest_response).part1 $(xtest_response).part2 $(xtest_response).part3
|
||||
endif
|
||||
|
||||
# This handles .excludes/.sources pairs, as well as resolving the
|
||||
# includes that occur in .sources files
|
||||
$(xtest_response): $(xtest_sourcefile_base) $(wildcard *xtest.dll.sources) $(wildcard $(xtest_sourcefile_base_excludes))
|
||||
$(GENSOURCES) --strict --platformsdir:$(topdir)/build "$@" "$(xtest_sourcefile_base)" "$(xtest_sourcefile_base_excludes)"
|
||||
# includes that occur in .sources files. It also handles splitting test assemblies into multiple parts.
|
||||
$(xtest_response): $(xtest_sourcefile_base) $(wildcard *_xtest.dll.sources) $(wildcard *_xtest.dll.exclude.sources) $(topdir)/build/tests.make $(depsdir)/.stamp
|
||||
$(GENSOURCES) --strict --platformsdir:$(topdir)/build "$@" "$(xtest_library)" "$(PROFILE_PLATFORM)" "$(PROFILE)"
|
||||
|
||||
$(xtest_makefrag): $(xtest_response)
|
||||
@echo Creating $@ ...
|
||||
@sed 's,^,$(xtest_lib_output): ,' $< >$@
|
||||
@sed 's,^,$(xtest_lib_output) $(xtest_lib_output:.dll=.part1.dll) $(xtest_lib_output:.dll=.part2.dll) $(xtest_lib_output:.dll=.part3.dll): ,' $< >$@
|
||||
|
||||
-include $(xtest_makefrag)
|
||||
|
||||
|
||||
@@ -27,14 +27,28 @@
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.CmsRecipient))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.CmsRecipientCollection))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.CmsRecipientEnumerator))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.CmsSigner))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.ContentInfo))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.EnvelopedCms))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.KeyAgreeRecipientInfo))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.KeyTransRecipientInfo))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12Builder))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12CertBag))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12ConfidentialityMode))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12Info))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12IntegrityMode))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12KeyBag))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12SafeBag))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12SafeContents))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12SafeContentsBag))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12SecretBag))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs8PrivateKeyInfo))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9AttributeObject))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9ContentType))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9DocumentDescription))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9DocumentName))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9LocalKeyId))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9MessageDigest))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9SigningTime))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.PublicKeyInfo))]
|
||||
@@ -42,10 +56,15 @@
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.RecipientInfoCollection))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.RecipientInfoEnumerator))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.RecipientInfoType))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Rfc3161TimestampToken))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Rfc3161TimestampTokenInfo))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SignedCms))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SignerInfo))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SignerInfoCollection))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SignerInfoEnumerator))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SubjectIdentifier))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SubjectIdentifierOrKey))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SubjectIdentifierOrKeyType))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SubjectIdentifierType))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Xml.X509IssuerSerial))]
|
||||
|
||||
|
||||
@@ -558,6 +558,10 @@ public class Tests : TestsBase, ITest2
|
||||
runtime_invoke_hybrid_exceptions();
|
||||
return 0;
|
||||
}
|
||||
if (args.Length > 0 && args [0] == "new_thread_hybrid_exception") {
|
||||
new_thread_hybrid_exception();
|
||||
return 0;
|
||||
}
|
||||
assembly_load ();
|
||||
breakpoints ();
|
||||
single_stepping ();
|
||||
@@ -2222,12 +2226,27 @@ public class Tests : TestsBase, ITest2
|
||||
[MethodImplAttribute (MethodImplOptions.NoInlining)]
|
||||
public static void runtime_invoke_hybrid_exceptions () {
|
||||
Type rtType = Type.GetType("RuntimeInvokeWithThrowClass");
|
||||
ConstructorInfo rtConstructor = rtType.GetConstructor(Type.EmptyTypes);
|
||||
object rtObject = rtConstructor.Invoke(new object[] { });
|
||||
MethodInfo rtMethod = rtType.GetMethod("RuntimeInvokeThrowMethod");
|
||||
rtMethod.Invoke(rtObject, new object[] { });
|
||||
ConstructorInfo rtConstructor = rtType.GetConstructor(Type.EmptyTypes);
|
||||
object rtObject = rtConstructor.Invoke(new object[] { });
|
||||
MethodInfo rtMethod = rtType.GetMethod("RuntimeInvokeThrowMethod");
|
||||
rtMethod.Invoke(rtObject, new object[] { });
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.NoInlining)]
|
||||
public static void new_thread_hybrid_exception() {
|
||||
try
|
||||
{
|
||||
Thread thread = new Thread(new_thread_hybrid_exception2);
|
||||
thread.Start();
|
||||
}
|
||||
catch (Exception sockEx)
|
||||
{
|
||||
}
|
||||
}
|
||||
public static void new_thread_hybrid_exception2()
|
||||
{
|
||||
throw new Exception("Error");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class SentinelClass : MarshalByRefObject {
|
||||
|
||||
@@ -470,7 +470,6 @@ public class DebuggerTests
|
||||
|
||||
var pdbFromMemory = assemblyMirror.GetPdbBlob ();
|
||||
if (!File.Exists (pdbPath)) {
|
||||
Assert.IsFalse (assemblyMirror.HasPdb);
|
||||
Assert.IsTrue (assemblyMirror.HasFetchedPdb);
|
||||
continue;
|
||||
}
|
||||
@@ -5151,6 +5150,19 @@ public class DebuggerTests
|
||||
vm.Exit (0);
|
||||
vm = null;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestNewThreadHybridSuspendException () {
|
||||
TearDown ();
|
||||
Start (dtest_app_path, "new_thread_hybrid_exception", forceExit: true);
|
||||
var req2 = vm.CreateExceptionRequest (null, false, true, false);
|
||||
req2.Enable ();
|
||||
vm.Resume ();
|
||||
var ev = GetNextEvent ();
|
||||
Assert.IsInstanceOfType (typeof (ExceptionEvent), ev);
|
||||
vm.Exit (0);
|
||||
vm = null;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestAsyncDebugGenerics () {
|
||||
|
||||
+3
-20
@@ -43,33 +43,16 @@ namespace Mono.Messaging.RabbitMQ {
|
||||
public class RabbitMQMessagingProvider : IMessagingProvider {
|
||||
|
||||
private int txCounter = 0;
|
||||
private readonly uint localIp;
|
||||
private readonly Guid localId;
|
||||
private readonly MessagingContextPool contextPool;
|
||||
|
||||
public RabbitMQMessagingProvider ()
|
||||
{
|
||||
localIp = GetLocalIP ();
|
||||
localId = Guid.NewGuid ();
|
||||
contextPool = new MessagingContextPool (new MessageFactory (this),
|
||||
CreateConnection);
|
||||
}
|
||||
|
||||
private static uint GetLocalIP ()
|
||||
{
|
||||
String strHostName = Dns.GetHostName ();
|
||||
IPHostEntry ipEntry = Dns.GetHostByName (strHostName);
|
||||
foreach (IPAddress ip in ipEntry.AddressList) {
|
||||
if (AddressFamily.InterNetwork == ip.AddressFamily) {
|
||||
byte[] addr = ip.GetAddressBytes ();
|
||||
uint localIP = 0;
|
||||
for (int i = 0; i < 4 && i < addr.Length; i++) {
|
||||
localIP += (uint) (addr[i] << 8 * (3 - i));
|
||||
}
|
||||
return localIP;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public IMessage CreateMessage ()
|
||||
{
|
||||
return new MessageBase ();
|
||||
@@ -78,7 +61,7 @@ namespace Mono.Messaging.RabbitMQ {
|
||||
public IMessageQueueTransaction CreateMessageQueueTransaction ()
|
||||
{
|
||||
Interlocked.Increment (ref txCounter);
|
||||
string txId = localIp.ToString () + txCounter.ToString ();
|
||||
string txId = localId.ToString () + "_" + txCounter.ToString ();
|
||||
|
||||
return new RabbitMQMessageQueueTransaction (txId, contextPool);
|
||||
}
|
||||
|
||||
@@ -5658,21 +5658,30 @@ namespace PEAPI {
|
||||
char[] name;
|
||||
Hashtable htable = new Hashtable();
|
||||
Hashtable btable = new Hashtable (new ByteArrayHashCodeProvider (), new ByteArrayComparer ());
|
||||
bool addInitByte = false;
|
||||
bool initByteAdded = false;
|
||||
|
||||
internal MetaDataStream(char[] name, bool addInitByte) : base(new MemoryStream())
|
||||
{
|
||||
if (addInitByte) { Write((byte)0); size = 1; }
|
||||
this.addInitByte = addInitByte;
|
||||
this.name = name;
|
||||
sizeOfHeader = StreamHeaderSize + (uint)name.Length;
|
||||
}
|
||||
|
||||
internal MetaDataStream(char[] name, System.Text.Encoding enc, bool addInitByte) : base(new MemoryStream(),enc)
|
||||
{
|
||||
if (addInitByte) { Write((byte)0); size = 1; }
|
||||
this.addInitByte = addInitByte;
|
||||
this.name = name;
|
||||
sizeOfHeader = StreamHeaderSize + (uint)name.Length;
|
||||
}
|
||||
|
||||
void AddInitByte () {
|
||||
if (addInitByte && !initByteAdded) {
|
||||
Write((byte)0);
|
||||
size += 1;
|
||||
initByteAdded = true;
|
||||
}
|
||||
}
|
||||
public uint Start {
|
||||
get { return start; }
|
||||
set { start = value; }
|
||||
@@ -5706,6 +5715,7 @@ namespace PEAPI {
|
||||
|
||||
internal uint Add(string str, bool prependSize)
|
||||
{
|
||||
AddInitByte ();
|
||||
Object val = htable[str];
|
||||
uint index = 0;
|
||||
if (val == null) {
|
||||
@@ -5723,6 +5733,7 @@ namespace PEAPI {
|
||||
}
|
||||
internal uint Add (byte[] str, bool prependSize)
|
||||
{
|
||||
AddInitByte ();
|
||||
Object val = btable [str];
|
||||
uint index = 0;
|
||||
if (val == null) {
|
||||
@@ -5740,6 +5751,7 @@ namespace PEAPI {
|
||||
|
||||
internal uint Add(Guid guid, bool prependSize)
|
||||
{
|
||||
AddInitByte ();
|
||||
byte [] b = guid.ToByteArray ();
|
||||
if (prependSize) CompressNum ((uint) b.Length);
|
||||
Write(guid.ToByteArray());
|
||||
@@ -5749,6 +5761,7 @@ namespace PEAPI {
|
||||
|
||||
internal uint Add(byte[] blob)
|
||||
{
|
||||
AddInitByte ();
|
||||
uint ix = size;
|
||||
CompressNum((uint)blob.Length);
|
||||
Write(blob);
|
||||
@@ -5758,6 +5771,7 @@ namespace PEAPI {
|
||||
|
||||
internal uint Add(byte val, bool prependSize)
|
||||
{
|
||||
AddInitByte ();
|
||||
uint ix = size;
|
||||
if (prependSize) CompressNum (1);
|
||||
Write(val);
|
||||
@@ -5767,6 +5781,7 @@ namespace PEAPI {
|
||||
|
||||
internal uint Add(sbyte val, bool prependSize)
|
||||
{
|
||||
AddInitByte ();
|
||||
uint ix = size;
|
||||
if (prependSize) CompressNum (1);
|
||||
Write(val);
|
||||
@@ -5776,6 +5791,7 @@ namespace PEAPI {
|
||||
|
||||
internal uint Add(ushort val, bool prependSize)
|
||||
{
|
||||
AddInitByte ();
|
||||
uint ix = size;
|
||||
if (prependSize) CompressNum (2);
|
||||
Write(val);
|
||||
@@ -5785,6 +5801,7 @@ namespace PEAPI {
|
||||
|
||||
internal uint Add(short val, bool prependSize)
|
||||
{
|
||||
AddInitByte ();
|
||||
uint ix = size;
|
||||
if (prependSize) CompressNum (2);
|
||||
Write(val);
|
||||
@@ -5794,6 +5811,7 @@ namespace PEAPI {
|
||||
|
||||
internal uint Add(uint val, bool prependSize)
|
||||
{
|
||||
AddInitByte ();
|
||||
uint ix = size;
|
||||
if (prependSize) CompressNum (4);
|
||||
Write(val);
|
||||
@@ -5803,6 +5821,7 @@ namespace PEAPI {
|
||||
|
||||
internal uint Add(int val, bool prependSize)
|
||||
{
|
||||
AddInitByte ();
|
||||
uint ix = size;
|
||||
if (prependSize) CompressNum (4);
|
||||
Write (val);
|
||||
@@ -5812,6 +5831,7 @@ namespace PEAPI {
|
||||
|
||||
internal uint Add(ulong val, bool prependSize)
|
||||
{
|
||||
AddInitByte ();
|
||||
uint ix = size;
|
||||
if (prependSize) CompressNum (8);
|
||||
Write(val);
|
||||
@@ -5821,6 +5841,7 @@ namespace PEAPI {
|
||||
|
||||
internal uint Add(long val, bool prependSize)
|
||||
{
|
||||
AddInitByte ();
|
||||
uint ix = size;
|
||||
if (prependSize) CompressNum (8);
|
||||
Write(val);
|
||||
@@ -5830,6 +5851,7 @@ namespace PEAPI {
|
||||
|
||||
internal uint Add(float val, bool prependSize)
|
||||
{
|
||||
AddInitByte ();
|
||||
uint ix = size;
|
||||
if (prependSize) CompressNum (4);
|
||||
Write(val);
|
||||
@@ -5839,6 +5861,7 @@ namespace PEAPI {
|
||||
|
||||
internal uint Add(double val, bool prependSize)
|
||||
{
|
||||
AddInitByte ();
|
||||
uint ix = size;
|
||||
if (prependSize) CompressNum (8);
|
||||
Write(val);
|
||||
|
||||
@@ -62,4 +62,6 @@ XTEST_LIB_REFS = System Facades/System.Threading.Tasks Microsoft.CSharp Facades/
|
||||
XTEST_LIB_FLAGS = -unsafe -d:FEATURE_COMPILE
|
||||
XTEST_RESX_RESOURCE_STRING = ../../../external/corefx/src/System.Collections.Immutable/src/Resources/Strings.resx
|
||||
|
||||
XTEST_SPLIT_ASSEMBLIES := $(filter monotouch%, $(PROFILE))
|
||||
|
||||
include ../../build/library.make
|
||||
@@ -3,12 +3,10 @@
|
||||
../../../external/corefx/src/CoreFx.Private.TestUtilities/src/System/AssertExtensions.cs
|
||||
../../../external/corefx/src/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs
|
||||
|
||||
# System.Linq
|
||||
# TODO: ../../../external/corefx/src/System.Linq/tests/*.cs
|
||||
|
||||
# System.Linq.Queryable
|
||||
../../../external/corefx/src/System.Linq.Queryable/tests/*.cs
|
||||
../../../external/corefx/src/Common/tests/System/Linq/SkipTakeData.cs
|
||||
#split monotouch
|
||||
#split monotouch_tv
|
||||
#split monotouch_watch
|
||||
|
||||
# System.Linq.Expressions
|
||||
../../../external/corefx/src/System.Linq.Expressions/tests/Array/*.cs:NewArrayBoundsTests.cs,ArrayAccessTests.cs,ArrayIndexTests.cs
|
||||
@@ -56,7 +54,19 @@
|
||||
../../../external/corefx/src/System.Linq.Expressions/tests/Unary/IncDecAssign/*.cs
|
||||
../../../external/corefx/src/System.Linq.Expressions/tests/*.cs:StackSpillerTests.cs,ReadOnlyCollectionBuilderTests.cs
|
||||
|
||||
# System.Linq.Expressions
|
||||
|
||||
#split monotouch
|
||||
#split monotouch_tv
|
||||
#split monotouch_watch
|
||||
|
||||
# System.Linq
|
||||
# TODO: ../../../external/corefx/src/System.Linq/tests/*.cs
|
||||
|
||||
# System.Linq.Queryable
|
||||
../../../external/corefx/src/System.Linq.Queryable/tests/*.cs
|
||||
../../../external/corefx/src/Common/tests/System/Linq/SkipTakeData.cs
|
||||
|
||||
# System.Linq.Parallel
|
||||
../../../external/corefx/src/System.Linq.Parallel/tests/Combinatorial/*.cs
|
||||
../../../external/corefx/src/System.Linq.Parallel/tests/Helpers/*.cs
|
||||
../../../external/corefx/src/System.Linq.Parallel/tests/QueryOperators/*.cs:DefaultIfEmptyTests.cs,SingleSingleOrDefaultTests.cs
|
||||
|
||||
@@ -2,16 +2,15 @@ thisdir = class/System.Net.Http/FunctionalTests
|
||||
SUBDIRS =
|
||||
include ../../../build/rules.make
|
||||
|
||||
ASSEMBLY = System.Net.Http.FunctionalTests
|
||||
LIBRARY = System.Net.Http.FunctionalTests.dll
|
||||
NO_BUILD = yes
|
||||
NO_INSTALL = yes
|
||||
|
||||
XTEST_LIB_REFS = System System.Core Facades/System.Threading.Tasks
|
||||
XTEST_LIB_REFS = System System.Core Facades/System.Threading.Tasks System.Net.Http
|
||||
USE_XTEST_REMOTE_EXECUTOR = YES
|
||||
|
||||
XTEST_LIB_FLAGS = /resource:../../System/Test/TestData/testservereku.contoso.com.pfx
|
||||
|
||||
the_assembly = $(topdir)/class/lib/$(PROFILE_DIRECTORY)/System.Net.Http.dll
|
||||
|
||||
include ../../../build/tests.make
|
||||
include ../../../build/library.make
|
||||
|
||||
TEST_RUNTIME := MONO_URI_DOTNETRELATIVEORABSOLUTE=true $(TEST_RUNTIME)
|
||||
|
||||
|
||||
Whitespace-only changes.
@@ -0,0 +1,27 @@
|
||||
using System.Reflection;
|
||||
|
||||
namespace System.Net.Http
|
||||
{
|
||||
partial class HttpClientHandler : HttpMessageHandler
|
||||
{
|
||||
static IMonoHttpClientHandler CreateDefaultHandler ()
|
||||
{
|
||||
string envvar = Environment.GetEnvironmentVariable ("XA_HTTP_CLIENT_HANDLER_TYPE")?.Trim ();
|
||||
if (envvar?.StartsWith("System.Net.Http.MonoWebRequestHandler", StringComparison.InvariantCulture) == true)
|
||||
{
|
||||
Type monoWrhType = Type.GetType (envvar, false);
|
||||
if (monoWrhType != null)
|
||||
return (IMonoHttpClientHandler) Activator.CreateInstance (monoWrhType);
|
||||
}
|
||||
|
||||
// Ignore other types of handlers here (e.g. AndroidHttpHandler) to keep the old behavior
|
||||
// and always create SocketsHttpHandler for code like this if MonoWebRequestHandler was not specified:
|
||||
//
|
||||
// var handler = new HttpClientHandler { Credentials = ... };
|
||||
// var httpClient = new HttpClient (handler);
|
||||
//
|
||||
// AndroidHttpHandler is used only when we use the parameterless ctor of HttpClient
|
||||
return new SocketsHttpHandler ();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,7 +70,7 @@ namespace System.Net.Http
|
||||
TimeSpan? timeout;
|
||||
bool disposed;
|
||||
|
||||
internal MonoWebRequestHandler ()
|
||||
public MonoWebRequestHandler ()
|
||||
{
|
||||
allowAutoRedirect = true;
|
||||
maxAutomaticRedirections = 50;
|
||||
|
||||
@@ -1328,7 +1328,7 @@
|
||||
<Compile Include="..\..\..\external\corefx\src\System.Net.Http\src\System\Net\Http\StreamContent.cs" />
|
||||
<Compile Include="..\..\..\external\corefx\src\System.Net.Http\src\System\Net\Http\StreamToStreamCopy.cs" />
|
||||
<Compile Include="..\..\..\external\corefx\src\System.Net.Http\src\System\Net\Http\StringContent.cs" />
|
||||
<Compile Include="HttpClientHandler.SocketsHandler.cs" />
|
||||
<Compile Include="HttpClientHandler.SocketsHandler.Android.cs" />
|
||||
<Compile Include="HttpClientHandler.cs" />
|
||||
<Compile Include="HttpRequestMessage.Mono.cs" />
|
||||
<Compile Include="IMonoHttpClientHandler.cs" />
|
||||
|
||||
@@ -8,27 +8,34 @@ namespace System.Net.Http {
|
||||
|
||||
static HttpMessageHandler CreateDefaultHandler ()
|
||||
{
|
||||
Type type = Type.GetType("Android.Runtime.AndroidEnvironment, Mono.Android");
|
||||
if (type == null)
|
||||
return GetFallback ("Invalid Mono.Android assembly? Cannot find Android.Runtime.AndroidEnvironment");
|
||||
string envvar = Environment.GetEnvironmentVariable ("XA_HTTP_CLIENT_HANDLER_TYPE")?.Trim ();
|
||||
|
||||
MethodInfo method = type.GetMethod ("GetHttpMessageHandler", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
if (method == null)
|
||||
return GetFallback ("Your Xamarin.Android version does not support obtaining of the custom HttpClientHandler");
|
||||
if (string.IsNullOrEmpty (envvar))
|
||||
return new HttpClientHandler ();
|
||||
|
||||
object ret = method.Invoke (null, null);
|
||||
if (ret == null)
|
||||
return GetFallback ("Xamarin.Android returned no custom HttpClientHandler");
|
||||
if (envvar?.StartsWith ("System.Net.Http.MonoWebRequestHandler", StringComparison.InvariantCulture) == true)
|
||||
{
|
||||
Type monoWrhType = Type.GetType (envvar, false);
|
||||
if (monoWrhType != null)
|
||||
return new HttpClientHandler ((IMonoHttpClientHandler) Activator.CreateInstance (monoWrhType));
|
||||
|
||||
var handler = ret as HttpMessageHandler;
|
||||
if (handler == null)
|
||||
return GetFallback ($"{ret?.GetType()} is not a valid HttpMessageHandler");
|
||||
return handler;
|
||||
}
|
||||
return new HttpClientHandler ();
|
||||
}
|
||||
|
||||
Type handlerType = Type.GetType (envvar, false);
|
||||
if (handlerType == null && !envvar.Contains (", "))
|
||||
{
|
||||
// if assembly was not specified - look for it in Mono.Android too
|
||||
// (e.g. AndroidHttpHandler is there)
|
||||
handlerType = Type.GetType (envvar + ", Mono.Android", false);
|
||||
}
|
||||
|
||||
if (handlerType == null)
|
||||
return new HttpClientHandler ();
|
||||
|
||||
if (Activator.CreateInstance (handlerType) is HttpMessageHandler msgHandler)
|
||||
return msgHandler;
|
||||
|
||||
static HttpMessageHandler GetFallback (string message)
|
||||
{
|
||||
Console.WriteLine (message + ". Defaulting to System.Net.Http.HttpClientHandler");
|
||||
return new HttpClientHandler ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,15 +2,15 @@ thisdir = class/System.Net.Http/UnitTests
|
||||
SUBDIRS =
|
||||
include ../../../build/rules.make
|
||||
|
||||
ASSEMBLY = System.Net.Http.UnitTests
|
||||
LIBRARY = System.Net.Http.UnitTests.dll
|
||||
NO_BUILD = yes
|
||||
NO_INSTALL = yes
|
||||
|
||||
XTEST_LIB_REFS = System System.Core Facades/System.Threading.Tasks
|
||||
USE_XTEST_REMOTE_EXECUTOR = YES
|
||||
XTEST_MCS_FLAGS = -nowarn:436
|
||||
|
||||
include ../../../build/tests.make
|
||||
|
||||
xtest_flags = $(xunit_libs_ref) $(XTEST_MCS_FLAGS) $(XTEST_LIB_MCS_FLAGS) /unsafe
|
||||
include ../../../build/library.make
|
||||
|
||||
clean-local:
|
||||
-rm -f $(tests_CLEAN_FILES) $(CLEAN_FILES)
|
||||
|
||||
Whitespace-only changes.
@@ -1 +1,2 @@
|
||||
HttpClient.DefaultHandler.cs
|
||||
HttpClientHandler.SocketsHandler.cs
|
||||
@@ -1,2 +1,3 @@
|
||||
#include socketshandler.sources
|
||||
System.Net.Http/HttpClient.android.cs
|
||||
HttpClientHandler.SocketsHandler.Android.cs
|
||||
@@ -30,7 +30,10 @@ namespace MonoTests.Remoting
|
||||
{
|
||||
try
|
||||
{
|
||||
tcp = new TcpChannel (0);
|
||||
Hashtable tcpOptions = new Hashtable ();
|
||||
tcpOptions ["port"] = 0;
|
||||
tcpOptions ["bindTo"] = "127.0.0.1";
|
||||
tcp = new TcpChannel (tcpOptions, null, null);
|
||||
|
||||
Hashtable options = new Hashtable ();
|
||||
options ["timeout"] = 10000; // 10s
|
||||
@@ -42,8 +45,8 @@ namespace MonoTests.Remoting
|
||||
AppDomain domain = BaseCallTest.CreateDomain ("testdomain_activation");
|
||||
server = (ActivationServer) domain.CreateInstanceAndUnwrap(GetType().Assembly.FullName,"MonoTests.Remoting.ActivationServer");
|
||||
|
||||
var tcpUrlPrefix = $"tcp://localhost:{server.TcpPort}";
|
||||
var httpUrlPrefix = $"http://localhost:{server.HttpPort}";
|
||||
var tcpUrlPrefix = $"tcp://127.0.0.1:{server.TcpPort}";
|
||||
var httpUrlPrefix = $"http://127.0.0.1:{server.HttpPort}";
|
||||
RemotingConfiguration.RegisterActivatedClientType (typeof(CaObject1), tcpUrlPrefix);
|
||||
RemotingConfiguration.RegisterActivatedClientType (typeof(CaObject2), httpUrlPrefix);
|
||||
RemotingConfiguration.RegisterWellKnownClientType (typeof(WkObjectSinglecall1), tcpUrlPrefix + "/wkoSingleCall1");
|
||||
@@ -169,8 +172,14 @@ namespace MonoTests.Remoting
|
||||
{
|
||||
TcpPort = NetworkHelpers.FindFreePort ();
|
||||
HttpPort = NetworkHelpers.FindFreePort ();
|
||||
tcp = new TcpChannel (TcpPort);
|
||||
http = new HttpChannel (HttpPort);
|
||||
IDictionary tcpProps = new Hashtable ();
|
||||
IDictionary httpProps = new Hashtable ();
|
||||
tcpProps ["port"] = TcpPort;
|
||||
tcpProps ["bindTo"] = "127.0.0.1";
|
||||
httpProps ["port"] = HttpPort;
|
||||
httpProps ["bindTo"] = "127.0.0.1";
|
||||
tcp = new TcpChannel (tcpProps, null, null);
|
||||
http = new HttpChannel (httpProps, null, null);
|
||||
|
||||
ChannelServices.RegisterChannel (tcp);
|
||||
ChannelServices.RegisterChannel (http);
|
||||
|
||||
@@ -172,6 +172,7 @@ namespace MonoTests.Remoting
|
||||
IDictionary props = new Hashtable ();
|
||||
props ["name"] = Guid.NewGuid ().ToString("N");
|
||||
props ["port"] = port;
|
||||
props ["bindTo"] = "127.0.0.1";
|
||||
TcpChannel chan = new TcpChannel (props, null, null);
|
||||
ChannelServices.RegisterChannel (chan);
|
||||
|
||||
|
||||
@@ -20,11 +20,15 @@ namespace MonoTests.Remoting.Http
|
||||
[Ignore ("This test somehow keeps http channel registered and then blocks any further http tests working. This also happens under .NET, so this test itself is wrong with nunit 2.4.8.")]
|
||||
public void Test ()
|
||||
{
|
||||
new HttpChannel (8086);
|
||||
var port = NetworkHelpers.FindFreePort ();
|
||||
Hashtable props = new Hashtable ();
|
||||
props["port"] = port;
|
||||
props["bindTo"] = "127.0.0.1";
|
||||
new HttpChannel (props, null, null);
|
||||
RemotingServices.Marshal (new Service (), "test");
|
||||
|
||||
Service remObj = (Service) RemotingServices.Connect (
|
||||
typeof (Service), "http://localhost:8086/test");
|
||||
typeof (Service), $"http://127.0.0.1:{port}/test");
|
||||
|
||||
ArrayList list;
|
||||
remObj.Test (out list);
|
||||
@@ -70,13 +74,16 @@ namespace MonoTests.Remoting.Http
|
||||
public void Main ()
|
||||
{
|
||||
var port = NetworkHelpers.FindFreePort ();
|
||||
channel = new HttpChannel (port);
|
||||
Hashtable props = new Hashtable ();
|
||||
props["port"] = port;
|
||||
props["bindTo"] = "127.0.0.1";
|
||||
channel = new HttpChannel (props, null, null);
|
||||
ChannelServices.RegisterChannel (channel);
|
||||
RemotingConfiguration.RegisterWellKnownServiceType
|
||||
(typeof (Bug321420),"Server.soap", WellKnownObjectMode.Singleton);
|
||||
|
||||
Bug321420 s = (Bug321420) Activator.GetObject (typeof
|
||||
(Bug321420), $"http://localhost:{port}/Server.soap");
|
||||
(Bug321420), $"http://127.0.0.1:{port}/Server.soap");
|
||||
|
||||
// this works: s.Method ("a", "b");
|
||||
s.Method ("a", "a");
|
||||
@@ -101,7 +108,7 @@ namespace MonoTests.Remoting.Http
|
||||
public void Main ()
|
||||
{
|
||||
Foo foo = (Foo) Activator.GetObject (typeof (Foo),
|
||||
$"http://localhost:{server.HttpPort}/Test");
|
||||
$"http://127.0.0.1:{server.HttpPort}/Test");
|
||||
|
||||
Bar bar = foo.Login ();
|
||||
if (bar != null)
|
||||
@@ -146,7 +153,10 @@ namespace MonoTests.Remoting.Http
|
||||
public void Start ()
|
||||
{
|
||||
HttpPort = NetworkHelpers.FindFreePort ();
|
||||
c = new HttpChannel (HttpPort);
|
||||
Hashtable props = new Hashtable ();
|
||||
props["port"] = HttpPort;
|
||||
props["bindTo"] = "127.0.0.1";
|
||||
c = new HttpChannel (props, null, null);
|
||||
ChannelServices.RegisterChannel (c);
|
||||
|
||||
Type t = typeof(Foo);
|
||||
@@ -174,11 +184,14 @@ namespace MonoTests.Remoting.Http
|
||||
[Test]
|
||||
public void Main ()
|
||||
{
|
||||
channel = new HttpChannel (0);
|
||||
Hashtable props = new Hashtable ();
|
||||
props["port"] = 0;
|
||||
props["bindTo"] = "127.0.0.1";
|
||||
channel = new HttpChannel (props, null, null);
|
||||
ChannelServices.RegisterChannel (channel);
|
||||
MarshalByRefObject obj = (MarshalByRefObject) RemotingServices.Connect (
|
||||
typeof (IFactorial),
|
||||
$"http://localhost:{server.HttpPort}/MyEndPoint");
|
||||
$"http://127.0.0.1:{server.HttpPort}/MyEndPoint");
|
||||
IFactorial cal = (IFactorial) obj;
|
||||
Assert.AreEqual (cal.CalculateFactorial (4), 24);
|
||||
}
|
||||
@@ -216,7 +229,10 @@ namespace MonoTests.Remoting.Http
|
||||
public void Start ()
|
||||
{
|
||||
HttpPort = NetworkHelpers.FindFreePort ();
|
||||
c = new HttpChannel (HttpPort);
|
||||
Hashtable props = new Hashtable ();
|
||||
props["port"] = HttpPort;
|
||||
props["bindTo"] = "127.0.0.1";
|
||||
c = new HttpChannel (props, null, null);
|
||||
ChannelServices.RegisterChannel (c);
|
||||
|
||||
Type t = typeof(Calculator);
|
||||
|
||||
@@ -294,6 +294,7 @@ namespace MonoTests.Remoting
|
||||
IDictionary props = new Hashtable ();
|
||||
props ["name"] = objMarshal.Uri;
|
||||
props ["port"] = port;
|
||||
props ["bindTo"] = "127.0.0.1";
|
||||
TcpChannel chn = new TcpChannel (props, null, null);
|
||||
ChannelServices.RegisterChannel (chn);
|
||||
|
||||
@@ -317,6 +318,7 @@ namespace MonoTests.Remoting
|
||||
IDictionary props = new Hashtable ();
|
||||
props ["name"] = objMarshal.Uri;
|
||||
props ["port"] = port;
|
||||
props ["bindTo"] = "127.0.0.1";
|
||||
TcpChannel chn = new TcpChannel (props, null, null);
|
||||
ChannelServices.RegisterChannel (chn);
|
||||
|
||||
@@ -346,7 +348,10 @@ namespace MonoTests.Remoting
|
||||
public void ExecuteMessage ()
|
||||
{
|
||||
var port = NetworkHelpers.FindFreePort ();
|
||||
TcpChannel chn = new TcpChannel (port);
|
||||
IDictionary props = new Hashtable ();
|
||||
props ["port"] = port;
|
||||
props ["bindTo"] = "127.0.0.1";
|
||||
TcpChannel chn = new TcpChannel (props, null, null);
|
||||
ChannelServices.RegisterChannel (chn);
|
||||
try {
|
||||
MarshalObject objMarshal = NewMarshalObject ();
|
||||
@@ -379,7 +384,10 @@ namespace MonoTests.Remoting
|
||||
public void IsOneWay ()
|
||||
{
|
||||
var port = NetworkHelpers.FindFreePort ();
|
||||
TcpChannel chn = new TcpChannel (port);
|
||||
IDictionary props = new Hashtable ();
|
||||
props ["port"] = port;
|
||||
props ["bindTo"] = "127.0.0.1";
|
||||
TcpChannel chn = new TcpChannel (props, null, null);
|
||||
ChannelServices.RegisterChannel (chn);
|
||||
try {
|
||||
RemotingConfiguration.RegisterWellKnownServiceType (typeof (MarshalObject), "MarshalObject.rem", WellKnownObjectMode.Singleton);
|
||||
@@ -403,7 +411,10 @@ namespace MonoTests.Remoting
|
||||
public void GetObjRefForProxy ()
|
||||
{
|
||||
var port = NetworkHelpers.FindFreePort ();
|
||||
TcpChannel chn = new TcpChannel (port);
|
||||
IDictionary props = new Hashtable ();
|
||||
props ["port"] = port;
|
||||
props ["bindTo"] = "127.0.0.1";
|
||||
TcpChannel chn = new TcpChannel (props, null, null);
|
||||
ChannelServices.RegisterChannel (chn);
|
||||
try {
|
||||
// Register le factory as a SAO
|
||||
@@ -427,7 +438,10 @@ namespace MonoTests.Remoting
|
||||
public void GetRealProxy ()
|
||||
{
|
||||
var port = NetworkHelpers.FindFreePort ();
|
||||
TcpChannel chn = new TcpChannel (port);
|
||||
IDictionary props = new Hashtable ();
|
||||
props ["port"] = port;
|
||||
props ["bindTo"] = "127.0.0.1";
|
||||
TcpChannel chn = new TcpChannel (props, null, null);
|
||||
ChannelServices.RegisterChannel (chn);
|
||||
try {
|
||||
RemotingConfiguration.RegisterWellKnownServiceType (typeof (MarshalObject), "MonoTests.System.Runtime.Remoting.RemotingServicesTest.MarshalObject.soap", WellKnownObjectMode.Singleton);
|
||||
@@ -449,7 +463,10 @@ namespace MonoTests.Remoting
|
||||
public void SetObjectUriForMarshal ()
|
||||
{
|
||||
var port = NetworkHelpers.FindFreePort ();
|
||||
TcpChannel chn = new TcpChannel (port);
|
||||
IDictionary props = new Hashtable ();
|
||||
props ["port"] = port;
|
||||
props ["bindTo"] = "127.0.0.1";
|
||||
TcpChannel chn = new TcpChannel (props, null, null);
|
||||
ChannelServices.RegisterChannel (chn);
|
||||
try {
|
||||
MarshalObject objRem = NewMarshalObject ();
|
||||
@@ -469,7 +486,10 @@ namespace MonoTests.Remoting
|
||||
public void GetServeurTypeForUri ()
|
||||
{
|
||||
var port = NetworkHelpers.FindFreePort ();
|
||||
TcpChannel chn = new TcpChannel (port);
|
||||
IDictionary props = new Hashtable ();
|
||||
props ["port"] = port;
|
||||
props ["bindTo"] = "127.0.0.1";
|
||||
TcpChannel chn = new TcpChannel (props, null, null);
|
||||
Type type = typeof (MarshalObject);
|
||||
ChannelServices.RegisterChannel (chn);
|
||||
try {
|
||||
@@ -491,7 +511,10 @@ namespace MonoTests.Remoting
|
||||
public void IsObjectOutOf ()
|
||||
{
|
||||
var port = NetworkHelpers.FindFreePort ();
|
||||
TcpChannel chn = new TcpChannel (port);
|
||||
IDictionary props = new Hashtable ();
|
||||
props ["port"] = port;
|
||||
props ["bindTo"] = "127.0.0.1";
|
||||
TcpChannel chn = new TcpChannel (props, null, null);
|
||||
ChannelServices.RegisterChannel (chn);
|
||||
try {
|
||||
RemotingConfiguration.RegisterWellKnownServiceType (typeof (MarshalObject), "MarshalObject2.rem", WellKnownObjectMode.Singleton);
|
||||
@@ -514,7 +537,10 @@ namespace MonoTests.Remoting
|
||||
{
|
||||
var port = NetworkHelpers.FindFreePort ();
|
||||
RemotingConfiguration.ApplicationName = "app";
|
||||
TcpChannel chn = new TcpChannel (port);
|
||||
IDictionary props = new Hashtable ();
|
||||
props ["port"] = port;
|
||||
props ["bindTo"] = "127.0.0.1";
|
||||
TcpChannel chn = new TcpChannel (props, null, null);
|
||||
ChannelServices.RegisterChannel (chn);
|
||||
try {
|
||||
RemotingConfiguration.RegisterWellKnownServiceType (typeof (MarshalObject), "obj3.rem", WellKnownObjectMode.Singleton);
|
||||
@@ -541,7 +567,10 @@ namespace MonoTests.Remoting
|
||||
public void GetObjectWithChannelDataTest ()
|
||||
{
|
||||
var port = NetworkHelpers.FindFreePort ();
|
||||
TcpChannel chn = new TcpChannel (port);
|
||||
IDictionary props = new Hashtable ();
|
||||
props ["port"] = port;
|
||||
props ["bindTo"] = "127.0.0.1";
|
||||
TcpChannel chn = new TcpChannel (props, null, null);
|
||||
ChannelServices.RegisterChannel (chn);
|
||||
try {
|
||||
RemotingConfiguration.RegisterWellKnownServiceType (typeof (MarshalObject), "getobjectwithchanneldata.rem", WellKnownObjectMode.Singleton);
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Runtime.Remoting;
|
||||
using System.Runtime.Remoting.Channels;
|
||||
using System.Runtime.Remoting.Channels.Tcp;
|
||||
@@ -55,12 +56,18 @@ namespace MonoTests.Remoting
|
||||
{
|
||||
public override IChannelSender CreateClientChannel ()
|
||||
{
|
||||
return new TcpChannel (0);
|
||||
Hashtable props = new Hashtable ();
|
||||
props["port"] = 0;
|
||||
props["bindTo"] = "127.0.0.1";
|
||||
return new TcpChannel (props, null, null);
|
||||
}
|
||||
|
||||
public override IChannelReceiver CreateServerChannel ()
|
||||
{
|
||||
return new TcpChannel (0);
|
||||
Hashtable props = new Hashtable ();
|
||||
props["port"] = 0;
|
||||
props["bindTo"] = "127.0.0.1";
|
||||
return new TcpChannel (props, null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -423,8 +423,10 @@ namespace System.Runtime.Serialization.Json
|
||||
XmlDictionaryString namespaceLocal = null;
|
||||
if (nameLocal != null && nameLocal is string)
|
||||
writer.WriteStartElement ((string) name, null);
|
||||
else
|
||||
else if (name is XmlDictionaryString)
|
||||
writer.WriteStartElement ((XmlDictionaryString) name, null);
|
||||
else
|
||||
writer.WriteStartElement (name.ToString(), null);
|
||||
}
|
||||
|
||||
void WriteEndElement ()
|
||||
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Cryptography.Pkcs;
|
||||
|
||||
namespace System.Security.Cryptography.Pkcs {
|
||||
/// <summary>Enables the creation of PKCS#12 PFX data values. This class cannot be inherited.</summary>
|
||||
public sealed class Pkcs12Builder {
|
||||
/// <summary>Gets a value that indicates whether the PFX data has been sealed.</summary>
|
||||
/// <returns>A value that indicates whether the PFX data has been sealed.</returns>
|
||||
public bool IsSealed {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Add contents to the PFX in an bundle encrypted with a byte-based password from a byte array.</summary>
|
||||
/// <param name="safeContents">The contents to add to the PFX.</param>
|
||||
/// <param name="passwordBytes">The byte array to use as a password when encrypting the contents.</param>
|
||||
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the contents.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="safeContents" /> or <paramref name="pbeParameters" /> parameter is <see langword="null" />.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="safeContents" /> parameter value is already encrypted.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">
|
||||
/// <paramref name="pbeParameters" /> indicates that <see cref="F:System.Security.Cryptography.PbeEncryptionAlgorithm.TripleDes3KeyPkcs12" /> should be used, which requires <see cref="T:System.Char" />-based passwords.</exception>
|
||||
public void AddSafeContentsEncrypted (Pkcs12SafeContents safeContents, byte[] passwordBytes, PbeParameters pbeParameters) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Add contents to the PFX in an bundle encrypted with a byte-based password from a span.</summary>
|
||||
/// <param name="safeContents">The contents to add to the PFX.</param>
|
||||
/// <param name="passwordBytes">The byte span to use as a password when encrypting the contents.</param>
|
||||
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the contents.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="safeContents" /> or <paramref name="pbeParameters" /> parameter is <see langword="null" />.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="safeContents" /> parameter value is already encrypted.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">
|
||||
/// <paramref name="pbeParameters" /> indicates that <see cref="F:System.Security.Cryptography.PbeEncryptionAlgorithm.TripleDes3KeyPkcs12" /> should be used, which requires <see cref="T:System.Char" />-based passwords.</exception>
|
||||
public void AddSafeContentsEncrypted (Pkcs12SafeContents safeContents, ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Add contents to the PFX in an bundle encrypted with a char-based password from a span.</summary>
|
||||
/// <param name="safeContents">The contents to add to the PFX.</param>
|
||||
/// <param name="password">The span to use as a password when encrypting the contents.</param>
|
||||
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the contents.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="safeContents" /> or <paramref name="pbeParameters" /> parameter is <see langword="null" />.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="safeContents" /> parameter value is already encrypted.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
|
||||
public void AddSafeContentsEncrypted (Pkcs12SafeContents safeContents, ReadOnlySpan<char> password, PbeParameters pbeParameters) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Add contents to the PFX in an bundle encrypted with a char-based password from a string.</summary>
|
||||
/// <param name="safeContents">The contents to add to the PFX.</param>
|
||||
/// <param name="password">The string to use as a password when encrypting the contents.</param>
|
||||
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the contents.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="safeContents" /> or <paramref name="pbeParameters" /> parameter is <see langword="null" />.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="safeContents" /> parameter value is already encrypted.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
|
||||
public void AddSafeContentsEncrypted (Pkcs12SafeContents safeContents, string password, PbeParameters pbeParameters) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Add contents to the PFX without encrypting them.</summary>
|
||||
/// <param name="safeContents">The contents to add to the PFX.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="safeContents" /> parameter is <see langword="null" />.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
|
||||
public void AddSafeContentsUnencrypted (Pkcs12SafeContents safeContents) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Encodes the contents of a sealed PFX and returns it as a byte array.</summary>
|
||||
/// <returns>A byte array representing the encoded form of the PFX.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The PFX is not sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="false" />).</exception>
|
||||
public byte[] Encode () {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Seals the PFX against further changes by applying a password-based Message Authentication Code (MAC) over the contents with a password from a span.</summary>
|
||||
/// <param name="password">The password to use as a key for computing the MAC.</param>
|
||||
/// <param name="hashAlgorithm">The hash algorithm to use when computing the MAC.</param>
|
||||
/// <param name="iterationCount">The iteration count for the Key Derivation Function (KDF) used in computing the MAC.</param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="iterationCount" /> parameter is less than or equal to 0.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
|
||||
public void SealWithMac (ReadOnlySpan<char> password, HashAlgorithmName hashAlgorithm, int iterationCount) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Seals the PFX against further changes by applying a password-based Message Authentication Code (MAC) over the contents with a password from a string.</summary>
|
||||
/// <param name="password">The password to use as a key for computing the MAC.</param>
|
||||
/// <param name="hashAlgorithm">The hash algorithm to use when computing the MAC.</param>
|
||||
/// <param name="iterationCount">The iteration count for the Key Derivation Function (KDF) used in computing the MAC.</param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="iterationCount" /> parameter is less than or equal to 0.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
|
||||
public void SealWithMac (string password, HashAlgorithmName hashAlgorithm, int iterationCount) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Seals the PFX from further changes without applying tamper-protection.</summary>
|
||||
/// <exception cref="T:System.InvalidOperationException">The PFX is already sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="true" />).</exception>
|
||||
public void SealWithoutIntegrity () {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Attempts to encode the contents of a sealed PFX into a provided buffer.</summary>
|
||||
/// <param name="destination">The byte span to receive the PKCS#12 PFX data.</param>
|
||||
/// <param name="bytesWritten">When this method returns, contains a value that indicates the number of bytes written to <paramref name="destination" />. This parameter is treated as uninitialized.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if <paramref name="destination" /> is big enough to receive the output; otherwise, <see langword="false" />.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The PFX is not sealed (<see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Builder.IsSealed" /> is <see langword="false" />).</exception>
|
||||
public bool TryEncode (Span<byte> destination, out int bytesWritten) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Cryptography.Pkcs;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace System.Security.Cryptography.Pkcs {
|
||||
/// <summary>Represents the PKCS#12 CertBag. This class cannot be inherited.</summary>
|
||||
public sealed class Pkcs12CertBag : Pkcs12SafeBag {
|
||||
/// <summary>Gets the uninterpreted certificate contents of the CertSafeBag.</summary>
|
||||
/// <returns>The uninterpreted certificate contents of the CertSafeBag.</returns>
|
||||
public ReadOnlyMemory<byte> EncodedCertificate {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value indicating whether the content type of the encoded certificate value is the X.509 public key certificate content type.</summary>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if the content type is the X.509 public key certificate content type (1.2.840.113549.1.9.22.1); otherwise, <see langword="false" />.</returns>
|
||||
public bool IsX509Certificate {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12CertBag" /> class using the specified certificate type and encoding.</summary>
|
||||
/// <param name="certificateType">The Object Identifier (OID) for the certificate type.</param>
|
||||
/// <param name="encodedCertificate">The encoded certificate value.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="certificateType" /> parameter is <see langword="null" />.</exception>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The <paramref name="encodedCertificate" /> parameter does not represent a single ASN.1 BER-encoded value.</exception>
|
||||
public Pkcs12CertBag (Oid certificateType, ReadOnlyMemory<byte> encodedCertificate)
|
||||
: base (null, default(ReadOnlyMemory<byte>)) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Gets the contents of the CertBag interpreted as an X.509 public key certificate.</summary>
|
||||
/// <returns>A certificate decoded from the contents of the CertBag.</returns>
|
||||
/// <exception cref="">The content type is not the X.509 public key certificate content type.</exception>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The contents were not valid for the X.509 certificate content type.</exception>
|
||||
public X509Certificate2 GetCertificate () {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Gets the Object Identifier (OID) which identifies the content type of the encoded certificte value.</summary>
|
||||
/// <returns>The Object Identifier (OID) which identifies the content type of the encoded certificate value.</returns>
|
||||
public Oid GetCertificateType () {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
namespace System.Security.Cryptography.Pkcs {
|
||||
/// <summary>Represents the kind of encryption associated with a PKCS#12 SafeContents value.</summary>
|
||||
public enum Pkcs12ConfidentialityMode {
|
||||
/// <summary>The SafeContents value is not encrypted.</summary>
|
||||
None = 1,
|
||||
/// <summary>The SafeContents value is encrypted with a password.</summary>
|
||||
Password = 2,
|
||||
/// <summary>The SafeContents value is encrypted using public key cryptography.</summary>
|
||||
PublicKey = 3,
|
||||
/// <summary>The kind of encryption applied to the SafeContents is unknown or could not be determined.</summary>
|
||||
Unknown = 0
|
||||
}
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Security.Cryptography.Pkcs;
|
||||
|
||||
namespace System.Security.Cryptography.Pkcs {
|
||||
/// <summary>Represents the data from PKCS#12 PFX contents. This class cannot be inherited.</summary>
|
||||
public sealed class Pkcs12Info {
|
||||
/// <summary>Gets a read-only collection of the SafeContents values present in the PFX AuthenticatedSafe.</summary>
|
||||
/// <returns>A read-only collection of the SafeContents values present in the PFX AuthenticatedSafe.</returns>
|
||||
public ReadOnlyCollection<Pkcs12SafeContents> AuthenticatedSafe {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value that indicates the type of tamper protection provided for the <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.AuthenticatedSafe" /> contents.</summary>
|
||||
/// <returns>One of the enumeration members that indicates the type of tamper protection provided for the <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.AuthenticatedSafe" /> contents.</returns>
|
||||
public Pkcs12IntegrityMode IntegrityMode {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
internal Pkcs12Info () {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Reads the provided data as a PKCS#12 PFX and returns an object view of the contents.</summary>
|
||||
/// <param name="encodedBytes">The data to interpret as a PKCS#12 PFX.</param>
|
||||
/// <param name="bytesConsumed">When this method returns, contains a value that indicates the number of bytes from <paramref name="encodedBytes" /> which were read by this method. This parameter is treated as uninitialized.</param>
|
||||
/// <param name="skipCopy">
|
||||
/// <see langword="true" /> to store <paramref name="encodedBytes" /> without making a defensive copy; otherwise, <see langword="false" />. The default is <see langword="false" />.</param>
|
||||
/// <returns>An object view of the PKCS#12 PFX decoded from the input.</returns>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The contents of the <paramref name="encodedBytes" /> parameter were not successfully decoded as a PKCS#12 PFX.</exception>
|
||||
public static Pkcs12Info Decode (ReadOnlyMemory<byte> encodedBytes, out int bytesConsumed, bool skipCopy = false) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Attempts to verify the integrity of the <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.AuthenticatedSafe" /> contents with a password represented by a <see cref="System.ReadOnlySpan{System.Char}" />.</summary>
|
||||
/// <param name="password">The password to use to attempt to verify integrity.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if the password successfully verifies the integrity of the <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.AuthenticatedSafe" /> contents; <see langword="false" /> if the password is not correct or the contents have been altered.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.IntegrityMode" /> value is not <see cref="F:System.Security.Cryptography.Pkcs.Pkcs12IntegrityMode.Password" />.</exception>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The hash algorithm option specified by the PKCS#12 PFX contents could not be identified or is not supported by this platform.</exception>
|
||||
public bool VerifyMac (ReadOnlySpan<char> password) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Attempts to verify the integrity of the <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.AuthenticatedSafe" /> contents with a password represented by a <see cref="T:System.String" />.</summary>
|
||||
/// <param name="password">The password to use to attempt to verify integrity.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if the password successfully verifies the integrity of the <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.AuthenticatedSafe" /> contents; <see langword="false" /> if the password is not correct or the contents have been altered.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.IntegrityMode" /> value is not <see cref="F:System.Security.Cryptography.Pkcs.Pkcs12IntegrityMode.Password" />.</exception>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The hash algorithm option specified by the PKCS#12 PFX contents could not be identified or is not supported by this platform.</exception>
|
||||
public bool VerifyMac (string password) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
namespace System.Security.Cryptography.Pkcs {
|
||||
/// <summary>Represents the type of anti-tampering applied to a PKCS#12 PFX value.</summary>
|
||||
public enum Pkcs12IntegrityMode {
|
||||
/// <summary>The PKCS#12 PFX value is not protected from tampering.</summary>
|
||||
None = 1,
|
||||
/// <summary>The PKCS#12 PFX value is protected from tampering with a Message Authentication Code (MAC) keyed with a password.</summary>
|
||||
Password = 2,
|
||||
/// <summary>The PKCS#12 PFX value is protected from tampering with a digital signature using public key cryptography.</summary>
|
||||
PublicKey = 3,
|
||||
/// <summary>The type of anti-tampering applied to the PKCS#12 PFX is unknown or could not be determined.</summary>
|
||||
Unknown = 0
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Security.Cryptography.Pkcs;
|
||||
|
||||
namespace System.Security.Cryptography.Pkcs {
|
||||
/// <summary>Represents the KeyBag from PKCS#12, a container whose contents are a PKCS#8 PrivateKeyInfo. This class cannot be inherited.</summary>
|
||||
public sealed class Pkcs12KeyBag : Pkcs12SafeBag {
|
||||
/// <summary>Gets a memory value containing the PKCS#8 PrivateKeyInfo value transported by this bag.</summary>
|
||||
/// <returns>A memory value containing the PKCS#8 PrivateKeyInfo value transported by this bag.</returns>
|
||||
public ReadOnlyMemory<byte> Pkcs8PrivateKey {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12KeyBag" /> from an existing encoded PKCS#8 PrivateKeyInfo value.</summary>
|
||||
/// <param name="pkcs8PrivateKey">A BER-encoded PKCS#8 PrivateKeyInfo value.</param>
|
||||
/// <param name="skipCopy">
|
||||
/// <see langword="true" /> to store <paramref name="pkcs8PrivateKey" /> without making a defensive copy; otherwise, <see langword="false" />. The default is <see langword="false" />.</param>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The <paramref name="pkcs8privateKey" /> parameter does not represent a single ASN.1 BER-encoded value.</exception>
|
||||
public Pkcs12KeyBag (ReadOnlyMemory<byte> pkcs8PrivateKey, bool skipCopy = false)
|
||||
: base (null, default(ReadOnlyMemory<byte>)) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace System.Security.Cryptography.Pkcs {
|
||||
/// <summary>Defines the core behavior of a SafeBag value from the PKCS#12 specification and provides a base for derived classes.</summary>
|
||||
public abstract class Pkcs12SafeBag {
|
||||
/// <summary>Gets the modifiable collection of attributes to encode with the SafeBag value.</summary>
|
||||
/// <returns>The modifiable collection of attributes to encode with the SafeBag value.</returns>
|
||||
public CryptographicAttributeObjectCollection Attributes {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the ASN.1 BER encoding of the contents of this SafeBag.</summary>
|
||||
/// <returns>The ASN.1 BER encoding of the contents of this SafeBag.</returns>
|
||||
public ReadOnlyMemory<byte> EncodedBagValue {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Called from constructors in derived classes to initialize the <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12SafeBag" /> class.</summary>
|
||||
/// <param name="bagIdValue">The Object Identifier (OID), in dotted decimal form, indicating the data type of this SafeBag.</param>
|
||||
/// <param name="encodedBagValue">The ASN.1 BER encoded value of the SafeBag contents.</param>
|
||||
/// <param name="skipCopy">
|
||||
/// <see langword="true" /> to store <paramref name="encodedBagValue" /> without making a defensive copy; otherwise, <see langword="false" />. The default is <see langword="false" />.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="bagIdValue" /> parameter is <see langword="null" /> or the empty string.</exception>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The <paramref name="encodedBagValue" /> parameter does not represent a single ASN.1 BER-encoded value.</exception>
|
||||
protected Pkcs12SafeBag (string bagIdValue, ReadOnlyMemory<byte> encodedBagValue, bool skipCopy = false) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Encodes the SafeBag value and returns it as a byte array.</summary>
|
||||
/// <returns>A byte array representing the encoded form of the SafeBag.</returns>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The object identifier value passed to the constructor was invalid.</exception>
|
||||
public byte[] Encode () {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Gets the Object Identifier (OID) identifying the content type of this SafeBag.</summary>
|
||||
/// <returns>The Object Identifier (OID) identifying the content type of this SafeBag.</returns>
|
||||
public Oid GetBagId () {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Attempts to encode the SafeBag value into a provided buffer.</summary>
|
||||
/// <param name="destination">The byte span to receive the encoded SafeBag value.</param>
|
||||
/// <param name="bytesWritten">When this method returns, contains a value that indicates the number of bytes written to <paramref name="destination" />. This parameter is treated as uninitialized.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if <paramref name="destination" /> is big enough to receive the output; otherwise, <see langword="false" />.</returns>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The object identifier value passed to the constructor was invalid.</exception>
|
||||
public bool TryEncode (Span<byte> destination, out int bytesWritten) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Cryptography.Pkcs;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace System.Security.Cryptography.Pkcs {
|
||||
/// <summary>Represents a PKCS#12 SafeContents value. This class cannot be inherited.</summary>
|
||||
public sealed class Pkcs12SafeContents {
|
||||
/// <summary>Gets a value that indicates the type of encryption applied to the contents.</summary>
|
||||
/// <returns>One of the enumeration values that indicates the type of encryption applied to the contents. The default value is <see cref="F:System.Security.Cryptography.Pkcs.Pkcs12ConfidentialityMode.None" />.</returns>
|
||||
public Pkcs12ConfidentialityMode ConfidentialityMode {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value that indicates whether this instance in a read-only state.</summary>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if this value is in a read-only state; otherwise, <see langword="false" />. The default value is <see langword="false" />.</returns>
|
||||
public bool IsReadOnly {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Adds a certificate to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12CertBag" /> and returns the newly created bag instance.</summary>
|
||||
/// <param name="certificate">The certificate to add.</param>
|
||||
/// <returns>The bag instance which was added to the SafeContents.</returns>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="certificate" /> parameter is <see langword="null" />.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The <paramref name="certificate" /> parameter is in an invalid state.</exception>
|
||||
public Pkcs12CertBag AddCertificate (X509Certificate2 certificate) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Adds an asymmetric private key to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12KeyBag" /> and returns the newly created bag instance.</summary>
|
||||
/// <param name="key">The asymmetric private key to add.</param>
|
||||
/// <returns>The bag instance which was added to the SafeContents.</returns>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="key" /> parameter is <see langword="null" />.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The key export failed.</exception>
|
||||
public Pkcs12KeyBag AddKeyUnencrypted (AsymmetricAlgorithm key) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Adds a nested SafeContents to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12SafeContentsBag" /> and returns the newly created bag instance.</summary>
|
||||
/// <param name="safeContents">The nested contents to add to the SafeContents.</param>
|
||||
/// <returns>The bag instance which was added to the SafeContents.</returns>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="safeContents" /> parameter is <see langword="null" />.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">The <paramref name="safeContents" /> parameter is encrypted.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
|
||||
public Pkcs12SafeContentsBag AddNestedContents (Pkcs12SafeContents safeContents) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Adds a SafeBag to the SafeContents.</summary>
|
||||
/// <param name="safeBag">The SafeBag value to add.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="safeBag" /> parameter is <see langword="null" />.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
|
||||
public void AddSafeBag (Pkcs12SafeBag safeBag) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Adds an ASN.1 BER-encoded value with a specified type identifier to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12SecretBag" /> and returns the newly created bag instance.</summary>
|
||||
/// <param name="secretType">The Object Identifier (OID) which identifies the data type of the secret value.</param>
|
||||
/// <param name="secretValue">The BER-encoded value representing the secret to add.</param>
|
||||
/// <returns>The bag instance which was added to the SafeContents.</returns>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="secretType" /> parameter is <see langword="null" />.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The <paramref name="secretValue" /> parameter does not represent a single ASN.1 BER-encoded value.</exception>
|
||||
public Pkcs12SecretBag AddSecret (Oid secretType, ReadOnlyMemory<byte> secretValue) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Adds an encrypted asymmetric private key to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag" /> from a byte-based password in an array and returns the newly created bag instance.</summary>
|
||||
/// <param name="key">The asymmetric private key to add.</param>
|
||||
/// <param name="passwordBytes">The bytes to use as a password when encrypting the key material.</param>
|
||||
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the key material.</param>
|
||||
/// <returns>The bag instance which was added to the SafeContents.</returns>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="key" /> parameter is <see langword="null" />.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The key export failed.</exception>
|
||||
public Pkcs12ShroudedKeyBag AddShroudedKey (AsymmetricAlgorithm key, byte[] passwordBytes, PbeParameters pbeParameters) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Adds an encrypted asymmetric private key to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag" /> from a byte-based password in a span and returns the newly created bag instance.</summary>
|
||||
/// <param name="key">The asymmetric private key to add.</param>
|
||||
/// <param name="passwordBytes">The bytes to use as a password when encrypting the key material.</param>
|
||||
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the key material.</param>
|
||||
/// <returns>The bag instance which was added to the SafeContents.</returns>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="key" /> parameter is <see langword="null" />.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The key export failed.</exception>
|
||||
public Pkcs12ShroudedKeyBag AddShroudedKey (AsymmetricAlgorithm key, ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Adds an encrypted asymmetric private key to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag" /> from a character-based password in a span and returns the newly created bag instance.</summary>
|
||||
/// <param name="key">The asymmetric private key to add.</param>
|
||||
/// <param name="password">The password to use when encrypting the key material.</param>
|
||||
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the key material.</param>
|
||||
/// <returns>The bag instance which was added to the SafeContents.</returns>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="key" /> parameter is <see langword="null" />.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The key export failed.</exception>
|
||||
public Pkcs12ShroudedKeyBag AddShroudedKey (AsymmetricAlgorithm key, ReadOnlySpan<char> password, PbeParameters pbeParameters) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Adds an encrypted asymmetric private key to the SafeContents via a new <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag" /> from a character-based password in a string and returns the newly created bag instance.</summary>
|
||||
/// <param name="key">The asymmetric private key to add.</param>
|
||||
/// <param name="password">The password to use when encrypting the key material.</param>
|
||||
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the key material.</param>
|
||||
/// <returns>The bag instance which was added to the SafeContents.</returns>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="key" /> parameter is <see langword="null" />.</exception>
|
||||
/// <exception cref="T:System.InvalidOperationException">This instance is read-only.</exception>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The key export failed.</exception>
|
||||
public Pkcs12ShroudedKeyBag AddShroudedKey (AsymmetricAlgorithm key, string password, PbeParameters pbeParameters) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Decrypts the contents of this SafeContents value using a byte-based password from an array.</summary>
|
||||
/// <param name="passwordBytes">The bytes to use as a password for decrypting the encrypted contents.</param>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12SafeContents.ConfidentialityMode" /> property is not <see cref="F:System.Security.Cryptography.Pkcs.Pkcs12ConfidentialityMode.Password" />.</exception>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The password is incorrect.
|
||||
/// -or-
|
||||
/// The contents were not successfully decrypted.</exception>
|
||||
public void Decrypt (byte[] passwordBytes) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Decrypts the contents of this SafeContents value using a byte-based password from a span.</summary>
|
||||
/// <param name="passwordBytes">The bytes to use as a password for decrypting the encrypted contents.</param>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12SafeContents.ConfidentialityMode" /> property is not <see cref="F:System.Security.Cryptography.Pkcs.Pkcs12ConfidentialityMode.Password" />.</exception>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The password is incorrect.
|
||||
/// -or-
|
||||
/// The contents were not successfully decrypted.</exception>
|
||||
public void Decrypt (ReadOnlySpan<byte> passwordBytes) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Decrypts the contents of this SafeContents value using a character-based password from a span.</summary>
|
||||
/// <param name="password">The password to use for decrypting the encrypted contents.</param>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12SafeContents.ConfidentialityMode" /> property is not <see cref="F:System.Security.Cryptography.Pkcs.Pkcs12ConfidentialityMode.Password" />.</exception>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The password is incorrect.
|
||||
/// -or-
|
||||
/// The contents were not successfully decrypted.</exception>
|
||||
public void Decrypt (ReadOnlySpan<char> password) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Decrypts the contents of this SafeContents value using a character-based password from a string.</summary>
|
||||
/// <param name="password">The password to use for decrypting the encrypted contents.</param>
|
||||
/// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.Security.Cryptography.Pkcs.Pkcs12SafeContents.ConfidentialityMode" /> property is not <see cref="F:System.Security.Cryptography.Pkcs.Pkcs12ConfidentialityMode.Password" />.</exception>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The password is incorrect.
|
||||
/// -or-
|
||||
/// The contents were not successfully decrypted.</exception>
|
||||
public void Decrypt (string password) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Gets an enumerable representation of the SafeBag values contained within the SafeContents.</summary>
|
||||
/// <returns>An enumerable representation of the SafeBag values contained within the SafeContents.</returns>
|
||||
/// <exception cref="T:System.InvalidOperationException">The contents are encrypted.</exception>
|
||||
public IEnumerable<Pkcs12SafeBag> GetBags () {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Security.Cryptography.Pkcs;
|
||||
|
||||
namespace System.Security.Cryptography.Pkcs {
|
||||
/// <summary>Represents the SafeContentsBag from PKCS#12, a container whose contents are a PKCS#12 SafeContents value. This class cannot be inherited.</summary>
|
||||
public sealed class Pkcs12SafeContentsBag : Pkcs12SafeBag {
|
||||
/// <summary>Gets the SafeContents value contained within this bag.</summary>
|
||||
/// <returns>The SafeContents value contained within this bag.</returns>
|
||||
public Pkcs12SafeContents SafeContents {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
internal Pkcs12SafeContentsBag ()
|
||||
: base (null, default(ReadOnlyMemory<byte>)) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Cryptography.Pkcs;
|
||||
|
||||
namespace System.Security.Cryptography.Pkcs {
|
||||
/// <summary>Represents the SecretBag from PKCS#12, a container whose contents are arbitrary data with a type identifier. This class cannot be inherited.</summary>
|
||||
public sealed class Pkcs12SecretBag : Pkcs12SafeBag {
|
||||
/// <summary>Gets a memory value containing the BER-encoded contents of the bag.</summary>
|
||||
/// <returns>A memory value containing the BER-encoded contents of the bag.</returns>
|
||||
public ReadOnlyMemory<byte> SecretValue {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
internal Pkcs12SecretBag ()
|
||||
: base (null, default(ReadOnlyMemory<byte>)) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Gets the Object Identifier (OID) which identifies the data type of the secret value.</summary>
|
||||
/// <returns>The Object Identifier (OID) which identifies the data type of the secret value.</returns>
|
||||
public Oid GetSecretType () {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Security.Cryptography.Pkcs;
|
||||
|
||||
namespace System.Security.Cryptography.Pkcs {
|
||||
/// <summary>Represents the ShroudedKeyBag from PKCS#12, a container whose contents are a PKCS#8 EncryptedPrivateKeyInfo. This class cannot be inherited.</summary>
|
||||
public sealed class Pkcs12ShroudedKeyBag : Pkcs12SafeBag {
|
||||
/// <summary>Gets a memory value containing the PKCS#8 EncryptedPrivateKeyInfo value transported by this bag.</summary>
|
||||
/// <returns>A memory value containing the PKCS#8 EncryptedPrivateKeyInfo value transported by this bag.</returns>
|
||||
public ReadOnlyMemory<byte> EncryptedPkcs8PrivateKey {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag" /> from an existing encoded PKCS#8 EncryptedPrivateKeyInfo value.</summary>
|
||||
/// <param name="encryptedPkcs8PrivateKey">A BER-encoded PKCS#8 EncryptedPrivateKeyInfo value.</param>
|
||||
/// <param name="skipCopy">
|
||||
/// <see langword="true" /> to store <paramref name="encryptedPkcs8PrivateKey" /> without making a defensive copy; otherwise, <see langword="false" />. The default is <see langword="false" />.</param>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The <paramref name="encryptedPkcs8privateKey" /> parameter does not represent a single ASN.1 BER-encoded value.</exception>
|
||||
public Pkcs12ShroudedKeyBag (ReadOnlyMemory<byte> encryptedPkcs8PrivateKey, bool skipCopy = false)
|
||||
: base (null, default(ReadOnlyMemory<byte>)) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
+149
@@ -0,0 +1,149 @@
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Cryptography.Pkcs;
|
||||
|
||||
namespace System.Security.Cryptography.Pkcs {
|
||||
/// <summary>Enables the inspection of and creation of PKCS#8 PrivateKeyInfo and EncryptedPrivateKeyInfo values. This class cannot be inherited.</summary>
|
||||
public sealed class Pkcs8PrivateKeyInfo {
|
||||
/// <summary>Gets the Object Identifier (OID) value identifying the algorithm this key is for.</summary>
|
||||
/// <returns>The Object Identifier (OID) value identifying the algorithm this key is for.</returns>
|
||||
public Oid AlgorithmId {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a memory value containing the BER-encoded algorithm parameters associated with this key.</summary>
|
||||
/// <returns>A memory value containing the BER-encoded algorithm parameters associated with this key, or <see langword="null" /> if no parameters were present.</returns>
|
||||
public ReadOnlyMemory<byte>? AlgorithmParameters {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the modifiable collection of attributes for this private key.</summary>
|
||||
/// <returns>The modifiable collection of attributes to encode with the private key.</returns>
|
||||
public CryptographicAttributeObjectCollection Attributes {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a memory value that represents the algorithm-specific encoded private key.</summary>
|
||||
/// <returns>A memory value that represents the algorithm-specific encoded private key.</returns>
|
||||
public ReadOnlyMemory<byte> PrivateKeyBytes {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.Pkcs.Pkcs8PrivateKeyInfo" /> class.</summary>
|
||||
/// <param name="algorithmId">The Object Identifier (OID) identifying the asymmetric algorithm this key is for.</param>
|
||||
/// <param name="algorithmParameters">The BER-encoded algorithm parameters associated with this key, or <see langword="null" /> to omit algorithm parameters when encoding.</param>
|
||||
/// <param name="privateKey">The algorithm-specific encoded private key.</param>
|
||||
/// <param name="skipCopies">
|
||||
/// <see langword="true" /> to store <paramref name="algorithmParameters" /> and <paramref name="privateKey" /> without making a defensive copy; otherwise, <see langword="false" />. The default is <see langword="false" />.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="algorithmId" /> parameter is <see langword="null" />.</exception>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The <paramref name="algorithmParameters" /> parameter is not <see langword="null" />, empty, or a single BER-encoded value.</exception>
|
||||
public Pkcs8PrivateKeyInfo (Oid algorithmId, ReadOnlyMemory<byte>? algorithmParameters, ReadOnlyMemory<byte> privateKey, bool skipCopies = false) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Exports a specified key as a PKCS#8 PrivateKeyInfo and returns its decoded interpretation.</summary>
|
||||
/// <param name="privateKey">The private key to represent in a PKCS#8 PrivateKeyInfo.</param>
|
||||
/// <returns>The decoded interpretation of the exported PKCS#8 PrivateKeyInfo.</returns>
|
||||
/// <exception cref="T:System.ArgumentNullException">The <paramref name="privateKey" /> parameter is <see langword="null" />.</exception>
|
||||
public static Pkcs8PrivateKeyInfo Create (AsymmetricAlgorithm privateKey) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Reads the provided data as a PKCS#8 PrivateKeyInfo and returns an object view of the contents.</summary>
|
||||
/// <param name="source">The data to interpret as a PKCS#8 PrivateKeyInfo value.</param>
|
||||
/// <param name="bytesRead">When this method returns, contains a value that indicates the number of bytes read from <paramref name="source" />. This parameter is treated as uninitialized.</param>
|
||||
/// <param name="skipCopy">
|
||||
/// <see langword="true" /> to store <paramref name="source" /> without making a defensive copy; otherwise, <see langword="false" />. The default is <see langword="false" />.</param>
|
||||
/// <returns>An object view of the contents decoded as a PKCS#8 PrivateKeyInfo.</returns>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The contents of the <paramref name="source" /> parameter were not successfully decoded as a PKCS#8 PrivateKeyInfo.</exception>
|
||||
public static Pkcs8PrivateKeyInfo Decode (ReadOnlyMemory<byte> source, out int bytesRead, bool skipCopy = false) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Decrypts the provided data using the provided byte-based password and decodes the output into an object view of the PKCS#8 PrivateKeyInfo.</summary>
|
||||
/// <param name="passwordBytes">The bytes to use as a password when decrypting the key material.</param>
|
||||
/// <param name="source">The data to read as a PKCS#8 EncryptedPrivateKeyInfo structure in the ASN.1-BER encoding.</param>
|
||||
/// <param name="bytesRead">When this method returns, contains a value that indicates the number of bytes read from <paramref name="source" />. This parameter is treated as uninitialized.</param>
|
||||
/// <returns>An object view of the contents decrypted decoded as a PKCS#8 PrivateKeyInfo.</returns>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">The password is incorrect.
|
||||
/// -or-
|
||||
/// The contents of <paramref name="source" /> indicate the Key Derivation Function (KDF) to apply is the legacy PKCS#12 KDF, which requires <see cref="T:System.Char" />-based passwords.
|
||||
/// -or-
|
||||
/// The contents of <paramref name="source" /> do not represent an ASN.1-BER-encoded PKCS#8 EncryptedPrivateKeyInfo structure.</exception>
|
||||
public static Pkcs8PrivateKeyInfo DecryptAndDecode (ReadOnlySpan<byte> passwordBytes, ReadOnlyMemory<byte> source, out int bytesRead) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Decrypts the provided data using the provided character-based password and decodes the output into an object view of the PKCS#8 PrivateKeyInfo.</summary>
|
||||
/// <param name="password">The password to use when decrypting the key material.</param>
|
||||
/// <param name="source">The bytes of a PKCS#8 EncryptedPrivateKeyInfo structure in the ASN.1-BER encoding.</param>
|
||||
/// <param name="bytesRead">When this method returns, contains a value that indicates the number of bytes read from <paramref name="source" />. This parameter is treated as uninitialized.</param>
|
||||
/// <returns>An object view of the contents decrypted decoded as a PKCS#8 PrivateKeyInfo.</returns>
|
||||
public static Pkcs8PrivateKeyInfo DecryptAndDecode (ReadOnlySpan<char> password, ReadOnlyMemory<byte> source, out int bytesRead) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Encodes the property data of this instance as a PKCS#8 PrivateKeyInfo and returns the encoding as a byte array.</summary>
|
||||
/// <returns>A byte array representing the encoded form of the PKCS#8 PrivateKeyInfo.</returns>
|
||||
public byte[] Encode () {
|
||||
throw new PlatformNotSupportedException();
|
||||
}
|
||||
|
||||
/// <summary>Produces a PKCS#8 EncryptedPrivateKeyInfo from the property contents of this object after encrypting with the specified byte-based password and encryption parameters.</summary>
|
||||
/// <param name="passwordBytes">The bytes to use as a password when encrypting the key material.</param>
|
||||
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the key material.</param>
|
||||
/// <returns>A byte array containing the encoded form of the PKCS#8 EncryptedPrivateKeyInfo.</returns>
|
||||
/// <exception cref="T:System.Security.Cryptography.CryptographicException">
|
||||
/// <paramref name="pbeParameters" /> indicates that <see cref="F:System.Security.Cryptography.PbeEncryptionAlgorithm.TripleDes3KeyPkcs12" /> should be used, which requires <see cref="T:System.Char" />-based passwords.</exception>
|
||||
public byte[] Encrypt (ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Produces a PKCS#8 EncryptedPrivateKeyInfo from the property contents of this object after encrypting with the specified character-based password and encryption parameters.</summary>
|
||||
/// <param name="password">The password to use when encrypting the key material.</param>
|
||||
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the key material.</param>
|
||||
/// <returns>A byte array containing the encoded form of the PKCS#8 EncryptedPrivateKeyInfo.</returns>
|
||||
public byte[] Encrypt (ReadOnlySpan<char> password, PbeParameters pbeParameters) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Attempts to encode the property data of this instance as a PKCS#8 PrivateKeyInfo, writing the results into a provided buffer.</summary>
|
||||
/// <param name="destination">The byte span to receive the PKCS#8 PrivateKeyInfo data.</param>
|
||||
/// <param name="bytesWritten">When this method returns, contains a value that indicates the number of bytes written to <paramref name="destination" />. This parameter is treated as uninitialized.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if <paramref name="destination" /> is big enough to receive the output; otherwise, <see langword="false" />.</returns>
|
||||
public bool TryEncode (Span<byte> destination, out int bytesWritten) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Attempts to produce a PKCS#8 EncryptedPrivateKeyInfo from the property contents of this object after encrypting with the specified byte-based password and encryption parameters, writing the results into a provided buffer.</summary>
|
||||
/// <param name="passwordBytes">The bytes to use as a password when encrypting the key material.</param>
|
||||
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the key material.</param>
|
||||
/// <param name="destination">The byte span to receive the PKCS#8 EncryptedPrivateKeyInfo data.</param>
|
||||
/// <param name="bytesWritten">When this method returns, contains a value that indicates the number of bytes written to <paramref name="destination" />. This parameter is treated as uninitialized.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if <paramref name="destination" /> is big enough to receive the output; otherwise, <see langword="false" />.</returns>
|
||||
public bool TryEncrypt (ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters, Span<byte> destination, out int bytesWritten) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Attempts to produce a PKCS#8 EncryptedPrivateKeyInfo from the property contents of this object after encrypting with the specified character-based password and encryption parameters, writing the result into a provided buffer.</summary>
|
||||
/// <param name="password">The password to use when encrypting the key material.</param>
|
||||
/// <param name="pbeParameters">The password-based encryption (PBE) parameters to use when encrypting the key material.</param>
|
||||
/// <param name="destination">The byte span to receive the PKCS#8 EncryptedPrivateKeyInfo data.</param>
|
||||
/// <param name="bytesWritten">When this method returns, contains a value that indicates the number of bytes written to <paramref name="destination" />. This parameter is treated as uninitialized.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if <paramref name="destination" /> is big enough to receive the output; otherwise, <see langword="false" />.</returns>
|
||||
public bool TryEncrypt (ReadOnlySpan<char> password, PbeParameters pbeParameters, Span<byte> destination, out int bytesWritten) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Security.Cryptography.Pkcs;
|
||||
|
||||
namespace System.Security.Cryptography.Pkcs {
|
||||
/// <summary>Represents the LocalKeyId attribute from PKCS#9.</summary>
|
||||
public sealed class Pkcs9LocalKeyId : Pkcs9AttributeObject {
|
||||
/// <summary>Gets a memory value containing the key identifier from this attribute.</summary>
|
||||
/// <returns>A memory value containing the key identifier from this attribute.</returns>
|
||||
public ReadOnlyMemory<byte> KeyId {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.Pkcs.Pkcs9LocalKeyId" /> class with an empty key identifier value.</summary>
|
||||
public Pkcs9LocalKeyId () {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.Pkcs.Pkcs9LocalKeyId" /> class with a key identifier specified by a byte array.</summary>
|
||||
/// <param name="keyId">A byte array containing the key identifier.</param>
|
||||
public Pkcs9LocalKeyId (byte[] keyId) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.Pkcs.Pkcs9LocalKeyId" /> class with a key identifier specified by a byte span.</summary>
|
||||
/// <param name="keyId">A byte array containing the key identifier.</param>
|
||||
public Pkcs9LocalKeyId (ReadOnlySpan<byte> keyId) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Cryptography.Pkcs;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace System.Security.Cryptography.Pkcs {
|
||||
public sealed class Rfc3161TimestampRequest {
|
||||
public bool HasExtensions {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public Oid HashAlgorithmId {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public Oid RequestedPolicyId {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public bool RequestSignerCertificate {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public int Version {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
internal Rfc3161TimestampRequest () {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <param name="data" />
|
||||
/// <param name="hashAlgorithm" />
|
||||
/// <param name="requestedPolicyId" />
|
||||
/// <param name="nonce" />
|
||||
/// <param name="requestSignerCertificates" />
|
||||
/// <param name="extensions" />
|
||||
public static Rfc3161TimestampRequest CreateFromData (ReadOnlySpan<byte> data, HashAlgorithmName hashAlgorithm, Oid requestedPolicyId = null, ReadOnlyMemory<byte>? nonce = default(ReadOnlyMemory<byte>?), bool requestSignerCertificates = false, X509ExtensionCollection extensions = null) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <param name="hash" />
|
||||
/// <param name="hashAlgorithm" />
|
||||
/// <param name="requestedPolicyId" />
|
||||
/// <param name="nonce" />
|
||||
/// <param name="requestSignerCertificates" />
|
||||
/// <param name="extensions" />
|
||||
public static Rfc3161TimestampRequest CreateFromHash (ReadOnlyMemory<byte> hash, HashAlgorithmName hashAlgorithm, Oid requestedPolicyId = null, ReadOnlyMemory<byte>? nonce = default(ReadOnlyMemory<byte>?), bool requestSignerCertificates = false, X509ExtensionCollection extensions = null) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Create a timestamp request using a pre-computed hash value.</summary>
|
||||
/// <param name="hash">The pre-computed hash value to be timestamped.</param>
|
||||
/// <param name="hashAlgorithmId">The Object Identifier (OID) for the hash algorithm that produced <paramref name="hash" />.</param>
|
||||
/// <param name="requestedPolicyId">The Object Identifier (OID) for a timestamp policy the Timestamp Authority (TSA) should use, or <see langword="null" /> to express no preference.</param>
|
||||
/// <param name="nonce">An optional nonce (number used once) to uniquely identify this request to pair it with the response. The value is interpreted as an unsigned big-endian integer and may be normalized to the encoding format.</param>
|
||||
/// <param name="requestSignerCertificates">
|
||||
/// <see langword="true" /> to indicate the Timestamp Authority (TSA) must include the signing certificate in the issued timestamp token; otherwise, <see langword="false" />.</param>
|
||||
/// <param name="extensions">RFC3161 extensions to present with the request.</param>
|
||||
/// <returns>An <see cref="T:System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest" /> representing the chosen values.</returns>
|
||||
public static Rfc3161TimestampRequest CreateFromHash (ReadOnlyMemory<byte> hash, Oid hashAlgorithmId, Oid requestedPolicyId = null, ReadOnlyMemory<byte>? nonce = default(ReadOnlyMemory<byte>?), bool requestSignerCertificates = false, X509ExtensionCollection extensions = null) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <param name="signerInfo" />
|
||||
/// <param name="hashAlgorithm" />
|
||||
/// <param name="requestedPolicyId" />
|
||||
/// <param name="nonce" />
|
||||
/// <param name="requestSignerCertificates" />
|
||||
/// <param name="extensions" />
|
||||
public static Rfc3161TimestampRequest CreateFromSignerInfo (SignerInfo signerInfo, HashAlgorithmName hashAlgorithm, Oid requestedPolicyId = null, ReadOnlyMemory<byte>? nonce = default(ReadOnlyMemory<byte>?), bool requestSignerCertificates = false, X509ExtensionCollection extensions = null) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
public byte[] Encode () {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
public X509ExtensionCollection GetExtensions () {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
public ReadOnlyMemory<byte> GetMessageHash () {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
public ReadOnlyMemory<byte>? GetNonce () {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <param name="responseBytes" />
|
||||
/// <param name="bytesConsumed" />
|
||||
public Rfc3161TimestampToken ProcessResponse (ReadOnlyMemory<byte> responseBytes, out int bytesConsumed) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <param name="encodedBytes" />
|
||||
/// <param name="request" />
|
||||
/// <param name="bytesConsumed" />
|
||||
public static bool TryDecode (ReadOnlyMemory<byte> encodedBytes, out Rfc3161TimestampRequest request, out int bytesConsumed) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <param name="destination" />
|
||||
/// <param name="bytesWritten" />
|
||||
public bool TryEncode (Span<byte> destination, out int bytesWritten) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Cryptography.Pkcs;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace System.Security.Cryptography.Pkcs {
|
||||
public sealed class Rfc3161TimestampToken {
|
||||
public Rfc3161TimestampTokenInfo TokenInfo {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
internal Rfc3161TimestampToken () {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <summary>Gets a Signed Cryptographic Message Syntax (CMS) representation of the RFC3161 timestamp token.</summary>
|
||||
/// <returns>The <see cref="T:System.Security.Cryptography.Pkcs.SignedCms" /> representation of the <see cref="T:System.Security.Cryptography.Pkcs.Rfc3161TimestampToken" />.</returns>
|
||||
public SignedCms AsSignedCms () {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <param name="encodedBytes" />
|
||||
/// <param name="token" />
|
||||
/// <param name="bytesConsumed" />
|
||||
public static bool TryDecode (ReadOnlyMemory<byte> encodedBytes, out Rfc3161TimestampToken token, out int bytesConsumed) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <param name="data" />
|
||||
/// <param name="signerCertificate" />
|
||||
/// <param name="extraCandidates" />
|
||||
public bool VerifySignatureForData (ReadOnlySpan<byte> data, out X509Certificate2 signerCertificate, X509Certificate2Collection extraCandidates = null) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <param name="hash" />
|
||||
/// <param name="hashAlgorithm" />
|
||||
/// <param name="signerCertificate" />
|
||||
/// <param name="extraCandidates" />
|
||||
public bool VerifySignatureForHash (ReadOnlySpan<byte> hash, HashAlgorithmName hashAlgorithm, out X509Certificate2 signerCertificate, X509Certificate2Collection extraCandidates = null) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <param name="hash" />
|
||||
/// <param name="hashAlgorithmId" />
|
||||
/// <param name="signerCertificate" />
|
||||
/// <param name="extraCandidates" />
|
||||
public bool VerifySignatureForHash (ReadOnlySpan<byte> hash, Oid hashAlgorithmId, out X509Certificate2 signerCertificate, X509Certificate2Collection extraCandidates = null) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <param name="signerInfo" />
|
||||
/// <param name="signerCertificate" />
|
||||
/// <param name="extraCandidates" />
|
||||
public bool VerifySignatureForSignerInfo (SignerInfo signerInfo, out X509Certificate2 signerCertificate, X509Certificate2Collection extraCandidates = null) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Cryptography.Pkcs;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace System.Security.Cryptography.Pkcs {
|
||||
public sealed class Rfc3161TimestampTokenInfo {
|
||||
public long? AccuracyInMicroseconds {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasExtensions {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public Oid HashAlgorithmId {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsOrdering {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public Oid PolicyId {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public DateTimeOffset Timestamp {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public int Version {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
/// <param name="policyId" />
|
||||
/// <param name="hashAlgorithmId" />
|
||||
/// <param name="messageHash" />
|
||||
/// <param name="serialNumber" />
|
||||
/// <param name="timestamp" />
|
||||
/// <param name="accuracyInMicroseconds" />
|
||||
/// <param name="isOrdering" />
|
||||
/// <param name="nonce" />
|
||||
/// <param name="timestampAuthorityName" />
|
||||
/// <param name="extensions" />
|
||||
public Rfc3161TimestampTokenInfo (Oid policyId, Oid hashAlgorithmId, ReadOnlyMemory<byte> messageHash, ReadOnlyMemory<byte> serialNumber, DateTimeOffset timestamp, long? accuracyInMicroseconds = default(long?), bool isOrdering = false, ReadOnlyMemory<byte>? nonce = default(ReadOnlyMemory<byte>?), ReadOnlyMemory<byte>? timestampAuthorityName = default(ReadOnlyMemory<byte>?), X509ExtensionCollection extensions = null) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
public byte[] Encode () {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
public X509ExtensionCollection GetExtensions () {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
public ReadOnlyMemory<byte> GetMessageHash () {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
public ReadOnlyMemory<byte>? GetNonce () {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
public ReadOnlyMemory<byte> GetSerialNumber () {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
public ReadOnlyMemory<byte>? GetTimestampAuthorityName () {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <param name="encodedBytes" />
|
||||
/// <param name="timestampTokenInfo" />
|
||||
/// <param name="bytesConsumed" />
|
||||
public static bool TryDecode (ReadOnlyMemory<byte> encodedBytes, out Rfc3161TimestampTokenInfo timestampTokenInfo, out int bytesConsumed) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
/// <param name="destination" />
|
||||
/// <param name="bytesWritten" />
|
||||
public bool TryEncode (Span<byte> destination, out int bytesWritten) {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -211,6 +211,22 @@
|
||||
<Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.ProtectedData\src\System\Security\Cryptography\DataProtectionScope.cs" />
|
||||
<Compile Include="Assembly\AssemblyInfo.cs" />
|
||||
<Compile Include="System.Security.Cryptography.Pkcs\EnvelopedCms.cs" />
|
||||
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs12Builder.NotSupported.cs" />
|
||||
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs12CertBag.NotSupported.cs" />
|
||||
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs12ConfidentialityMode.NotSupported.cs" />
|
||||
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs12Info.NotSupported.cs" />
|
||||
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs12IntegrityMode.NotSupported.cs" />
|
||||
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs12KeyBag.NotSupported.cs" />
|
||||
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs12SafeBag.NotSupported.cs" />
|
||||
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs12SafeContents.NotSupported.cs" />
|
||||
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs12SafeContentsBag.NotSupported.cs" />
|
||||
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs12SecretBag.NotSupported.cs" />
|
||||
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs12ShroudedKeyBag.NotSupported.cs" />
|
||||
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs8PrivateKeyInfo.NotSupported.cs" />
|
||||
<Compile Include="System.Security.Cryptography.Pkcs\Pkcs9LocalKeyId.NotSupported.cs" />
|
||||
<Compile Include="System.Security.Cryptography.Pkcs\Rfc3161TimestampRequest.NotSupported.cs" />
|
||||
<Compile Include="System.Security.Cryptography.Pkcs\Rfc3161TimestampToken.NotSupported.cs" />
|
||||
<Compile Include="System.Security.Cryptography.Pkcs\Rfc3161TimestampTokenInfo.NotSupported.cs" />
|
||||
<Compile Include="corefx\SR.cs" />
|
||||
</ItemGroup>
|
||||
<!--End of common files-->
|
||||
|
||||
@@ -99,5 +99,25 @@ System.Security.Cryptography.Pkcs/EnvelopedCms.cs
|
||||
../../../external/corefx/src/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/SignerInfoCollection.cs
|
||||
../../../external/corefx/src/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/SignerInfoEnumerator.cs
|
||||
|
||||
|
||||
# System.Security.Cryptography.Pkcs NotSupported
|
||||
System.Security.Cryptography.Pkcs/Pkcs12Builder.NotSupported.cs
|
||||
System.Security.Cryptography.Pkcs/Pkcs12CertBag.NotSupported.cs
|
||||
System.Security.Cryptography.Pkcs/Pkcs12ConfidentialityMode.NotSupported.cs
|
||||
System.Security.Cryptography.Pkcs/Pkcs12Info.NotSupported.cs
|
||||
System.Security.Cryptography.Pkcs/Pkcs12IntegrityMode.NotSupported.cs
|
||||
System.Security.Cryptography.Pkcs/Pkcs12KeyBag.NotSupported.cs
|
||||
System.Security.Cryptography.Pkcs/Pkcs12SafeBag.NotSupported.cs
|
||||
System.Security.Cryptography.Pkcs/Pkcs12SafeContents.NotSupported.cs
|
||||
System.Security.Cryptography.Pkcs/Pkcs12SafeContentsBag.NotSupported.cs
|
||||
System.Security.Cryptography.Pkcs/Pkcs12SecretBag.NotSupported.cs
|
||||
System.Security.Cryptography.Pkcs/Pkcs12ShroudedKeyBag.NotSupported.cs
|
||||
System.Security.Cryptography.Pkcs/Pkcs8PrivateKeyInfo.NotSupported.cs
|
||||
System.Security.Cryptography.Pkcs/Pkcs9LocalKeyId.NotSupported.cs
|
||||
System.Security.Cryptography.Pkcs/Rfc3161TimestampRequest.NotSupported.cs
|
||||
System.Security.Cryptography.Pkcs/Rfc3161TimestampToken.NotSupported.cs
|
||||
System.Security.Cryptography.Pkcs/Rfc3161TimestampTokenInfo.NotSupported.cs
|
||||
|
||||
|
||||
# System.Security.Cryptography.Xml
|
||||
../../../external/corefx/src/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Xml/X509IssuerSerial.cs
|
||||
@@ -9,4 +9,7 @@ partial class SR
|
||||
public const string SynchronizedCollectionWrongType1 = "A value of type '{0}' cannot be added to the generic collection, because the collection has been parameterized with a different type.";
|
||||
public const string SynchronizedCollectionWrongTypeNull = "A null value cannot be added to the generic collection, because the collection has been parameterized with a value type.";
|
||||
public const string ValueMustBeInRange = "The value of this argument must fall within the range {0} to {1}.";
|
||||
public const string XmlLangAttributeMissing = "Required xml:lang attribute value is missing.";
|
||||
public const string InvalidXmlQualifiedName = "Expected XML qualified name, found '{0}'";
|
||||
public const string UnboundPrefixInQName = "Unbound prefix used in qualified name '{0}'.";
|
||||
}
|
||||
@@ -40,8 +40,9 @@ namespace System.ServiceModel.Channels
|
||||
public static MessageFault CreateFault (Message message, int maxBufferSize)
|
||||
{
|
||||
try {
|
||||
if (message.Version.Envelope == EnvelopeVersion.Soap11)
|
||||
return CreateFault11 (message, maxBufferSize);
|
||||
if (message.Version.Envelope == EnvelopeVersion.Soap11) {
|
||||
return CreateFault11 (message, maxBufferSize);
|
||||
}
|
||||
else // common to None and SOAP12
|
||||
return CreateFault12 (message, maxBufferSize);
|
||||
} catch (XmlException ex) {
|
||||
@@ -55,14 +56,14 @@ namespace System.ServiceModel.Channels
|
||||
FaultReason fr = null;
|
||||
string actor = null;
|
||||
XmlDictionaryReader r = message.GetReaderAtBodyContents ();
|
||||
|
||||
r.ReadStartElement ("Fault", message.Version.Envelope.Namespace);
|
||||
fc = ReadFaultCode11 (r, maxBufferSize);
|
||||
|
||||
r.MoveToContent ();
|
||||
|
||||
while (r.NodeType != XmlNodeType.EndElement) {
|
||||
switch (r.LocalName) {
|
||||
case "faultcode":
|
||||
fc = ReadFaultCode11 (r);
|
||||
break;
|
||||
switch (r.LocalName) {
|
||||
case "faultstring":
|
||||
fr = new FaultReason (r.ReadElementContentAsString());
|
||||
break;
|
||||
@@ -128,26 +129,27 @@ namespace System.ServiceModel.Channels
|
||||
return new SimpleMessageFault (fc, fr, false, null, null, null, node);
|
||||
}
|
||||
|
||||
static FaultCode ReadFaultCode11 (XmlDictionaryReader r)
|
||||
// In reference source for soap 1.1, the fault code value is not strictly enforced as per the
|
||||
// Namespaces in XML spec.
|
||||
//
|
||||
// Additionally, the fault sub code is not looked for:
|
||||
//
|
||||
// See: https://referencesource.microsoft.com/#System.ServiceModel/System/ServiceModel/Channels/MessageFault.cs,f23a5298fd999b2d
|
||||
//
|
||||
static FaultCode ReadFaultCode11 (XmlDictionaryReader reader, int maxBufferSize)
|
||||
{
|
||||
FaultCode subcode = null;
|
||||
XmlQualifiedName value = XmlQualifiedName.Empty;
|
||||
FaultCode code;
|
||||
string ns;
|
||||
string name;
|
||||
|
||||
if (r.IsEmptyElement)
|
||||
throw new ArgumentException ("Fault Code is mandatory in SOAP fault message.");
|
||||
reader.ReadStartElement ("faultcode", "");
|
||||
|
||||
XmlUtil.ReadContentAsQName (reader, out name, out ns);
|
||||
code = new FaultCode (name, ns);
|
||||
|
||||
r.ReadStartElement ("faultcode");
|
||||
r.MoveToContent ();
|
||||
while (r.NodeType != XmlNodeType.EndElement) {
|
||||
if (r.NodeType == XmlNodeType.Element)
|
||||
subcode = ReadFaultCode11 (r);
|
||||
else
|
||||
value = (XmlQualifiedName) r.ReadContentAs (typeof (XmlQualifiedName), r as IXmlNamespaceResolver);
|
||||
r.MoveToContent ();
|
||||
}
|
||||
r.ReadEndElement ();
|
||||
|
||||
return new FaultCode (value.Name, value.Namespace, subcode);
|
||||
reader.ReadEndElement ();
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
static FaultCode ReadFaultCode12 (XmlDictionaryReader r, string ns)
|
||||
|
||||
@@ -117,6 +117,7 @@
|
||||
<Compile Include="..\referencesource\System.ServiceModel\System\ServiceModel\SynchronizedCollection.cs" />
|
||||
<Compile Include="..\referencesource\System.ServiceModel\System\ServiceModel\SynchronizedKeyedCollection.cs" />
|
||||
<Compile Include="..\referencesource\System.ServiceModel\System\ServiceModel\SynchronizedReadOnlyCollection.cs" />
|
||||
<Compile Include="..\referencesource\System.ServiceModel\System\ServiceModel\XmlUtil.cs" />
|
||||
<Compile Include="Assembly\AssemblyInfo.cs" />
|
||||
<Compile Include="Mono.CodeGeneration\CodeAdd.cs" />
|
||||
<Compile Include="Mono.CodeGeneration\CodeAnd.cs" />
|
||||
|
||||
@@ -912,4 +912,5 @@ System.ServiceModel.Configuration/HttpBindingBaseElement.cs
|
||||
System.ServiceModel.Configuration/BasicHttpsBindingElement.cs
|
||||
System.ServiceModel.Configuration/BasicHttpsSecurityElement.cs
|
||||
System.ServiceModel.Configuration/BasicHttpsBindingCollectionElement.cs
|
||||
../referencesource/System.ServiceModel/System/ServiceModel/XmlUtil.cs
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
|
||||
<s:Body>
|
||||
<s:Fault>
|
||||
<faultcode>s:1</faultcode>
|
||||
<faultstring xml:lang="en-US">String is empty.</faultstring>
|
||||
</s:Fault>
|
||||
</s:Body>
|
||||
</s:Envelope>
|
||||
@@ -22,6 +22,15 @@ namespace MonoTests.System.ServiceModel.Channels
|
||||
MessageFault.CreateFault (msg, 0x10000);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CreateFaultWithNumberCode ()
|
||||
{
|
||||
var msgVersion = MessageVersion.CreateVersion (EnvelopeVersion.Soap11, AddressingVersion.None);
|
||||
|
||||
var msg = Message.CreateMessage (XmlReader.Create (new StreamReader (TestResourceHelper.GetFullPathOfResource ("Test/Resources/soap-fault-number.xml"))), 0x10000, msgVersion);
|
||||
MessageFault.CreateFault (msg, 0x10000);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CreateFaultMessageVersionNone ()
|
||||
{
|
||||
|
||||
@@ -296,3 +296,4 @@ System.ServiceModel.Security.Tokens/SecurityTokenReferenceStyle.cs
|
||||
System.ServiceModel.Security.Tokens/SecureConversationSecurityTokenParameters.cs
|
||||
System.ServiceModel.Security.Tokens/SupportingTokenParameters.cs
|
||||
System.ServiceModel.Security.Tokens/UserNameSecurityTokenParameters.cs
|
||||
../referencesource/System.ServiceModel/System/ServiceModel/XmlUtil.cs
|
||||
@@ -429,13 +429,9 @@ namespace System.Xml.Serialization
|
||||
}
|
||||
}
|
||||
|
||||
static Encoding DefaultEncoding = Encoding.Default;
|
||||
|
||||
public void Serialize (Stream stream, object o)
|
||||
{
|
||||
XmlTextWriter xmlWriter = new XmlTextWriter (stream, DefaultEncoding);
|
||||
xmlWriter.Formatting = Formatting.Indented;
|
||||
Serialize (xmlWriter, o, null);
|
||||
Serialize (stream, o, null);
|
||||
}
|
||||
|
||||
public void Serialize (TextWriter textWriter, object o)
|
||||
@@ -452,7 +448,7 @@ namespace System.Xml.Serialization
|
||||
|
||||
public void Serialize (Stream stream, object o, XmlSerializerNamespaces namespaces)
|
||||
{
|
||||
XmlTextWriter xmlWriter = new XmlTextWriter (stream, DefaultEncoding);
|
||||
XmlTextWriter xmlWriter = new XmlTextWriter (stream, Encoding.UTF8);
|
||||
xmlWriter.Formatting = Formatting.Indented;
|
||||
Serialize (xmlWriter, o, namespaces);
|
||||
}
|
||||
|
||||
@@ -2676,6 +2676,19 @@ namespace MonoTests.System.XmlSerialization
|
||||
Assert.AreEqual ("<:GenComplexStructOfInt32String http://www.w3.org/2000/xmlns/:xsd='http://www.w3.org/2001/XMLSchema' http://www.w3.org/2000/xmlns/:xsi='http://www.w3.org/2001/XMLSchema-instance'><:something>123</><:simpleclass><:something>456</></><:simplestruct><:something>789</></><:listclass><:somelist><:int>100</><:int>200</></></><:arrayclass><:arr><:int>11</><:int>22</><:int>33</></></><:twoclass><:something1>10</><:something2>Ten</></><:derivedclass><:something1>two</><:something2>2</><:another1>1</><:another2>one</></><:derived2><:something1>4</><:something2>four</><:another1>3</><:another2>three</></><:nestedouter><:outer>5</></><:nestedinner><:inner>six</><:something>6</></></>", WriterText);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSerializeStreamPreserveUTFChars () {
|
||||
string foo = "BÄR";
|
||||
XmlSerializer serializer = new XmlSerializer (typeof (string));
|
||||
|
||||
MemoryStream stream = new MemoryStream ();
|
||||
|
||||
serializer.Serialize (stream, foo);
|
||||
stream.Position = 0;
|
||||
foo = (string) serializer.Deserialize (stream);
|
||||
Assert.AreEqual("BÄR", foo);
|
||||
}
|
||||
|
||||
[Test] // bug #80759
|
||||
public void HasNullableField ()
|
||||
{
|
||||
|
||||
@@ -64,6 +64,7 @@ namespace Mono.Net.Security
|
||||
}
|
||||
|
||||
SslStream sslStream;
|
||||
readonly object sslStreamLock = new object ();
|
||||
|
||||
internal SslStream SslStream {
|
||||
get { return sslStream; }
|
||||
@@ -157,9 +158,11 @@ namespace Mono.Net.Security
|
||||
}
|
||||
|
||||
void CloseSslStream () {
|
||||
if (sslStream != null) {
|
||||
sslStream.Dispose ();
|
||||
sslStream = null;
|
||||
lock (sslStreamLock) {
|
||||
if (sslStream != null) {
|
||||
sslStream.Dispose ();
|
||||
sslStream = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1083,6 +1083,9 @@ namespace System.Net.Sockets
|
||||
sockares.CurrentAddress++;
|
||||
sockares.EndPoint = new IPEndPoint (sockares.Addresses [i], sockares.Port);
|
||||
|
||||
if (!sockares.socket.CanTryAddressFamily(sockares.EndPoint.AddressFamily))
|
||||
continue;
|
||||
|
||||
return BeginSConnect (sockares);
|
||||
} catch (Exception e) {
|
||||
exc = e;
|
||||
|
||||
@@ -97,6 +97,10 @@ using System.Runtime.InteropServices;
|
||||
[assembly: InternalsVisibleTo ("Xamarin.Mac, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
|
||||
#endif
|
||||
|
||||
#if MONODROID
|
||||
[assembly: InternalsVisibleTo ("Mono.Android, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
|
||||
#endif
|
||||
|
||||
[assembly: InternalsVisibleTo ("System.Net.Http, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
|
||||
|
||||
[assembly: Guid ("BED7F4EA-1A96-11D2-8F08-00A0C9A6186D")]
|
||||
@@ -173,6 +173,7 @@ LIB_MCS_FLAGS += -d:FEATURE_CRYPTO_CONFIGURABLE
|
||||
TEST_MCS_FLAGS += -d:FEATURE_CRYPTO_CONFIGURABLE
|
||||
endif
|
||||
|
||||
XTEST_SPLIT_ASSEMBLIES := $(filter monotouch%, $(PROFILE))
|
||||
|
||||
CC_PROFILE := $(filter monotouch% xammac, $(PROFILE))
|
||||
ifdef CC_PROFILE
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Diagnostics;
|
||||
|
||||
namespace System
|
||||
{
|
||||
internal enum LogLevel {
|
||||
internal enum BCLDebugLogLevel {
|
||||
Trace = 0,
|
||||
Status = 20,
|
||||
Warning= 40,
|
||||
@@ -33,7 +33,7 @@ namespace System
|
||||
}
|
||||
|
||||
[Conditional("_DEBUG")]
|
||||
public static void Log (string switchName, LogLevel level, params object[] messages)
|
||||
public static void Log (string switchName, BCLDebugLogLevel level, params object[] messages)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -820,8 +820,9 @@ namespace System
|
||||
|
||||
public override string FullName {
|
||||
get {
|
||||
// https://bugzilla.xamarin.com/show_bug.cgi?id=57938
|
||||
if (IsGenericType && ContainsGenericParameters && !IsGenericTypeDefinition)
|
||||
// See https://github.com/mono/mono/issues/18180 and
|
||||
// https://github.com/dotnet/runtime/blob/f23e2796ab5f6fea71c9fdacac024822280253db/src/coreclr/src/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs#L1468-L1472
|
||||
if (ContainsGenericParameters && !GetRootElementType().IsGenericTypeDefinition)
|
||||
return null;
|
||||
|
||||
string fullName;
|
||||
|
||||
@@ -1000,11 +1000,17 @@ namespace System {
|
||||
}
|
||||
|
||||
#if MONO_FEATURE_MULTIPLE_APPDOMAINS
|
||||
#if MONODROID
|
||||
[Obsolete ("AppDomain.CreateDomain will no longer be supported in .NET 5 and later. Consider AssemblyLoadContext when it becomes available https://docs.microsoft.com/en-us/dotnet/core/dependency-loading/understanding-assemblyloadcontext")]
|
||||
#endif
|
||||
public static AppDomain CreateDomain (string friendlyName)
|
||||
{
|
||||
return CreateDomain (friendlyName, null, null);
|
||||
}
|
||||
|
||||
|
||||
#if MONODROID
|
||||
[Obsolete ("AppDomain.CreateDomain will no longer be supported in .NET 5 and later. Consider AssemblyLoadContext when it becomes available https://docs.microsoft.com/en-us/dotnet/core/dependency-loading/understanding-assemblyloadcontext")]
|
||||
#endif
|
||||
public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo)
|
||||
{
|
||||
return CreateDomain (friendlyName, securityInfo, null);
|
||||
@@ -1015,6 +1021,9 @@ namespace System {
|
||||
|
||||
[MonoLimitationAttribute ("Currently it does not allow the setup in the other domain")]
|
||||
[SecurityPermission (SecurityAction.Demand, ControlAppDomain = true)]
|
||||
#if MONODROID
|
||||
[Obsolete ("AppDomain.CreateDomain will no longer be supported in .NET 5 and later. Consider AssemblyLoadContext when it becomes available https://docs.microsoft.com/en-us/dotnet/core/dependency-loading/understanding-assemblyloadcontext")]
|
||||
#endif
|
||||
public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo, AppDomainSetup info)
|
||||
{
|
||||
if (friendlyName == null)
|
||||
|
||||
@@ -195,76 +195,81 @@ namespace System {
|
||||
lock (initLock){
|
||||
if (inited)
|
||||
return;
|
||||
inited = true;
|
||||
|
||||
/* This should not happen any more, since it is checked for in Console */
|
||||
if (!ConsoleDriver.IsConsole)
|
||||
throw new IOException ("Not a tty.");
|
||||
|
||||
ConsoleDriver.SetEcho (false);
|
||||
|
||||
string endString = null;
|
||||
keypadXmit = reader.Get (TermInfoStrings.KeypadXmit);
|
||||
keypadLocal = reader.Get (TermInfoStrings.KeypadLocal);
|
||||
if (keypadXmit != null) {
|
||||
WriteConsole (keypadXmit); // Needed to get the arrows working
|
||||
if (keypadLocal != null)
|
||||
endString += keypadLocal;
|
||||
}
|
||||
|
||||
origPair = reader.Get (TermInfoStrings.OrigPair);
|
||||
origColors = reader.Get (TermInfoStrings.OrigColors);
|
||||
setfgcolor = reader.Get (TermInfoStrings.SetAForeground);
|
||||
setbgcolor = reader.Get (TermInfoStrings.SetABackground);
|
||||
maxColors = reader.Get (TermInfoNumbers.MaxColors);
|
||||
maxColors = Math.Max (Math.Min (maxColors, 16), 1);
|
||||
|
||||
string resetColors = (origColors == null) ? origPair : origColors;
|
||||
if (resetColors != null)
|
||||
endString += resetColors;
|
||||
|
||||
unsafe {
|
||||
if (!ConsoleDriver.TtySetup (keypadXmit, endString, out control_characters, out native_terminal_size)){
|
||||
control_characters = new byte [17];
|
||||
native_terminal_size = null;
|
||||
//throw new IOException ("Error initializing terminal.");
|
||||
try {
|
||||
/* This should not happen any more, since it is checked for in Console */
|
||||
if (!ConsoleDriver.IsConsole)
|
||||
throw new IOException ("Not a tty.");
|
||||
|
||||
ConsoleDriver.SetEcho (false);
|
||||
|
||||
string endString = null;
|
||||
keypadXmit = reader.Get (TermInfoStrings.KeypadXmit);
|
||||
keypadLocal = reader.Get (TermInfoStrings.KeypadLocal);
|
||||
if (keypadXmit != null) {
|
||||
WriteConsole (keypadXmit); // Needed to get the arrows working
|
||||
if (keypadLocal != null)
|
||||
endString += keypadLocal;
|
||||
}
|
||||
|
||||
origPair = reader.Get (TermInfoStrings.OrigPair);
|
||||
origColors = reader.Get (TermInfoStrings.OrigColors);
|
||||
setfgcolor = reader.Get (TermInfoStrings.SetAForeground);
|
||||
setbgcolor = reader.Get (TermInfoStrings.SetABackground);
|
||||
maxColors = reader.Get (TermInfoNumbers.MaxColors);
|
||||
maxColors = Math.Max (Math.Min (maxColors, 16), 1);
|
||||
|
||||
string resetColors = (origColors == null) ? origPair : origColors;
|
||||
if (resetColors != null)
|
||||
endString += resetColors;
|
||||
|
||||
unsafe {
|
||||
if (!ConsoleDriver.TtySetup (keypadXmit, endString, out control_characters, out native_terminal_size)){
|
||||
control_characters = new byte [17];
|
||||
native_terminal_size = null;
|
||||
//throw new IOException ("Error initializing terminal.");
|
||||
}
|
||||
}
|
||||
|
||||
stdin = new StreamReader (Console.OpenStandardInput (0), Console.InputEncoding);
|
||||
clear = reader.Get (TermInfoStrings.ClearScreen);
|
||||
bell = reader.Get (TermInfoStrings.Bell);
|
||||
if (clear == null) {
|
||||
clear = reader.Get (TermInfoStrings.CursorHome);
|
||||
clear += reader.Get (TermInfoStrings.ClrEos);
|
||||
}
|
||||
|
||||
csrVisible = reader.Get (TermInfoStrings.CursorNormal);
|
||||
if (csrVisible == null)
|
||||
csrVisible = reader.Get (TermInfoStrings.CursorVisible);
|
||||
|
||||
csrInvisible = reader.Get (TermInfoStrings.CursorInvisible);
|
||||
if (term == "cygwin" || term == "linux" || (term != null && term.StartsWith ("xterm")) ||
|
||||
term == "rxvt" || term == "dtterm") {
|
||||
titleFormat = "\x1b]0;{0}\x7"; // icon + window title
|
||||
} else if (term == "iris-ansi") {
|
||||
titleFormat = "\x1bP1.y{0}\x1b\\"; // not tested
|
||||
} else if (term == "sun-cmd") {
|
||||
titleFormat = "\x1b]l{0}\x1b\\"; // not tested
|
||||
}
|
||||
|
||||
cursorAddress = reader.Get (TermInfoStrings.CursorAddress);
|
||||
|
||||
GetCursorPosition ();
|
||||
#if DEBUG
|
||||
logger.WriteLine ("noGetPosition: {0} left: {1} top: {2}", noGetPosition, cursorLeft, cursorTop);
|
||||
logger.Flush ();
|
||||
#endif
|
||||
if (noGetPosition) {
|
||||
WriteConsole (clear);
|
||||
cursorLeft = 0;
|
||||
cursorTop = 0;
|
||||
}
|
||||
|
||||
} finally {
|
||||
inited = true;
|
||||
}
|
||||
|
||||
stdin = new StreamReader (Console.OpenStandardInput (0), Console.InputEncoding);
|
||||
clear = reader.Get (TermInfoStrings.ClearScreen);
|
||||
bell = reader.Get (TermInfoStrings.Bell);
|
||||
if (clear == null) {
|
||||
clear = reader.Get (TermInfoStrings.CursorHome);
|
||||
clear += reader.Get (TermInfoStrings.ClrEos);
|
||||
}
|
||||
|
||||
csrVisible = reader.Get (TermInfoStrings.CursorNormal);
|
||||
if (csrVisible == null)
|
||||
csrVisible = reader.Get (TermInfoStrings.CursorVisible);
|
||||
|
||||
csrInvisible = reader.Get (TermInfoStrings.CursorInvisible);
|
||||
if (term == "cygwin" || term == "linux" || (term != null && term.StartsWith ("xterm")) ||
|
||||
term == "rxvt" || term == "dtterm") {
|
||||
titleFormat = "\x1b]0;{0}\x7"; // icon + window title
|
||||
} else if (term == "iris-ansi") {
|
||||
titleFormat = "\x1bP1.y{0}\x1b\\"; // not tested
|
||||
} else if (term == "sun-cmd") {
|
||||
titleFormat = "\x1b]l{0}\x1b\\"; // not tested
|
||||
}
|
||||
|
||||
cursorAddress = reader.Get (TermInfoStrings.CursorAddress);
|
||||
|
||||
GetCursorPosition ();
|
||||
#if DEBUG
|
||||
logger.WriteLine ("noGetPosition: {0} left: {1} top: {2}", noGetPosition, cursorLeft, cursorTop);
|
||||
logger.Flush ();
|
||||
#endif
|
||||
if (noGetPosition) {
|
||||
WriteConsole (clear);
|
||||
cursorLeft = 0;
|
||||
cursorTop = 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@ namespace MonoTests.System.IO
|
||||
DirectoryInfo info = new DirectoryInfo (path);
|
||||
Assert.IsFalse (info.Exists, "#1");
|
||||
info.Create ();
|
||||
Assert.IsFalse (info.Exists, "#2");
|
||||
Assert.IsTrue (info.Exists, "#2");
|
||||
info = new DirectoryInfo (path);
|
||||
Assert.IsTrue (info.Exists, "#3");
|
||||
} finally {
|
||||
|
||||
@@ -5106,6 +5106,16 @@ namespace MonoTests.System
|
||||
typeof(UserByRefLikeStruct).MakeArrayType ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetConstructorsOnArrayOfGenericArgumentsToArraySpecialInterfaceGtd ()
|
||||
{
|
||||
// Regression test for https://github.com/mono/mono/issues/7095#issuecomment-470465597
|
||||
// The assertion here isn't very important; what matters is that the runtime doesn't crash.
|
||||
Type ilist_arg = typeof(IList<>).GetGenericArguments () [0];
|
||||
Type ilist_arg_array = ilist_arg.MakeArrayType ();
|
||||
Assert.NotNull (ilist_arg_array.GetConstructors ());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class UserType : Type
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.ExceptionServices;
|
||||
|
||||
namespace Internal.Runtime.Augments {
|
||||
partial class RuntimeAugments {
|
||||
@@ -7,7 +8,8 @@ namespace Internal.Runtime.Augments {
|
||||
|
||||
public static void ReportUnhandledException (Exception exception)
|
||||
{
|
||||
throw exception;
|
||||
var edi = ExceptionDispatchInfo.Capture (exception);
|
||||
edi.Throw ();
|
||||
}
|
||||
|
||||
internal static ReflectionExecutionDomainCallbacks Callbacks => s_reflectionExecutionDomainCallbacks;
|
||||
@@ -19,4 +21,4 @@ namespace Internal.Runtime.Augments {
|
||||
return new MissingMetadataException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,12 +15,19 @@ corefx/GlobalizationMode.cs
|
||||
../../../external/corefx/src/Common/tests/System/Security/Cryptography/ByteUtils.cs
|
||||
../../../external/corefx/src/Common/tests/System/ShouldNotBeInvokedException.cs
|
||||
|
||||
../../../external/corefx/src/System.Reflection/tests/Common.cs
|
||||
|
||||
../../../external/corefx/src/System.Reflection/tests/TypeInfoTests.cs
|
||||
|
||||
|
||||
#split monotouch
|
||||
#split monotouch_tv
|
||||
#split monotouch_watch
|
||||
|
||||
#../../../external/corefx/src/System.Globalization/tests/CompareInfo/*.cs:
|
||||
|
||||
../../../external/corefx/src/System.Reflection.Emit/tests/Utilities.cs
|
||||
|
||||
../../../external/corefx/src/System.Reflection/tests/Common.cs
|
||||
|
||||
../../../external/corefx/src/System.Reflection/tests/*.cs:AssemblyTests.cs,AssemblyTests.netcoreapp.cs,AssemblyNameTests.cs,MethodInfoTests.cs
|
||||
../../../external/corefx/src/System.Reflection.Extensions/tests/Definitions/PropertyDefinitions.cs
|
||||
../../../external/corefx/src/System.Reflection.Extensions/tests/*.cs
|
||||
@@ -207,56 +214,74 @@ corefx/GlobalizationMode.cs
|
||||
# FIXME: this is internal in corlib
|
||||
../../../external/corefx/src/Common/src/System/MutableDecimal.cs
|
||||
|
||||
# System.Collections
|
||||
../../../external/corefx/src/Common/tests/System/Collections/CollectionAsserts.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/TestBase.NonGeneric.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/TestBase.Generic.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/TestingTypes.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/IList.NonGeneric.Tests.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/IList.Generic.Tests.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/ICollection.NonGeneric.Tests.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/ICollection.Generic.Tests.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/IDictionary.NonGeneric.Tests.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/IDictionary.Generic.Tests.cs
|
||||
#../../../external/corefx/src/Common/tests/System/Collections/IEnumerable.NonGeneric.Serialization.Tests.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/IEnumerable.NonGeneric.Tests.cs
|
||||
#../../../external/corefx/src/Common/tests/System/Collections/IEnumerable.Generic.Serialization.Tests.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/IEnumerable.Generic.Tests.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/ISet.Generic.Tests.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/IGenericSharedAPI.Tests.cs
|
||||
../../../external/corefx/src/Common/tests/System/EnumTypes.cs
|
||||
../../../external/corefx/src/Common/tests/System/ObjectCloner.cs
|
||||
../../../external/corefx/src/Common/tests/System/Diagnostics/DebuggerAttributes.cs
|
||||
../../../external/corefx/src/System.Collections/tests/Generic/SortedSet/*.cs:SortedSet.TreeSubSet.Tests.cs
|
||||
../../../external/corefx/src/System.Collections/tests/Generic/Stack/*.cs
|
||||
../../../external/corefx/src/System.Collections/tests/Generic/SortedList/*.cs
|
||||
../../../external/corefx/src/System.Collections/tests/Generic/SortedDictionary/*.cs
|
||||
../../../external/corefx/src/System.Collections/tests/Generic/Queue/*.cs
|
||||
../../../external/corefx/src/System.Collections/tests/Generic/List/*.cs
|
||||
../../../external/corefx/src/System.Collections/tests/Generic/LinkedList/*.cs
|
||||
../../../external/corefx/src/System.Collections/tests/Generic/Dictionary/HashCollisionScenarios/*.cs
|
||||
../../../external/corefx/src/System.Collections/tests/Generic/Dictionary/*.cs
|
||||
../../../external/corefx/src/System.Collections/tests/Generic/Comparers/*.cs:EqualityComparer.Tests.cs
|
||||
../../../external/corefx/src/System.Collections/tests/BitArray/*.cs:BitArray_GetSetTests.cs
|
||||
../../../external/corefx/src/System.Collections/tests/*.cs
|
||||
|
||||
# System.Collections.NonGeneric
|
||||
#../../../external/corefx/src/System.Collections.NonGeneric/tests/ArrayList/*.cs
|
||||
../../../external/corefx/src/System.Collections.NonGeneric/tests/Hashtable/*.cs
|
||||
../../../external/corefx/src/System.Collections.NonGeneric/tests/*.cs:SortedListTests.cs,CollectionBaseTests.cs,DictionaryBaseTests.cs,ArrayListTests.cs,ReadOnlyCollectionBaseTests.cs
|
||||
#split monotouch
|
||||
#split monotouch_tv
|
||||
#split monotouch_watch
|
||||
|
||||
# System.Collections.Concurrent
|
||||
../../../external/corefx/src/System.Collections.Concurrent/tests/ConcurrentDictionary/*.cs
|
||||
../../../external/corefx/src/System.Collections.Concurrent/tests/*.cs:ProducerConsumerCollectionTests.cs,EtwTests.cs,ConcurrentBagTests.cs,ConcurrentQueueTests.cs,ConcurrentStackTests.cs
|
||||
# System.Runtime.Extensions
|
||||
../../../external/corefx/src/System.Runtime.Extensions/tests/System/Diagnostics/*.cs
|
||||
../../../external/corefx/src/System.Runtime.Extensions/tests/System/Runtime/Versioning/*.cs:VersioningHelperTests.cs
|
||||
../../../external/corefx/src/System.Runtime.Extensions/tests/System/*.cs:AppDomainTests.cs,Environment.Exit.cs,Environment.GetCommandLineArgs.cs,Environment.GetEnvironmentVariable.cs,Environment.SetEnvironmentVariable.cs,EnvironmentTests.cs,Environment.StackTrace.cs,MarshalByRefObjectTest.cs,StringComparer.cs,StringComparer.netcoreapp.cs,UnloadingAndProcessExitTests.netcoreapp.cs,Environment.UserDomainName.cs,Environment.MachineName.cs
|
||||
|
||||
# System.Collections.Specialized
|
||||
../../../external/corefx/src/System.Collections.Specialized/tests/StringDictionary/*.cs
|
||||
../../../external/corefx/src/System.Collections.Specialized/tests/NameObjectCollectionBase/*.cs:NameObjectCollectionBase.KeysTests.cs,NameObjectCollectionBase.CopyToTests.cs
|
||||
#../../../external/corefx/src/System.Collections.Specialized/tests/NameValueCollection/*.cs
|
||||
../../../external/corefx/src/System.Collections.Specialized/tests/ListDictionary/*.cs
|
||||
../../../external/corefx/src/System.Collections.Specialized/tests/HybridDictionary/*.cs
|
||||
../../../external/corefx/src/System.Collections.Specialized/tests/OrderedDictionary/*.cs
|
||||
../../../external/corefx/src/System.Collections.Specialized/tests/*.cs:StringCollectionTests.cs
|
||||
# System.Runtime.InteropServices
|
||||
../../../external/corefx/src/System.Runtime.InteropServices/tests/System/Runtime/CompilerServices/*.cs
|
||||
../../../external/corefx/src/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/*.cs:MarshalTests.cs,GCHandleTests.cs,SafeBufferTests.cs,ComEventsHelperTests.cs,RuntimeEnvironmentTests.cs,DispatchWrapperTests.cs,ArrayWithOffsetTests.cs,SetWin32ContextInIDispatchAttributeTests.cs,ComAwareEventInfoTests.cs,IDispatchImplAttributeTests.cs,ComAwareEventInfoTests.Windows.cs,MarshalTests.Windows.cs
|
||||
|
||||
# System.IO.MemoryStream
|
||||
../../../external/corefx/src/System.IO/tests/MemoryStream/*.cs
|
||||
../../../external/corefx/src/Common/tests/System/IO/DelegateStream.cs
|
||||
|
||||
# System.IO.UnmanagedMemoryStream
|
||||
../../../external/corefx/src/System.IO.UnmanagedMemoryStream/tests/*.cs
|
||||
|
||||
# System.IO.TextReader/StreamReader
|
||||
../../../external/corefx/src/System.IO/tests/TextReader/*.cs
|
||||
../../../external/corefx/src/System.IO/tests/StreamReader/*.cs
|
||||
../../../external/corefx/src/System.IO/tests/TestDataProvider/TestDataProvider.cs
|
||||
|
||||
# System.IO.Stream
|
||||
../../../external/corefx/src/Common/tests/System/IO/CallTrackingStream.cs
|
||||
../../../external/corefx/src/System.IO/tests/Stream/*.cs
|
||||
|
||||
# System.IO.BufferedStream
|
||||
../../../external/corefx/src/System.IO/tests/StreamWriter/StreamWriter.CloseTests.cs
|
||||
../../../external/corefx/src/System.IO/tests/StreamWriter/StreamWriter.WriteTests.cs
|
||||
../../../external/corefx/src/System.IO/tests/StreamWriter/StreamWriter.FlushTests.cs
|
||||
../../../external/corefx/src/System.IO/tests/BinaryWriter/BinaryWriterTests.cs
|
||||
../../../external/corefx/src/System.IO/tests/BinaryWriter/BinaryWriter.WriteTests.cs
|
||||
../../../external/corefx/src/System.IO/tests/BinaryWriter/BinaryWriter.WriteByteCharTests.cs
|
||||
../../../external/corefx/src/System.IO/tests/StreamReader/StreamReaderTests.cs
|
||||
../../../external/corefx/src/System.IO/tests/TestDataProvider/TestDataProvider.cs
|
||||
../../../external/corefx/src/Common/tests/System/IO/WrappedMemoryStream.cs
|
||||
../../../external/corefx/src/System.IO/tests/BufferedStream/*.cs
|
||||
|
||||
# FileSystem Helper (not used on Windows)
|
||||
../../../external/corefx/src/System.IO.FileSystem/tests/FileSystemTest.Unix.cs
|
||||
|
||||
# System.IO.FileInfo
|
||||
../../../external/corefx/src/Common/tests/System/IO/TempFile.cs
|
||||
../../../external/corefx/src/Common/tests/System/IO/PathFeatures.cs
|
||||
../../../external/corefx/src/System.IO.FileSystem/tests/TestData.cs
|
||||
../../../external/corefx/src/System.IO.FileSystem/tests/FSAssert.cs
|
||||
../../../external/corefx/src/CoreFx.Private.TestUtilities/src/System/AdminHelpers.cs
|
||||
../../../external/corefx/src/CoreFx.Private.TestUtilities/src/System/TheoryExtensions.cs
|
||||
../../../external/corefx/src/System.IO.FileSystem/tests/Base/*.cs:StaticGetSetTimes.cs
|
||||
../../../external/corefx/src/System.IO.FileSystem/tests/File/*.cs:GetSetTimes.cs
|
||||
../../../external/corefx/src/System.IO.FileSystem/tests/FileStream/ctor_*.cs
|
||||
../../../external/corefx/src/System.IO.FileSystem/tests/PortedCommon/*.cs
|
||||
../../../external/corefx/src/System.IO.FileSystem/tests/FileSystemTest.cs
|
||||
../../../external/corefx/src/System.IO.FileSystem/tests/FileInfo/*.cs:GetSetTimes.cs
|
||||
|
||||
# System.IO.Directory
|
||||
../../../external/corefx/src/System.IO.FileSystem/tests/Directory/*.cs:GetSetTimes.cs
|
||||
|
||||
# System.IO.DirectoryInfo
|
||||
../../../external/corefx/src/System.IO.FileSystem/tests/DirectoryInfo/*.cs:GetSetTimes.cs
|
||||
|
||||
# System.IO.TextWriter/StreamWriter
|
||||
../../../external/corefx/src/System.IO/tests/TextReader/*.cs
|
||||
../../../external/corefx/src/System.IO/tests/StreamReader/*.cs
|
||||
|
||||
# System.Runtime
|
||||
../../../external/corefx/src/System.Runtime/tests/System/AccessViolationExceptionTests.cs
|
||||
@@ -269,8 +294,6 @@ corefx/GlobalizationMode.cs
|
||||
../../../external/corefx/src/System.Runtime/tests/System/TimeZoneNotFoundExceptionTests.cs
|
||||
../../../external/corefx/src/System.Runtime/tests/System/TimeSpanTests.cs
|
||||
../../../external/corefx/src/System.Runtime/tests/System/TimeSpanTests.netcoreapp.cs
|
||||
../../../external/corefx/src/System.Runtime/tests/System/ArraySegmentTests.cs
|
||||
../../../external/corefx/src/System.Runtime/tests/System/ArraySegmentTests.netcoreapp.cs
|
||||
../../../external/corefx/src/System.Runtime/tests/System/BooleanTests.cs
|
||||
../../../external/corefx/src/System.Runtime/tests/System/BooleanTests.netcoreapp.cs
|
||||
../../../external/corefx/src/System.Runtime/tests/System/ByteTests.cs
|
||||
@@ -341,66 +364,63 @@ corefx/GlobalizationMode.cs
|
||||
../../../external/corefx/src/System.Runtime/tests/System/Text/*.cs
|
||||
../../../external/corefx/src/System.Runtime/tests/System/Runtime/CompilerServices/*.cs:RuntimeHelpersTests.netcoreapp.cs,ConditionalWeakTableTests.netcoreapp.cs,ConditionalWeakTableTests.cs
|
||||
|
||||
# System.Runtime.Extensions
|
||||
../../../external/corefx/src/System.Runtime.Extensions/tests/System/Diagnostics/*.cs
|
||||
../../../external/corefx/src/System.Runtime.Extensions/tests/System/Runtime/Versioning/*.cs:VersioningHelperTests.cs
|
||||
../../../external/corefx/src/System.Runtime.Extensions/tests/System/*.cs:AppDomainTests.cs,Environment.Exit.cs,Environment.GetCommandLineArgs.cs,Environment.GetEnvironmentVariable.cs,Environment.SetEnvironmentVariable.cs,EnvironmentTests.cs,Environment.StackTrace.cs,MarshalByRefObjectTest.cs,StringComparer.cs,StringComparer.netcoreapp.cs,UnloadingAndProcessExitTests.netcoreapp.cs,Environment.UserDomainName.cs,Environment.MachineName.cs
|
||||
|
||||
# System.Runtime.InteropServices
|
||||
../../../external/corefx/src/System.Runtime.InteropServices/tests/System/Runtime/CompilerServices/*.cs
|
||||
../../../external/corefx/src/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/*.cs:MarshalTests.cs,GCHandleTests.cs,SafeBufferTests.cs,ComEventsHelperTests.cs,RuntimeEnvironmentTests.cs,DispatchWrapperTests.cs,ArrayWithOffsetTests.cs,SetWin32ContextInIDispatchAttributeTests.cs,ComAwareEventInfoTests.cs,IDispatchImplAttributeTests.cs,ComAwareEventInfoTests.Windows.cs,MarshalTests.Windows.cs
|
||||
#split monotouch
|
||||
#split monotouch_tv
|
||||
#split monotouch_watch
|
||||
|
||||
# System.IO.MemoryStream
|
||||
../../../external/corefx/src/System.IO/tests/MemoryStream/*.cs
|
||||
../../../external/corefx/src/Common/tests/System/IO/DelegateStream.cs
|
||||
|
||||
# System.IO.UnmanagedMemoryStream
|
||||
../../../external/corefx/src/System.IO.UnmanagedMemoryStream/tests/*.cs
|
||||
../../../external/corefx/src/System.Runtime/tests/System/ArraySegmentTests.cs
|
||||
../../../external/corefx/src/System.Runtime/tests/System/ArraySegmentTests.netcoreapp.cs
|
||||
|
||||
# System.IO.TextReader/StreamReader
|
||||
../../../external/corefx/src/System.IO/tests/TextReader/*.cs
|
||||
../../../external/corefx/src/System.IO/tests/StreamReader/*.cs
|
||||
../../../external/corefx/src/System.IO/tests/TestDataProvider/TestDataProvider.cs
|
||||
# System.Collections
|
||||
../../../external/corefx/src/Common/tests/System/Collections/CollectionAsserts.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/TestBase.NonGeneric.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/TestBase.Generic.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/TestingTypes.cs
|
||||
../../../external/corefx/src/Common/tests/System/EnumTypes.cs
|
||||
../../../external/corefx/src/Common/tests/System/ObjectCloner.cs
|
||||
../../../external/corefx/src/Common/tests/System/Diagnostics/DebuggerAttributes.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/IList.NonGeneric.Tests.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/IList.Generic.Tests.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/ICollection.NonGeneric.Tests.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/ICollection.Generic.Tests.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/IDictionary.NonGeneric.Tests.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/IDictionary.Generic.Tests.cs
|
||||
#../../../external/corefx/src/Common/tests/System/Collections/IEnumerable.NonGeneric.Serialization.Tests.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/IEnumerable.NonGeneric.Tests.cs
|
||||
#../../../external/corefx/src/Common/tests/System/Collections/IEnumerable.Generic.Serialization.Tests.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/IEnumerable.Generic.Tests.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/ISet.Generic.Tests.cs
|
||||
../../../external/corefx/src/Common/tests/System/Collections/IGenericSharedAPI.Tests.cs
|
||||
../../../external/corefx/src/System.Collections/tests/Generic/SortedSet/*.cs:SortedSet.TreeSubSet.Tests.cs
|
||||
../../../external/corefx/src/System.Collections/tests/Generic/Stack/*.cs
|
||||
../../../external/corefx/src/System.Collections/tests/Generic/SortedList/*.cs
|
||||
../../../external/corefx/src/System.Collections/tests/Generic/SortedDictionary/*.cs
|
||||
../../../external/corefx/src/System.Collections/tests/Generic/Queue/*.cs
|
||||
../../../external/corefx/src/System.Collections/tests/Generic/List/*.cs
|
||||
../../../external/corefx/src/System.Collections/tests/Generic/LinkedList/*.cs
|
||||
../../../external/corefx/src/System.Collections/tests/Generic/Dictionary/HashCollisionScenarios/*.cs
|
||||
../../../external/corefx/src/System.Collections/tests/Generic/Dictionary/*.cs
|
||||
../../../external/corefx/src/System.Collections/tests/Generic/Comparers/*.cs:EqualityComparer.Tests.cs
|
||||
../../../external/corefx/src/System.Collections/tests/BitArray/*.cs:BitArray_GetSetTests.cs
|
||||
../../../external/corefx/src/System.Collections/tests/*.cs
|
||||
|
||||
# System.IO.Stream
|
||||
../../../external/corefx/src/Common/tests/System/IO/CallTrackingStream.cs
|
||||
../../../external/corefx/src/System.IO/tests/Stream/*.cs
|
||||
# System.Collections.NonGeneric
|
||||
#../../../external/corefx/src/System.Collections.NonGeneric/tests/ArrayList/*.cs
|
||||
../../../external/corefx/src/System.Collections.NonGeneric/tests/Hashtable/*.cs
|
||||
../../../external/corefx/src/System.Collections.NonGeneric/tests/*.cs:SortedListTests.cs,CollectionBaseTests.cs,DictionaryBaseTests.cs,ArrayListTests.cs,ReadOnlyCollectionBaseTests.cs
|
||||
|
||||
# System.IO.BufferedStream
|
||||
../../../external/corefx/src/System.IO/tests/StreamWriter/StreamWriter.CloseTests.cs
|
||||
../../../external/corefx/src/System.IO/tests/StreamWriter/StreamWriter.WriteTests.cs
|
||||
../../../external/corefx/src/System.IO/tests/StreamWriter/StreamWriter.FlushTests.cs
|
||||
../../../external/corefx/src/System.IO/tests/BinaryWriter/BinaryWriterTests.cs
|
||||
../../../external/corefx/src/System.IO/tests/BinaryWriter/BinaryWriter.WriteTests.cs
|
||||
../../../external/corefx/src/System.IO/tests/BinaryWriter/BinaryWriter.WriteByteCharTests.cs
|
||||
../../../external/corefx/src/System.IO/tests/StreamReader/StreamReaderTests.cs
|
||||
../../../external/corefx/src/System.IO/tests/TestDataProvider/TestDataProvider.cs
|
||||
../../../external/corefx/src/Common/tests/System/IO/WrappedMemoryStream.cs
|
||||
../../../external/corefx/src/System.IO/tests/BufferedStream/*.cs
|
||||
# System.Collections.Concurrent
|
||||
../../../external/corefx/src/System.Collections.Concurrent/tests/ConcurrentDictionary/*.cs
|
||||
../../../external/corefx/src/System.Collections.Concurrent/tests/*.cs:ProducerConsumerCollectionTests.cs,EtwTests.cs,ConcurrentBagTests.cs,ConcurrentQueueTests.cs,ConcurrentStackTests.cs
|
||||
|
||||
# FileSystem Helper (not used on Windows)
|
||||
../../../external/corefx/src/System.IO.FileSystem/tests/FileSystemTest.Unix.cs
|
||||
# System.Collections.Specialized
|
||||
../../../external/corefx/src/System.Collections.Specialized/tests/StringDictionary/*.cs
|
||||
../../../external/corefx/src/System.Collections.Specialized/tests/NameObjectCollectionBase/*.cs:NameObjectCollectionBase.KeysTests.cs,NameObjectCollectionBase.CopyToTests.cs
|
||||
#../../../external/corefx/src/System.Collections.Specialized/tests/NameValueCollection/*.cs
|
||||
../../../external/corefx/src/System.Collections.Specialized/tests/ListDictionary/*.cs
|
||||
../../../external/corefx/src/System.Collections.Specialized/tests/HybridDictionary/*.cs
|
||||
../../../external/corefx/src/System.Collections.Specialized/tests/OrderedDictionary/*.cs
|
||||
../../../external/corefx/src/System.Collections.Specialized/tests/*.cs:StringCollectionTests.cs
|
||||
|
||||
# System.IO.FileInfo
|
||||
../../../external/corefx/src/Common/tests/System/IO/TempFile.cs
|
||||
../../../external/corefx/src/Common/tests/System/IO/PathFeatures.cs
|
||||
../../../external/corefx/src/System.IO.FileSystem/tests/TestData.cs
|
||||
../../../external/corefx/src/System.IO.FileSystem/tests/FSAssert.cs
|
||||
../../../external/corefx/src/CoreFx.Private.TestUtilities/src/System/AdminHelpers.cs
|
||||
../../../external/corefx/src/CoreFx.Private.TestUtilities/src/System/TheoryExtensions.cs
|
||||
../../../external/corefx/src/System.IO.FileSystem/tests/Base/*.cs:StaticGetSetTimes.cs
|
||||
../../../external/corefx/src/System.IO.FileSystem/tests/File/*.cs:GetSetTimes.cs
|
||||
../../../external/corefx/src/System.IO.FileSystem/tests/FileStream/ctor_*.cs
|
||||
../../../external/corefx/src/System.IO.FileSystem/tests/PortedCommon/*.cs
|
||||
../../../external/corefx/src/System.IO.FileSystem/tests/FileSystemTest.cs
|
||||
../../../external/corefx/src/System.IO.FileSystem/tests/FileInfo/*.cs:GetSetTimes.cs
|
||||
|
||||
# System.IO.Directory
|
||||
../../../external/corefx/src/System.IO.FileSystem/tests/Directory/*.cs:GetSetTimes.cs
|
||||
|
||||
# System.IO.DirectoryInfo
|
||||
../../../external/corefx/src/System.IO.FileSystem/tests/DirectoryInfo/*.cs:GetSetTimes.cs
|
||||
|
||||
# System.IO.TextWriter/StreamWriter
|
||||
../../../external/corefx/src/System.IO/tests/TextReader/*.cs
|
||||
../../../external/corefx/src/System.IO/tests/StreamReader/*.cs
|
||||
@@ -86,7 +86,9 @@ namespace System.ServiceModel
|
||||
int j;
|
||||
for (j = s.Length; j > 0 && IsWhitespace(s[j - 1]); j--);
|
||||
|
||||
#if !MONO
|
||||
Fx.Assert(j > i, "Logic error in XmlUtil.Trim().");
|
||||
#endif
|
||||
|
||||
if (i != 0 || j != s.Length)
|
||||
{
|
||||
|
||||
@@ -750,7 +750,7 @@ namespace System.Xml {
|
||||
// This method tests whether a value is in a given range with just one test; start and end should be constants
|
||||
private static bool InRange(int value, int start, int end) {
|
||||
Debug.Assert(start <= end);
|
||||
return (uint)(value - start) <= (uint)(end - start);
|
||||
return (uint)(value - start) <= (uint)(end - start);
|
||||
}
|
||||
|
||||
#if XMLCHARTYPE_GEN_RESOURCE
|
||||
|
||||
@@ -358,7 +358,7 @@ namespace System.Resources {
|
||||
_store.BaseStream.Seek(_nameSectionOffset + GetNamePosition(index), SeekOrigin.Begin);
|
||||
lastReadString = _store.ReadString();
|
||||
}
|
||||
BCLDebug.Log("RESMGRFILEFORMAT", LogLevel.Status, "FindPosForResource for ", name, " failed. i: ", index, " lo: ", lo, " hi: ", hi, " last read string: \"", lastReadString, '\'');
|
||||
BCLDebug.Log("RESMGRFILEFORMAT", BCLDebugLogLevel.Status, "FindPosForResource for ", name, " failed. i: ", index, " lo: ", lo, " hi: ", hi, " last read string: \"", lastReadString, '\'');
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
@@ -909,7 +909,7 @@ namespace System.Resources {
|
||||
throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesHeaderCorrupted"));
|
||||
}
|
||||
if (resMgrHeaderVersion > 1) {
|
||||
BCLDebug.Log("RESMGRFILEFORMAT", LogLevel.Status, "ReadResources: Unexpected ResMgr header version: {0} Skipping ahead {1} bytes.", resMgrHeaderVersion, numBytesToSkip);
|
||||
BCLDebug.Log("RESMGRFILEFORMAT", BCLDebugLogLevel.Status, "ReadResources: Unexpected ResMgr header version: {0} Skipping ahead {1} bytes.", resMgrHeaderVersion, numBytesToSkip);
|
||||
_store.BaseStream.Seek(numBytesToSkip, SeekOrigin.Current);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -30,7 +30,6 @@ ROSLYN_FILES_TO_COPY_FOR_MSBUILD = \
|
||||
$(ROSLYN_CSC_DIR)/Microsoft.Build.Tasks.CodeAnalysis.dll \
|
||||
$(ROSLYN_CSC_DIR)/Microsoft.CSharp.Core.targets \
|
||||
$(ROSLYN_CSC_DIR)/Microsoft.Managed.Core.targets \
|
||||
$(ROSLYN_CSC_DIR)/Microsoft.Managed.EditorConfig.targets \
|
||||
$(ROSLYN_CSC_DIR)/Microsoft.VisualBasic.Core.targets
|
||||
|
||||
DISTFILES = $(ROSLYN_FILES_FOR_MONO) $(ROSLYN_FILES_TO_COPY_FOR_MSBUILD) csi-test.csx
|
||||
|
||||
@@ -116,9 +116,6 @@ public static class Program {
|
||||
if (SourcesParser.TraceLevel > 0)
|
||||
Console.Error.WriteLine ($"// Writing sources from {sourcesFile} minus {excludesFile}, to {outFile}.");
|
||||
} else if (args.Count == 4) {
|
||||
if (baseDir != null)
|
||||
Console.Error.WriteLine ($"// WARNING: baseDir has no effect in this mode");
|
||||
|
||||
var libraryFullName = Path.GetFullPath (args[1]);
|
||||
var platformName = args[2].Trim ();
|
||||
var profileName = args[3].Trim ();
|
||||
@@ -135,13 +132,12 @@ public static class Program {
|
||||
throw new Exception ();
|
||||
}
|
||||
|
||||
var fileNames = result.GetMatches ()
|
||||
var files = result.GetMatches ()
|
||||
.OrderBy (e => e.RelativePath, StringComparer.Ordinal)
|
||||
.Select (e => e.RelativePath)
|
||||
.Distinct ()
|
||||
.Distinct (new MatchEntryEqualityComparer ())
|
||||
.ToList ();
|
||||
|
||||
var unexpectedEmptyResult = (fileNames.Count == 0);
|
||||
var unexpectedEmptyResult = (files.Count == 0);
|
||||
|
||||
// HACK: We have sources files that are literally empty, so as long as *some* sources files were
|
||||
// parsed during this invocation and they are all empty, producing no matching file names is not
|
||||
@@ -150,7 +146,7 @@ public static class Program {
|
||||
unexpectedEmptyResult = false;
|
||||
|
||||
if ((result.ErrorCount > 0) || unexpectedEmptyResult) {
|
||||
Console.Error.WriteLine ($"// gensources produced {result.ErrorCount} error(s) and a set of {fileNames.Count} filename(s)");
|
||||
Console.Error.WriteLine ($"// gensources produced {result.ErrorCount} error(s) and a set of {files.Count} filename(s)");
|
||||
Console.Error.WriteLine ($"// Invoked with '{Environment.CommandLine}'");
|
||||
Console.Error.WriteLine ($"// Working directory was '{Environment.CurrentDirectory}'");
|
||||
|
||||
@@ -163,17 +159,29 @@ public static class Program {
|
||||
}
|
||||
}
|
||||
|
||||
TextWriter output;
|
||||
if (useStdout)
|
||||
output = Console.Out;
|
||||
else
|
||||
output = new StreamWriter (outFile);
|
||||
int parts = files.Count == 0 ? 0 : files.Max (f => f.SplitNumber);
|
||||
if (useStdout && parts > 0)
|
||||
throw new InvalidOperationException ("useStdout can't be used together with assembly splitting");
|
||||
|
||||
using (output) {
|
||||
foreach (var fileName in fileNames)
|
||||
output.WriteLine (fileName);
|
||||
TextWriter[] outputs = new TextWriter[parts + 1];
|
||||
for (int i = 0; i < parts + 1; i++) { // we create one file with all sources and part assemblies with only common+specific ones
|
||||
outputs[i] = useStdout ? Console.Out : new StreamWriter (i == 0 ? outFile : $"{outFile}.part{i}");
|
||||
}
|
||||
|
||||
foreach (var fileName in files) {
|
||||
if (fileName.SplitNumber == 0) { // split number 0 is the special case: common files that should be included in all output parts
|
||||
foreach (var output in outputs)
|
||||
output.WriteLine (fileName.RelativePath);
|
||||
}
|
||||
else { // all other split numbers should only be included in the full assembly and the specific part assembly
|
||||
outputs[0].WriteLine (fileName.RelativePath);
|
||||
outputs[fileName.SplitNumber].WriteLine (fileName.RelativePath);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var output in outputs)
|
||||
output.Dispose();
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -195,11 +203,25 @@ public class SourcesFile {
|
||||
public struct ParseEntry {
|
||||
public string Directory;
|
||||
public string Pattern;
|
||||
public int SplitNumber;
|
||||
}
|
||||
|
||||
public struct MatchEntry {
|
||||
public SourcesFile SourcesFile;
|
||||
public string RelativePath;
|
||||
public int SplitNumber;
|
||||
}
|
||||
|
||||
public class MatchEntryEqualityComparer : IEqualityComparer<MatchEntry> {
|
||||
public bool Equals (MatchEntry x, MatchEntry y)
|
||||
{
|
||||
return (x.RelativePath == y.RelativePath);
|
||||
}
|
||||
|
||||
public int GetHashCode (MatchEntry obj)
|
||||
{
|
||||
return obj.RelativePath?.GetHashCode() ?? 0;
|
||||
}
|
||||
}
|
||||
|
||||
public class TargetParseResult {
|
||||
@@ -309,6 +331,7 @@ public class ParseResult {
|
||||
yield return new MatchEntry {
|
||||
SourcesFile = sourcesFile,
|
||||
RelativePath = relativePath,
|
||||
SplitNumber = entry.SplitNumber
|
||||
};
|
||||
}
|
||||
} else {
|
||||
@@ -329,6 +352,7 @@ public class ParseResult {
|
||||
yield return new MatchEntry {
|
||||
SourcesFile = sourcesFile,
|
||||
RelativePath = relativePath,
|
||||
SplitNumber = entry.SplitNumber
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -403,6 +427,7 @@ public class SourcesParser {
|
||||
public string HostPlatform;
|
||||
public string ProfileName;
|
||||
public string ExclusionsFileName;
|
||||
public int CurrentSplitNumber;
|
||||
|
||||
public int SourcesFilesParsed, ExclusionsFilesParsed;
|
||||
}
|
||||
@@ -413,6 +438,7 @@ public class SourcesParser {
|
||||
public readonly string BaseDirectory;
|
||||
|
||||
private int ParseDepth = 0;
|
||||
private string TargetProfileName = "";
|
||||
|
||||
public SourcesParser (
|
||||
string platformsFolder, string profilesFolder, string baseDir
|
||||
@@ -442,6 +468,7 @@ public class SourcesParser {
|
||||
}
|
||||
|
||||
public ParseResult Parse (string libraryDirectory, string libraryName, string hostPlatform, string profile) {
|
||||
TargetProfileName = profile;
|
||||
var state = new State {
|
||||
Result = new ParseResult (libraryDirectory),
|
||||
ProfileName = profile,
|
||||
@@ -581,6 +608,7 @@ public class SourcesParser {
|
||||
bool asExclusionsList, string directive
|
||||
) {
|
||||
var include = "#include ";
|
||||
var split = "#split ";
|
||||
if (directive.StartsWith (include)) {
|
||||
var includeName = directive.Substring (include.Length).Trim ();
|
||||
var fileName = Path.Combine (includeDirectory, includeName);
|
||||
@@ -598,6 +626,14 @@ public class SourcesParser {
|
||||
}
|
||||
|
||||
file.Includes.Add (newFile);
|
||||
} else if (directive.StartsWith (split)) {
|
||||
if (asExclusionsList) throw new InvalidOperationException ("split directive is not valid for exclusion lists");
|
||||
|
||||
var profileName = directive.Substring (split.Length).Trim ();
|
||||
|
||||
if (profileName == TargetProfileName) {
|
||||
state.CurrentSplitNumber++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -715,7 +751,8 @@ public class SourcesParser {
|
||||
foreach (var pattern in explicitExclusions) {
|
||||
result.Exclusions.Add (new ParseEntry {
|
||||
Directory = pathDirectory,
|
||||
Pattern = Path.Combine (mainPatternDirectory, pattern)
|
||||
Pattern = Path.Combine (mainPatternDirectory, pattern),
|
||||
SplitNumber = state.CurrentSplitNumber
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -723,7 +760,8 @@ public class SourcesParser {
|
||||
(asExclusionsList ? result.Exclusions : result.Sources)
|
||||
.Add (new ParseEntry {
|
||||
Directory = pathDirectory,
|
||||
Pattern = parts[0]
|
||||
Pattern = parts[0],
|
||||
SplitNumber = state.CurrentSplitNumber
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+16
-3
@@ -137,15 +137,28 @@ dump_table_assemblyref (MonoImage *m)
|
||||
cols [MONO_ASSEMBLYREF_REV_NUMBER],
|
||||
mono_metadata_string_heap (m, cols [MONO_ASSEMBLYREF_NAME]));
|
||||
fprintf (output, "\tFlags=0x%08x\n", cols [MONO_ASSEMBLYREF_FLAGS]);
|
||||
ptr = mono_metadata_blob_heap (m, cols [MONO_ASSEMBLYREF_PUBLIC_KEY]);
|
||||
len = mono_metadata_decode_value (ptr, &ptr);
|
||||
ptr = mono_metadata_blob_heap_null_ok (m, cols [MONO_ASSEMBLYREF_PUBLIC_KEY]);
|
||||
if (ptr)
|
||||
len = mono_metadata_decode_value (ptr, &ptr);
|
||||
else
|
||||
len = 0;
|
||||
if (len > 0){
|
||||
fprintf (output, "\tPublic Key:");
|
||||
hex_dump (ptr, 0, len);
|
||||
fprintf (output, "\n");
|
||||
} else
|
||||
fprintf (output, "\tZero sized public key\n");
|
||||
|
||||
ptr = mono_metadata_blob_heap_null_ok (m, cols [MONO_ASSEMBLYREF_HASH_VALUE]);
|
||||
if (ptr)
|
||||
len = mono_metadata_decode_value (ptr, &ptr);
|
||||
else
|
||||
len = 0;
|
||||
if (len > 0) {
|
||||
fprintf (output, "\tHash:");
|
||||
hex_dump (ptr, 0, len);
|
||||
fprintf (output, "\n");
|
||||
} else
|
||||
fprintf (output, "\tZero sized hash value\n");
|
||||
}
|
||||
fprintf (output, "\n");
|
||||
}
|
||||
|
||||
@@ -63,7 +63,11 @@ if !ENABLE_MSVC_ONLY
|
||||
eglibdir=$(datadir)/mono-$(API_VER)/mono/eglib
|
||||
eglib_DATA = eglib-config.h
|
||||
|
||||
libeglib_la_CFLAGS = -g -Wall -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE
|
||||
libeglib_la_CFLAGS = -g -Wall -D_GNU_SOURCE
|
||||
|
||||
if !HOST_WIN32
|
||||
libeglib_la_CFLAGS += -D_FORTIFY_SOURCE=2
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = -I$(srcdir)
|
||||
|
||||
|
||||
@@ -124,6 +124,7 @@
|
||||
#define g_mem_set_vtable monoeg_g_mem_set_vtable
|
||||
#define g_mem_get_vtable monoeg_g_mem_get_vtable
|
||||
#define g_mkdtemp monoeg_g_mkdtemp
|
||||
#define g_module_address monoeg_g_module_address
|
||||
#define g_module_build_path monoeg_g_module_build_path
|
||||
#define g_module_close monoeg_g_module_close
|
||||
#define g_module_error monoeg_g_module_error
|
||||
|
||||
+2
-4
@@ -247,13 +247,11 @@ typedef guint32 gunichar;
|
||||
#define ABS(a) ((a) > 0 ? (a) : -(a))
|
||||
#endif
|
||||
|
||||
#ifndef ALIGN_TO
|
||||
#define ALIGN_TO(val,align) ((((gssize)val) + ((align) - 1)) & ~((align) - 1))
|
||||
#endif
|
||||
|
||||
#ifndef ALIGN_PTR_TO
|
||||
#define ALIGN_DOWN_TO(val,align) (((gssize)val) & ~((align) - 1))
|
||||
|
||||
#define ALIGN_PTR_TO(ptr,align) (gpointer)((((gssize)(ptr)) + (align - 1)) & (~(align - 1)))
|
||||
#endif
|
||||
|
||||
#define G_STRUCT_OFFSET(p_type,field) offsetof(p_type,field)
|
||||
|
||||
|
||||
@@ -34,7 +34,10 @@ SOURCES = \
|
||||
|
||||
test_eglib_SOURCES = $(SOURCES)
|
||||
|
||||
GLIB_TEST_FLAGS_COMMON = -Wall -DEGLIB_TESTS=1 -D_FORTIFY_SOURCE=2 -I$(srcdir)/.. -I.. -DDRIVER_NAME=\"EGlib\"
|
||||
GLIB_TEST_FLAGS_COMMON = -Wall -DEGLIB_TESTS=1 -I$(srcdir)/.. -I.. -DDRIVER_NAME=\"EGlib\"
|
||||
if !HOST_WIN32
|
||||
GLIB_TEST_FLAGS_COMMON += -D_FORTIFY_SOURCE=2
|
||||
endif
|
||||
CFLAGS += $(GLIB_TEST_FLAGS_COMMON)
|
||||
CXXFLAGS += $(GLIB_TEST_FLAGS_COMMON) @CXXFLAGS_COMMON@
|
||||
if HOST_AIX
|
||||
|
||||
@@ -130,13 +130,11 @@ libmonoruntime_config_la_CPPFLAGS = $(AM_CPPFLAGS) -DMONO_BINDIR=\"$(bindir)/\"
|
||||
#
|
||||
# Support is a separate library because it is not valid C++.
|
||||
#
|
||||
if !ENABLE_NETCORE
|
||||
support_libraries = libmonoruntime-support.la
|
||||
|
||||
libmonoruntime_support_la_SOURCES = support.c
|
||||
libmonoruntime_support_la_LDFLAGS = $(Z_LIBS)
|
||||
libmonoruntime_support_la_CFLAGS = $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@) @ZLIB_CFLAGS@
|
||||
endif
|
||||
|
||||
#
|
||||
# This library contains the icall tables if the runtime was configured with --disable-icall-tables
|
||||
|
||||
@@ -2725,7 +2725,8 @@ mono_alc_load_raw_bytes (MonoAssemblyLoadContext *alc, guint8 *assembly_data, gu
|
||||
|
||||
MonoAssembly* redirected_asm = NULL;
|
||||
MonoImageOpenStatus new_status = MONO_IMAGE_OK;
|
||||
if ((redirected_asm = mono_assembly_binding_applies_to_image (alc, image, &new_status))) {
|
||||
// http://blogs.microsoft.co.il/sasha/2010/06/09/assemblyreflectiononlyload-ignores-assembly-binding-redirects/
|
||||
if (!refonly && (redirected_asm = mono_assembly_binding_applies_to_image (alc, image, &new_status))) {
|
||||
mono_image_close (image);
|
||||
image = redirected_asm->image;
|
||||
mono_image_addref (image); /* so that mono_image close, below, has something to do */
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <mono/metadata/profiler-private.h>
|
||||
#include <mono/metadata/class-internals.h>
|
||||
#include <mono/metadata/domain-internals.h>
|
||||
#include <mono/metadata/exception-internals.h>
|
||||
#include <mono/metadata/reflection-internals.h>
|
||||
#include <mono/metadata/mono-endian.h>
|
||||
#include <mono/metadata/mono-debug.h>
|
||||
@@ -1269,6 +1270,10 @@ assemblyref_public_tok_checked (MonoImage *image, guint32 key_index, guint32 fla
|
||||
|
||||
public_tok = mono_metadata_blob_heap_checked (image, key_index, error);
|
||||
return_val_if_nok (error, NULL);
|
||||
if (!public_tok) {
|
||||
mono_error_set_bad_image (error, image, "expected public key token (index = %d) in assembly reference, but the Blob heap is NULL", key_index);
|
||||
return NULL;
|
||||
}
|
||||
len = mono_metadata_decode_blob_size (public_tok, &public_tok);
|
||||
|
||||
if (flags & ASSEMBLYREF_FULL_PUBLIC_KEY_FLAG) {
|
||||
@@ -1478,10 +1483,18 @@ mono_assembly_get_assemblyref (MonoImage *image, int index, MonoAssemblyName *an
|
||||
t = &image->tables [MONO_TABLE_ASSEMBLYREF];
|
||||
|
||||
mono_metadata_decode_row (t, index, cols, MONO_ASSEMBLYREF_SIZE);
|
||||
|
||||
hash = mono_metadata_blob_heap (image, cols [MONO_ASSEMBLYREF_HASH_VALUE]);
|
||||
aname->hash_len = mono_metadata_decode_blob_size (hash, &hash);
|
||||
aname->hash_value = hash;
|
||||
|
||||
// ECMA-335: II.22.5 - AssemblyRef
|
||||
// HashValue can be null or non-null. If non-null it's an index into the blob heap
|
||||
// Sometimes ILasm can create an image without a Blob heap.
|
||||
hash = mono_metadata_blob_heap_null_ok (image, cols [MONO_ASSEMBLYREF_HASH_VALUE]);
|
||||
if (hash) {
|
||||
aname->hash_len = mono_metadata_decode_blob_size (hash, &hash);
|
||||
aname->hash_value = hash;
|
||||
} else {
|
||||
aname->hash_len = 0;
|
||||
aname->hash_value = NULL;
|
||||
}
|
||||
aname->name = mono_metadata_string_heap (image, cols [MONO_ASSEMBLYREF_NAME]);
|
||||
aname->culture = mono_metadata_string_heap (image, cols [MONO_ASSEMBLYREF_CULTURE]);
|
||||
aname->flags = cols [MONO_ASSEMBLYREF_FLAGS];
|
||||
@@ -1697,7 +1710,7 @@ leave:
|
||||
#endif /* ENABLE_NETCORE */
|
||||
|
||||
/**
|
||||
* mono_assembly_get_assemblyref:
|
||||
* mono_assembly_get_assemblyref_checked:
|
||||
* \param image pointer to the \c MonoImage to extract the information from.
|
||||
* \param index index to the assembly reference in the image.
|
||||
* \param aname pointer to a \c MonoAssemblyName that will hold the returned value.
|
||||
@@ -1719,10 +1732,18 @@ mono_assembly_get_assemblyref_checked (MonoImage *image, int index, MonoAssembly
|
||||
if (!mono_metadata_decode_row_checked (image, t, index, cols, MONO_ASSEMBLYREF_SIZE, error))
|
||||
return FALSE;
|
||||
|
||||
// ECMA-335: II.22.5 - AssemblyRef
|
||||
// HashValue can be null or non-null. If non-null it's an index into the blob heap
|
||||
// Sometimes ILasm can create an image without a Blob heap.
|
||||
hash = mono_metadata_blob_heap_checked (image, cols [MONO_ASSEMBLYREF_HASH_VALUE], error);
|
||||
return_val_if_nok (error, FALSE);
|
||||
aname->hash_len = mono_metadata_decode_blob_size (hash, &hash);
|
||||
aname->hash_value = hash;
|
||||
if (hash) {
|
||||
aname->hash_len = mono_metadata_decode_blob_size (hash, &hash);
|
||||
aname->hash_value = hash;
|
||||
} else {
|
||||
aname->hash_len = 0;
|
||||
aname->hash_value = NULL;
|
||||
}
|
||||
aname->name = mono_metadata_string_heap_checked (image, cols [MONO_ASSEMBLYREF_NAME], error);
|
||||
return_val_if_nok (error, FALSE);
|
||||
aname->culture = mono_metadata_string_heap_checked (image, cols [MONO_ASSEMBLYREF_CULTURE], error);
|
||||
@@ -1769,7 +1790,15 @@ mono_assembly_load_reference (MonoImage *image, int index)
|
||||
if (reference)
|
||||
return;
|
||||
|
||||
mono_assembly_get_assemblyref (image, index, &aname);
|
||||
mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Requesting loading reference %d (of %d) of %s", index, image->nreferences, image->name);
|
||||
|
||||
ERROR_DECL (local_error);
|
||||
mono_assembly_get_assemblyref_checked (image, index, &aname, local_error);
|
||||
if (!is_ok (local_error)) {
|
||||
mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_ASSEMBLY, "Decoding assembly reference %d (of %d) of %s failed due to: %s", index, image->nreferences, image->name, mono_error_get_message (local_error));
|
||||
mono_error_cleanup (local_error);
|
||||
goto commit_reference;
|
||||
}
|
||||
|
||||
if (image->assembly) {
|
||||
if (mono_trace_is_traced (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY)) {
|
||||
@@ -1839,6 +1868,7 @@ mono_assembly_load_reference (MonoImage *image, int index)
|
||||
|
||||
}
|
||||
|
||||
commit_reference:
|
||||
mono_assemblies_lock ();
|
||||
if (reference == NULL) {
|
||||
/* Flag as not found */
|
||||
|
||||
@@ -767,6 +767,7 @@ check_valid_generic_inst_arguments (MonoGenericInst *inst, MonoError *error)
|
||||
/*
|
||||
* Create the `MonoClass' for an instantiation of a generic type.
|
||||
* We only do this if we actually need it.
|
||||
* This will sometimes return a GTD due to checking the cached_class.
|
||||
*/
|
||||
MonoClass*
|
||||
mono_class_create_generic_inst (MonoGenericClass *gclass)
|
||||
@@ -1186,7 +1187,7 @@ static MonoClass*
|
||||
make_generic_param_class (MonoGenericParam *param)
|
||||
{
|
||||
MonoClass *klass, **ptr;
|
||||
int count, pos, i;
|
||||
int count, pos, i, min_align;
|
||||
MonoGenericParamInfo *pinfo = mono_generic_param_info (param);
|
||||
MonoGenericContainer *container = mono_generic_param_owner (param);
|
||||
g_assert_checked (container);
|
||||
@@ -1259,13 +1260,17 @@ make_generic_param_class (MonoGenericParam *param)
|
||||
/* We don't use type_token for VAR since only classes can use it (not arrays, pointer, VARs, etc) */
|
||||
klass->sizes.generic_param_token = !is_anonymous ? pinfo->token : 0;
|
||||
|
||||
/*Init these fields to sane values*/
|
||||
klass->min_align = 1;
|
||||
if (param->gshared_constraint) {
|
||||
MonoClass *constraint_class = mono_class_from_mono_type_internal (param->gshared_constraint);
|
||||
mono_class_init_sizes (constraint_class);
|
||||
klass->has_references = m_class_has_references (constraint_class);
|
||||
}
|
||||
/*
|
||||
* This makes sure the the value size of this class is equal to the size of the types the gparam is
|
||||
* constrained to, the JIT depends on this.
|
||||
*/
|
||||
klass->instance_size = MONO_ABI_SIZEOF (MonoObject) + mono_type_stack_size_internal (m_class_get_byval_arg (klass), NULL, TRUE);
|
||||
klass->instance_size = MONO_ABI_SIZEOF (MonoObject) + mono_type_size (m_class_get_byval_arg (klass), &min_align);
|
||||
klass->min_align = min_align;
|
||||
mono_memory_barrier ();
|
||||
klass->size_inited = 1;
|
||||
|
||||
@@ -3030,6 +3035,8 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o
|
||||
if (decl->is_inflated) {
|
||||
override = mono_class_inflate_generic_method_checked (override, mono_method_get_context (decl), error);
|
||||
mono_error_assert_ok (error);
|
||||
} else if (mono_class_is_gtd (override->klass)) {
|
||||
override = mono_class_inflate_generic_method_full_checked (override, ic, mono_class_get_context (ic), error);
|
||||
}
|
||||
if (!apply_override (klass, ic, vtable, decl, override, &override_map, &override_class_map, &conflict_map))
|
||||
goto fail;
|
||||
@@ -3901,7 +3908,7 @@ mono_class_layout_fields (MonoClass *klass, int base_instance_size, int packing_
|
||||
|
||||
MonoType *klass_byval_arg = m_class_get_byval_arg (klass);
|
||||
if (klass_byval_arg->type == MONO_TYPE_VAR || klass_byval_arg->type == MONO_TYPE_MVAR)
|
||||
instance_size = MONO_ABI_SIZEOF (MonoObject) + mono_type_stack_size_internal (klass_byval_arg, NULL, TRUE);
|
||||
instance_size = MONO_ABI_SIZEOF (MonoObject) + mono_type_size (klass_byval_arg, &min_align);
|
||||
else if (klass_byval_arg->type == MONO_TYPE_PTR)
|
||||
instance_size = MONO_ABI_SIZEOF (MonoObject) + MONO_ABI_SIZEOF (gpointer);
|
||||
|
||||
@@ -4137,10 +4144,20 @@ static void
|
||||
setup_generic_array_ifaces (MonoClass *klass, MonoClass *iface, MonoMethod **methods, int pos, GHashTable *cache)
|
||||
{
|
||||
MonoGenericContext tmp_context;
|
||||
MonoGenericClass *gclass;
|
||||
int i;
|
||||
|
||||
// The interface can sometimes be a GTD in cases like IList
|
||||
// See: https://github.com/mono/mono/issues/7095#issuecomment-470465597
|
||||
if (mono_class_is_gtd (iface)) {
|
||||
MonoType *ty = mono_class_gtd_get_canonical_inst (iface);
|
||||
g_assert (ty->type == MONO_TYPE_GENERICINST);
|
||||
gclass = ty->data.generic_class;
|
||||
} else
|
||||
gclass = mono_class_get_generic_class (iface);
|
||||
|
||||
tmp_context.class_inst = NULL;
|
||||
tmp_context.method_inst = mono_class_get_generic_class (iface)->context.class_inst;
|
||||
tmp_context.method_inst = gclass->context.class_inst;
|
||||
//g_print ("setting up array interface: %s\n", mono_type_get_name_full (m_class_get_byval_arg (iface), 0));
|
||||
|
||||
for (i = 0; i < generic_array_method_num; i++) {
|
||||
|
||||
@@ -2543,9 +2543,12 @@ static int STDCALL
|
||||
cominterop_ccw_addref (MonoCCWInterface* ccwe)
|
||||
{
|
||||
int result;
|
||||
gpointer dummy;
|
||||
gpointer orig_domain = mono_threads_attach_coop (mono_domain_get (), &dummy);
|
||||
MONO_ENTER_GC_UNSAFE;
|
||||
result = cominterop_ccw_addref_impl (ccwe);
|
||||
MONO_EXIT_GC_UNSAFE;
|
||||
mono_threads_detach_coop (orig_domain, &dummy);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -2574,9 +2577,12 @@ static int STDCALL
|
||||
cominterop_ccw_release (MonoCCWInterface* ccwe)
|
||||
{
|
||||
int result;
|
||||
gpointer dummy;
|
||||
gpointer orig_domain = mono_threads_attach_coop (mono_domain_get (), &dummy);
|
||||
MONO_ENTER_GC_UNSAFE;
|
||||
result = cominterop_ccw_release_impl (ccwe);
|
||||
MONO_EXIT_GC_UNSAFE;
|
||||
mono_threads_detach_coop (orig_domain, &dummy);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -2623,9 +2629,12 @@ static int STDCALL
|
||||
cominterop_ccw_queryinterface (MonoCCWInterface* ccwe, const guint8* riid, gpointer* ppv)
|
||||
{
|
||||
int result;
|
||||
gpointer dummy;
|
||||
gpointer orig_domain = mono_threads_attach_coop (mono_domain_get (), &dummy);
|
||||
MONO_ENTER_GC_UNSAFE;
|
||||
result = cominterop_ccw_queryinterface_impl (ccwe, riid, ppv);
|
||||
MONO_EXIT_GC_UNSAFE;
|
||||
mono_threads_detach_coop (orig_domain, &dummy);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -2655,7 +2664,7 @@ cominterop_ccw_queryinterface_impl (MonoCCWInterface* ccwe, const guint8* riid,
|
||||
*ppv = cominterop_get_ccw_checked (object, mono_class_get_iunknown_class (), error);
|
||||
mono_error_assert_ok (error);
|
||||
/* remember to addref on QI */
|
||||
cominterop_ccw_addref ((MonoCCWInterface *)*ppv);
|
||||
cominterop_ccw_addref_impl ((MonoCCWInterface *)*ppv);
|
||||
return MONO_S_OK;
|
||||
}
|
||||
|
||||
@@ -2667,7 +2676,7 @@ cominterop_ccw_queryinterface_impl (MonoCCWInterface* ccwe, const guint8* riid,
|
||||
*ppv = cominterop_get_ccw_checked (object, mono_class_get_idispatch_class (), error);
|
||||
mono_error_assert_ok (error);
|
||||
/* remember to addref on QI */
|
||||
cominterop_ccw_addref ((MonoCCWInterface *)*ppv);
|
||||
cominterop_ccw_addref_impl ((MonoCCWInterface *)*ppv);
|
||||
return MONO_S_OK;
|
||||
}
|
||||
|
||||
@@ -2707,7 +2716,7 @@ cominterop_ccw_queryinterface_impl (MonoCCWInterface* ccwe, const guint8* riid,
|
||||
return MONO_E_NOINTERFACE;
|
||||
}
|
||||
/* remember to addref on QI */
|
||||
cominterop_ccw_addref ((MonoCCWInterface *)*ppv);
|
||||
cominterop_ccw_addref_impl ((MonoCCWInterface *)*ppv);
|
||||
return MONO_S_OK;
|
||||
}
|
||||
|
||||
@@ -2743,9 +2752,12 @@ cominterop_ccw_get_ids_of_names (MonoCCWInterface* ccwe, gpointer riid,
|
||||
guint32 lcid, gint32 *rgDispId)
|
||||
{
|
||||
int result;
|
||||
gpointer dummy;
|
||||
gpointer orig_domain = mono_threads_attach_coop (mono_domain_get(), &dummy);
|
||||
MONO_ENTER_GC_UNSAFE;
|
||||
result = cominterop_ccw_get_ids_of_names_impl (ccwe, riid, rgszNames, cNames, lcid, rgDispId);
|
||||
MONO_EXIT_GC_UNSAFE;
|
||||
mono_threads_detach_coop (orig_domain, &dummy);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -172,8 +172,7 @@ mono_ppdb_load_file (MonoImage *image, const guint8 *raw_contents, int size)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Temporarily disabled to unblock Roslyn
|
||||
#if HOST_WIN32 //|| HAVE_SYS_ZLIB
|
||||
#if HOST_WIN32 || HAVE_SYS_ZLIB
|
||||
if (ppdb_data) {
|
||||
/* Embedded PPDB data */
|
||||
/* ppdb_size is the uncompressed size */
|
||||
@@ -436,7 +435,8 @@ mono_ppdb_lookup_location (MonoDebugMethodInfo *minfo, uint32_t offset)
|
||||
}
|
||||
|
||||
location = g_new0 (MonoDebugSourceLocation, 1);
|
||||
location->source_file = docname;
|
||||
if (docname && docname [0])
|
||||
location->source_file = docname;
|
||||
location->row = start_line;
|
||||
location->column = start_col;
|
||||
location->il_offset = iloffset;
|
||||
|
||||
+10
-3
@@ -590,20 +590,27 @@ mono_init_internal (const char *filename, const char *exe_filename, const char *
|
||||
mono_fixup_exe_image (exe_image);
|
||||
#endif
|
||||
} else if (runtime_version != NULL) {
|
||||
runtimes = g_slist_prepend (runtimes, (gpointer)get_runtime_by_version (runtime_version));
|
||||
const MonoRuntimeInfo* rt = get_runtime_by_version (runtime_version);
|
||||
if (rt != NULL)
|
||||
runtimes = g_slist_prepend (runtimes, (gpointer)rt);
|
||||
}
|
||||
|
||||
if (runtimes == NULL) {
|
||||
const MonoRuntimeInfo *default_runtime = get_runtime_by_version (DEFAULT_RUNTIME_VERSION);
|
||||
g_assert (default_runtime);
|
||||
runtimes = g_slist_prepend (runtimes, (gpointer)default_runtime);
|
||||
g_print ("WARNING: The runtime version supported by this application is unavailable.\n");
|
||||
if (runtime_version != NULL)
|
||||
g_print ("WARNING: The requested runtime version \"%s\" is unavailable.\n", runtime_version);
|
||||
else
|
||||
g_print ("WARNING: The runtime version supported by this application is unavailable.\n");
|
||||
g_print ("Using default runtime: %s\n", default_runtime->runtime_version);
|
||||
}
|
||||
|
||||
/* The selected runtime will be the first one for which there is a mscrolib.dll */
|
||||
GSList *tmp = runtimes;
|
||||
while (tmp != NULL) {
|
||||
current_runtime = (MonoRuntimeInfo*)runtimes->data;
|
||||
current_runtime = (MonoRuntimeInfo*)tmp->data;
|
||||
g_assert (current_runtime);
|
||||
ass = mono_assembly_load_corlib (current_runtime, &status);
|
||||
if (status != MONO_IMAGE_OK && status != MONO_IMAGE_ERROR_ERRNO)
|
||||
break;
|
||||
|
||||
@@ -118,6 +118,7 @@
|
||||
#include "icall-decl.h"
|
||||
#include "mono/utils/mono-threads-coop.h"
|
||||
#include "mono/metadata/icall-signatures.h"
|
||||
#include "mono/utils/mono-signal-handler.h"
|
||||
|
||||
//#define MONO_DEBUG_ICALLARRAY
|
||||
|
||||
@@ -6470,7 +6471,7 @@ ves_icall_Mono_Runtime_ExceptionToState (MonoExceptionHandle exc_handle, guint64
|
||||
// FIXME: Push handles down into mini/mini-exceptions.c
|
||||
MonoException *exc = MONO_HANDLE_RAW (exc_handle);
|
||||
MonoThreadSummary out;
|
||||
mono_summarize_timeline_start ();
|
||||
mono_summarize_timeline_start ("ExceptionToState");
|
||||
mono_summarize_timeline_phase_log (MonoSummarySuspendHandshake);
|
||||
mono_summarize_timeline_phase_log (MonoSummaryUnmanagedStacks);
|
||||
mono_get_eh_callbacks ()->mono_summarize_exception (exc, &out);
|
||||
@@ -6515,8 +6516,7 @@ ves_icall_Mono_Runtime_SendMicrosoftTelemetry (const char *payload, guint64 port
|
||||
hashes.offset_free_hash = portable_hash;
|
||||
hashes.offset_rich_hash = unportable_hash;
|
||||
|
||||
// Tells mono that we want to send the HANG EXC_TYPE.
|
||||
const char *signal = "SIGTERM";
|
||||
const char *signal = "MANAGED_EXCEPTION";
|
||||
|
||||
gboolean success = mono_merp_invoke (crashed_pid, signal, payload, &hashes);
|
||||
if (!success) {
|
||||
@@ -6634,7 +6634,7 @@ ves_icall_Mono_Runtime_DumpStateTotal (guint64 *portable_hash, guint64 *unportab
|
||||
|
||||
mono_get_runtime_callbacks ()->install_state_summarizer ();
|
||||
|
||||
mono_summarize_timeline_start ();
|
||||
mono_summarize_timeline_start ("DumpStateTotal");
|
||||
|
||||
gboolean success = mono_threads_summarize (ctx, &out, &hashes, TRUE, FALSE, scratch, MONO_MAX_SUMMARY_LEN_ICALL);
|
||||
mono_summarize_timeline_phase_log (MonoSummaryCleanup);
|
||||
@@ -7736,7 +7736,12 @@ ves_icall_System_Environment_FailFast (MonoStringHandle message, MonoExceptionHa
|
||||
} else {
|
||||
char *msg = mono_string_handle_to_utf8 (message, error);
|
||||
g_warning ("CLR: Managed code called FailFast, saying \"%s\"", msg);
|
||||
#ifndef DISABLE_CRASH_REPORTING
|
||||
char *old_msg = mono_crash_save_failfast_msg (msg);
|
||||
g_free (old_msg);
|
||||
#else
|
||||
g_free (msg);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!MONO_HANDLE_IS_NULL (exception)) {
|
||||
|
||||
@@ -907,6 +907,8 @@ mono_image_load_metadata (MonoImage *image, MonoCLIImageInfo *iinfo);
|
||||
|
||||
const char*
|
||||
mono_metadata_string_heap_checked (MonoImage *meta, uint32_t table_index, MonoError *error);
|
||||
const char *
|
||||
mono_metadata_blob_heap_null_ok (MonoImage *meta, guint32 index);
|
||||
const char*
|
||||
mono_metadata_blob_heap_checked (MonoImage *meta, uint32_t table_index, MonoError *error);
|
||||
gboolean
|
||||
|
||||
@@ -1078,22 +1078,45 @@ mono_metadata_user_string (MonoImage *meta, guint32 index)
|
||||
const char *
|
||||
mono_metadata_blob_heap (MonoImage *meta, guint32 index)
|
||||
{
|
||||
/* Some tools can produce assemblies with a size 0 Blob stream. If a
|
||||
* blob value is optional, if the index == 0 and heap_blob.size == 0
|
||||
* assertion is hit, consider updating caller to use
|
||||
* mono_metadata_blob_heap_null_ok and handling a null return value. */
|
||||
g_assert (!(index == 0 && meta->heap_blob.size == 0));
|
||||
g_assert (index < meta->heap_blob.size);
|
||||
g_return_val_if_fail (index < meta->heap_blob.size, "");/*FIXME shouldn't we return NULL and check for index == 0?*/
|
||||
return meta->heap_blob.data + index;
|
||||
}
|
||||
|
||||
/**
|
||||
* mono_metadata_blob_heap_null_ok:
|
||||
* \param meta metadata context
|
||||
* \param index index into the blob.
|
||||
* \return an in-memory pointer to the \p index in the Blob heap.
|
||||
* If the Blob heap is empty or missing and index is 0 returns NULL, instead of asserting.
|
||||
*/
|
||||
const char *
|
||||
mono_metadata_blob_heap_null_ok (MonoImage *meta, guint32 index)
|
||||
{
|
||||
if (G_UNLIKELY (index == 0 && meta->heap_blob.size == 0))
|
||||
return NULL;
|
||||
else
|
||||
return mono_metadata_blob_heap (meta, index);
|
||||
}
|
||||
|
||||
/**
|
||||
* mono_metadata_blob_heap_checked:
|
||||
* \param meta metadata context
|
||||
* \param index index into the blob.
|
||||
* \param error set on error
|
||||
* \returns an in-memory pointer to the \p index in the Blob heap. On failure sets \p error and returns NULL;
|
||||
* If the Blob heap is empty or missing and \p index is 0 returns NULL, without setting error.
|
||||
*
|
||||
*/
|
||||
const char *
|
||||
mono_metadata_blob_heap_checked (MonoImage *meta, guint32 index, MonoError *error)
|
||||
{
|
||||
if (G_UNLIKELY (index == 0 && meta->heap_blob.size == 0))
|
||||
return NULL;
|
||||
if (G_UNLIKELY (!(index < meta->heap_blob.size))) {
|
||||
mono_error_set_bad_image_by_name (error, meta->name ? meta->name : "unknown image", "blob heap index %u out of bounds %u", index, meta->heap_blob.size);
|
||||
return NULL;
|
||||
|
||||
@@ -97,12 +97,14 @@ typedef struct {
|
||||
|
||||
extern MonoProfilerState mono_profiler_state;
|
||||
|
||||
typedef struct {
|
||||
guchar *cil_code;
|
||||
guint32 count;
|
||||
} MonoProfilerCoverageInfoEntry;
|
||||
|
||||
typedef struct {
|
||||
guint32 entries;
|
||||
struct {
|
||||
guchar *cil_code;
|
||||
guint32 count;
|
||||
} data [1];
|
||||
MonoProfilerCoverageInfoEntry data [MONO_ZERO_LEN_ARRAY];
|
||||
} MonoProfilerCoverageInfo;
|
||||
|
||||
void mono_profiler_started (void);
|
||||
|
||||
@@ -435,7 +435,7 @@ mono_profiler_coverage_alloc (MonoMethod *method, guint32 entries)
|
||||
|
||||
coverage_lock ();
|
||||
|
||||
MonoProfilerCoverageInfo *info = g_malloc0 (sizeof (MonoProfilerCoverageInfo) + SIZEOF_VOID_P * 2 * entries);
|
||||
MonoProfilerCoverageInfo *info = g_malloc0 (sizeof (MonoProfilerCoverageInfo) + sizeof (MonoProfilerCoverageInfoEntry) * entries);
|
||||
|
||||
info->entries = entries;
|
||||
|
||||
|
||||
@@ -2634,7 +2634,7 @@ mono_gc_get_allocated_bytes_for_current_thread (void)
|
||||
info = mono_thread_info_current ();
|
||||
|
||||
/*There are some more allocated bytes in the current tlab that have not been recorded yet */
|
||||
return info->total_bytes_allocated + info->tlab_next - info->tlab_start;
|
||||
return info->total_bytes_allocated + (ptrdiff_t)(info->tlab_next - info->tlab_start);
|
||||
}
|
||||
|
||||
guint64
|
||||
@@ -3013,6 +3013,13 @@ sgen_client_handle_gc_debug (const char *opt)
|
||||
mono_log_finalizers = TRUE;
|
||||
} else if (!strcmp (opt, "no-managed-allocator")) {
|
||||
sgen_set_use_managed_allocator (FALSE);
|
||||
} else if (!strcmp (opt, "managed-allocator")) {
|
||||
/*
|
||||
* This option can be used to override the disabling of the managed allocator by
|
||||
* the nursery canaries option. This can be used when knowing for sure that no
|
||||
* aot code will be used by the application.
|
||||
*/
|
||||
sgen_set_use_managed_allocator (TRUE);
|
||||
} else if (!sgen_bridge_handle_gc_debug (opt)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1550,6 +1550,34 @@ mono_thread_attach (MonoDomain *domain)
|
||||
return thread;
|
||||
}
|
||||
|
||||
/**
|
||||
* mono_threads_attach_tools_thread:
|
||||
*
|
||||
* Attach the current thread as a tool thread. DON'T USE THIS FUNCTION WITHOUT READING ALL DISCLAIMERS.
|
||||
*
|
||||
* A tools thread is a very special kind of thread that needs access to core
|
||||
* runtime facilities but should not be counted as a regular thread for high
|
||||
* order facilities such as executing managed code or accessing the managed
|
||||
* heap.
|
||||
*
|
||||
* This is intended only for low-level utilities than need to be able to use
|
||||
* some low-level runtime facilities when doing things like resolving
|
||||
* backtraces in their background processing thread.
|
||||
*
|
||||
* Note in particular that the thread is not fully attached - it does not have
|
||||
* a "current domain" because it cannot run managed code or interact with
|
||||
* managed objects. However it can act on some metadata, and use our low-level
|
||||
* locks and the coop thread state machine (ie GC Safe and GC Unsafe
|
||||
* transitions make sense).
|
||||
*/
|
||||
void
|
||||
mono_threads_attach_tools_thread (void)
|
||||
{
|
||||
MonoThreadInfo *info = mono_thread_info_attach ();
|
||||
g_assert (info);
|
||||
mono_thread_info_set_flags (MONO_THREAD_INFO_FLAGS_NO_GC | MONO_THREAD_INFO_FLAGS_NO_SAMPLE);
|
||||
}
|
||||
|
||||
/**
|
||||
* mono_thread_detach:
|
||||
*/
|
||||
@@ -1560,6 +1588,8 @@ mono_thread_detach (MonoThread *thread)
|
||||
mono_thread_detach_internal (thread->internal_thread);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* mono_thread_detach_if_exiting:
|
||||
*
|
||||
@@ -6483,6 +6513,9 @@ summarizer_state_term (SummarizerGlobalState *state, gchar **out, gchar *mem, si
|
||||
mono_get_eh_callbacks ()->mono_summarize_managed_stack (threads [i]);
|
||||
}
|
||||
|
||||
/* The value of the breadcrumb should match the "StackHash" value written by `mono_merp_write_fingerprint_payload` */
|
||||
mono_create_crash_hash_breadcrumb (controlling);
|
||||
|
||||
MonoStateWriter writer;
|
||||
memset (&writer, 0, sizeof (writer));
|
||||
|
||||
|
||||
@@ -44,6 +44,9 @@ MONO_API MonoThread *mono_thread_attach (MonoDomain *domain);
|
||||
MONO_API void mono_thread_detach (MonoThread *thread);
|
||||
MONO_API void mono_thread_exit (void);
|
||||
|
||||
MONO_API MONO_RT_EXTERNAL_ONLY void
|
||||
mono_threads_attach_tools_thread (void);
|
||||
|
||||
MONO_API char *mono_thread_get_name_utf8 (MonoThread *thread);
|
||||
MONO_API int32_t mono_thread_get_managed_id (MonoThread *thread);
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ TOOLS_RUNTIME = MONO_PATH=$(mcs_topdir)/class/lib/build $(top_builddir)/runtime/
|
||||
INTERP_RUNTIME = $(MINI_RUNTIME) --interpreter
|
||||
RUNTIME_AOTCHECK = MONO_PATH="$(CLASS)$(PLATFORM_PATH_SEPARATOR)." $(RUNTIME_EXECUTABLE)
|
||||
|
||||
MCS = CSC_SDK_PATH_DISABLED= $(TOOLS_RUNTIME) $(CSC) -langversion:7.2 -nostdlib -unsafe -nowarn:0162 -nologo -noconfig -r:$(CLASS)/mscorlib.dll -r:$(CLASS)/System.dll -r:$(CLASS)/System.Core.dll
|
||||
MCS = CSC_SDK_PATH_DISABLED= $(TOOLS_RUNTIME) $(CSC) -langversion:8.0 -nostdlib -unsafe -nowarn:0162 -nologo -noconfig -r:$(CLASS)/mscorlib.dll -r:$(CLASS)/System.dll -r:$(CLASS)/System.Core.dll
|
||||
ILASM = $(TOOLS_RUNTIME) $(mcs_topdir)/class/lib/build/ilasm.exe
|
||||
|
||||
if !ENABLE_MSVC_ONLY
|
||||
@@ -825,7 +825,7 @@ MemoryIntrinsics.dll: MemoryIntrinsics.il
|
||||
|
||||
GENMDESC_OPTS=
|
||||
|
||||
GENMDESC_PRG=python $(srcdir)/genmdesc.py $(target_define) $(srcdir)
|
||||
GENMDESC_PRG=$(PYTHON) $(srcdir)/genmdesc.py $(target_define) $(srcdir)
|
||||
|
||||
cpu-wasm.h: mini-ops.h cpu-wasm.md $(srcdir)/genmdesc.py
|
||||
$(GENMDESC_PRG) cpu-wasm.h wasm_desc $(srcdir)/cpu-wasm.md
|
||||
|
||||
Loaded 100 of 176 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user