Commit Graph
53 Commits
Author SHA1 Message Date
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
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
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 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 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 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 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
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 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 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
Sebastien Pouliot 4e61e9daf2 2004-09-16 Sebastien Pouliot <[email protected]>
* Signature.cs: Fixed Xmldsig and broken unit tests.
	* SignedXml.cs: Fixed warning (level 4) for unused variable.
	* XmlDsigEnvelopedSignatureTransform.cs: Fixed warning (l4) for unused
	variable.

svn path=/trunk/mcs/; revision=33996
2004-09-17 01:02:27 +00:00
Tim Coleman a80897d945 2004-09-03 Tim Colmean <[email protected]>
* EncryptedXml.cs: Add support for RSA for key formatting
        * Reference.cs: Include XmlDecryptionTransform
        * SignedXml.cs:
                Set the EncryptedKey on the XmlDecryptionTransform when
                loading XML
        * XmlDecryptionTransform.cs:
                Clean up decryption transformation to work without ugly hack.
        * XmlDsigExcC14NTransform.cs:
                Add algorithm identifier.
        * XmlSignature.cs:
                Add namespaces for various classes.

svn path=/trunk/mcs/; revision=33317
2004-09-03 22:06:23 +00:00
Tim Coleman 16a536b789 2004-09-02 Tim Coleman <[email protected]>
* CipherReference.cs: Add XmlDecryptionTransform for 2.0
        * EncryptedType.cs: Fix type initialization to conform to .NET
        * EncryptedXml.cs:
                Add support for RSA key decryption and "cloning" for Transform
        * KeyInfoX509Data Reference.cs SignedInfo.cs XmlDsigC14NTransform.cs:
                Add 2.0 stubs
        * Signature.cs:
                Create internal GetXml function if we already have a doc
        * SignedXml.cs: Fix the transformation when we get an XmlDocument out
        * XmlDecryptionTransform.cs: Implemented Xml Decryption
        * XmlSignature.cs: Add namespace for Xml Decryption

svn path=/trunk/mcs/; revision=33236
2004-09-02 17:20:35 +00:00
Tim Coleman f337c45d30 2004-08-31 Tim Coleman <[email protected]>
* XmlDsigExcC14NTransform.cs XmlDsigExcC14NWithCommentsTransform.cs:
                Add new stub classes
        * SignedXml.cs Transform.cs:
                New methods for 2.0

svn path=/trunk/mcs/; revision=33093
2004-08-31 12:29:00 +00:00
Duncan Mak 25e1e7ccfd Add MIT license to System.Security.DLL
svn path=/trunk/mcs/; revision=30060
2004-06-21 18:32:17 +00:00
Gert Driesen 2725186677 * SignedXml.cs: API signature fixes
svn path=/trunk/mcs/; revision=29206
2004-06-10 17:19:14 +00:00
Atsushi Eno d5a5f5ad9a 2004-06-04 Atsushi Enomoto <[email protected]>
* SignedXml.cs : Complete fix for bug #59545. Support #xpointer(id()).
	  Namespace fixup is required when signing prefixed xml.

svn path=/trunk/mcs/; revision=28835
2004-06-04 12:40:01 +00:00
Atsushi Eno a966e4e229 2004-06-04 Atsushi Enomoto <[email protected]>
* SignedXml.cs : Fix for bug #59545. Handle #xpointer(/) as document.

svn path=/trunk/mcs/; revision=28824
2004-06-04 08:23:43 +00:00
Atsushi Eno 0820f840a5 2004-05-31 Atsushi Enomoto <[email protected]>
* SignedXml.cs : partial fix for bug #59165 that does not output
	  namespace that conflicts with element's namespace.

svn path=/trunk/mcs/; revision=28551
2004-05-31 12:06:45 +00:00
Sebastien Pouliot 7fcbfac84a 2004-05-13 Sebastien Pouliot <[email protected]>
* SignedXml.cs: Update TODO informations.

svn path=/trunk/mcs/; revision=27274
2004-05-13 14:36:48 +00:00
Atsushi Eno 461b2e57a5 2004-05-05 Atsushi Enomoto <[email protected]>
* SignedXml.cs,
	  Transform.cs : code cleanup. #if !NET_1_0 -> #if NET_1_1.
	* XmlDsigBase64Transform.cs : Should not output the content of the
	  selected element nodes. Put text content only those text nodes are
	  in the node list.
	* XmlDsigEnvelopedSignatureTransform.cs : removed MonoTODO.
	* XmlDsigXsltTransform.cs : Use XmlResolver to load document and
	  to transform. Throw null reference exception explicitly when
	  the input was not loaded.

svn path=/trunk/mcs/; revision=26731
2004-05-05 03:45:49 +00:00
Atsushi Eno de60011134 2004-03-27 Atsushi Enomoto <[email protected]>
* SignedXml.cs : namespace nodes also should be supplied for enveloped
	  objects.
	* KeyInfoRetrievalMethod.cs : Keep input element as well as others.

svn path=/trunk/mcs/; revision=24658
2004-03-27 19:59:31 +00:00
Atsushi Eno cad79eadd9 2004-03-27 Atsushi Enomoto <[email protected]>
* SignedXml.cs : XPath transformation output is not type of Stream.
	  Fix to support them by canonicalizing it.

svn path=/trunk/mcs/; revision=24657
2004-03-27 19:46:40 +00:00
Atsushi Eno 4c107154e6 2004-03-27 Atsushi Enomoto <[email protected]>
* SignedXml.cs : Added xmlns support for Manifest.

svn path=/trunk/mcs/; revision=24654
2004-03-27 18:13:50 +00:00
Sebastien Pouliot 5f7ab7bca8 2004-03-26 Sebastien Pouliot <[email protected]>
* Manifest.cs: New. Support for <Manifest> in Xml Digital Signature.
	This should help us to validate more tests from the Phaos suite.
	Note: Microsoft doesn't support this and we only support it for
	verification (not signature generation).
	* SignedXml.cs: Added support for Manifest, including recursive
	manifests. Made some changes to reuse existing code as much as
	possible. Better support for local/remote files - but requires
	catching an Uri exception for local files :-(.

svn path=/trunk/mcs/; revision=24645
2004-03-26 21:10:40 +00:00
Atsushi Eno da7c4adefd 2004-03-26 Atsushi Enomoto <[email protected]>
* SignedXml.cs :
	  - Use specified (or default) XmlResolver to get external resource,
	    instead of using WebRequest directly. Also modified it easier.
	  - ApplyTransform() : Clone only when it is required. Handle
	    transformation output other than Stream.
	  - Even if applicable key was not found in GetHash(), don't throw
	    crypto exception every time and just return false (MS does it).
	    Throw an exception only when no key was specified as KeyInfo.
	* XmlDsigEnvelopedSignatureTransform.cs : Fixed get_OutputTypes which
	  incorrectly set InputTypes internally.
	* XmlDsigXPathTransform.cs : Context namespace nodes in loaded
	  transform parameter (i.e. <XPath>..</XPath>) should be registered
	  to XsltContext. Otherwise prefix binding error occurs.
	  Just filter attribute node, instead of filtering attribute children.

svn path=/trunk/mcs/; revision=24636
2004-03-26 16:08:47 +00:00
Sebastien Pouliot 04f2e11aeb 2004-03-25 Sebastien Pouliot <[email protected]>
* SignedXml.cs: Added try/catch in CheckSignatureWithKey to return
	false on exceptions. Fix signature-rsa-detached-xslt-transform-bad
	-retrieval-method.xml in the Phaos test suite.

svn path=/trunk/mcs/; revision=24599
2004-03-25 18:01:12 +00:00
Atsushi Eno f4e851c96f 2004-03-24 Atsushi Enomoto <[email protected]>
* Reference.cs, Signature.cs : They should keep input element and hence
	  keep namespace context nodes on LoadXml() as same as SignedInfo.
	* SignedXml.cs : Fixed SignedInfoTransformed() to fill context
	  namespace nodes into the input document (unlike other classes, there
	  seems no other way to keep ns-nodes here).
	  Now some of W3C phaos xmldsig test passes.

svn path=/trunk/mcs/; revision=24532
2004-03-24 18:32:58 +00:00
Sebastien Pouliot 189c0f1443 2004-03-20 Sebastien Pouliot <[email protected]>
* SignedXml.cs: Removed unused (and commented) ComputeHash method.

svn path=/trunk/mcs/; revision=24381
2004-03-21 01:03:10 +00:00
Sebastien Pouliot b69503f4bc 2004-03-19 Sebastien Pouliot <[email protected]>
* SignedXml.cs: Lot of small changes to complete TODOs and to match
	the new unit tests.

svn path=/trunk/mcs/; revision=24326
2004-03-19 13:34:28 +00:00
Sebastien Pouliot 97b4f60edb 2004-03-17 Sebastien Pouliot <[email protected]>
* SignedXml.cs: The old method was working for creating signature -
	so it was reintroduced for (only) this case.

svn path=/trunk/mcs/; revision=24230
2004-03-17 15:19:15 +00:00
Atsushi Eno 26abb1d17e 2004-03-17 Atsushi Enomoto <[email protected]>
* SignedXml.cs : the result from enveloped signature transform should
	  be canonicalized before getting its hash.
	* XmlDsigEnvelopedSignatureTransform.cs : in XPath selection,
	  if the node is Signature itself it is not allowed.
	  PreserveWhitespace is required.

svn path=/trunk/mcs/; revision=24197
2004-03-17 00:33:57 +00:00
Sebastien Pouliot 0770526333 2004-03-16 Sebastien Pouliot <[email protected]>
* SignedXml.cs: Changed (again). This time we use the Stream when
	loading the document. We now pass 14 out of 15 of the Merlin's
	tests (including one that MS fails). The only failing test is the
	one that use the EnvelopedTransform (unfinished).

svn path=/trunk/mcs/; revision=24158
2004-03-16 19:56:56 +00:00
Sebastien Pouliot 0db94b32a3 2004-03-16 Sebastien Pouliot <[email protected]>
* SignedXml.cs: Commented my last changes to SignedXml as it made other
	unis tests fail (in the c14n-izer).

svn path=/trunk/mcs/; revision=24125
2004-03-16 13:28:17 +00:00
Atsushi Eno 169eba649f 2004-03-16 Atsushi Enomoto <[email protected]>
* XmlDsigNodeList.cs : added.
	* XmlDsigXPathTransform.cs : removed XmlDsigNodeList class.
	* XmlDsigEnvelopedSignatureTransform.cs :
	  Implemented GetOutput(). However, it is totally MS behavior
	  dependent and not based on the spec (we can reimplement it based on
	  improved XmlDsigXPathTransform).
	* SignedXml.cs : in GetOutput(), accept XmlNodeList input too.

svn path=/trunk/mcs/; revision=24120
2004-03-16 11:43:33 +00:00
Sebastien Pouliot 33be26a105 2004-03-15 Sebastien Pouliot <[email protected]>
* SignedXml.cs: Now use the original Signature element before applying
	the C14N transformation. Added a check for null in LoadXml.

svn path=/trunk/mcs/; revision=24066
2004-03-15 21:18:09 +00:00
Sebastien Pouliot 6a0ea78ade 2004-03-12 Sebastien Pouliot <[email protected]>
* Signature.cs: KeyInfo isn't required in schema.
	* SignedInfo.cs: Added support for missing HMACOutputLength.
	* SignedXml.cs: Added support to download a reference (experimental).
	Now throw exception for unknown hash algorithm or canonicalization
	methods. Changed GetPublicKey to iterate all available keys (not just
	the first one).

svn path=/trunk/mcs/; revision=23968
2004-03-12 22:37:04 +00:00
Atsushi Eno e0d0f2c7d7 2004-03-09 Atsushi Enomoto <[email protected]>
* KeyInfo.cs : Attribute Id was not handlded.
	* KeyInfoX509Data.cs : all array members return null when there are
	  no such contents. Just find child elements, not descendants.
	* SignedXml.cs : key is not always required when CheckSignature() is
	  called.
	* XmlDsigXsltTransform.cs : LoadInput should allow node list.
	* XmlSignature.cs : added GetChildElements().

svn path=/trunk/mcs/; revision=23934
2004-03-11 21:38:32 +00:00
Sebastien Pouliot 9ff63f2031 2004-01-11 Sebastien Pouliot <[email protected]>
* SignedXml.cs: Fixed class signature (for 1.1+) by adding public to
	Resolver property.
	* Transform.cs: Fixed class signature (for 1.1+) by adding public to
	Resolver property.

svn path=/trunk/mcs/; revision=21962
2004-01-12 01:26:55 +00:00
Sebastien Pouliot 49e8ac25c6 2003-12-14 Sebastien Pouliot <[email protected]>
* SignedXml.cs: Now load the public key when verifying (bug #52084)
	and can find an element by it's Id when Id isn't defined in DTD or XSD.

svn path=/trunk/mcs/; revision=21123
2003-12-14 17:18:56 +00:00
Sebastien Pouliot 4dce7be6f7 2003-06-11 Sebastien Pouliot <[email protected]>
* SignedXml.cs: Changed USE_VERSION_1_0 for NET_1_0.
	* Transform.cs: Changed USE_VERSION_1_0 for NET_1_0.

svn path=/trunk/mcs/; revision=15357
2003-06-13 03:32:30 +00:00
Sebastien Pouliot 801391605d 2003-05-10 Sebastien Pouliot <[email protected]>
* SignedXml.cs: Added property XmlResolver Resolver as per framework 1.1
	documentation (no public declaration).
	* Transform.cs: Added property XmlResolver Resolver as per framework 1.1
	documentation (no public declaration).

svn path=/trunk/mcs/; revision=14454
2003-05-10 14:47:44 +00:00