Commit Graph
101 Commits
Author SHA1 Message Date
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
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
Atsushi Eno b321edc78e 2005-04-04 Atsushi Enomoto <[email protected]>
* System.Security.dll.sources: added XmlSignatureStreamReader.cs.

	* XmlSignatureStreamReader.cs : new file. Handles Stream to rip CR off.
	* XmlDsigXPathTransform.cs,
	  XmlDecryptionTransform.cs,
	  XmlDsigC14NTransform.cs,
	  XmlDsigEnvelopedSignatureTransform.cs,
	  XmlDsigXsltTransform.cs : use XmlSignatureStreamReader for Streams.

	* XmlCanonicalizer.cs : don't rip &#xD; off here.

	* XmlDsigC14NTransformTest.cs :
	  Reverted last change in LoadInputAsXmlNodeList2(). It is MS bug.
	  It now handles Load() behavioral difference between Stream and
	  XmlDocument as expected.

	* Makefile : Fixed reference to Mono.Security.dll. Added decent-reader
	  option that indicates to use CR ('\r') stripping TextReader.
	* xmldsig.cs : use CR-stripping TextReader (optionally).


svn path=/trunk/mcs/; revision=42525
2005-04-04 14:39:38 +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 7a2da46ad9 2004-09-04 Tim Coleman <[email protected]>
* XmlDecryptionTransform.cs:
                Implement rudimentary xpointer support for Except URIs.

svn path=/trunk/mcs/; revision=33348
2004-09-04 19:59:02 +00:00
Tim Coleman 4eb5a353ec 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 XmlDsigExcC14NWithCommentsTransform.cs:
                Implement this class based on XmlDsigC14N
        * XmlSignature.cs: Add namespaces for various classes.
        * KeyInfoEncryptedKey.cs SymmetricKeyWrap.cs:
                Remove TODO attributes from implemented methods.
        * KeyInfoName.cs: Put #if NET_2_0 markers in
        * Transform.cs: Implement GetDigestedOutput

svn path=/trunk/mcs/; revision=33321
2004-09-04 00:21:59 +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
Tim Coleman 1b4a5c9cf4 2004-08-31 Tim Coleman <[email protected]>
* EncryptedXml.cs SymmetricKeyWrap.cs:
                Get symmetric key wrap to work for AES keys.

svn path=/trunk/mcs/; revision=33071
2004-08-31 02:29:44 +00:00
Tim Coleman 56df8d8a7b 2004-08-30 Tim Coleman <[email protected]>
* EncryptedXml.cs: Implement lots of XML Encryption code.
        * SymmetricKeyWrap.cs: Fix TripleDES keywrap algorithm.
        * XmlSignature.cs: Add NET_2_0 check around EncryptedKey

svn path=/trunk/mcs/; revision=33049
2004-08-30 16:02:17 +00:00
Atsushi Eno 1d63027f6e 2004-08-30 Atsushi Enomoto <[email protected]>
* KeyInfo.cs : NET_1_1 build fix.

svn path=/trunk/mcs/; revision=33019
2004-08-30 03:04:54 +00:00
Tim Coleman 74bc359484 2004-08-29 Tim Coleman <[email protected]>
* EncryptedKey.cs: Fix element name when generating XML.
        * EncryptedXml.cs: Implement more of encryption/decryption routines for .NET 2.0
        * KeyInfo.cs: Support for EncryptedKey KeyInfoClause.
        * KeyInfoName.cs: Add missing constructor
        * SymmetricKeyWrap.cs: Add untested TripleDES key wrap
        algorithms for encryption/decryption
        * XmlSignature.cs: Add EncryptedKey constant.

svn path=/trunk/mcs/; revision=33007
2004-08-30 00:23:11 +00:00
Tim Coleman a9869c59af 2004-08-29 Tim Coleman <[email protected]>
* EncryptedData.cs EncryptedXml.cs:
                Add .NET 2.0 method stubs.

svn path=/trunk/mcs/; revision=32996
2004-08-29 17:35:53 +00:00
Atsushi Eno 901d0ff658 2004-07-20 Atsushi Enomoto <[email protected]>
* Signature.cs : Fixed NextElementPos() that incorrectly examined
	  node matching.

svn path=/trunk/mcs/; revision=31301
2004-07-20 07:25:35 +00:00
Sebastien Pouliot ab83dcf609 2004-07-07 Sebastien Pouliot <[email protected]>
* EncryptedXml.cs: Fixed Urls for XmlEncElementUrl and
	XmlEncElementContentUrl.
	* X509IssuerSerial.cs: Make constructor internal so it doesn't show up
	in corcompare results for NET_2_0 profile.

svn path=/trunk/mcs/; revision=30853
2004-07-07 19:36:05 +00:00
Sebastien Pouliot e858743eaf 2004-06-17 Sebastien Pouliot <[email protected]>
* KeyInfoX509Data.cs: Removed old internal IssuerSerial for the
	undocumented structure (now documented, and public, in Fx 2.0).
	* X509IssuerSerial.cs: Use structure as public in NET_2_0 and as
	internal before that.

svn path=/trunk/mcs/; revision=29817
2004-06-17 23:12:52 +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