X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.Security%2FSystem.Security.Cryptography.Xml%2FXmlDecryptionTransform.cs;h=154061b1949adb39a9440c3b1b8277e33d52fa48;hb=097409cdab4f046189c17d4bd9490c8aecbc5ef4;hp=27ac0f527de2147272a4c7deb959ecd45aa2d3df;hpb=6110fc90713ce59ff0996fcd3520e09a96575820;p=mono.git diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDecryptionTransform.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDecryptionTransform.cs index 27ac0f527de..154061b1949 100644 --- a/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDecryptionTransform.cs +++ b/mcs/class/System.Security/System.Security.Cryptography.Xml/XmlDecryptionTransform.cs @@ -27,7 +27,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System.Collections; using System.IO; @@ -44,7 +43,6 @@ namespace System.Security.Cryptography.Xml { Type[] outputTypes; object inputObj; ArrayList exceptUris; - object lockObject; const string NamespaceUri = "http://www.w3.org/2002/07/decrypt#"; @@ -57,7 +55,6 @@ namespace System.Security.Cryptography.Xml { Algorithm = XmlSignature.AlgorithmNamespaces.XmlDecryptionTransform; encryptedXml = new EncryptedXml (); exceptUris = new ArrayList (); - lockObject = new object (); } #endregion // Constructors @@ -71,22 +68,18 @@ namespace System.Security.Cryptography.Xml { public override Type[] InputTypes { get { - if (inputTypes == null) { - lock (lockObject) { - inputTypes = new Type [2] {typeof (System.IO.Stream), typeof (System.Xml.XmlDocument)}; - } - } + if (inputTypes == null) + inputTypes = new Type [2] {typeof (System.IO.Stream), typeof (System.Xml.XmlDocument)}; + return inputTypes; } } public override Type[] OutputTypes { get { - if (outputTypes == null) { - lock (lockObject) { - outputTypes = new Type [1] {typeof (System.Xml.XmlDocument)}; - } - } + if (outputTypes == null) + outputTypes = new Type [1] {typeof (System.Xml.XmlDocument)}; + return outputTypes; } } @@ -159,7 +152,7 @@ namespace System.Security.Cryptography.Xml { public override object GetOutput (Type type) { - if (type == Type.GetType ("Stream")) + if (type == typeof (Stream)) return GetOutput (); throw new ArgumentException ("type"); } @@ -167,6 +160,8 @@ namespace System.Security.Cryptography.Xml { [MonoTODO ("verify")] protected virtual bool IsTargetElement (XmlElement inputElement, string idValue) { + if ((inputElement == null) || (idValue == null)) + return false; return (inputElement.Attributes ["id"].Value == idValue); } @@ -197,4 +192,3 @@ namespace System.Security.Cryptography.Xml { } } -#endif