2003-11-10 Todd Berman <tberman@gentoo.org>
authorTodd Berman <tberman@mono-cvs.ximian.com>
Tue, 11 Nov 2003 04:20:12 +0000 (04:20 -0000)
committerTodd Berman <tberman@mono-cvs.ximian.com>
Tue, 11 Nov 2003 04:20:12 +0000 (04:20 -0000)
        * sn.cs: No more OutOfMemoryExceptions if the GetPublicKey returns
        a new byte[0].

svn path=/trunk/mcs/; revision=19811

mcs/tools/security/ChangeLog
mcs/tools/security/sn.cs

index b48747bd4967cd40e158284bbc5e82d16f9fdf59..76d0706e05eeba193d3556a0d580875340e15c50 100644 (file)
@@ -1,3 +1,8 @@
+2003-11-10  Todd Berman  <tberman@gentoo.org>
+
+       * sn.cs: No more OutOfMemoryExceptions if the GetPublicKey returns
+       a new byte[0].
+       
 2003-10-30  Sebastien Pouliot  <spouliot@videotron.ca>
 
        * sn.cs: Fixed strongname generation for small exponents (like 17). 
index 2b8970405ede3569ff11aa096bf1cdb00afa4390..f2172dc22736a4d8ab273adfab4f1579b9d34ed2 100644 (file)
@@ -382,11 +382,15 @@ namespace Mono.Tools {
                                case "-v":
                                        filename = args [i++];
                                        an = AssemblyName.GetAssemblyName (filename);
-                                       byte[] akey = an.GetPublicKey ();
-                                       byte[] pkey = new byte [akey.Length - 12];
-                                       Buffer.BlockCopy (akey, 12, pkey, 0, pkey.Length);
-                                       sn = new StrongName (pkey);
-                                       Verify (filename, sn);
+                                       try {
+                                               byte[] akey = an.GetPublicKey ();
+                                               byte[] pkey = new byte [akey.Length - 12];
+                                               Buffer.BlockCopy (akey, 12, pkey, 0, pkey.Length);
+                                               sn = new StrongName (pkey);
+                                               Verify (filename, sn);
+                                       } catch {
+                                               Console.WriteLine (filename + " is not a strongly named assembly");
+                                       }
                                        break;
                                case "-vf":
                                        Console.WriteLine ("Unimplemented option");