Delete PortableStrongNameProvider

上级 56be4132
......@@ -149,7 +149,7 @@ class C
{
public static void Main(string[] args) { }
}";
var testProvider = new StrongNameProviderWithBadInputStream(s_defaultDesktopProvider);
var testProvider = new StrongNameProviderWithBadInputStream(DefaultDesktopStrongNameProvider);
var options = TestOptions.DebugExe
.WithStrongNameProvider(testProvider)
.WithCryptoKeyContainer("RoslynTestContainer");
......
......@@ -943,7 +943,7 @@ End Sub
syntaxTrees: new[] { VisualBasic.VisualBasicSyntaxTree.ParseText(s) },
references: new[] { MscorlibRef_v4_0_30316_17626 },
assemblyName: "Paul",
options: new VisualBasic.VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary).WithStrongNameProvider(s_defaultDesktopProvider));
options: new VisualBasic.VisualBasicCompilationOptions(OutputKind.DynamicallyLinkedLibrary).WithStrongNameProvider(DefaultDesktopStrongNameProvider));
other.VerifyDiagnostics();
var requestor = CreateCompilation(
......
......@@ -21747,9 +21747,8 @@ public void ValueTupleBase_AssemblyUnification()
public class A
{
}";
var signedDllOptions = TestOptions.ReleaseDll.
WithCryptoKeyFile(SigningTestHelpers.KeyPairFile).
WithStrongNameProvider(SigningTestHelpers.s_defaultDesktopProvider);
var signedDllOptions = TestOptions.SigningReleaseDll.
WithCryptoKeyFile(SigningTestHelpers.KeyPairFile);
var comp0v1 = CreateCompilationWithMscorlib40(source0v1, assemblyName: "A", options: signedDllOptions);
comp0v1.VerifyDiagnostics();
var ref0v1 = comp0v1.EmitToImageReference();
......@@ -1524,9 +1524,8 @@ public void RefAssembly_PublicSigning()
[ConditionalFact(typeof(WindowsOnly), Reason = "https://github.com/dotnet/roslyn/issues/30152")]
public void RefAssembly_StrongNameProvider()
{
var signedDllOptions = TestOptions.ReleaseDll.
WithCryptoKeyFile(SigningTestHelpers.KeyPairFile).
WithStrongNameProvider(s_defaultDesktopProvider);
var signedDllOptions = TestOptions.SigningReleaseDll.
WithCryptoKeyFile(SigningTestHelpers.KeyPairFile);
var comp = CreateCompilation("public class C{}", options: signedDllOptions);
......@@ -1543,9 +1542,8 @@ public void RefAssembly_StrongNameProvider()
[ConditionalFact(typeof(WindowsOnly), Reason = "https://github.com/dotnet/roslyn/issues/30152")]
public void RefAssembly_StrongNameProvider_Arm64()
{
var signedDllOptions = TestOptions.ReleaseDll.
var signedDllOptions = TestOptions.SigningReleaseDll.
WithCryptoKeyFile(SigningTestHelpers.KeyPairFile).
WithStrongNameProvider(s_defaultDesktopProvider).
WithPlatform(Platform.Arm64).
WithDeterministic(true);
......@@ -1564,10 +1562,9 @@ public void RefAssembly_StrongNameProvider_Arm64()
[ConditionalFact(typeof(WindowsOnly), Reason = "https://github.com/dotnet/roslyn/issues/30152")]
public void RefAssembly_StrongNameProviderAndDelaySign()
{
var signedDllOptions = TestOptions.ReleaseDll
var signedDllOptions = TestOptions.SigningReleaseDll
.WithCryptoKeyFile(SigningTestHelpers.KeyPairFile)
.WithDelaySign(true)
.WithStrongNameProvider(s_defaultDesktopProvider);
.WithDelaySign(true);
var comp = CreateCompilation("public class C{}", options: signedDllOptions);
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection.Metadata;
using System.Security.Cryptography;
using System.Text;
using Microsoft.Cci;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis
{
// TODO: delete this
internal sealed class PortableStrongNameProvider : StrongNameProvider
{
private readonly DesktopStrongNameProvider _provider;
public PortableStrongNameProvider(ImmutableArray<string> keySearchPaths, StrongNameFileSystem strongNameFileSystem, string tempPath)
{
_provider = new DesktopStrongNameProvider(keySearchPaths, tempPath, strongNameFileSystem);
}
public override int GetHashCode()
{
return 0;
}
internal override StrongNameFileSystem FileSystem => _provider.FileSystem;
internal override StrongNameKeys CreateKeys(string keyFilePath, string keyContainerName, bool hasCounterSignature, CommonMessageProvider messageProvider)
{
return _provider.CreateKeys(keyFilePath, keyContainerName, hasCounterSignature, messageProvider);
}
internal override void SignPeBuilder(ExtendedPEBuilder peBuilder, BlobBuilder peBlob, RSAParameters privateKey)
{
_provider.SignPeBuilder(peBuilder, peBlob, privateKey);
}
internal override Stream CreateInputStream()
{
return _provider.CreateInputStream();
}
public override bool Equals(object obj)
{
if (!(obj is PortableStrongNameProvider other))
{
return false;
}
return FileSystem == other.FileSystem;
}
}
}
......@@ -54,7 +54,7 @@ Partial Public Class InternalsVisibleToAndStrongNameTests
<ConditionalFact(GetType(WindowsOnly), Reason:=ConditionalSkipReason.TestExecutionNeedsWindowsTypes)>
Public Sub BadInputStream()
SigningTestHelpers.InstallKey()
Dim testProvider = New StrongNameProviderWithBadInputStream(s_defaultDesktopProvider)
Dim testProvider = New StrongNameProviderWithBadInputStream(DefaultDesktopStrongNameProvider)
Dim options = TestOptions.DebugDll.WithStrongNameProvider(testProvider).WithCryptoKeyContainer("RoslynTestContainer")
Dim comp = CreateCompilationWithMscorlib40(
......
......@@ -18725,9 +18725,8 @@ BC30652: Reference required to assembly '5a03232e-1a0f-4d1b-99ba-5d7b40ea931e, V
<ConditionalFact(GetType(WindowsOnly), Reason:=ConditionalSkipReason.TestExecutionNeedsWindowsTypes)>
Public Sub ValueTupleBase_AssemblyUnification()
Dim signedDllOptions = TestOptions.ReleaseDll.
WithCryptoKeyFile(SigningTestHelpers.KeyPairFile).
WithStrongNameProvider(s_defaultDesktopProvider)
Dim signedDllOptions = TestOptions.SigningReleaseDll.
WithCryptoKeyFile(SigningTestHelpers.KeyPairFile)
Dim comp0v1 = CreateCompilationWithMscorlib40(
<compilation name="A">
<file name="a.vb"><![CDATA[
......
......@@ -7,7 +7,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests
Public Class PrivateProtected
Inherits BasicTestBase
Private Shared ReadOnly s_defaultProvider As StrongNameProvider = SigningTestHelpers.s_defaultPortableProvider
Private Shared ReadOnly s_defaultProvider As StrongNameProvider = SigningTestHelpers.DefaultDesktopStrongNameProvider
<Fact>
Public Sub RejectIncompatibleModifiers()
......
......@@ -13,15 +13,9 @@ namespace Roslyn.Test.Utilities
{
internal static class SigningTestHelpers
{
// TODO: rename this to match naming conventions.
public static readonly StrongNameProvider s_defaultDesktopProvider =
public static readonly StrongNameProvider DefaultDesktopStrongNameProvider =
new DesktopStrongNameProvider(ImmutableArray<string>.Empty, null, new VirtualizedStrongNameFileSystem());
public static readonly StrongNameProvider DefaultDesktopStrongNameProvider = s_defaultDesktopProvider;
public static readonly StrongNameProvider s_defaultPortableProvider =
new PortableStrongNameProvider(ImmutableArray<string>.Empty, new VirtualizedStrongNameFileSystem(), null);
// these are virtual paths that don't exist on disk
internal static readonly string KeyFileDirectory = ExecutionConditionUtil.IsWindows
? @"R:\__Test__\"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册