2008-04-25 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Fri, 25 Apr 2008 14:38:59 +0000 (14:38 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Fri, 25 Apr 2008 14:38:59 +0000 (14:38 -0000)
* StrongName.cs: New test cases to verify signatures from streams.
Patch from Dave Hillier <daveh@lindenlab.com>

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

mcs/class/corlib/Mono.Security/ChangeLog
mcs/class/corlib/Mono.Security/StrongName.cs

index 90bc20f234578caee4a87290f955430d53ade18d..95faa15cf0e97268f30100c980072e4ba7e0fe2a 100644 (file)
@@ -1,3 +1,8 @@
+2008-04-25  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * StrongName.cs: New test cases to verify signatures from streams.
+       Patch from Dave Hillier <daveh@lindenlab.com>
+
 2008-03-10  Stephane Delcroix  <sdelcroix@novell.com>
 
        * Uri.cs: port the changes I did in System.Uri in r97844.
index a1a9b6660ddf89f89558e4c253c170ec34555bd4..a2101f57c09fb0cece85a77fb4ee9bce3d26b663 100644 (file)
@@ -430,11 +430,17 @@ namespace Mono.Security {
 
                public bool Verify (string fileName) 
                {
-                       StrongNameSignature sn;
+                       bool result = false;
                        using (FileStream fs = File.OpenRead (fileName)) {
-                               sn = StrongHash (fs, StrongNameOptions.Signature);
+                               result = Verify (fs);
                                fs.Close ();
                        }
+                       return result;
+               }
+
+               public bool Verify (Stream stream)
+               {
+                       StrongNameSignature sn = StrongHash (stream, StrongNameOptions.Signature);
                        if (sn.Hash == null) {
                                return false;
                        }