瀏覽代碼

2005-04-26 Sebastien Pouliot <[email protected]>

	* AlgorithmIdentifier.cs: Removed FIXME - seems "by design".
	* ContentInfo.cs: Applied fix for ArgumentNullException (was fixed in 
	beta2).
	* Pkcs9ContentType.cs: Added new override for CopyFrom.
	* Pkcs9DocumentDescription.cs: Added new override for CopyFrom. 
	Applied fix for ArgumentNullException (was fixed in beta2).
	* Pkcs9DocumentName.cs: Added new override for CopyFrom. 
	Applied fix for ArgumentNullException (was fixed in beta2).
	* Pkcs9MessageDigest.cs: Added new override for CopyFrom.
	* Pkcs9SigningTime.cs: Added new override for CopyFrom.


svn path=/trunk/mcs/; revision=43615
Sebastien Pouliot 21 年之前
父節點
當前提交
a7e797ce40

+ 11 - 9
mcs/class/System.Security/System.Security.Cryptography.Pkcs/AlgorithmIdentifier.cs

@@ -5,7 +5,7 @@
 //	Sebastien Pouliot  <[email protected]>
 //
 // (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -29,8 +29,6 @@
 
 #if NET_2_0
 
-using System;
-
 namespace System.Security.Cryptography.Pkcs {
 
 	public sealed class AlgorithmIdentifier {
@@ -41,16 +39,20 @@ namespace System.Security.Cryptography.Pkcs {
 
 		// constructors
 
-		public AlgorithmIdentifier () : this (new Oid ("1.2.840.113549.3.7", "3des")) {}
+		public AlgorithmIdentifier ()
+		{
+			_oid = new Oid ("1.2.840.113549.3.7", "3des");
+			_params = new byte [0];
+		}
 
-		public AlgorithmIdentifier (Oid algorithm) : this (algorithm, 0) {}
+		public AlgorithmIdentifier (Oid algorithm)
+		{
+			_oid = algorithm;
+			_params = new byte [0];
+		}
 
 		public AlgorithmIdentifier (Oid algorithm, int keyLength)
 		{
-// FIXME: compatibility with fx 1.2.3400.0
-//			if (algorithm == null)
-//				throw new ArgumentNullException ("algorithm");
-
 			_oid = algorithm;
 			_length = keyLength;
 			_params = new byte [0];

+ 13 - 0
mcs/class/System.Security/System.Security.Cryptography.Pkcs/ChangeLog

@@ -1,3 +1,16 @@
+2005-04-26  Sebastien Pouliot  <[email protected]>
+
+	* AlgorithmIdentifier.cs: Removed FIXME - seems "by design".
+	* ContentInfo.cs: Applied fix for ArgumentNullException (was fixed in 
+	beta2).
+	* Pkcs9ContentType.cs: Added new override for CopyFrom.
+	* Pkcs9DocumentDescription.cs: Added new override for CopyFrom. 
+	Applied fix for ArgumentNullException (was fixed in beta2).
+	* Pkcs9DocumentName.cs: Added new override for CopyFrom. 
+	Applied fix for ArgumentNullException (was fixed in beta2).
+	* Pkcs9MessageDigest.cs: Added new override for CopyFrom.
+	* Pkcs9SigningTime.cs: Added new override for CopyFrom.
+
 2005-04-25  Sebastien Pouliot  <[email protected]>
 
 	* SignedCms.cs: Fix compiler warning (unused variable).

+ 2 - 3
mcs/class/System.Security/System.Security.Cryptography.Pkcs/ContentInfo.cs

@@ -86,10 +86,9 @@ namespace System.Security.Cryptography.Pkcs {
 		[MonoTODO("Incomplete OID support")]
 		public static Oid GetContentType (byte[] encodedMessage)
 		{
-// FIXME: compatibility with fx 1.2.3400.0
 			if (encodedMessage == null)
-				throw new NullReferenceException ();
-//				throw new ArgumentNullException ("algorithm");
+				throw new ArgumentNullException ("algorithm");
+
 			try {
 				PKCS7.ContentInfo ci = new PKCS7.ContentInfo (encodedMessage);
 				switch (ci.ContentType) {

+ 8 - 0
mcs/class/System.Security/System.Security.Cryptography.Pkcs/Pkcs9ContentType.cs

@@ -71,6 +71,14 @@ namespace System.Security.Cryptography.Pkcs {
 			get { return _contentType; }
 		}
 
+		// methods
+
+		public override void CopyFrom (AsnEncodedData asnEncodedData)
+		{
+			base.CopyFrom (asnEncodedData);
+			Decode (this.RawData);
+		}
+
 		// internal stuff
 
 		internal void Decode (byte[] attribute)

+ 7 - 2
mcs/class/System.Security/System.Security.Cryptography.Pkcs/Pkcs9DocumentDescription.cs

@@ -51,8 +51,7 @@ namespace System.Security.Cryptography.Pkcs {
 		public Pkcs9DocumentDescription (string documentDescription)
 		{
 			if (documentDescription == null)
-				throw new NullReferenceException ("documentName");
-// match MS			throw new ArgumentNullException ("documentName");
+				throw new ArgumentNullException ("documentName");
 
 			(this as AsnEncodedData).Oid = new Oid (oid, friendlyName);
 			_desc = documentDescription;
@@ -73,6 +72,12 @@ namespace System.Security.Cryptography.Pkcs {
 			get { return _desc; }
 		}
 
+		public override void CopyFrom (AsnEncodedData asnEncodedData)
+		{
+			base.CopyFrom (asnEncodedData);
+			Decode (this.RawData);
+		}
+
 		// internal stuff
 
 		internal void Decode (byte[] attribute)

+ 7 - 2
mcs/class/System.Security/System.Security.Cryptography.Pkcs/Pkcs9DocumentName.cs

@@ -51,8 +51,7 @@ namespace System.Security.Cryptography.Pkcs {
 		public Pkcs9DocumentName (string documentName) 
 		{
 			if (documentName == null)
-				throw new NullReferenceException ("documentName");
-// match MS			throw new ArgumentNullException ("documentName");
+				throw new ArgumentNullException ("documentName");
 
 			(this as AsnEncodedData).Oid = new Oid (oid, friendlyName);
 			_name = documentName;
@@ -73,6 +72,12 @@ namespace System.Security.Cryptography.Pkcs {
 			get { return _name; }
 		}
 
+		public override void CopyFrom (AsnEncodedData asnEncodedData)
+		{
+			base.CopyFrom (asnEncodedData);
+			Decode (this.RawData);
+		}
+
 		// internal stuff
 
 		internal void Decode (byte[] attribute)

+ 8 - 0
mcs/class/System.Security/System.Security.Cryptography.Pkcs/Pkcs9MessageDigest.cs

@@ -70,6 +70,14 @@ namespace System.Security.Cryptography.Pkcs {
 			get { return _messageDigest; }
 		}
 
+		// methods
+
+		public override void CopyFrom (AsnEncodedData asnEncodedData)
+		{
+			base.CopyFrom (asnEncodedData);
+			Decode (this.RawData);
+		}
+
 		// internal stuff
 
 		internal void Decode (byte[] attribute)

+ 6 - 0
mcs/class/System.Security/System.Security.Cryptography.Pkcs/Pkcs9SigningTime.cs

@@ -72,6 +72,12 @@ namespace System.Security.Cryptography.Pkcs {
 			get { return _signingTime; }
 		}
 
+		public override void CopyFrom (AsnEncodedData asnEncodedData)
+		{
+			base.CopyFrom (asnEncodedData);
+			Decode (this.RawData);
+		}
+
 		// internal stuff
 
 		internal void Decode (byte[] attribute)