Compare commits

..
28 Commits
Author SHA1 Message Date
Alex Corrado f12adef20c 2.10.4 2011-08-08 21:00:25 -04:00
Gonzalo Paniagua Javier d41b9d61c2 Merge pull request #150 from bassamtabbara/mono-2-10
Some fixes to mono-2-10
2011-08-08 06:26:42 -07:00
Bassam Tabbara 71b1f58d41 Fixed regression in System.Web.Routing caused by 62b047ae5b. Value and constraint where switched when evaluating regex route constraints. 2011-08-07 23:09:08 -07:00
Bassam Tabbara f983186526 Remove Console.WriteLine from DriveInfo.GetDrives() 2011-08-07 11:51:08 -07:00
Bassam Tabbara c726c88f32 Networkstream now throws IOException('connection closed') if the socket was closed/disposed 2011-08-07 11:17:27 -07:00
Jérémie Laval 3cb9ce92bc Fix for #162 2011-08-05 22:35:13 +02:00
Miguel de Icaza 2504797e50 Merge pull request #129 from grumpydev/CryptoFixo
Fix for out of bounds exception in Rfc2898DeriveBytes
2011-08-05 10:05:56 -04:00
Mark Probst 67ebb6a498 [sgen] Enqueue finalizers after update the pointer.
If the object was forwarded we read a bogus vtable and hence a bogus
klass.
2011-08-04 12:04:50 +02:00
Atsushi Eno d9e839c91b Merge pull request #146 from flutos/207ce0bccceec3ff7860ea986086fedb5a92d822
fix for bug 708178 that would fail if the type wasnt IEnumerable, should check if it implement IEnumerable rather than is IEnumerable
2011-08-04 09:08:12 +09:00
Rodrigo Kumpera fd65ec9388 Fix padding of call instructions. 2011-08-03 19:47:34 -03:00
Chris Toshok 7a0052ae2f don't redefine ABS 2011-08-03 10:42:01 -07:00
Marek Habersack ec0e9d7771 [runtime, globalization] Fix for Xamarin bug #161. Fix culture info data for certain locale short date formats
Modified locales which don't use '/' as the short date separator.
2011-08-03 16:00:46 +02:00
Rolf Bjarne Kvinge 4325b8151a [aot-compiler] Replace assert with descriptive error message. 2011-08-03 15:07:41 +02:00
Atsushi Eno 482e406319 Fix NET_2_1 builds (regression from the previous SecurityBindingElement fixes). 2011-08-03 13:54:08 +09:00
Rodrigo Kumpera e421b10a3d Implement fail tramp support on arm for full-aot imt thunks.
* aot-compiler.c (arch_emit_imt_thunk): Implement fail tramp
	support on arm. This enables variance to work under full-aot.
	The code blowout is not really significant as even on non linked
	apps the imt thunk overhead is 0.5%.
2011-08-03 00:47:20 -03:00
Geoff Norton 55c4b01d95 [gc] Darwin/AMD64 can have 64-bit thread id's, so we need to ensure
we cast properly to make sure the modulus has a valid result.
Additionally add support for x86_THREAD_STATE64.
2011-08-02 23:36:05 -04:00
Atsushi Eno a5610cbed1 Merge pull request #145 from ngraziano/99b87f07af0beed3a887
Fix Service Model Xml Serialization and XMLAttributes
2011-08-02 13:51:35 -07:00
Atsushi Eno fc9e1be0b3 Fix build, merge some missing changes to MessagePartDescription. 2011-08-03 05:46:53 +09:00
Atsushi Eno 9b9fef57d9 Fix bug #707434, check order only when applicable.
Based on the input by Scott Fluto.
2011-08-03 05:36:30 +09:00
Nicolas GRAZIANO 99b87f07af TypedMessageConverter do not take into account the xml attribute which modify the serialization.
Correction and Unit Test.
2011-08-02 22:15:58 +02:00
Atsushi Eno 9a69207087 Merge pull request #143 from mistoll/master
Fixes for WCF BasicHttpBinding with message security
2011-08-02 22:53:01 +09:00
Alex 4cfb3889f8 Define MONO_ARCH_NOMAP32BIT for DragonFly BSD. 2011-08-02 00:07:59 +02:00
Atsushi Eno 0a7f80fb0a Fill/reflect ReturnValue to and from corresponding message part.
This may have fixed bug #41.
2011-08-02 10:00:49 -07:00
Atsushi Eno df66c40aaa part of fix bug #41. MessageParameterAttribute is considered for return value.
Conflicts:

	mcs/class/System.ServiceModel/System.ServiceModel.Description/MessagePartDescription.cs
2011-08-02 07:52:03 -07:00
Jeffrey Stedfast 9b3e4f9034 Oops, fixed a typo 2011-08-01 16:59:52 -04:00
Alex 89dad63b0f Add support for DragonFly and NetBSD to sigcontext. 2011-08-01 10:29:43 +02:00
Jeffrey Stedfast 9636231dda Fix a mkbundle compiler warning by #including mono-config.h 2011-07-29 16:59:27 -04:00
Miguel de Icaza a2d896ec4e Update copyrights 2011-07-29 15:22:11 -04:00
78 changed files with 2160 additions and 1347 deletions

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@ AC_CANONICAL_SYSTEM
m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(mono,2.10.3)
AM_INIT_AUTOMAKE(mono,2.10.4)
AM_MAINTAINER_MODE
API_VER=2.0
+2
View File
@@ -114,7 +114,9 @@ typedef int32_t gboolean;
#define G_USEC_PER_SEC 1000000
#ifndef ABS
#define ABS(a) ((a) > 0 ? (a) : -(a))
#endif
#define G_STRUCT_OFFSET(p_type,field) offsetof(p_type,field)
+2
View File
@@ -371,6 +371,8 @@ void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES]));
# define GC_MACH_THREAD_STATE_FLAVOR PPC_THREAD_STATE
# elif defined(I386)
# define GC_MACH_THREAD_STATE_FLAVOR i386_THREAD_STATE
# elif defined(X86_64)
# define GC_MACH_THREAD_STATE_FLAVOR x86_THREAD_STATE64
# else
# define GC_MACH_THREAD_STATE_FLAVOR MACHINE_THREAD_STATE
# endif
+4 -4
View File
@@ -729,7 +729,7 @@ void nacl_shutdown_gc_thread()
/* Caller holds allocation lock. */
GC_thread GC_new_thread(pthread_t id)
{
int hv = ((word)id) % THREAD_TABLE_SZ;
int hv = ((unsigned long)id) % THREAD_TABLE_SZ;
GC_thread result;
static GC_bool first_thread_used = FALSE;
@@ -760,7 +760,7 @@ GC_thread GC_new_thread(pthread_t id)
/* Caller holds allocation lock. */
void GC_delete_thread(pthread_t id)
{
int hv = ((word)id) % THREAD_TABLE_SZ;
int hv = ((unsigned long)id) % THREAD_TABLE_SZ;
register GC_thread p = GC_threads[hv];
register GC_thread prev = 0;
@@ -796,7 +796,7 @@ void GC_delete_thread(pthread_t id)
/* This is OK, but we need a way to delete a specific one. */
void GC_delete_gc_thread(pthread_t id, GC_thread gc_id)
{
int hv = ((word)id) % THREAD_TABLE_SZ;
int hv = ((unsigned long)id) % THREAD_TABLE_SZ;
register GC_thread p = GC_threads[hv];
register GC_thread prev = 0;
@@ -825,7 +825,7 @@ void GC_delete_gc_thread(pthread_t id, GC_thread gc_id)
/* return the most recent one. */
GC_thread GC_lookup_thread(pthread_t id)
{
int hv = ((word)id) % THREAD_TABLE_SZ;
int hv = ((unsigned long)id) % THREAD_TABLE_SZ;
register GC_thread p = GC_threads[hv];
while (p != 0 && !pthread_equal(p -> id, id)) p = p -> next;
@@ -54,9 +54,24 @@ namespace System.IdentityModel.Tokens
#if TARGET_DOTNET
throw new NotImplementedException ();
#else
return new BigInteger (FromBinHex (hexString)).ToString ();
// http://tools.ietf.org/html/rfc5280#section-4.1.2.2
// We SHOULD support negative numbers
var bytes = FromBinHex (hexString);
var negative = bytes.Length > 0 && bytes [0] >= 0x80;
if (negative) {
for (int i = 0; i < bytes.Length; i++)
bytes [i] = (byte) ~ bytes [i];
}
var big = new BigInteger (bytes);
if (negative) {
big = big + 1;
return "-" + big.ToString ();
} else
return big.ToString ();
#endif
}
}
public X509IssuerSerialKeyIdentifierClause (X509Certificate2 certificate)
: base (null)
@@ -40,6 +40,7 @@ namespace MonoTests.System.IdentityModel.Selectors
{
static readonly X509Certificate2 cert = new X509Certificate2 ("Test/Resources/test.pfx", "mono");
static readonly X509Certificate2 cert2 = new X509Certificate2 ("Test/Resources/test2.pfx", "mono");
static readonly X509Certificate2 cert3 = new X509Certificate2("Test/Resources/test_neg_serial.cer");
[Test]
public void Properties ()
@@ -50,5 +51,14 @@ namespace MonoTests.System.IdentityModel.Selectors
Assert.AreEqual ("22491767666218099257720700881460366085", ic.IssuerSerialNumber, "#2");
Assert.AreEqual (null, ic.ClauseType, "#3");
}
[Test]
public void NegativeSerialNumber ()
{
var clause = new X509IssuerSerialKeyIdentifierClause (cert3);
Assert.AreEqual ("CN=test, OU=cert, O=test, [email protected]", clause.IssuerName, "#1");
Assert.AreEqual ("-168428216848510272180165529369113665228", clause.IssuerSerialNumber, "#2");
Assert.AreEqual (null, clause.ClauseType, "#3");
}
}
}
@@ -132,7 +132,7 @@ namespace System.ServiceModel.Channels.Security
// FIXME: use proper max buffer
buf = source.CreateBufferedCopy (int.MaxValue);
Console.WriteLine ("####### " + buf.CreateMessage ());
//Console.WriteLine ("####### " + buf.CreateMessage ());
doc = new XmlDocument ();
doc.PreserveWhitespace = true;
@@ -162,10 +162,7 @@ Console.WriteLine ("####### " + buf.CreateMessage ());
if (srcmsg.Version.Envelope == EnvelopeVersion.None)
throw new ArgumentException ("The message to decrypt is not an expected SOAP envelope.");
string action = GetAction ();
if (action == null)
throw new ArgumentException ("SOAP action could not be retrieved from the message to decrypt.");
XPathNavigator nav = doc.CreateNavigator ();
using (XmlWriter writer = nav.AppendChild ()) {
buf.CreateMessage ().WriteMessage (writer);
@@ -348,6 +345,9 @@ doc.PreserveWhitespace = true;
// and check if any of them can validate it.
SupportingTokenParameters supp;
string action = GetAction ();
if (action == null)
throw new ArgumentException ("SOAP action could not be retrieved from the message to decrypt.");
ValidateTokensByParameters (security.Element.EndpointSupportingTokenParameters, tokens, false);
if (security.Element.OperationSupportingTokenParameters.TryGetValue (action, out supp))
ValidateTokensByParameters (supp, tokens, false);
@@ -441,7 +441,7 @@ doc.PreserveWhitespace = true;
string ret = source_message.Headers.Action;
if (ret == null) {
HttpRequestMessageProperty reqprop =
source_message.Properties ["Action"] as HttpRequestMessageProperty;
source_message.Properties[HttpRequestMessageProperty.Name] as HttpRequestMessageProperty;
if (reqprop != null)
ret = reqprop.Headers ["Action"];
}
@@ -233,8 +233,6 @@ namespace System.ServiceModel.Channels.Security
security.SigningToken;
MessageProtectionOrder protectionOrder =
security.MessageProtectionOrder;
SecurityTokenSerializer serializer =
security.TokenSerializer;
SecurityBindingElement element =
security.Element;
SecurityAlgorithmSuite suite = element.DefaultAlgorithmSuite;
@@ -243,26 +241,19 @@ namespace System.ServiceModel.Channels.Security
int identForMessageId = 1;
XmlDocument doc = new XmlDocument ();
doc.PreserveWhitespace = true;
var action = msg.Headers.Action;
// FIXME: get correct ReplyTo value
if (Direction == MessageDirection.Input)
msg.Headers.ReplyTo = new EndpointAddress (Constants.WsaAnonymousUri);
if (MessageTo != null)
msg.Headers.To = MessageTo.Uri;
if (msg.Version.Addressing != AddressingVersion.None) {
AddAddressingToHeader (msg.Headers);
}
// wss:Security
WSSecurityMessageHeader header =
new WSSecurityMessageHeader (serializer);
new WSSecurityMessageHeader (security.TokenSerializer);
msg.Headers.Add (header);
// 1. [Timestamp]
if (element.IncludeTimestamp) {
WsuTimestamp timestamp = new WsuTimestamp ();
timestamp.Id = messageId + "-" + identForMessageId++;
timestamp.Created = DateTime.Now;
// FIXME: on service side, use element.LocalServiceSettings.TimestampValidityDuration
timestamp.Expires = timestamp.Created.Add (element.LocalClientSettings.TimestampValidityDuration);
header.AddContent (timestamp);
AddTimestampToHeader (header, messageId + "-" + identForMessageId++);
}
XmlNamespaceManager nsmgr = new XmlNamespaceManager (doc.NameTable);
@@ -272,13 +263,10 @@ namespace System.ServiceModel.Channels.Security
nsmgr.AddNamespace ("o11", Constants.Wss11Namespace);
/*WrappedKey*/SecurityToken primaryToken = null;
DerivedKeySecurityToken dkeyToken = null;
SecurityToken actualToken = null;
SecurityKeyIdentifierClause actualClause = null;
Signature sig = null;
List<DerivedKeySecurityToken> derivedKeys =
new List<DerivedKeySecurityToken> ();
SymmetricAlgorithm masterKey = new RijndaelManaged ();
masterKey.KeySize = suite.DefaultSymmetricKeyLength;
@@ -303,7 +291,6 @@ namespace System.ServiceModel.Channels.Security
SecurityKeyIdentifierClause encClause = ShouldOutputEncryptedKey ?
CounterParameters.CallCreateKeyIdentifierClause (encToken, !ShouldOutputEncryptedKey ? SecurityTokenReferenceStyle.Internal : includeEncToken ? Parameters.ReferenceStyle : SecurityTokenReferenceStyle.External) : null;
MessagePartSpecification sigSpec = SignaturePart;
MessagePartSpecification encSpec = EncryptionPart;
// encryption key (possibly also used for signing)
@@ -341,27 +328,11 @@ else
// generate derived key if needed
if (CounterParameters.RequireDerivedKeys) {
RijndaelManaged deriv = new RijndaelManaged ();
deriv.KeySize = suite.DefaultEncryptionKeyDerivationLength;
deriv.Mode = CipherMode.CBC;
deriv.Padding = PaddingMode.ISO10126;
deriv.GenerateKey ();
dkeyToken = new DerivedKeySecurityToken (
GenerateId (doc),
null, // algorithm
actualClause,
new InMemorySymmetricSecurityKey (actualKey.Key),
null, // name
null, // generation
null, // offset
deriv.Key.Length,
null, // label
deriv.Key);
derivedKeys.Add (dkeyToken);
actualToken = dkeyToken;
actualKey.Key = ((SymmetricSecurityKey) dkeyToken.SecurityKeys [0]).GetSymmetricKey ();
actualClause = new LocalIdKeyIdentifierClause (dkeyToken.Id);
header.AddContent (dkeyToken);
var dkeyToken = CreateDerivedKey (GenerateId (doc), actualClause, actualKey);
actualToken = dkeyToken;
actualKey.Key = ((SymmetricSecurityKey)dkeyToken.SecurityKeys [0]).GetSymmetricKey ();
actualClause = new LocalIdKeyIdentifierClause (dkeyToken.Id);
header.AddContent (dkeyToken);
}
ReferenceList refList = new ReferenceList ();
@@ -397,7 +368,6 @@ else
XmlElement body = doc.SelectSingleNode ("/s:Envelope/s:Body/*", nsmgr) as XmlElement;
string bodyId = null;
XmlElement secElem = null;
Collection<WSSignedXml> endorsedSignatures =
new Collection<WSSignedXml> ();
bool signatureProtection = (protectionOrder == MessageProtectionOrder.SignBeforeEncryptAndEncryptSignature);
@@ -413,110 +383,29 @@ else
case MessageProtectionOrder.SignBeforeEncrypt:
case MessageProtectionOrder.SignBeforeEncryptAndEncryptSignature:
// sign
// see clause 8 of WS-SecurityPolicy C.2.2
WSSignedXml sxml = new WSSignedXml (doc);
SecurityTokenReferenceKeyInfo sigKeyInfo;
sig = sxml.Signature;
sig.SignedInfo.CanonicalizationMethod =
suite.DefaultCanonicalizationAlgorithm;
foreach (XmlElement elem in doc.SelectNodes ("/s:Envelope/s:Header/o:Security/u:Timestamp", nsmgr))
CreateReference (sig, elem, elem.GetAttribute ("Id", Constants.WsuNamespace));
foreach (XmlElement elem in doc.SelectNodes ("/s:Envelope/s:Header/o:Security/o11:SignatureConfirmation", nsmgr))
CreateReference (sig, elem, elem.GetAttribute ("Id", Constants.WsuNamespace));
foreach (SupportingTokenInfo tinfo in tokenInfos)
if (tinfo.Mode != SecurityTokenAttachmentMode.Endorsing) {
XmlElement el = sxml.GetIdElement (doc, tinfo.Token.Id);
CreateReference (sig, el, el.GetAttribute ("Id", Constants.WsuNamespace));
}
XmlNodeList nodes = doc.SelectNodes ("/s:Envelope/s:Header/*", nsmgr);
for (int i = 0; i < msg.Headers.Count; i++) {
MessageHeaderInfo h = msg.Headers [i];
if (h.Name == "Security" && h.Namespace == Constants.WssNamespace)
secElem = nodes [i] as XmlElement;
else if (sigSpec.HeaderTypes.Count == 0 ||
sigSpec.HeaderTypes.Contains (new XmlQualifiedName (h.Name, h.Namespace))) {
string id = GenerateId (doc);
h.Id = id;
CreateReference (sig, nodes [i] as XmlElement, id);
}
}
if (sigSpec.IsBodyIncluded) {
bodyId = GenerateId (doc);
CreateReference (sig, body.ParentNode as XmlElement, bodyId);
}
if (security.DefaultSignatureAlgorithm == SignedXml.XmlDsigHMACSHA1Url) {
// FIXME: use appropriate hash algorithm
sxml.ComputeSignature (new HMACSHA1 (actualKey.Key));
sigKeyInfo = new SecurityTokenReferenceKeyInfo (actualClause, serializer, doc);
}
else {
SecurityKeyIdentifierClause signClause =
CounterParameters.CallCreateKeyIdentifierClause (signToken, includeSigToken ? CounterParameters.ReferenceStyle : SecurityTokenReferenceStyle.External);
AsymmetricSecurityKey signKey = (AsymmetricSecurityKey) signToken.ResolveKeyIdentifierClause (signClause);
sxml.SigningKey = signKey.GetAsymmetricAlgorithm (security.DefaultSignatureAlgorithm, true);
sxml.ComputeSignature ();
sigKeyInfo = new SecurityTokenReferenceKeyInfo (signClause, serializer, doc);
}
sxml.KeyInfo = new KeyInfo ();
sxml.KeyInfo.AddClause (sigKeyInfo);
if (!signatureProtection)
header.AddContent (sig);
// endorse the signature with (signed)endorsing
// supporting tokens.
foreach (SupportingTokenInfo tinfo in tokenInfos) {
switch (tinfo.Mode) {
case SecurityTokenAttachmentMode.Endorsing:
case SecurityTokenAttachmentMode.SignedEndorsing:
if (sxml.Signature.Id == null) {
sig.Id = GenerateId (doc);
secElem.AppendChild (sxml.GetXml ());
}
WSSignedXml ssxml = new WSSignedXml (doc);
ssxml.Signature.SignedInfo.CanonicalizationMethod = suite.DefaultCanonicalizationAlgorithm;
CreateReference (ssxml.Signature, doc, sig.Id);
SecurityToken sst = tinfo.Token;
SecurityKey ssk = sst.SecurityKeys [0]; // FIXME: could be different?
SecurityKeyIdentifierClause tclause = new LocalIdKeyIdentifierClause (sst.Id); // FIXME: could be different?
if (ssk is SymmetricSecurityKey) {
SymmetricSecurityKey signKey = (SymmetricSecurityKey) ssk;
ssxml.ComputeSignature (signKey.GetKeyedHashAlgorithm (suite.DefaultSymmetricSignatureAlgorithm));
} else {
AsymmetricSecurityKey signKey = (AsymmetricSecurityKey) ssk;
ssxml.SigningKey = signKey.GetAsymmetricAlgorithm (suite.DefaultAsymmetricSignatureAlgorithm, true);
ssxml.ComputeSignature ();
}
ssxml.KeyInfo.AddClause (new SecurityTokenReferenceKeyInfo (tclause, serializer, doc));
if (!signatureProtection)
header.AddContent (ssxml.Signature);
endorsedSignatures.Add (ssxml);
break;
}
}
var sig = CreateSignature (doc, body, nsmgr, tokenInfos,
actualClause, actualKey, signToken, includeSigToken,
signatureProtection, header, endorsedSignatures,
ref bodyId);
// encrypt
WSEncryptedXml exml = new WSEncryptedXml (doc);
EncryptedData edata = Encrypt (body, actualKey, actualToken.Id, refList, actualClause, exml, doc);
EncryptedData edata = Encrypt (body, actualKey, actualToken.Id, refList, actualClause, exml, doc, EncryptedXml.XmlEncElementContentUrl);
EncryptedXml.ReplaceElement (body, edata, false);
// encrypt signature
if (signatureProtection) {
XmlElement sigxml = sig.GetXml ();
edata = Encrypt (sigxml, actualKey, actualToken.Id, refList, actualClause, exml, doc);
edata = Encrypt (sigxml, actualKey, actualToken.Id, refList, actualClause, exml, doc, EncryptedXml.XmlEncElementUrl);
header.AddContent (edata);
foreach (WSSignedXml ssxml in endorsedSignatures) {
sigxml = ssxml.GetXml ();
edata = Encrypt (sigxml, actualKey, actualToken.Id, refList, actualClause, exml, doc);
edata = Encrypt (sigxml, actualKey, actualToken.Id, refList, actualClause, exml, doc, EncryptedXml.XmlEncElementUrl);
header.AddContent (edata);
}
@@ -524,7 +413,7 @@ else
Collection<Wss11SignatureConfirmation> confs = header.FindAll<Wss11SignatureConfirmation> ();
int count = 0;
foreach (XmlElement elem in doc.SelectNodes ("/s:Envelope/s:Header/o:Security/o11:SignatureConfirmation", nsmgr)) {
edata = Encrypt (elem, actualKey, confs [count].Id, refList, actualClause, exml, doc);
edata = Encrypt (elem, actualKey, confs [count].Id, refList, actualClause, exml, doc, EncryptedXml.XmlEncElementUrl);
EncryptedXml.ReplaceElement (elem, edata, false);
header.Contents.Insert (header.Contents.IndexOf (confs [count]), edata);
header.Contents.Remove (confs [count++]);
@@ -532,11 +421,12 @@ else
}
}
// encrypt Encrypted supporting tokens
foreach (SupportingTokenInfo tinfo in tokenInfos) {
if (tinfo.Mode == SecurityTokenAttachmentMode.SignedEncrypted) {
XmlElement el = exml.GetIdElement (doc, tinfo.Token.Id);
tinfo.Encrypted = Encrypt (el, actualKey, actualToken.Id, refList, actualClause, exml, doc);
tinfo.Encrypted = Encrypt (el, actualKey, actualToken.Id, refList, actualClause, exml, doc, EncryptedXml.XmlEncElementUrl);
EncryptedXml.ReplaceElement (el, tinfo.Encrypted, false);
header.Contents.Insert (header.Contents.IndexOf (tinfo.Token), tinfo.Encrypted);
header.Contents.Remove (tinfo.Token);
@@ -545,7 +435,10 @@ else
break;
}
Message ret = new WSSecurityMessage (Message.CreateMessage (msg.Version, msg.Headers.Action, new XmlNodeReader (doc.SelectSingleNode ("/s:Envelope/s:Body/*", nsmgr) as XmlElement)), bodyId);
Message ret = new WSSecurityMessage (Message.CreateMessage (msg.Version, action, new XmlNodeReader (doc.SelectSingleNode ("/s:Envelope/s:Body/*", nsmgr) as XmlElement)), bodyId);
ret.Properties.Security = (SecurityMessageProperty) secprop.CreateCopy ();
ret.Properties.Security.EncryptionKey = masterKey.Key;
@@ -559,7 +452,7 @@ else
ret.Headers.Clear ();
ret.Headers.CopyHeadersFrom (msg);
// Header contents are:
// - Timestamp
// - SignatureConfirmation if required
@@ -589,6 +482,157 @@ else
return ret;
}
Signature CreateSignature (XmlDocument doc, XmlElement body,
XmlNamespaceManager nsmgr,
SupportingTokenInfoCollection tokenInfos,
SecurityKeyIdentifierClause actualClause,
SymmetricAlgorithm actualKey,
SecurityToken signToken,
bool includeSigToken,
bool signatureProtection,
WSSecurityMessageHeader header,
Collection<WSSignedXml> endorsedSignatures,
ref string bodyId)
{
// sign
// see clause 8 of WS-SecurityPolicy C.2.2
WSSignedXml sxml = new WSSignedXml (doc);
SecurityTokenReferenceKeyInfo sigKeyInfo;
XmlElement secElem = null;
var sigSpec = SignaturePart;
var serializer = security.TokenSerializer;
var suite = security.Element.DefaultAlgorithmSuite;
var sig = sxml.Signature;
sig.SignedInfo.CanonicalizationMethod =
suite.DefaultCanonicalizationAlgorithm;
foreach (XmlElement elem in doc.SelectNodes ("/s:Envelope/s:Header/o:Security/u:Timestamp", nsmgr))
CreateReference(sig, elem, elem.GetAttribute ("Id", Constants.WsuNamespace));
foreach (XmlElement elem in doc.SelectNodes ("/s:Envelope/s:Header/o:Security/o11:SignatureConfirmation", nsmgr))
CreateReference(sig, elem, elem.GetAttribute ("Id", Constants.WsuNamespace));
foreach (SupportingTokenInfo tinfo in tokenInfos)
if (tinfo.Mode != SecurityTokenAttachmentMode.Endorsing) {
XmlElement el = sxml.GetIdElement (doc, tinfo.Token.Id);
CreateReference (sig, el, el.GetAttribute ("Id", Constants.WsuNamespace));
}
XmlNodeList nodes = doc.SelectNodes ("/s:Envelope/s:Header/*", nsmgr);
for (int i = 0; i < msg.Headers.Count; i++) {
MessageHeaderInfo h = msg.Headers [i];
if (h.Name == "Security" && h.Namespace == Constants.WssNamespace)
secElem = nodes [i] as XmlElement;
else if ((sigSpec.HeaderTypes.Count == 0 ||
sigSpec.HeaderTypes.Contains (new XmlQualifiedName(h.Name, h.Namespace))) &&
(msg.Version.Addressing != AddressingVersion.None ||
!String.Equals (h.Name, "Action", StringComparison.Ordinal))) {
string id = GenerateId (doc);
h.Id = id;
CreateReference (sig, nodes [i] as XmlElement, id);
}
}
if (sigSpec.IsBodyIncluded) {
bodyId = GenerateId (doc);
CreateReference (sig, body.ParentNode as XmlElement, bodyId);
}
if (security.DefaultSignatureAlgorithm == SignedXml.XmlDsigHMACSHA1Url) {
// FIXME: use appropriate hash algorithm
sxml.ComputeSignature (new HMACSHA1(actualKey.Key));
sigKeyInfo = new SecurityTokenReferenceKeyInfo (actualClause, serializer, doc);
} else {
SecurityKeyIdentifierClause signClause =
CounterParameters.CallCreateKeyIdentifierClause (signToken, includeSigToken ? CounterParameters.ReferenceStyle : SecurityTokenReferenceStyle.External);
AsymmetricSecurityKey signKey = (AsymmetricSecurityKey)signToken.ResolveKeyIdentifierClause (signClause);
sxml.SigningKey = signKey.GetAsymmetricAlgorithm (security.DefaultSignatureAlgorithm, true);
sxml.ComputeSignature ();
sigKeyInfo = new SecurityTokenReferenceKeyInfo (signClause, serializer, doc);
}
sxml.KeyInfo = new KeyInfo ();
sxml.KeyInfo.AddClause (sigKeyInfo);
if (!signatureProtection)
header.AddContent (sig);
// endorse the signature with (signed)endorsing
// supporting tokens.
foreach (SupportingTokenInfo tinfo in tokenInfos) {
switch (tinfo.Mode) {
case SecurityTokenAttachmentMode.Endorsing:
case SecurityTokenAttachmentMode.SignedEndorsing:
if (sxml.Signature.Id == null) {
sig.Id = GenerateId (doc);
secElem.AppendChild (sxml.GetXml ());
}
WSSignedXml ssxml = new WSSignedXml (doc);
ssxml.Signature.SignedInfo.CanonicalizationMethod = suite.DefaultCanonicalizationAlgorithm;
CreateReference (ssxml.Signature, doc, sig.Id);
SecurityToken sst = tinfo.Token;
SecurityKey ssk = sst.SecurityKeys [0]; // FIXME: could be different?
SecurityKeyIdentifierClause tclause = new LocalIdKeyIdentifierClause (sst.Id); // FIXME: could be different?
if (ssk is SymmetricSecurityKey) {
SymmetricSecurityKey signKey = (SymmetricSecurityKey)ssk;
ssxml.ComputeSignature (signKey.GetKeyedHashAlgorithm(suite.DefaultSymmetricSignatureAlgorithm));
} else {
AsymmetricSecurityKey signKey = (AsymmetricSecurityKey)ssk;
ssxml.SigningKey = signKey.GetAsymmetricAlgorithm (suite.DefaultAsymmetricSignatureAlgorithm, true);
ssxml.ComputeSignature ();
}
ssxml.KeyInfo.AddClause (new SecurityTokenReferenceKeyInfo (tclause, serializer, doc));
if (!signatureProtection)
header.AddContent (ssxml.Signature);
endorsedSignatures.Add (ssxml);
break;
}
}
return sig;
}
void AddAddressingToHeader (MessageHeaders headers)
{
// FIXME: get correct ReplyTo value
if (Direction == MessageDirection.Input)
headers.ReplyTo = new EndpointAddress (Constants.WsaAnonymousUri);
if (MessageTo != null)
headers.To = MessageTo.Uri;
}
DerivedKeySecurityToken CreateDerivedKey (string id,
SecurityKeyIdentifierClause actualClause,
SymmetricAlgorithm actualKey)
{
RijndaelManaged deriv = new RijndaelManaged ();
deriv.KeySize = security.Element.DefaultAlgorithmSuite.DefaultEncryptionKeyDerivationLength;
deriv.Mode = CipherMode.CBC;
deriv.Padding = PaddingMode.ISO10126;
deriv.GenerateKey ();
var dkeyToken = new DerivedKeySecurityToken (
id,
null, // algorithm
actualClause,
new InMemorySymmetricSecurityKey (actualKey.Key),
null, // name
null, // generation
null, // offset
deriv.Key.Length,
null, // label
deriv.Key);
return dkeyToken;
}
void AddTimestampToHeader (WSSecurityMessageHeader header, string id)
{
WsuTimestamp timestamp = new WsuTimestamp ();
timestamp.Id = id;
timestamp.Created = DateTime.Now;
// FIXME: on service side, use element.LocalServiceSettings.TimestampValidityDuration
timestamp.Expires = timestamp.Created.Add (security.Element.LocalClientSettings.TimestampValidityDuration);
header.AddContent (timestamp);
}
void CreateReference (Signature sig, XmlElement el, string id)
{
CreateReference (sig, el.OwnerDocument, id);
@@ -626,7 +670,7 @@ else
throw new Exception (String.Format ("INTERNAL ERROR: Invalid canonicalization URL: {0}", url));
}
EncryptedData Encrypt (XmlElement target, SymmetricAlgorithm actualKey, string ekeyId, ReferenceList refList, SecurityKeyIdentifierClause encClause, EncryptedXml exml, XmlDocument doc)
EncryptedData Encrypt (XmlElement target, SymmetricAlgorithm actualKey, string ekeyId, ReferenceList refList, SecurityKeyIdentifierClause encClause, EncryptedXml exml, XmlDocument doc, string elementType)
{
SecurityAlgorithmSuite suite = security.Element.DefaultAlgorithmSuite;
SecurityTokenSerializer serializer = security.TokenSerializer;
@@ -634,7 +678,7 @@ else
byte [] encrypted = exml.EncryptData (target, actualKey, false);
EncryptedData edata = new EncryptedData ();
edata.Id = GenerateId (doc);
edata.Type = EncryptedXml.XmlEncElementContentUrl;
edata.Type = elementType;
edata.EncryptionMethod = new EncryptionMethod (suite.DefaultEncryptionAlgorithm);
// FIXME: here wsse:DigestMethod should be embedded
// inside EncryptionMethod. Since it is not possible
@@ -668,7 +712,7 @@ else
string ret = msg.Headers.Action;
if (ret == null) {
HttpRequestMessageProperty reqprop =
msg.Properties ["Action"] as HttpRequestMessageProperty;
msg.Properties[HttpRequestMessageProperty.Name] as HttpRequestMessageProperty;
if (reqprop != null)
ret = reqprop.Headers ["Action"];
}
@@ -716,8 +760,10 @@ else
{
var dic = Constants.SoapDictionary;
writer.WriteStartElement ("s", dic.Add ("Body"), dic.Add (Version.Envelope.Namespace));
if (body_id != null)
writer.WriteAttributeString ("Id", Constants.WsuNamespace, body_id);
if (body_id != null)
writer.WriteAttributeString ("u", "Id", Constants.WsuNamespace, body_id);
}
protected override void OnWriteBodyContents (XmlDictionaryWriter w)
@@ -372,27 +372,59 @@ namespace System.ServiceModel.Channels
throw new NotImplementedException ();
}
[MonoTODO]
public static SecurityBindingElement
CreateMutualCertificateBindingElement ()
{
throw new NotImplementedException ();
return CreateMutualCertificateBindingElement (MessageSecurityVersion.Default, false);
}
[MonoTODO]
public static SecurityBindingElement
CreateMutualCertificateBindingElement (MessageSecurityVersion version)
{
throw new NotImplementedException ();
return CreateMutualCertificateBindingElement (version, false);
}
[MonoTODO]
[MonoTODO("Does not support allowSerializedSigningTokenOnReply.")]
public static SecurityBindingElement
CreateMutualCertificateBindingElement (
MessageSecurityVersion version,
bool allowSerializedSigningTokenOnReply)
{
throw new NotImplementedException ();
if (version == null)
throw new ArgumentNullException ("version");
if (allowSerializedSigningTokenOnReply)
throw new NotSupportedException ("allowSerializedSigningTokenOnReply is not supported");
if (version.SecurityVersion == SecurityVersion.WSSecurity10) {
var recipient = new X509SecurityTokenParameters (
X509KeyIdentifierClauseType.Any,
SecurityTokenInclusionMode.Never);
recipient.RequireDerivedKeys = false;
var initiator = new X509SecurityTokenParameters (
X509KeyIdentifierClauseType.Any,
SecurityTokenInclusionMode.AlwaysToRecipient);
initiator.RequireDerivedKeys = false;
return new AsymmetricSecurityBindingElement (recipient, initiator) {
MessageSecurityVersion = version
};
} else {
X509SecurityTokenParameters p =
new X509SecurityTokenParameters (X509KeyIdentifierClauseType.Thumbprint);
p.RequireDerivedKeys = false;
var sym = new SymmetricSecurityBindingElement () {
MessageSecurityVersion = version,
RequireSignatureConfirmation = true
};
sym.EndpointSupportingTokenParameters.Endorsing.Add (p);
return sym;
}
}
[MonoTODO]
@@ -47,6 +47,13 @@ namespace System.ServiceModel.Description
return att;
return null;
}
public static T GetCustomAttribute<T> (this ParameterInfo pi, bool inherit) where T : Attribute
{
foreach (T att in pi.GetCustomAttributes (typeof (T), inherit))
return att;
return null;
}
}
public class ContractDescription
@@ -294,8 +294,21 @@ namespace System.ServiceModel.Description
od.Behaviors.Add (new DataContractSerializerOperationBehavior (od, dfa));
od.Messages.Add (GetMessage (od, mi, oca, true, isCallback, null));
if (!od.IsOneWay)
od.Messages.Add (GetMessage (od, mi, oca, false, isCallback, asyncReturnType));
if (!od.IsOneWay) {
var md = GetMessage (od, mi, oca, false, isCallback, asyncReturnType);
od.Messages.Add (md);
var mpa = mi.ReturnParameter.GetCustomAttribute<MessageParameterAttribute> (true);
if (mpa != null) {
var mpd = md.Body.Parts.FirstOrDefault (pd => pd.Name == mpa.Name);
if (mpd != null) {
md.Body.Parts.Remove (mpd);
md.Body.ReturnValue = mpd;
mpd.Name = mpa.Name;
}
else if (md.Body.ReturnValue == null)
throw new InvalidOperationException (String.Format ("Specified message part '{0}' in MessageParameterAttribute on the return value, was not found", mpa.Name));
}
}
var knownTypeAtts =
cd.ContractType.GetCustomAttributes (typeof (ServiceKnownTypeAttribute), false).Union (
mi.GetCustomAttributes (typeof (ServiceKnownTypeAttribute), false)).Union (
@@ -27,6 +27,7 @@
//
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Security;
using System.Runtime.Serialization;
using System.Reflection;
@@ -35,6 +36,7 @@ using System.Xml.Serialization;
namespace System.ServiceModel.Description
{
[DebuggerDisplay ("Name={name}, Namespace={ns}, Type={Type}, Index={index}}")]
public class MessagePartDescription
{
int index;
@@ -50,8 +52,8 @@ namespace System.ServiceModel.Description
public MessagePartDescription (string name, string ns)
{
this.name = name;
this.ns = ns;
this.Name = name;
}
public int Index {
@@ -66,6 +68,10 @@ namespace System.ServiceModel.Description
public string Name {
get { return name; }
internal set {
name = value;
XmlName = new XmlName (value);
}
}
public string Namespace {
@@ -102,6 +108,10 @@ namespace System.ServiceModel.Description
#region internals required for moonlight compatibility
internal XmlName XmlName {
get; private set;
}
ICustomAttributeProvider additional_att_provider;
internal ICustomAttributeProvider AdditionalAttributesProvider {
@@ -300,7 +300,10 @@ namespace System.ServiceModel.Dispatcher
((PropertyInfo) mi).SetValue (msgObject, pair.Value, null);
}
foreach (MessagePartDescription partDesc in md.Body.Parts)
var l = new List<MessagePartDescription> (md.Body.Parts);
if (md.Body.ReturnValue != null)
l.Add (md.Body.ReturnValue);
foreach (MessagePartDescription partDesc in l)
if (partDesc.MemberInfo is FieldInfo)
((FieldInfo) partDesc.MemberInfo).SetValue (msgObject, parts [partDesc.Index]);
else
@@ -317,7 +320,10 @@ namespace System.ServiceModel.Dispatcher
headers [headDesc] = ((PropertyInfo) mi).GetValue (msgObject, null);
}
foreach (MessagePartDescription partDesc in md.Body.Parts)
var l = new List<MessagePartDescription> (md.Body.Parts);
if (md.Body.ReturnValue != null)
l.Add (md.Body.ReturnValue);
foreach (MessagePartDescription partDesc in l)
if (partDesc.MemberInfo is FieldInfo)
parts [partDesc.Index] = ((FieldInfo) partDesc.MemberInfo).GetValue (msgObject);
else
@@ -65,6 +65,7 @@ namespace System.ServiceModel.Dispatcher
m.IsReturnValue = isReturnValue;
m.MemberName = partDesc.Name;
m.MemberType = partDesc.Type;
m.XmlAttributes = new XmlAttributes(partDesc.MemberInfo);
return m;
}
@@ -181,23 +181,10 @@ namespace System.ServiceModel
CreateBindingElements ()
{
var list = new List<BindingElement> ();
switch (Security.Mode) {
#if !NET_2_1
case BasicHttpSecurityMode.Message:
if (Security.Message.ClientCredentialType != BasicHttpMessageCredentialType.Certificate)
throw new InvalidOperationException ("When Message security is enabled in a BasicHttpBinding, the message security credential type must be BasicHttpMessageCredentialType.Certificate.");
goto case BasicHttpSecurityMode.TransportWithMessageCredential;
case BasicHttpSecurityMode.TransportWithMessageCredential:
SecurityBindingElement sec;
if (Security.Message.ClientCredentialType != BasicHttpMessageCredentialType.Certificate)
// FIXME: pass proper security token parameters.
sec = SecurityBindingElement.CreateCertificateOverTransportBindingElement ();
else
sec = new AsymmetricSecurityBindingElement ();
list.Add (sec);
break;
#endif
}
var security = CreateSecurityBindingElement ();
if (security != null)
list.Add (security);
#if NET_2_1
if (EnableHttpCookieContainer)
@@ -209,6 +196,37 @@ namespace System.ServiceModel
return new BindingElementCollection (list.ToArray ());
}
SecurityBindingElement CreateSecurityBindingElement ()
{
SecurityBindingElement element;
switch (Security.Mode) {
#if !NET_2_1
case BasicHttpSecurityMode.Message:
if (Security.Message.ClientCredentialType != BasicHttpMessageCredentialType.Certificate)
throw new InvalidOperationException ("When Message security is enabled in a BasicHttpBinding, the message security credential type must be BasicHttpMessageCredentialType.Certificate.");
element = SecurityBindingElement.CreateMutualCertificateBindingElement (
MessageSecurityVersion.WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10);
break;
case BasicHttpSecurityMode.TransportWithMessageCredential:
if (Security.Message.ClientCredentialType != BasicHttpMessageCredentialType.Certificate)
// FIXME: pass proper security token parameters.
element = SecurityBindingElement.CreateCertificateOverTransportBindingElement ();
else
element = new AsymmetricSecurityBindingElement ();
break;
#endif
default:
return null;
}
#if !NET_2_1
element.SetKeyDerivation (false);
element.SecurityHeaderLayout = SecurityHeaderLayout.Lax;
#endif
return element;
}
MessageEncodingBindingElement BuildMessageEncodingBindingElement ()
{
@@ -103,6 +103,7 @@ System.ServiceModel.Configuration/StandardBindingElementCollectionTest.cs
System.ServiceModel.Configuration/StandardBindingElementTest.cs
System.ServiceModel.Configuration/StandardEndpointsSectionTest.cs
System.ServiceModel.Configuration/UserBinding.cs
System.ServiceModel.Description/BugX41.cs
System.ServiceModel.Description/ClientCredentialsTest.cs
System.ServiceModel.Description/ContractDescriptionTest.cs
System.ServiceModel.Description/FaultDescriptionTest.cs
@@ -0,0 +1,288 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.235
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Dealerinfo.wsvDealerinfo {
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Namespace="http://programcallbean.accentry.accell.nl", ConfigurationName="wsvDealerinfo.WSVDealerInfoServices")]
public interface WSVDealerInfoServices {
// CODEGEN: Parameter 'wsvdealerinfo_XMLReturn' requires additional schema information that cannot be captured using the parameter mode. The specific attribute is 'System.Xml.Serialization.XmlElementAttribute'.
[System.ServiceModel.OperationContractAttribute(Action="wsvdealerinfo_XML", ReplyAction="*")]
[System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)]
[return: System.ServiceModel.MessageParameterAttribute(Name="wsvdealerinfo_XMLReturn")]
Dealerinfo.wsvDealerinfo.wsvdealerinfo_XMLResponse wsvdealerinfo_XML(Dealerinfo.wsvDealerinfo.wsvdealerinfo_XMLRequest request);
// CODEGEN: Parameter 'wsvdealerinfoReturn' requires additional schema information that cannot be captured using the parameter mode. The specific attribute is 'System.Xml.Serialization.XmlElementAttribute'.
[System.ServiceModel.OperationContractAttribute(Action="wsvdealerinfo", ReplyAction="*")]
[System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)]
[return: System.ServiceModel.MessageParameterAttribute(Name="wsvdealerinfoReturn")]
Dealerinfo.wsvDealerinfo.wsvdealerinfoResponse wsvdealerinfo(Dealerinfo.wsvDealerinfo.wsvdealerinfoRequest request);
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://programcallbean.accentry.accell.nl")]
public partial class WSVDealerInfoInput : object, System.ComponentModel.INotifyPropertyChanged {
private string returncodeField;
private string wSVBedrijfscodeField;
private string wSVDealercodeField;
private string wSVWachtwoordField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true, Order=0)]
public string returncode {
get {
return this.returncodeField;
}
set {
this.returncodeField = value;
this.RaisePropertyChanged("returncode");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true, Order=1)]
public string WSVBedrijfscode {
get {
return this.wSVBedrijfscodeField;
}
set {
this.wSVBedrijfscodeField = value;
this.RaisePropertyChanged("WSVBedrijfscode");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true, Order=2)]
public string WSVDealercode {
get {
return this.wSVDealercodeField;
}
set {
this.wSVDealercodeField = value;
this.RaisePropertyChanged("WSVDealercode");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true, Order=3)]
public string WSVWachtwoord {
get {
return this.wSVWachtwoordField;
}
set {
this.wSVWachtwoordField = value;
this.RaisePropertyChanged("WSVWachtwoord");
}
}
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
protected void RaisePropertyChanged(string propertyName) {
System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
if ((propertyChanged != null)) {
propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://programcallbean.accentry.accell.nl")]
public partial class WSVDealerInfoResult : object, System.ComponentModel.INotifyPropertyChanged {
private string returncodeField;
private string wSVFoutmeldingField;
private string wSVDealerinfoField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true, Order=0)]
public string returncode {
get {
return this.returncodeField;
}
set {
this.returncodeField = value;
this.RaisePropertyChanged("returncode");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true, Order=1)]
public string WSVFoutmelding {
get {
return this.wSVFoutmeldingField;
}
set {
this.wSVFoutmeldingField = value;
this.RaisePropertyChanged("WSVFoutmelding");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true, Order=2)]
public string WSVDealerinfo {
get {
return this.wSVDealerinfoField;
}
set {
this.wSVDealerinfoField = value;
this.RaisePropertyChanged("WSVDealerinfo");
}
}
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
protected void RaisePropertyChanged(string propertyName) {
System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
if ((propertyChanged != null)) {
propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
}
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
[System.ServiceModel.MessageContractAttribute(WrapperName="wsvdealerinfo_XML", WrapperNamespace="http://programcallbean.accentry.accell.nl", IsWrapped=true)]
public partial class wsvdealerinfo_XMLRequest {
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://programcallbean.accentry.accell.nl", Order=0)]
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
public Dealerinfo.wsvDealerinfo.WSVDealerInfoInput inputData;
public wsvdealerinfo_XMLRequest() {
}
public wsvdealerinfo_XMLRequest(Dealerinfo.wsvDealerinfo.WSVDealerInfoInput inputData) {
this.inputData = inputData;
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
[System.ServiceModel.MessageContractAttribute(WrapperName="wsvdealerinfo_XMLResponse", WrapperNamespace="http://programcallbean.accentry.accell.nl", IsWrapped=true)]
public partial class wsvdealerinfo_XMLResponse {
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://programcallbean.accentry.accell.nl", Order=0)]
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
public string wsvdealerinfo_XMLReturn;
public wsvdealerinfo_XMLResponse() {
}
public wsvdealerinfo_XMLResponse(string wsvdealerinfo_XMLReturn) {
this.wsvdealerinfo_XMLReturn = wsvdealerinfo_XMLReturn;
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
[System.ServiceModel.MessageContractAttribute(WrapperName="wsvdealerinfo", WrapperNamespace="http://programcallbean.accentry.accell.nl", IsWrapped=true)]
public partial class wsvdealerinfoRequest {
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://programcallbean.accentry.accell.nl", Order=0)]
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
public Dealerinfo.wsvDealerinfo.WSVDealerInfoInput inputData;
public wsvdealerinfoRequest() {
}
public wsvdealerinfoRequest(Dealerinfo.wsvDealerinfo.WSVDealerInfoInput inputData) {
this.inputData = inputData;
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
[System.ServiceModel.MessageContractAttribute(WrapperName="wsvdealerinfoResponse", WrapperNamespace="http://programcallbean.accentry.accell.nl", IsWrapped=true)]
public partial class wsvdealerinfoResponse {
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://programcallbean.accentry.accell.nl", Order=0)]
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
public Dealerinfo.wsvDealerinfo.WSVDealerInfoResult wsvdealerinfoReturn;
public wsvdealerinfoResponse() {
}
public wsvdealerinfoResponse(Dealerinfo.wsvDealerinfo.WSVDealerInfoResult wsvdealerinfoReturn) {
this.wsvdealerinfoReturn = wsvdealerinfoReturn;
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public interface WSVDealerInfoServicesChannel : Dealerinfo.wsvDealerinfo.WSVDealerInfoServices, System.ServiceModel.IClientChannel {
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class WSVDealerInfoServicesClient : System.ServiceModel.ClientBase<Dealerinfo.wsvDealerinfo.WSVDealerInfoServices>, Dealerinfo.wsvDealerinfo.WSVDealerInfoServices {
public WSVDealerInfoServicesClient() {
}
public WSVDealerInfoServicesClient(string endpointConfigurationName) :
base(endpointConfigurationName) {
}
public WSVDealerInfoServicesClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress) {
}
public WSVDealerInfoServicesClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress) {
}
public WSVDealerInfoServicesClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress) {
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
Dealerinfo.wsvDealerinfo.wsvdealerinfo_XMLResponse Dealerinfo.wsvDealerinfo.WSVDealerInfoServices.wsvdealerinfo_XML(Dealerinfo.wsvDealerinfo.wsvdealerinfo_XMLRequest request) {
return base.Channel.wsvdealerinfo_XML(request);
}
public string wsvdealerinfo_XML(Dealerinfo.wsvDealerinfo.WSVDealerInfoInput inputData) {
Dealerinfo.wsvDealerinfo.wsvdealerinfo_XMLRequest inValue = new Dealerinfo.wsvDealerinfo.wsvdealerinfo_XMLRequest();
inValue.inputData = inputData;
Dealerinfo.wsvDealerinfo.wsvdealerinfo_XMLResponse retVal = ((Dealerinfo.wsvDealerinfo.WSVDealerInfoServices)(this)).wsvdealerinfo_XML(inValue);
return retVal.wsvdealerinfo_XMLReturn;
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
Dealerinfo.wsvDealerinfo.wsvdealerinfoResponse Dealerinfo.wsvDealerinfo.WSVDealerInfoServices.wsvdealerinfo(Dealerinfo.wsvDealerinfo.wsvdealerinfoRequest request) {
return base.Channel.wsvdealerinfo(request);
}
public Dealerinfo.wsvDealerinfo.WSVDealerInfoResult wsvdealerinfo(Dealerinfo.wsvDealerinfo.WSVDealerInfoInput inputData) {
Dealerinfo.wsvDealerinfo.wsvdealerinfoRequest inValue = new Dealerinfo.wsvDealerinfo.wsvdealerinfoRequest();
inValue.inputData = inputData;
Dealerinfo.wsvDealerinfo.wsvdealerinfoResponse retVal = ((Dealerinfo.wsvDealerinfo.WSVDealerInfoServices)(this)).wsvdealerinfo(inValue);
return retVal.wsvdealerinfoReturn;
}
}
}
@@ -544,6 +544,17 @@ namespace MonoTests.System.ServiceModel.Description
Assert.IsNotNull (xb, "#1");
}
[Test]
public void MessageParameterDescriptionInUse ()
{
// bug #41
var cd = ContractDescription.GetContract (typeof (Dealerinfo.wsvDealerinfo.WSVDealerInfoServices));
foreach (var od in cd.Operations)
foreach (var md in od.Messages)
if (md.Action == "*") // return
Assert.IsNotNull (md.Body.ReturnValue, od.Name);
}
// It is for testing attribute search in interfaces.
public class Foo : IFoo
{
@@ -34,7 +34,9 @@ using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using NUnit.Framework;
namespace MonoTests.System.ServiceModel.Description
@@ -119,6 +121,49 @@ namespace MonoTests.System.ServiceModel.Description
Assert.AreEqual ("test", t2.echo.msg, "#01");
Assert.AreEqual ("testtest", t2.body2, "#02");
}
[Test]
public void XmlSerializerdWithXmlAttribute()
{
TypedMessageConverter c = TypedMessageConverter.Create (
typeof (Test3), "http://tempuri.org/MyTest",
new XmlSerializerFormatAttribute ());
string xmlMessage = @"<s:Envelope xmlns:s='http://www.w3.org/2003/05/soap-envelope'
xmlns:a='http://www.w3.org/2005/08/addressing'>
<s:Header><a:Action s:mustUnderstand='1'>http://tempuri.org/MyTest</a:Action></s:Header>
<s:Body xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<test xmlns='urn:foo'>
<Id>OneID</Id>
<Element>
<Prop1 xmlns='urn:bar'>foo</Prop1>
<Prop2 xmlns='urn:bar'>2</Prop2>
</Element>
<Element>
<Prop1 xmlns='urn:bar'>bar</Prop1>
<Prop2 xmlns='urn:bar'>3</Prop2>
</Element>
</test>
</s:Body>
</s:Envelope>";
byte[] buffer = Encoding.UTF8.GetBytes(xmlMessage);
using (XmlDictionaryReader reader = XmlDictionaryReader.CreateTextReader(buffer, XmlDictionaryReaderQuotas.Max))
{
Message messagedisk = Message.CreateMessage(reader, int.MaxValue, MessageVersion.Soap12);
Test3 obj = c.FromMessage(messagedisk) as Test3;
Assert.IsNotNull(obj);
Assert.AreEqual("OneID", obj.Id);
Assert.IsNotNull(obj.ArrayOfElement);
Assert.AreEqual(2, obj.ArrayOfElement.Length);
Assert.AreEqual("foo", obj.ArrayOfElement[0].Prop1);
Assert.AreEqual(3, obj.ArrayOfElement[1].Prop2);
}
}
}
[MessageContract (WrapperNamespace = "space", WrapperName = "MyName")]
@@ -146,4 +191,32 @@ namespace MonoTests.System.ServiceModel.Description
[MessageBodyMember (Name = "body", Namespace = "urn:foo")]
public Echo Body { get; set; }
}
[MessageContract(WrapperName = "test",
WrapperNamespace = "urn:foo",
IsWrapped = true)]
public class Test3
{
[MessageBodyMember()]
[XmlElementAttribute()]
public string Id;
[MessageBodyMember()]
[XmlElement(Type = typeof(ElementType), ElementName = "Element")]
public ElementType[] ArrayOfElement;
}
[Serializable]
[XmlType(Namespace = "urn:bar")]
public class ElementType
{
[XmlElement(Order = 0)]
public string Prop1 { get; set; }
[XmlElement(Order = 1)]
public int Prop2 { get; set; }
}
}
@@ -188,22 +188,22 @@ namespace System.Web.Routing
return false;
}
static bool MatchConstraintRegex (string rx, string constraint)
static bool MatchConstraintRegex (string value, string constraint)
{
int rxlen = rx.Length;
if (rxlen > 0) {
int len = constraint.Length;
if (len > 0) {
// Bug #651966 - regexp constraints must be treated
// as absolute expressions
if (rx [0] != '^') {
rx = "^" + rx;
rxlen++;
if (constraint [0] != '^') {
constraint = "^" + constraint;
len++;
}
if (rx [rxlen - 1] != '$')
rx += "$";
if (constraint [len - 1] != '$')
constraint += "$";
}
return Regex.Match (rx, constraint).Success;
return Regex.Match (value, constraint).Success;
}
protected virtual bool ProcessConstraint (HttpContextBase httpContext, object constraint, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
@@ -444,7 +444,7 @@ namespace System.Xml.Serialization
#if NET_2_0
internal static Type GetGenericListItemType (Type type)
{
if (type.IsGenericType && type.GetGenericTypeDefinition () == typeof (IEnumerable<>)) {
if (type.IsGenericType && typeof(IEnumerable).IsAssignableFrom(type.GetGenericTypeDefinition ())) {
Type [] gatypes = type.GetGenericArguments ();
if (type.GetMethod ("Add", gatypes) != null)
return gatypes [0];
@@ -279,17 +279,21 @@ namespace System.Xml.Serialization
sb.Append ("|");
}
public int Order {
internal int? Order {
get {
int order = -1;
if (XmlElements != null)
int? order = null;
if (XmlElements.Count > 0)
order = XmlElements.Order;
if (order < 0 && XmlArray != null)
else if (XmlArray != null)
order = XmlArray.Order;
if (order < 0 && XmlAnyElements != null)
else if (XmlAnyElements.Count > 0)
order = XmlAnyElements.Order;
return order;
}
}
internal int SortableOrder {
get { return Order != null ? (int) Order : int.MinValue; }
}
}
}
@@ -348,13 +348,17 @@ namespace System.Xml.Serialization {
bool? isOrderExplicit = null;
foreach (XmlReflectionMember rmember in members)
{
int? order = rmember.XmlAttributes.Order;
if (isOrderExplicit == null)
isOrderExplicit = rmember.XmlAttributes.Order >= 0;
else if (isOrderExplicit != (rmember.XmlAttributes.Order >= 0))
{
if (order != null)
isOrderExplicit = (int) order >= 0;
}
else if (order != null && isOrderExplicit != ((int) order >= 0))
throw new InvalidOperationException ("Inconsistent XML sequence was detected. If there are XmlElement/XmlArray/XmlAnyElement attributes with explicit Order, then every other member must have an explicit order too.");
}
if (isOrderExplicit == true)
members.Sort ((m1, m2) => m1.XmlAttributes.Order - m2.XmlAttributes.Order);
members.Sort ((m1, m2) => (int) m1.XmlAttributes.SortableOrder - (int) m2.XmlAttributes.SortableOrder);
foreach (XmlReflectionMember rmember in members)
{
@@ -1635,6 +1635,27 @@ namespace MonoTests.System.XmlSerialization
var xs = new XmlSerializer (typeof (Bug704813Type));
xs.Serialize (TextWriter.Null, new Bug704813Type ());
}
[Test]
public void Bug708178Type()
{
XmlSerializer xmlSerializer = new XmlSerializer (typeof(Bug708178Type));
Bug708178Type bugType = new Bug708178Type ();
bugType.Foo.Add ("test");
Assert.AreEqual (1, bugType.Foo.Count);
//xml Serialize
TextWriter WriteFileStream = new StreamWriter (@"Bug708178Type.xml", false);
xmlSerializer.Serialize (WriteFileStream, bugType);
WriteFileStream.Close ();
//xml Deserialize
FileStream ReadFileStream = new FileStream (@"Bug708178Type.xml", FileMode.Open, FileAccess.Read, FileShare.Read);
Bug708178Type bugTypeReload = (Bug708178Type)xmlSerializer.Deserialize (ReadFileStream);
//should have deserialized the relationship
Assert.AreEqual(1, bugTypeReload.Foo.Count);
}
#endif
public class Employee : IXmlSerializable
@@ -183,6 +183,22 @@ namespace MonoTests.System.XmlSerialization
<child>Hello</child>
<child>World</child>
<child0>test</child0>
</root>"));
Assert.AreEqual ("Hello", result.Child1, "#1");
Assert.AreEqual ("World", result.Child2, "#2");
Assert.IsNull (result.Child0, "#3"); // not "test"
}
[Test]
public void ExplicitlyOrderedMembers4 ()
{
var xs = new XmlSerializer (typeof (ExplicitlyOrderedMembersType4));
//Would result in an Inconsistent XML sequence error , see Bug 707434
var result = (ExplicitlyOrderedMembersType4) xs.Deserialize(new StringReader (@"
<root>
<child>Hello</child>
<child>World</child>
<child0>test</child0>
</root>"));
Assert.AreEqual ("Hello", result.Child1, "#1");
Assert.AreEqual ("World", result.Child2, "#2");
@@ -968,6 +968,16 @@ namespace MonoTests.System.Xml.TestClasses
}
}
public class Bug708178Type
{
List<string> foo = new List<string> ();
[XmlArray("Foo"), XmlArrayItem("Foo", typeof(string))]
public List<string> Foo {
get { return foo; }
}
}
[XmlRoot("root")]
public class ExplicitlyOrderedMembersType1
{
@@ -1007,5 +1017,20 @@ namespace MonoTests.System.Xml.TestClasses
public string Child2;
}
[XmlRoot("root")]
public class ExplicitlyOrderedMembersType4
{
[XmlElement("child0", Order = 1)] // it's between 0 and 2. After two "child" elements, child0 is not recognized as this member.
public string Child0;
[XmlElement("child", Order = 0)]
public string Child1;
[XmlElement("child", Order = 2)]
public string Child2;
[XmlAttribute]
public string Child3;
}
}
@@ -214,8 +214,14 @@ namespace System.Net.Sockets
throw new ArgumentOutOfRangeException("offset+size exceeds the size of buffer");
}
Socket s = socket;
if (s == null) {
throw new IOException("Connection closed");
}
try {
retval = socket.BeginReceive (buffer, offset, size, 0, callback, state);
retval = s.BeginReceive (buffer, offset, size, 0, callback, state);
} catch (Exception e) {
throw new IOException ("BeginReceive failure", e);
}
@@ -240,8 +246,14 @@ namespace System.Net.Sockets
throw new ArgumentOutOfRangeException("offset+size exceeds the size of buffer");
}
Socket s = socket;
if (s == null) {
throw new IOException("Connection closed");
}
try {
retval = socket.BeginSend (buffer, offset, size, 0, callback, state);
retval = s.BeginSend (buffer, offset, size, 0, callback, state);
} catch {
throw new IOException ("BeginWrite failure");
}
@@ -316,8 +328,14 @@ namespace System.Net.Sockets
if (ar == null)
throw new ArgumentNullException ("async result is null");
Socket s = socket;
if (s == null) {
throw new IOException("Connection closed");
}
try {
res = socket.EndReceive (ar);
res = s.EndReceive (ar);
} catch (Exception e) {
throw new IOException ("EndRead failure", e);
}
@@ -330,8 +348,14 @@ namespace System.Net.Sockets
if (ar == null)
throw new ArgumentNullException ("async result is null");
Socket s = socket;
if (s == null) {
throw new IOException("Connection closed");
}
try {
socket.EndSend (ar);
s.EndSend (ar);
} catch (Exception e) {
throw new IOException ("EndWrite failure", e);
}
@@ -363,8 +387,14 @@ namespace System.Net.Sockets
throw new ArgumentOutOfRangeException("offset+size exceeds the size of buffer");
}
Socket s = socket;
if (s == null) {
throw new IOException("Connection closed");
}
try {
res = socket.Receive (buffer, offset, size, 0);
res = s.Receive (buffer, offset, size, 0);
} catch (Exception e) {
throw new IOException ("Read failure", e);
}
@@ -398,10 +428,16 @@ namespace System.Net.Sockets
if (size < 0 || size > buffer.Length - offset)
throw new ArgumentOutOfRangeException("offset+size exceeds the size of buffer");
Socket s = socket;
if (s == null) {
throw new IOException("Connection closed");
}
try {
int count = 0;
while (size - count > 0) {
count += socket.Send (buffer, offset + count, size - count, 0);
count += s.Send (buffer, offset + count, size - count, 0);
}
} catch (Exception e) {
throw new IOException ("Write failure", e);
-1
View File
@@ -232,7 +232,6 @@ namespace System.IO {
int i = 0;
foreach (string s in drives) {
infos [i++] = new DriveInfo (s, GetDriveFormat (s));
Console.WriteLine (infos [i-1].path);
}
return infos;
@@ -33,9 +33,9 @@ using System.Text;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography {
namespace System.Security.Cryptography {
[ComVisible (true)]
[ComVisible (true)]
public class Rfc2898DeriveBytes : DeriveBytes {
private const int defaultIterations = 1000;
@@ -155,6 +155,13 @@ namespace System.Security.Cryptography {
Buffer.BlockCopy (_buffer, _pos, result, 0, count);
if (count >= cb)
return result;
// If we are going to go over the boundaries
// of the result on our l-1 iteration, reduce
// l to compensate.
if (((l-1) * 20 + count) > result.Length)
l--;
_pos = 0;
rpos = count;
}
@@ -108,7 +108,7 @@ namespace System.Threading.Tasks
this.action = action == null ? EmptyFunc : action;
this.state = state;
this.taskId = Interlocked.Increment (ref id);
this.status = TaskStatus.Created;
this.status = cancellationToken.IsCancellationRequested ? TaskStatus.Canceled : TaskStatus.Created;
this.token = cancellationToken;
// Process taskCreationOptions
@@ -356,6 +356,15 @@ namespace MonoTests.System.Security.Cryptography {
CompareBuffers (big, a, b);
}
[Test]
public void MultipleCalls_DoesntOverrunBuffer ()
{
Rfc2898DeriveBytes keygen = new Rfc2898DeriveBytes("Password", new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 });
keygen.GetBytes(32);
keygen.GetBytes(64);
}
}
}
@@ -117,6 +117,15 @@ namespace MonoTests.System.Threading.Tasks
Assert.AreEqual (1, aggr.InnerExceptions.Count, "#4");
Assert.IsInstanceOfType (typeof (OperationCanceledException), aggr.InnerExceptions[0], "#5");
}
[Test, ExpectedException (typeof (InvalidOperationException))]
public void CreationWhileInitiallyCanceled ()
{
var token = new CancellationToken (true);
var task = new Task (() => { }, token);
Assert.AreEqual (TaskStatus.Canceled, task.Status);
task.Start ();
}
[Test]
public void ContinueWithOnAnyTestCase()
+1
View File
@@ -206,6 +206,7 @@ class MakeBundle {
string prog = null;
tc.WriteLine ("/* This source code was produced by mkbundle, do not edit */");
tc.WriteLine ("#include <mono/metadata/mono-config.h>");
tc.WriteLine ("#include <mono/metadata/assembly.h>\n");
if (compress) {
File diff suppressed because it is too large. Load diff
+3 -3
View File
@@ -4109,6 +4109,9 @@ finalize_in_range (CopyOrMarkObjectFunc copy_func, char *start, char *end, int g
if (is_fin_ready) {
char *from;
FinalizeEntry *next;
/* Make it survive */
from = entry->object;
entry->object = copy;
/* remove and put in fin_ready_list */
if (prev)
prev->next = entry->next;
@@ -4119,9 +4122,6 @@ finalize_in_range (CopyOrMarkObjectFunc copy_func, char *start, char *end, int g
hash_table->num_registered--;
queue_finalization_entry (entry);
bridge_register_finalized_object ((MonoObject*)copy);
/* Make it survive */
from = entry->object;
entry->object = copy;
DEBUG (5, fprintf (gc_debug_file, "Queueing object for finalization: %p (%s) (was at %p) (%d/%d)\n", entry->object, safe_name (entry->object), from, num_ready_finalizers, hash_table->num_registered));
entry = next;
continue;
+7 -2
View File
@@ -1425,7 +1425,9 @@ arch_emit_imt_thunk (MonoAotCompile *acfg, int offset, int *tramp_size)
/* No match */
arm_patch (labels [3], code);
ARM_DBRK (code);
ARM_LDR_IMM (code, ARMREG_R0, ARMREG_R0, 4);
ARM_STR_IMM (code, ARMREG_R0, ARMREG_SP, 8);
ARM_POP (code, (1 << ARMREG_R0)|(1 << ARMREG_R1)|(1 << ARMREG_PC));
/* Fixup offset */
code2 = labels [0];
@@ -6950,7 +6952,10 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
int i = g_file_open_tmp ("mono_aot_XXXXXX", &acfg->tmpfname, NULL);
acfg->fp = fdopen (i, "w+");
}
g_assert (acfg->fp);
if (acfg->fp == 0) {
fprintf (stderr, "Unable to open file '%s': %s\n", acfg->tmpfname, strerror (errno));
return 1;
}
}
acfg->w = img_writer_create (acfg->fp, FALSE);
+1 -1
View File
@@ -1400,7 +1400,7 @@ mono_main (int argc, char* argv[])
char *build = mono_get_runtime_build_info ();
char *gc_descr;
g_print ("Mono JIT compiler version %s\nCopyright (C) 2002-2011 Novell, Inc and Contributors. www.mono-project.com\n", build);
g_print ("Mono JIT compiler version %s\nCopyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com\n", build);
g_free (build);
g_print (info);
gc_descr = mono_gc_get_description ();
+4
View File
@@ -298,6 +298,10 @@ typedef struct {
#define MONO_ARCH_NOMAP32BIT
#elif defined (__DragonFly__)
#define MONO_ARCH_NOMAP32BIT
#elif defined (__FreeBSD__)
#define REG_RAX 7
+1 -1
View File
@@ -1808,7 +1808,7 @@ emit_call (MonoCompile *cfg, guint8 *code, guint32 patch_type, gconstpointer dat
*/
guint32 pad_size = (guint32)(code + 1 - cfg->native_code) & 0x3;
if (pad_size)
x86_padding (code, pad_size);
x86_padding (code, 4 - pad_size);
mono_add_patch_info (cfg, code - cfg->native_code, patch_type, data);
x86_call_code (code, 0);
+30 -4
View File
@@ -8,14 +8,14 @@
#if defined(__i386__)
#if defined(__FreeBSD__) || defined(__APPLE__)
#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__DragonFly__)
#include <ucontext.h>
#endif
#if defined(__APPLE__)
#include <AvailabilityMacros.h>
#endif
#if defined(__FreeBSD__)
#if defined(__FreeBSD__) || defined(__DragonFly__)
#define UCONTEXT_REG_EAX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_eax)
#define UCONTEXT_REG_EBX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_ebx)
#define UCONTEXT_REG_ECX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_ecx)
@@ -99,8 +99,34 @@
#define UCONTEXT_REG_R13(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__r13)
#define UCONTEXT_REG_R14(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__r14)
#define UCONTEXT_REG_R15(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__r15)
#elif defined(__FreeBSD__)
#define UCONTEXT_GREGS(ctx) ((guint64*)&(((ucontext_t*)(ctx))->uc_mcontext))
#elif defined(__FreeBSD__) || defined(__DragonFly__)
#define UCONTEXT_REG_RAX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_rax)
#define UCONTEXT_REG_RBX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_rbx)
#define UCONTEXT_REG_RCX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_rcx)
#define UCONTEXT_REG_RDX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_rdx)
#define UCONTEXT_REG_RBP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_rbp)
#define UCONTEXT_REG_RSP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_rsp)
#define UCONTEXT_REG_RSI(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_rsi)
#define UCONTEXT_REG_RDI(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_rdi)
#define UCONTEXT_REG_RIP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_rip)
#define UCONTEXT_REG_R12(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_r12)
#define UCONTEXT_REG_R13(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_r13)
#define UCONTEXT_REG_R14(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_r14)
#define UCONTEXT_REG_R15(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_r15)
#elif defined(__NetBSD__)
#define UCONTEXT_REG_RAX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_RAX])
#define UCONTEXT_REG_RBX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_RBX])
#define UCONTEXT_REG_RCX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_RCX])
#define UCONTEXT_REG_RDX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_RDX])
#define UCONTEXT_REG_RBP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_RBP])
#define UCONTEXT_REG_RSP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_RSP])
#define UCONTEXT_REG_RSI(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_RSI])
#define UCONTEXT_REG_RDI(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_RDI])
#define UCONTEXT_REG_RIP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_RIP])
#define UCONTEXT_REG_R12(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_R12])
#define UCONTEXT_REG_R13(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_R13])
#define UCONTEXT_REG_R14(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_R14])
#define UCONTEXT_REG_R15(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_R15])
#elif defined(__OpenBSD__)
/* OpenBSD/amd64 has no gregs array, ucontext_t == sigcontext */
#define UCONTEXT_REG_RAX(ctx) (((ucontext_t*)(ctx))->sc_rax)
+3
View File
@@ -7,6 +7,9 @@
>
<ldml>
<dates>
<symbols>
<dateSeparator>-</dateSeparator>
</symbols>
<calendars>
<calendar_type type="GregorianCalendar" />
<calendar type="gregorian">
+3
View File
@@ -7,6 +7,9 @@
>
<ldml>
<dates>
<symbols>
<dateSeparator>-</dateSeparator>
</symbols>
<calendars>
<calendar_type type="GregorianCalendar" />
<calendar type="gregorian">
+3
View File
@@ -7,6 +7,9 @@
>
<ldml>
<dates>
<symbols>
<dateSeparator>-</dateSeparator>
</symbols>
<calendars>
<calendar_type type="GregorianCalendar" />
<calendar type="gregorian">
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>.</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>.</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -10,6 +10,9 @@
</decimalFormats>
</numbers>
<dates>
<symbols>
<dateSeparator>.</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -10,6 +10,9 @@
</percentFormats>
</numbers>
<dates>
<symbols>
<dateSeparator>-</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>.</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>.</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>-</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>.</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -10,6 +10,9 @@
</percentFormats>
</numbers>
<dates>
<symbols>
<dateSeparator>.</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>-</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>-</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>.</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>-</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>.</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -10,6 +10,9 @@
</percentFormats>
</numbers>
<dates>
<symbols>
<dateSeparator>. </dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>.</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>.</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>.</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>.</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -10,6 +10,9 @@
</decimalFormats>
</numbers>
<dates>
<symbols>
<dateSeparator>.</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>.</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>.</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -10,6 +10,9 @@
</percentFormats>
</numbers>
<dates>
<symbols>
<dateSeparator>-</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -12,6 +12,9 @@
<language type="pl" />
</identity>
<dates>
<symbols>
<dateSeparator>-</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>-</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>.</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>.</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>. </dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>.</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>-</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>.</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>-</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>.</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>
+3
View File
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ldml>
<dates>
<symbols>
<dateSeparator>.</dateSeparator>
</symbols>
<calendars>
<calendar type="gregorian">
<dateFormats>