Commit Graph
127 Commits
Author SHA1 Message Date
Marek Safar d5d4b9c22b Fix some warnings 2012-06-08 12:48:08 +01:00
Miguel de Icaza 1c19405a83 [class libraries] drop NET_1_0 definitions 2012-06-02 21:46:34 -04:00
Miguel de Icaza ae0feab435 Removal of NET_1_1 defines and some NET_2_0; Both defines are true these days in Mono, no versions prior to 2.0 are supported 2012-06-01 18:04:24 -04:00
Marek Safar aad016fd87 Clean up few more warnings 2010-10-15 15:20:25 +01:00
Raja R Harinath b293948fb7 EOL handling
This set of .gitattributes was automatically generated from the list of files
that GIT tried to normalize when I enabled automatic EOL conversion.

With this set of attributes, we prevent automated EOL conversion on files that
we know will cause trouble down the road.
2010-07-25 20:17:39 +05:30
Atsushi Eno 642ee8319d 2010-07-09 Atsushi Enomoto <[email protected]>
* SignedXml.cs : avoid using LoadXml() to load xml element as in
	  literal string. Use ImportNode() instead.
	  Copy namespaces for a referenced node found in envelope document too.


svn path=/trunk/mcs/; revision=160143
2010-07-09 16:24:09 +00:00
Sebastien Pouliot 14846e6f2f Security fix for CVE-2009-0217
svn path=/trunk/mcs/; revision=137886
2009-07-14 18:45:19 +00:00
Marek Safar 2d36f50709 2009-06-05 Marek Safar <[email protected]>
* Makefile: Fixed NET_2_0 conditional to actually handle Mono.Security
	dependency.


svn path=/trunk/mcs/; revision=135540
2009-06-05 16:27:11 +00:00
Sebastien Pouliot bd6370ad74 2008-11-01 Sebastien Pouliot <[email protected]>
* EncryptedXml.cs: Add proper null check inside methods.
	* SignedXml.cs: GetIdElement returns null if either of its parameter
	is null.
	* Transform.cs: Comment compatibility-NRE in GetDigestedOutput.
	* XmlDecryptionTransform.cs: IsTargetElement returns null if either
	of its parameter is null.
	* XmlDsigC14NTransform.cs: Comment compatibility-NRE in 
	GetDigestedOutput.
	* XmlDsigExcC14NTransform.cs: Comment compatibility-NRE in 
	GetDigestedOutput.
	[Found using Gendarme CheckParametersNullityInVisibleMethodsRule]


svn path=/trunk/mcs/; revision=117622
2008-11-02 00:25:45 +00:00
Gert Driesen 19098dd864 * XmlDsigXsltTranformTest.cs: Added test for .ctor (bool).
* XmlDsigEnvelopedTransformTest.cs: Added test for .ctor (bool). Use
Assert class. Improved properties tests.
* XmlDsigC14TransformTest.cs: Added test for .ctor (bool).
* XmlDsigExcC14NTransformTest.cs: Added .ctor tests and added asserts
IncludsiveNamespacesPrefixList
* XmlDsigExcC14NWithCommentsTransformTest.cs: Added basic .ctor and
properties tests.
* XmlDsigC14NWithCommentsTransformTest.cs: Fixed line endings.
* XmlLicenseTransformTest.cs: Added basic .ctor and properties tests.
* XmlDsigBase64Transform.cs: Use constant for Algorithm namespace.
* XmlDsigExcC14NTransform.cs: Fixed ctors to use WithComments
algorithm if includeComments is true. Assign includeNamespacesPrefixList
to instance field.
* XmlDsigExcC14NWithCommentsTransform.cs: Remove unnecessary
assignment to Algorithm now that base ctor is fixed.
* XmlDsigC14NWithCommentsTransform.cs: Remove unnecessary assignment
to Algorithm now that base ctor is fixed.
* XmlDsigC14NTransform.cs: In default ctor, just invoke .ctor (bool).
In .ctor (bool), assign WithComments algorithm if includeComments is
true. Use constants for Algorithm namespace.
* XmlDsigEnvelopedSignatureTransform.cs: Use constant for Algorithm
namespace.
* XmlDsigXPathTransform.cs: Use constant for Algorithm namespace.
* XmlDsigXsltTransform.cs: Use constant for Algorithm namespace.
* XmlLicenseTransform.cs: Assign Algorithm in ctor.
* XmlSignature.cs: Added constant for XmlLicenseTransform algorithm.
* System.Security_test.dll.sources: Added XmlLicenseTransformTest.cs
and XmlDsigExcC14NWithCommentsTransformTest.cs.

svn path=/trunk/mcs/; revision=115803
2008-10-14 18:33:13 +00:00
Sebastien Pouliot aef5ecbb98 2008-10-12 Sebastien Pouliot <[email protected]>
* EncryptedReference.cs, EncryptedType.cs: Remove unneeded field
	initialization to their default values.
	[Found using Gendarme AvoidUnneededFieldInitializationRule]


svn path=/trunk/mcs/; revision=115568
2008-10-12 15:03:58 +00:00
Sebastien Pouliot bc20013f7a 2008-09-17 Sebastien Pouliot <[email protected]>
* SignedXmlTest.cs: Add support for signing XML using HMACSHA256,
	HMACSHA384, HMACSHA512 and HMACRIPEMD160.
	[Fix bug #425724]


svn path=/trunk/mcs/; revision=113344
2008-09-17 19:10:13 +00:00
Atsushi Eno b6bd67e86b 2008-08-07 Atsushi Enomoto <[email protected]>
* set Algorithm in .ctor(bool), fixed bug #398904.


svn path=/trunk/mcs/; revision=109851
2008-08-07 12:24:18 +00:00
Sebastien Pouliot 3f7129f550 2008-08-06 Sebastien Pouliot <[email protected]>
* XmlDsigC14NTransform.cs,
	* XmlDsigExcC14NTransform.cs
	* XmlDsigXsltTransform.cs: Don't use is + as.
	[Found using Gendarme AvoidRepetitiveCastsRule]


svn path=/trunk/mcs/; revision=109819
2008-08-07 02:05:52 +00:00
Sebastien Pouliot 5ae85e3077 2008-06-28 Sebastien Pouliot <[email protected]>
* XmlDecryptionTransform.cs,
	* XmlDsigC14NTransform.cs,
	* XmlDsigEnvelopedSignatureTransform.cs,
	* XmlDsigExcC14NTransform.cs,
	* XmlDsigXsltTransform.cs: Replace Type.GetType("x") into typeof(x)
	[Found using Gendarme AvoidTypeGetTypeForConstantStringsRule]


svn path=/trunk/mcs/; revision=106840
2008-06-28 19:22:09 +00:00
Sebastien Pouliot 6341269da0 2008-05-25 Sebastien Pouliot <[email protected]>
* XmlDecryptionTransform.cs,
	* XmlDsigBase64Transform.cs,
	* XmlDsigC14NTransform.cs,
	* XmlDsigEnvelopedSignatureTransform.cs,
	* XmlDsigExcC14NTransform.cs,
	* XmlDsigXPathTransform.cs,
	* XmlDsigXsltTransform.cs,
	* XmlLicenseTransform.cs: Don't use lock(this). In fact remove locking
	since the worse that can happen is two copies of the same data.
	[Found using Gendarme]


svn path=/trunk/mcs/; revision=104039
2008-05-25 21:52:19 +00:00
Sebastien Pouliot 649084c451 2008-01-12 Sebastien Pouliot <[email protected]>
* ReferenceList.cs: Avoid infinite recursion when setting []. 
	Found by Gendarme.
	* XmlDsigXPathTransform.cs: Fix direct comparison with NaN. Found 
	by Gendarme.


svn path=/trunk/mcs/; revision=92756
2008-01-12 16:58:39 +00:00
Atsushi Eno 63b1a04ec2 2007-11-13 Atsushi Enomoto <[email protected]>
* XmlDsigExcC14NTransform.cs : removed extra [ComVisible].


svn path=/trunk/mcs/; revision=89546
2007-11-13 11:40:41 +00:00
Atsushi Eno bacad2cd34 2007-03-22 Atsushi Enomoto <[email protected]>
* XmlCanonicalizer.cs : fill prefixes which should be actually
	  written. It must be actually done before canonicalization (so
	  that node list filtering still takes spec-conformant effect).

	* Transform.cs, XmlDsigC14NTransform.cs, XmlDsigExcC14NTransform.cs :
	  handle PropagatedNamespaces.

	* XmlDsigC14NTransformTest.cs : added test for xmlns attribute 
	  completion for input nodes, as well as test for
	  PropagatedNamespaces (ignored so far).


svn path=/trunk/mcs/; revision=74812
2007-03-22 15:29:11 +00:00
Atsushi Eno dcf1584c86 2007-02-01 Atsushi Enomoto <[email protected]>
* SignedXml.cs : for internal URI (#blah) resolution, use
	  GetIdElement() so that any derived class which overrides this
	  method could resolve the reference correctly.


svn path=/trunk/mcs/; revision=72119
2007-02-01 18:29:34 +00:00
Atsushi Eno b2f49647aa 2007-01-25 Atsushi Enomoto <[email protected]>
* SignedXml.cs : for DataObject, copy namespaces in Data into Object
	  element itself. I haven't solved the puzzle on why it is needed
	  though.

	* SignedXmlTest.cs : enable SignElementWithPrefixedNamespace().


svn path=/trunk/mcs/; revision=71658
2007-01-25 09:57:57 +00:00
Atsushi Eno 037c955757 2007-01-23 Atsushi Enomoto <[email protected]>
* DataObject.cs : it should not append created DataObject element to
	  the owner document. It affects on XPath selection, though currently
	  SignedXml.GetReferenceHash() is bogus so I cannot add meaningful
	  tests for it.

	* XmlCanonicalizer.cs : in Canonicalize(XmlNodeList), nodes [0] could
	  be XmlDocument and thus it could cause NullReferenceException.


svn path=/trunk/mcs/; revision=71540
2007-01-23 18:48:18 +00:00
Atsushi Eno db6d5d50c3 2007-01-22 Atsushi Enomoto <[email protected]>
* XmlCanonicalizer.cs : Fixed incorect is-visibly-utilized check. Got
	  Phaos tests passed.

	* SignedInfo.cs : removed incorrect CanonicalizationMethodObject
	  implementation.
	* EncryptedReference.cs : added exc-c14n support in LoadXml().


svn path=/trunk/mcs/; revision=71452
2007-01-22 18:27:02 +00:00
Atsushi Eno a0c14ae0ea 2007-01-17 Atsushi Enomoto <[email protected]>
* XmlCanonicalizer.cs : don't output default namespace when the node's
	  namespace is not empty. Check "visibly utilized" namespace nodes in
	  exc-c14n. Also, in exc-c14n, rendered namespaces are not written.
	  Added InclusiveNamespaces PrefixList field (not in use yet).

	* XmlDsigExcC14NTransform.cs :
	  re-imported from XmlDsigC14NTransform.cs.

	* System.Security_test.dll.sources : added
	  XmlDsigExcC14NTransformTest.cs.

	* XmlDsigExcC14NTransformTest.cs : new tests, mostly copied from
	  non-exc test.

	* xmldsig.cs : exc-c14n tests could be run under 2.0 profile (and
	  they are not working correctly yet).
	* Makefile : Added net_2_0 profile support.


svn path=/trunk/mcs/; revision=71220
2007-01-17 17:30:12 +00:00
Atsushi Eno 255664a33f 2007-01-12 Atsushi Enomoto <[email protected]>
* SignedXml.cs : when there is an envelope document and no referenced
	  DataObject was found, then look for the target element from the
	  envelope.

	* SignedXmlTest.cs : added DataReferenceToNonDataObject().

	* xmldsig.cs : signature-big.xml also depends on the input document.


svn path=/trunk/mcs/; revision=70919
2007-01-12 14:35:05 +00:00
Atsushi Eno c74b0f26b9 2007-01-12 Atsushi Enomoto <[email protected]>
* DataObject.cs : don't clear attributes or children unnecessarily.

	* DataObjectTest.cs : test to make sure to not clear attributes or
	  children unnecessarily.


svn path=/trunk/mcs/; revision=70916
2007-01-12 12:22:39 +00:00
Atsushi Eno 56d4be2982 2007-01-12 Atsushi Enomoto <[email protected]>
* SignedXml.cs : actually ComputeSignature() itself does not raise
	  silly exception. It always use CryptographicException.
	  Added another check; malformed reference object.

	* SignedXmlTest.cs : fixed ComputeSignatureNoSigningKey() to not
	  expect silly exception. Added test for malformed reference.


svn path=/trunk/mcs/; revision=70911
2007-01-12 10:51:17 +00:00
Atsushi Eno 7dba740284 2007-01-12 Atsushi Enomoto <[email protected]>
* SignedXml.cs : ComputeSignature() should check empty key.

	* SignedXmlTest.cs : added ComputeSignatureNoSigningKey().


svn path=/trunk/mcs/; revision=70909
2007-01-12 10:24:09 +00:00
Atsushi Eno ec958572d6 2006-10-11 Atsushi Enomoto <[email protected]>
* SignedXml.cs : when SigningMethod does not match the algorithm that
	  the key actually supports, it raises an error.

	* SignedXmlTest.cs : added a test for signature method mismatch.


svn path=/trunk/mcs/; revision=66535
2006-10-10 23:11:22 +00:00
Atsushi Eno 24da8a2f2a 2006-09-22 Atsushi Enomoto <[email protected]>
* EncryptedXml.cs : use Padding member instead of const ISO10126 (though
	  I doubt it should be there). Use it in DecryptData().

	* EncryptedXmlTest.cs, EncryptedXmlSample3.xml :
	  another decryption test for padding sanity.

	* Makefile:
	  Added Test/S.S.C.Xml/EncryptedXmlSample3.xml to EXTRA_DISTFILES.


svn path=/trunk/mcs/; revision=65804
2006-09-22 04:32:02 +00:00
Atsushi Eno 614d7f4d2f 2006-09-21 Atsushi Enomoto <[email protected]>
* EncryptedXml.cs : implement orthodox padding on encryption.

	* EncryptedXmlTest.cs : added roundtrip sample i.e. encryption test.


svn path=/trunk/mcs/; revision=65800
2006-09-22 01:16:12 +00:00
Atsushi Eno 8d2ce38aae 2006-09-21 Atsushi Enomoto <[email protected]>
* EncryptedXml.cs :
	  Handle orthodox padding (xmlenc spec section 5.2). However, like 
	  EncryptedXmlSample1, it might not exist, so make it optional.

	* EncryptedXmlTest.cs, EncryptedXmlSample2.xml :
	  Added another case that expects correct padding processing which is 
	  specified in W3C xmlenc spec section 5.2.

	* Makefile:
	  Added Test/S.S.C.Xml/EncryptedXmlSample2.xml to EXTRA_DISTFILES.


svn path=/trunk/mcs/; revision=65766
2006-09-21 14:10:41 +00:00
Atsushi Eno eb9e570294 2006-09-21 Atsushi Enomoto <[email protected]>
* EncryptedXml.cs : True fix for DecryptData(). It indeed uses block size
	  (or possibly IV size) in Transform(), but only for stripping the heading
	  n bytes garbage.

	* EncryptedXmlTest.cs : new file. Added practical example.
	* EncryptedXmlSample1.xml, sample.pfx : support files for the above test.

	* System.Security_test.dll.sources: added EncryptedXmlTest.cs.
	* Makefile: added some extra test support files as EXTRA_DISTFILES.


svn path=/trunk/mcs/; revision=65750
2006-09-21 07:25:48 +00:00
Atsushi Eno a09f566ab1 2006-09-20 Atsushi Enomoto <[email protected]>
* SignedXml.cs : overwrite my fix with Gert's patch on #79454 to make it
	  possible to handle multiple certificates.


svn path=/trunk/mcs/; revision=65732
2006-09-20 17:58:51 +00:00
Atsushi Eno 92fa75bd2c 2006-09-20 Atsushi Enomoto <[email protected]>
* SignedXml.cs : handle KeyInfoX509Data in GetPublicKey(). Fixed #1 of
	  bug #79454.


svn path=/trunk/mcs/; revision=65727
2006-09-20 16:35:24 +00:00
Atsushi Eno bab5d554e1 2006-09-07 Atsushi Enomoto <[email protected]>
* EncryptedXml.cs : DecryptData() should not pass block size to
	  Transform() as the index.


svn path=/trunk/mcs/; revision=65071
2006-09-07 17:20:19 +00:00
Atsushi Eno 690296b936 2006-09-06 Atsushi Enomoto <[email protected]>
* CipherReference.cs, EncryptedReference.cs : unify duplicate code.
	  Remove incorrect name check in the latter class so that it works
	  for DataReference and KeyReference as well.

	* DataReferenceTest.cs : new test.

	* System.Security_test.dll.sources: added DataReferenceTest.cs.


svn path=/trunk/mcs/; revision=64990
2006-09-06 10:30:58 +00:00
Sebastien Pouliot 74e8f43fa0 2006-05-31 Sebastien Pouliot <[email protected]>
* KeyInfoClause.cs: Under 2.0 the ctor is protected.
	* Transform.cs: Under 2.0 the ctor is protected. Enable the use of 
	XmlSecureResolver when the security manager is active.


svn path=/trunk/mcs/; revision=61337
2006-05-31 14:55:33 +00:00
Atsushi Eno 6fdeb62eef 2006-01-30 Atsushi Enomoto <[email protected]>
* XmlDsigEnvelopedSignatureTransform.cs :
	  It should not remove nodes in another XmlNodeList while its
	  iterator is in active use. This is exposed by the recent
	  XmlNodeList change.


svn path=/trunk/mcs/; revision=56250
2006-01-30 14:23:28 +00:00
Sebastien Pouliot e8eab2dee7 2005-09-27 Sebastien Pouliot <[email protected]>
* KeyInfoX509Data.cs: Remove old 2.0 specific check.
	* XmlDsigXPathTransform.cs: Remove old 2.0 specific check. Return 
	empty node list of the XmlDocument is null (fixed tests case for 2.0
	RC).


svn path=/trunk/mcs/; revision=50855
2005-09-27 13:20:36 +00:00
Ben Maurer 0e8decdb37 remove svn:executable from .cs files
svn path=/trunk/mcs/; revision=46562
2005-06-27 15:51:40 +00:00
Ben Maurer 47876a3539 more copy and paste reuse going away
svn path=/trunk/mcs/; revision=45988
2005-06-14 19:21:45 +00:00
Sebastien Pouliot b1f8b5d2ce 2005-05-09 Sebastien Pouliot <[email protected]>
* EncryptionProperties.cs: Added [IndexerName] attribute to rename 
	"this" from Item to ItemOf. Added missing Item(int) method.
	* ReferenceList.cs: Added [IndexerName] attribute to rename "this" 
	from Item to ItemOf.


svn path=/trunk/mcs/; revision=44262
2005-05-09 10:53:09 +00:00
Sebastien Pouliot 5faed2987b 2005-05-04 Sebastien Pouliot <[email protected]>
* SignedXml.cs: Return an empty (not null) KeyInfo by default and
	don't throw a CryptographicException in CheckSignature (both NET_2_0).
	* KeyInfoRetrievalMethod.cs: Don't include an empty URI attribute
	in the XML output for NET_2_0.
	* XmlDsigXPathTransform.cs: Throw an XPathException in NET_2_0 if no
	xpath expression has been supplied to the transform.


svn path=/trunk/mcs/; revision=44034
2005-05-04 16:21:08 +00:00
Sebastien Pouliot 46cd89262c 2005-05-03 Sebastien Pouliot <[email protected]>
* XmlDsigXsltTransform.cs: Fixed 2 test cases (that nows throws 
	ArgumentNullException) in 2.0.


svn path=/trunk/mcs/; revision=43919
2005-05-03 11:09:31 +00:00
Sebastien Pouliot 3ea926b789 2005-05-02 Sebastien Pouliot <[email protected]>
* SignedXml.cs: Throw ArgumentNullException in AddObject and 
	AddReference methods in 2.0.
	* XmlDsigC14NTransform.cs: Throw ArgumentException when loading from
	an unknown type in 2.0 (it was simply ignored in 1.x).


svn path=/trunk/mcs/; revision=43879
2005-05-02 13:00:05 +00:00
Sebastien Pouliot fbbe2bcfcc 2005-04-26 Sebastien Pouliot <[email protected]>
* KeyInfoX509Data.cs: Fixed to work biwht unit tests on both NET_1_1 
	and NET_2_0 (except for obvious beta2 bugs). ArraList are now only 
	created when required.


svn path=/trunk/mcs/; revision=43596
2005-04-26 14:31:38 +00:00
Sebastien Pouliot 7be5c07990 2005-04-25 Sebastien Pouliot <[email protected]>
* EncryptedData.cs: Avoid re-creating collection object on load.
	* EncryptedKey.cs: Fix compiler warning (unused variables).
	* EncryptedType.cs: Remove set on EncryptionProperties property.
	* IRelDecryptor.cs: New. Interface for XrML support.
	* SymmetricKeyWrap.cs: Comment unused static method Xor(byte[],int).
	* XmlDecryptionTransform.cs: Fix compiler warning (unused variable).
	* XmlDsigEnvelopedSignatureTransform.cs: Fix compiler warning.
	* XmlLicenseTransform.cs: New. Class for XrML support.


svn path=/trunk/mcs/; revision=43539
2005-04-25 11:52:50 +00:00
Sebastien Pouliot 801c89f75e 2005-04-24 Sebastien Pouliot <[email protected]>
* SignedInfo.cs: Added [ComVisible (false)] to new property.
	* SignedXml.cs: Added [ComVisible (false)] to new properties and 
	methods.
	* ReferenceList.cs: Fixed members signatures for beta2.
	* Reference.cs: Added [ComVisible (false)] to new set_TransformChain.
	* EncryptedType.cs: Fix compilation with EncryptionPropertyCollection
	changes.
	* DataObject.cs: Fix compilation warnings.
	* EncryptedKey.cs: Fix compilation with ReferenceList and 
	EncryptionPropertyCollection changes.
	* EncryptionProperties.cs: Class has been renamed to 
	EncryptionPropertyCollection.
	* Transform.cs: Added [ComVisible (false)] to new properties and 
	methods.
	* EncryptedXml.cs: Changed XmlEncRSA1_5Url to XmlEncRSA15Url.
	* KeyInfoRetrievalMethod.cs: Added [ComVisible (false)] to Type 
	property.
	* KeyInfoX509Data.cs: Added [ComVisible (false)] to AddSubjectKeyId
	(string) method and implemented it.
	* EncryptedData.cs: Changed EncryptionProperties to new 
	EncryptionPropertyCollection.
	* XmlDsigC14NTransform.cs: Added [ComVisible (false)] to 
	GetDigestedOutput method and added a basic implementation.
	* X509IssuerSerial.cs: IssuerName and SerialNumber are now properties.


svn path=/trunk/mcs/; revision=43514
2005-04-24 16:16:23 +00:00
Sebastien Pouliot ff497e2d08 2005-04-23 Sebastien Pouliot <[email protected]>
* EncryptedXml.cs, SignedXml.cs: Changed X509CertificateEx to 
	X509Certificate2 to match beta2.


svn path=/trunk/mcs/; revision=43484
2005-04-23 14:23:41 +00:00