Author: spouliot
Date: 2005-04-04 15:00:34 -0400 (Mon, 04 Apr 2005)
New Revision: 42533

Modified:
   trunk/mcs/class/corlib/System.Reflection/ChangeLog
   trunk/mcs/class/corlib/System.Reflection/StrongNameKeyPair.cs
Log:
2005-04-04  Sebastien Pouliot  <[EMAIL PROTECTED]> 
 
        * StrongNameKeyPair.cs: Added demands for unmanaged code to all
        constructors (as we do not want partially trusted code to create
        strongnamed assemblies).


Modified: trunk/mcs/class/corlib/System.Reflection/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.Reflection/ChangeLog  2005-04-04 18:50:50 UTC 
(rev 42532)
+++ trunk/mcs/class/corlib/System.Reflection/ChangeLog  2005-04-04 19:00:34 UTC 
(rev 42533)
@@ -1,11 +1,14 @@
-2005-04-04  Sebastien Pouliot  <[EMAIL PROTECTED]>
-
+2005-04-04  Sebastien Pouliot  <[EMAIL PROTECTED]> 
+ 
        * AssemblyName.cs: Implemented EscapedCodeBase using the copy of 
        System.Uri (System.dll) located in Mono.Security.Uri. Added missing
        null check in GetObjectData.
        * Module.cs: Added a FileIOPermission for PathDiscovery on 
        FullyQualifiedName property (but not on Name property like MS).
        Added missing null check in GetObjectData.
+       * StrongNameKeyPair.cs: Added demands for unmanaged code to all
+       constructors (as we do not want partially trusted code to create
+       strongnamed assemblies).
 
 2005-03-30  Zoltan Varga  <[EMAIL PROTECTED]>
 

Modified: trunk/mcs/class/corlib/System.Reflection/StrongNameKeyPair.cs
===================================================================
--- trunk/mcs/class/corlib/System.Reflection/StrongNameKeyPair.cs       
2005-04-04 18:50:50 UTC (rev 42532)
+++ trunk/mcs/class/corlib/System.Reflection/StrongNameKeyPair.cs       
2005-04-04 19:00:34 UTC (rev 42533)
@@ -7,12 +7,8 @@
 //
 // (C) 2002 Kevin Winchester
 // Portions (C) 2002 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2004 Novell (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
 //
-
-//
-// Copyright (C) 2004 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
 // "Software"), to deal in the Software without restriction, including
@@ -35,6 +31,7 @@
 
 using System.IO;
 using System.Security.Cryptography;
+using System.Security.Permissions;
 
 using Mono.Security;
 using Mono.Security.Cryptography;
@@ -52,6 +49,10 @@
        [NonSerialized]
        private RSA _rsa;
 
+       // note: we ask for UnmanagedCode because we do not want everyone
+       // to be able to generate strongnamed assemblies
+
+       [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
        public StrongNameKeyPair (byte[] keyPairArray) 
        {
                if (keyPairArray == null)
@@ -61,6 +62,7 @@
                GetRSA ();
        }
        
+       [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
        public StrongNameKeyPair (FileStream keyPairFile) 
        {
                if (keyPairFile == null)
@@ -72,6 +74,7 @@
                GetRSA ();
        }
        
+       [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
        public StrongNameKeyPair (string keyPairContainer) 
        {
                // named key container

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to