Imported Upstream version 6.6.0.108

Former-commit-id: 00c6fff7917ab7dddc0c67044b046850c2283096
This commit is contained in:
Xamarin Public Jenkins (auto-signing) 2019-10-04 09:01:11 +00:00
parent 4c26f54a2f
commit 9050bbfc26
51 changed files with 188 additions and 118 deletions

View File

@ -1 +1 @@
37cc903befff71e98631598a26de46eacfdc7aca e2349164fad4ccd2424944cf6b3605ae76e1f876

View File

@ -1 +1 @@
f1495d076977e40b18b728f5367643e7374a3bc0 1e5e08337bc1443e8611aa9a92c9fd36e0baf00f

View File

@ -402,13 +402,16 @@ namespace IKVM.Reflection
{ {
return publicKey; return publicKey;
} }
byte[] hash = new SHA1Managed().ComputeHash(publicKey); using (var sha1 = SHA1.Create())
byte[] token = new byte[8];
for (int i = 0; i < token.Length; i++)
{ {
token[i] = hash[hash.Length - 1 - i]; byte[] hash = sha1.ComputeHash(publicKey);
byte[] token = new byte[8];
for (int i = 0; i < token.Length; i++)
{
token[i] = hash[hash.Length - 1 - i];
}
return token;
} }
return token;
} }
internal static string ComputePublicKeyToken(string publicKey) internal static string ComputePublicKeyToken(string publicKey)

View File

@ -472,21 +472,23 @@ namespace IKVM.Reflection.Emit
private int AddFile(ModuleBuilder manifestModule, string fileName, int flags) private int AddFile(ModuleBuilder manifestModule, string fileName, int flags)
{ {
SHA1Managed hash = new SHA1Managed(); using (var hash = SHA1.Create())
string fullPath = fileName;
if (dir != null)
{ {
fullPath = Path.Combine(dir, fileName); string fullPath = fileName;
} if (dir != null)
using (FileStream fs = new FileStream(fullPath, FileMode.Open, FileAccess.Read))
{
using (CryptoStream cs = new CryptoStream(Stream.Null, hash, CryptoStreamMode.Write))
{ {
byte[] buf = new byte[8192]; fullPath = Path.Combine(dir, fileName);
ModuleWriter.HashChunk(fs, cs, buf, (int)fs.Length);
} }
using (FileStream fs = new FileStream(fullPath, FileMode.Open, FileAccess.Read))
{
using (CryptoStream cs = new CryptoStream(Stream.Null, hash, CryptoStreamMode.Write))
{
byte[] buf = new byte[8192];
ModuleWriter.HashChunk(fs, cs, buf, (int)fs.Length);
}
}
return manifestModule.__AddModule(flags, Path.GetFileName(fileName), hash.Hash);
} }
return manifestModule.__AddModule(flags, Path.GetFileName(fileName), hash.Hash);
} }
public void AddResourceFile(string name, string fileName) public void AddResourceFile(string name, string fileName)

View File

@ -382,53 +382,55 @@ namespace IKVM.Reflection.Writer
private static void StrongName(Stream stream, StrongNameKeyPair keyPair, uint headerLength, uint textSectionFileOffset, uint strongNameSignatureFileOffset, uint strongNameSignatureLength) private static void StrongName(Stream stream, StrongNameKeyPair keyPair, uint headerLength, uint textSectionFileOffset, uint strongNameSignatureFileOffset, uint strongNameSignatureLength)
{ {
SHA1Managed hash = new SHA1Managed(); using (var hash = SHA1.Create())
using (CryptoStream cs = new CryptoStream(Stream.Null, hash, CryptoStreamMode.Write))
{ {
stream.Seek(0, SeekOrigin.Begin); using (CryptoStream cs = new CryptoStream(Stream.Null, hash, CryptoStreamMode.Write))
byte[] buf = new byte[8192];
HashChunk(stream, cs, buf, (int)headerLength);
stream.Seek(textSectionFileOffset, SeekOrigin.Begin);
HashChunk(stream, cs, buf, (int)(strongNameSignatureFileOffset - textSectionFileOffset));
stream.Seek(strongNameSignatureLength, SeekOrigin.Current);
HashChunk(stream, cs, buf, (int)(stream.Length - (strongNameSignatureFileOffset + strongNameSignatureLength)));
}
using (RSA rsa = keyPair.CreateRSA())
{
RSAPKCS1SignatureFormatter sign = new RSAPKCS1SignatureFormatter(rsa);
byte[] signature = sign.CreateSignature(hash);
Array.Reverse(signature);
if (signature.Length != strongNameSignatureLength)
{ {
throw new InvalidOperationException("Signature length mismatch"); stream.Seek(0, SeekOrigin.Begin);
byte[] buf = new byte[8192];
HashChunk(stream, cs, buf, (int)headerLength);
stream.Seek(textSectionFileOffset, SeekOrigin.Begin);
HashChunk(stream, cs, buf, (int)(strongNameSignatureFileOffset - textSectionFileOffset));
stream.Seek(strongNameSignatureLength, SeekOrigin.Current);
HashChunk(stream, cs, buf, (int)(stream.Length - (strongNameSignatureFileOffset + strongNameSignatureLength)));
}
using (RSA rsa = keyPair.CreateRSA())
{
RSAPKCS1SignatureFormatter sign = new RSAPKCS1SignatureFormatter(rsa);
byte[] signature = sign.CreateSignature(hash);
Array.Reverse(signature);
if (signature.Length != strongNameSignatureLength)
{
throw new InvalidOperationException("Signature length mismatch");
}
stream.Seek(strongNameSignatureFileOffset, SeekOrigin.Begin);
stream.Write(signature, 0, signature.Length);
} }
stream.Seek(strongNameSignatureFileOffset, SeekOrigin.Begin);
stream.Write(signature, 0, signature.Length);
}
// compute the PE checksum // compute the PE checksum
stream.Seek(0, SeekOrigin.Begin); stream.Seek(0, SeekOrigin.Begin);
int count = (int)stream.Length / 4; int count = (int)stream.Length / 4;
BinaryReader br = new BinaryReader(stream); BinaryReader br = new BinaryReader(stream);
long sum = 0; long sum = 0;
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
sum += br.ReadUInt32(); sum += br.ReadUInt32();
int carry = (int)(sum >> 32); int carry = (int)(sum >> 32);
sum &= 0xFFFFFFFFU; sum &= 0xFFFFFFFFU;
sum += carry; sum += carry;
} }
while ((sum >> 16) != 0) while ((sum >> 16) != 0)
{ {
sum = (sum & 0xFFFF) + (sum >> 16); sum = (sum & 0xFFFF) + (sum >> 16);
} }
sum += stream.Length; sum += stream.Length;
// write the PE checksum, note that it is always at offset 0xD8 in the file // write the PE checksum, note that it is always at offset 0xD8 in the file
ByteBuffer bb = new ByteBuffer(4); ByteBuffer bb = new ByteBuffer(4);
bb.Write((int)sum); bb.Write((int)sum);
stream.Seek(0xD8, SeekOrigin.Begin); stream.Seek(0xD8, SeekOrigin.Begin);
bb.WriteTo(stream); bb.WriteTo(stream);
}
} }
internal static void HashChunk(Stream stream, CryptoStream cs, byte[] buf, int length) internal static void HashChunk(Stream stream, CryptoStream cs, byte[] buf, int length)
@ -443,21 +445,23 @@ namespace IKVM.Reflection.Writer
private static Guid GenerateModuleVersionId(Stream stream) private static Guid GenerateModuleVersionId(Stream stream)
{ {
SHA1Managed hash = new SHA1Managed(); using (var hash = SHA1.Create())
using (CryptoStream cs = new CryptoStream(Stream.Null, hash, CryptoStreamMode.Write))
{ {
stream.Seek(0, SeekOrigin.Begin); using (CryptoStream cs = new CryptoStream(Stream.Null, hash, CryptoStreamMode.Write))
byte[] buf = new byte[8192]; {
HashChunk(stream, cs, buf, (int)stream.Length); stream.Seek(0, SeekOrigin.Begin);
byte[] buf = new byte[8192];
HashChunk(stream, cs, buf, (int)stream.Length);
}
byte[] bytes = new byte[16];
Buffer.BlockCopy(hash.Hash, 0, bytes, 0, bytes.Length);
// set GUID type to "version 4" (random)
bytes[7] &= 0x0F;
bytes[7] |= 0x40;
bytes[8] &= 0x3F;
bytes[8] |= 0x80;
return new Guid(bytes);
} }
byte[] bytes = new byte[16];
Buffer.BlockCopy(hash.Hash, 0, bytes, 0, bytes.Length);
// set GUID type to "version 4" (random)
bytes[7] &= 0x0F;
bytes[7] |= 0x40;
bytes[8] &= 0x3F;
bytes[8] |= 0x80;
return new Guid(bytes);
} }
} }
} }

View File

@ -41,7 +41,7 @@ static partial class Consts
// Use these assembly version constants to make code more maintainable. // Use these assembly version constants to make code more maintainable.
// //
public const string MonoVersion = "6.6.0.104"; public const string MonoVersion = "6.6.0.108";
public const string MonoCompany = "Mono development team"; public const string MonoCompany = "Mono development team";
public const string MonoProduct = "Mono Common Language Infrastructure"; public const string MonoProduct = "Mono Common Language Infrastructure";
public const string MonoCopyright = "(c) Various Mono authors"; public const string MonoCopyright = "(c) Various Mono authors";

View File

@ -1 +1 @@
addab8be965ae9005b32f1e7d936ae29cb4ddcb9 b10ab205f4ddf7ade4f67c298be0e63e3c5f8f21

View File

@ -1 +1 @@
08b71dcc521f5daf8d9ae0ed23c76174fd660f3d e3f5bd3451532718c09696f79f48473f70fa4fda

View File

@ -1 +1 @@
8fa48a2b7ac8924c42b928ae493daa20f9f7b5fd 3663feb80116629dcca2773e113a1deafac0bce0

View File

@ -1 +1 @@
a5183e89063f54935ac22fc1f71783b278094ec8 327b3da707a9b6f16d9231839094d1ca0765c5f5

View File

@ -1 +1 @@
6432fb38c53b70767df7c23d754f0389dd1c81c2 4bc82e5018b862e746408c4226aaabb48a39c7ce

View File

@ -1 +1 @@
3fc6751cf2f2ec7fdaf7aef8bdc83bf41b164075 7fc65f5a9b87a7c64125074e2dcf74a3ae422bb4

View File

@ -1 +1 @@
e352912f599cf03664d63b0c48185fa3935cb9ce 50c42c6133e6f0da5d405fe88fa3fe18c494d6e7

View File

@ -1 +1 @@
addab8be965ae9005b32f1e7d936ae29cb4ddcb9 b10ab205f4ddf7ade4f67c298be0e63e3c5f8f21

View File

@ -1 +1 @@
08b71dcc521f5daf8d9ae0ed23c76174fd660f3d e3f5bd3451532718c09696f79f48473f70fa4fda

View File

@ -1 +1 @@
8fa48a2b7ac8924c42b928ae493daa20f9f7b5fd 3663feb80116629dcca2773e113a1deafac0bce0

View File

@ -1 +1 @@
a5183e89063f54935ac22fc1f71783b278094ec8 327b3da707a9b6f16d9231839094d1ca0765c5f5

View File

@ -1 +1 @@
6432fb38c53b70767df7c23d754f0389dd1c81c2 4bc82e5018b862e746408c4226aaabb48a39c7ce

View File

@ -1 +1 @@
3fc6751cf2f2ec7fdaf7aef8bdc83bf41b164075 7fc65f5a9b87a7c64125074e2dcf74a3ae422bb4

View File

@ -1 +1 @@
f96950d184e0aef6f894f376f123130316461e94 130318c7d2a52a90714b422cfad67998f7bb3cf7

View File

@ -1 +1 @@
e352912f599cf03664d63b0c48185fa3935cb9ce 50c42c6133e6f0da5d405fe88fa3fe18c494d6e7

View File

@ -1 +1 @@
addab8be965ae9005b32f1e7d936ae29cb4ddcb9 b10ab205f4ddf7ade4f67c298be0e63e3c5f8f21

View File

@ -1 +1 @@
08b71dcc521f5daf8d9ae0ed23c76174fd660f3d e3f5bd3451532718c09696f79f48473f70fa4fda

View File

@ -1 +1 @@
8fa48a2b7ac8924c42b928ae493daa20f9f7b5fd 3663feb80116629dcca2773e113a1deafac0bce0

View File

@ -1 +1 @@
a5183e89063f54935ac22fc1f71783b278094ec8 327b3da707a9b6f16d9231839094d1ca0765c5f5

View File

@ -1 +1 @@
6432fb38c53b70767df7c23d754f0389dd1c81c2 4bc82e5018b862e746408c4226aaabb48a39c7ce

View File

@ -1 +1 @@
3fc6751cf2f2ec7fdaf7aef8bdc83bf41b164075 7fc65f5a9b87a7c64125074e2dcf74a3ae422bb4

View File

@ -1 +1 @@
f96950d184e0aef6f894f376f123130316461e94 130318c7d2a52a90714b422cfad67998f7bb3cf7

View File

@ -1 +1 @@
e352912f599cf03664d63b0c48185fa3935cb9ce 50c42c6133e6f0da5d405fe88fa3fe18c494d6e7

View File

@ -1 +1 @@
addab8be965ae9005b32f1e7d936ae29cb4ddcb9 b10ab205f4ddf7ade4f67c298be0e63e3c5f8f21

View File

@ -1 +1 @@
08b71dcc521f5daf8d9ae0ed23c76174fd660f3d e3f5bd3451532718c09696f79f48473f70fa4fda

View File

@ -1 +1 @@
a08c1152c80e09a99161f724af26482eeb952f3a 9bcfceec699d6367b78ca0c5399160d4bdf5c80a

View File

@ -1 +1 @@
a5183e89063f54935ac22fc1f71783b278094ec8 327b3da707a9b6f16d9231839094d1ca0765c5f5

View File

@ -1 +1 @@
6432fb38c53b70767df7c23d754f0389dd1c81c2 4bc82e5018b862e746408c4226aaabb48a39c7ce

View File

@ -1 +1 @@
3fc6751cf2f2ec7fdaf7aef8bdc83bf41b164075 7fc65f5a9b87a7c64125074e2dcf74a3ae422bb4

View File

@ -1 +1 @@
f96950d184e0aef6f894f376f123130316461e94 130318c7d2a52a90714b422cfad67998f7bb3cf7

View File

@ -1 +1 @@
0d2b0f53ef60a6730266b85dbccd938771a81553 b54ef7f2f86747166ea4b8a626acea06a69b43a5

View File

@ -212,6 +212,9 @@ typedef guint32 gunichar;
*/ */
#define G_N_ELEMENTS(s) (sizeof(s) / sizeof ((s) [0])) #define G_N_ELEMENTS(s) (sizeof(s) / sizeof ((s) [0]))
// e.g. strncmp (foo, G_STRING_CONSTANT_AND_LENGTH ("version"))
#define G_STRING_CONSTANT_AND_LENGTH(x) (x), G_N_ELEMENTS (x) - 1
#define FALSE 0 #define FALSE 0
#define TRUE 1 #define TRUE 1

View File

@ -1 +1 @@
72beeeab2c62a712243061cd3355c22c89d204fc 9a59db811341b6f8b76a6169859c33f3ad6d8198

View File

@ -1 +1 @@
#define FULL_VERSION "explicit/57f0684" #define FULL_VERSION "explicit/bd72952"

View File

@ -1496,10 +1496,10 @@ distclean-generic:
maintainer-clean-generic: maintainer-clean-generic:
@echo "This command is intended for maintainers to use" @echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild." @echo "it deletes files that may require special tools to rebuild."
@CROSS_COMPILE_TRUE@test-local:
@HOST_WIN32_TRUE@test-local:
@CROSS_COMPILE_TRUE@clean-local: @CROSS_COMPILE_TRUE@clean-local:
@HOST_WIN32_TRUE@clean-local: @HOST_WIN32_TRUE@clean-local:
@CROSS_COMPILE_TRUE@test-local:
@HOST_WIN32_TRUE@test-local:
clean: clean-am clean: clean-am
clean-am: clean-checkPROGRAMS clean-generic clean-libtool clean-local \ clean-am: clean-checkPROGRAMS clean-generic clean-libtool clean-local \

View File

@ -42,7 +42,7 @@
#include <utils/mono-threads-debug.h> #include <utils/mono-threads-debug.h>
static const char * static const char *
os_version_string (void) kernel_version_string (void)
{ {
#ifdef HAVE_SYS_UTSNAME_H #ifdef HAVE_SYS_UTSNAME_H
static struct utsname name; static struct utsname name;
@ -62,6 +62,61 @@ os_version_string (void)
return ""; return "";
} }
static gboolean
starts_with (const char *pre, size_t pre_sz, const char *str)
{
return strncmp (pre, str, pre_sz) == 0;
}
static const char *
macos_version_string (void)
{
/* Can't allocate in here, could be called from a signal handler in a
* crashed process.
*/
static const char *version_string;
static char buf[256];
static const size_t buf_size = sizeof (buf);
if (version_string)
return version_string;
/* macOS 10.13.6 or later */
if (!version_string) {
size_t size = 0;
if (sysctlbyname ("kern.osproductversion", NULL, &size, NULL, 0) < 0 || size >= buf_size) {
/* if we couldn't get the size or if it needs more space that we have in buf, leave it empty */
version_string = "";
return version_string;
}
if (sysctlbyname ("kern.osproductversion", (char*)buf, &size, NULL, 0) >= 0)
version_string = &buf[0];
}
/* macOS 10.13.5 or older */
if (!version_string) {
const char *kv_string = kernel_version_string ();
if (starts_with (G_STRING_CONSTANT_AND_LENGTH ("17"), kv_string))
version_string = "10.13"; // High Sierra
else if (starts_with (G_STRING_CONSTANT_AND_LENGTH ("16"), kv_string))
version_string = "10.12"; // Sierra
else if (starts_with (G_STRING_CONSTANT_AND_LENGTH ("15"), kv_string))
version_string = "10.11"; // El Capitan
else if (starts_with (G_STRING_CONSTANT_AND_LENGTH ("14"), kv_string))
version_string = "10.10"; // Yosemite
else if (starts_with (G_STRING_CONSTANT_AND_LENGTH ("13"), kv_string))
version_string = "10.9"; // Mavericks
else if (starts_with (G_STRING_CONSTANT_AND_LENGTH ("12"), kv_string))
version_string = "10.8"; // Mountain Lion
else if (starts_with (G_STRING_CONSTANT_AND_LENGTH ("11"), kv_string))
version_string = "10.7"; // Lion
}
if (!version_string)
version_string = "";
return version_string;
}
// To get the path of the running process // To get the path of the running process
#include <libproc.h> #include <libproc.h>
@ -350,8 +405,11 @@ mono_init_merp (const intptr_t crashed_pid, const char *signal, MonoStackHash *h
merp->moduleOffset = 0; merp->moduleOffset = 0;
merp->uiLidArg = MONO_LOCALE_INVARIANT; merp->uiLidArg = MONO_LOCALE_INVARIANT;
#if defined (TARGET_OSX)
merp->osVersion = os_version_string (); merp->osVersion = macos_version_string ();
#else
merp->osVersion = kernel_version_string ();
#endif
// FIXME: THis is apple-only for now // FIXME: THis is apple-only for now
merp->systemManufacturer = "apple"; merp->systemManufacturer = "apple";

Binary file not shown.

View File

@ -1 +1 @@
10894cdaa094f6155721bf0961ba3db9ad97f79f e727019f93cee4e44d819fe38f455666a5410ec7

Binary file not shown.

View File

@ -1 +1 @@
7160a9b3071cb39b07f05bdc67e1438743f18474 cfd7c03350f27a21f5e8f316dc86775666cce613

Binary file not shown.

View File

@ -1 +1 @@
b1a533ed924fcbdf874422f9324b0f5f3a96dbd7 aec18ddaf444a4ce62c19bfe092eb30d1b754407

View File

@ -6,9 +6,9 @@
#, fuzzy #, fuzzy
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: mono 6.6.0.104\n" "Project-Id-Version: mono 6.6.0.108\n"
"Report-Msgid-Bugs-To: http://www.mono-project.com/Bugs\n" "Report-Msgid-Bugs-To: http://www.mono-project.com/Bugs\n"
"POT-Creation-Date: 2019-10-02 08:34+0000\n" "POT-Creation-Date: 2019-10-04 08:30+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"

Binary file not shown.

View File

@ -1 +1 @@
bf1652d5aa7b6d76d99906b182ab3b83dd2d23da 98fb9d36ed14a4c6389304d8fd50110df62cc70a