From 9d97cda8b63392c03bb7a106de9679369b387c43 Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Tue, 22 Sep 2009 13:12:28 +0000 Subject: [PATCH] 2009-09-22 Sebastien Pouliot * StrongName.cs: Moonlight NET_2_1 cannot depend on machine.config * StrongNameManager_2_1.cs: Minimal version for NET_2_1 svn path=/trunk/mcs/; revision=142391 --- mcs/class/corlib/Mono.Security/ChangeLog | 5 +++ mcs/class/corlib/Mono.Security/StrongName.cs | 4 ++ .../corlib/Mono.Security/StrongNameManager_2_1.cs | 47 ++++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 mcs/class/corlib/Mono.Security/StrongNameManager_2_1.cs diff --git a/mcs/class/corlib/Mono.Security/ChangeLog b/mcs/class/corlib/Mono.Security/ChangeLog index 4f3f436deb7..6f406ac13a5 100644 --- a/mcs/class/corlib/Mono.Security/ChangeLog +++ b/mcs/class/corlib/Mono.Security/ChangeLog @@ -1,3 +1,8 @@ +2009-09-22 Sebastien Pouliot + + * StrongName.cs: Moonlight NET_2_1 cannot depend on machine.config + * StrongNameManager_2_1.cs: Minimal version for NET_2_1 + 2009-04-30 Sebastien Pouliot * StrongName.cs: Adapt to work with only RSAManaged when built diff --git a/mcs/class/corlib/Mono.Security/StrongName.cs b/mcs/class/corlib/Mono.Security/StrongName.cs index afa43f84dc7..64a1a38092e 100644 --- a/mcs/class/corlib/Mono.Security/StrongName.cs +++ b/mcs/class/corlib/Mono.Security/StrongName.cs @@ -467,8 +467,12 @@ namespace Mono.Security { if (!initialized) { lock (lockObject) { if (!initialized) { +#if NET_2_1 + // Moonlight cannot depend on machine.config +#else string config = Environment.GetMachineConfigPath (); StrongNameManager.LoadConfig (config); +#endif initialized = true; } } diff --git a/mcs/class/corlib/Mono.Security/StrongNameManager_2_1.cs b/mcs/class/corlib/Mono.Security/StrongNameManager_2_1.cs new file mode 100644 index 00000000000..317a5f4682a --- /dev/null +++ b/mcs/class/corlib/Mono.Security/StrongNameManager_2_1.cs @@ -0,0 +1,47 @@ +// +// StrongNameManager.cs - StrongName Management +// +// Author: +// Sebastien Pouliot +// +// Copyright (C) 2004,2009 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 +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; +using System.Reflection; + +namespace Mono.Security { + + internal class StrongNameManager { + + static public byte[] GetMappedPublicKey (byte[] token) + { + return token; + } + + static public bool MustVerify (AssemblyName an) + { + return true; + } + } +} + -- 2.11.4.GIT