[Mono-bugs] [Bug 49542][Nor] New - MCS doesn't correctly include the strongname public key inside an assembly.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 10 Oct 2003 19:31:43 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by spouliot@videotron.ca.

http://bugzilla.ximian.com/show_bug.cgi?id=49542

--- shadow/49542	2003-10-10 19:31:43.000000000 -0400
+++ shadow/49542.tmp.16318	2003-10-10 19:31:43.000000000 -0400
@@ -0,0 +1,75 @@
+Bug#: 49542
+Product: Mono/MCS
+Version: unspecified
+OS: All
+OS Details: Need Windows to reproduce
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: spouliot@videotron.ca               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: MCS doesn't correctly include the strongname public key inside an assembly. 
+
+Description of Problem:
+
+MCS doesn't correctly include the strongname public key inside an 
+assembly. 
+
+
+Steps to reproduce the problem:
+*** Must be executed under Windows ***
+
+1. Create a new strongname keypair named hello.snk
+   sn -k hello.snk
+
+2. compile the following source with CSC
+   csc helloworld.cs
+
+using System;
+using System.Reflection;
+
+[assembly: AssemblyKeyFile ("hello.snk")]
+[assembly: AssemblyDelaySign (true)]
+
+public class MainClass {
+     public static void Main (string[] args)
+     {
+          Console.WriteLine ("Hello world!");
+     }
+}
+
+3. Sign the assembly (which already contains the public key)
+   sn -R helloworld.exe hello.snk
+
+4. Validate the strongname signature on the CSC generated assembly
+   sn -v helloworld.exe
+
+   Result should be: Assembly 'helloworld.exe' is valid
+
+5. Now compile the same source code using MCS
+   mcs helloworld.exe
+
+6. Sign the assembly (which SHOULD contains the public key)
+   sn -R helloworld.exe hello.snk
+
+7. Validate the strongname signature on the MCS generated assembly
+
+   This results in the following message:
+   Failed to verify assembly -- Unable to format error message 80131414
+
+Now from an internal point of view...
+
+AssemblyName an = AssemblyName.GetAssemblyName (assemblyName);
+Console.WriteLine (an.GetPublicKey ().Length);
+
+Actual Results (for MCS):
+596
+
+Expected Results (as CSC):
+160