diff options
author | Sebastien Pouliot <sebastien@ximian.com> | 2006-05-09 19:23:33 +0400 |
---|---|---|
committer | Sebastien Pouliot <sebastien@ximian.com> | 2006-05-09 19:23:33 +0400 |
commit | 5197eff4859342c1e3b1ceff563c0533c4f16dc3 (patch) | |
tree | 286e15c9d7f4ad053053b56e467e363872f07ea4 | |
parent | b71dfbe5bf0430129a4e3b5c0e001e1b8b2e3f24 (diff) |
2006-05-09 Sebastien Pouliot <sebastien@ximian.com>
* Driver.cs: Move up the loading of the strongname key pair to allow
embedding the public part into the assembly. Also don't try to sign
netmodules.
svn path=/branches/mono-1-1-13/mcs/; revision=60450
-rw-r--r-- | mcs/ilasm/ChangeLog | 6 | ||||
-rw-r--r-- | mcs/ilasm/Driver.cs | 23 |
2 files changed, 23 insertions, 6 deletions
diff --git a/mcs/ilasm/ChangeLog b/mcs/ilasm/ChangeLog index 881df3aab99..92578fd0124 100644 --- a/mcs/ilasm/ChangeLog +++ b/mcs/ilasm/ChangeLog @@ -1,3 +1,9 @@ +2006-05-09 Sebastien Pouliot <sebastien@ximian.com> + + * Driver.cs: Move up the loading of the strongname key pair to allow + embedding the public part into the assembly. Also don't try to sign + netmodules. + 2006-04-24 Ankit Jain <jankit@novell.com> * Driver.cs (DriverMain.Run): Update use of CodeGen.ctor . diff --git a/mcs/ilasm/Driver.cs b/mcs/ilasm/Driver.cs index fe1d1450667..7f84057d27e 100644 --- a/mcs/ilasm/Driver.cs +++ b/mcs/ilasm/Driver.cs @@ -52,6 +52,7 @@ namespace Mono.ILASM { private CodeGen codegen; private bool keycontainer = false; private string keyname; + private StrongName sn; public DriverMain (string[] args) { @@ -78,6 +79,13 @@ namespace Mono.ILASM { if (target != Target.Dll && !codegen.HasEntryPoint) Report.Error ("No entry point found."); + // if we have a key and aren't assembling a netmodule + if ((keyname != null) && !codegen.IsThisAssembly (null)) { + LoadKey (); + // this overrides any attribute or .publickey directive in the source + codegen.SetAssemblyPublicKey (sn.PublicKey); + } + try { codegen.Write (); } catch { @@ -93,7 +101,7 @@ namespace Mono.ILASM { } try { - if (keyname != null) { + if (sn != null) { Console.WriteLine ("Signing assembly with the specified strongname keypair"); return Sign (output_file); } @@ -110,12 +118,8 @@ namespace Mono.ILASM { Console.WriteLine ("***** FAILURE *****\n"); } - private bool Sign (string filename) + private void LoadKey () { - // note: if the file cannot be signed (no public key in it) then - // we do not show an error, or a warning, if the key file doesn't - // exists - StrongName sn = null; if (keycontainer) { CspParameters csp = new CspParameters (); csp.KeyContainerName = keyname; @@ -130,6 +134,13 @@ namespace Mono.ILASM { } sn = new StrongName (data); } + } + + private bool Sign (string filename) + { + // note: if the file cannot be signed (no public key in it) then + // we do not show an error, or a warning, if the key file doesn't + // exists return sn.Sign (filename); } |