Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Sign.Cli/AzureKeyVaultCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.CommandLine.IO;
using Azure.Core;
using Azure.Security.KeyVault.Certificates;
using Azure.Security.KeyVault.Keys;
using Azure.Security.KeyVault.Keys.Cryptography;
using Microsoft.Extensions.Azure;
using Microsoft.Extensions.DependencyInjection;
Expand Down
2 changes: 1 addition & 1 deletion src/Sign.Core/DataFormatSigners/ClickOnceSigner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ await Parallel.ForEachAsync(files, _parallelOptions, async (file, state) =>
if (string.IsNullOrEmpty(options.PublisherName))
{
string publisherName = certificate.SubjectName.Name;

// get the DN. it may be quoted
publisherParam = $@"-pub ""{publisherName.Replace("\"", "")}""";
}
Expand Down
2 changes: 1 addition & 1 deletion src/Sign.Core/DataFormatSigners/SignOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ internal SignOptions(
}

internal SignOptions(HashAlgorithmName fileHashAlgorithm, Uri timestampService)
: this(applicationName: null, publisherName: null, description: null, descriptionUrl: null,
: this(applicationName: null, publisherName: null, description: null, descriptionUrl: null,
fileHashAlgorithm, HashAlgorithmName.SHA256, timestampService, matcher: null,
antiMatcher: null)
{
Expand Down
5 changes: 4 additions & 1 deletion test/Sign.Cli.Test/SignCommandTests.Globbing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public partial class SignCommandTests
{
public sealed class GlobbingTests : IDisposable
{
private readonly DirectoryService _directoryService;
private readonly Parser _parser;
private readonly SignerSpy _signerSpy;
private readonly TemporaryDirectory _temporaryDirectory;
Expand All @@ -33,7 +34,8 @@ public GlobbingTests()

_parser = Program.CreateParser(serviceProviderFactory);

_temporaryDirectory = new TemporaryDirectory(new DirectoryService(Mock.Of<ILogger<IDirectoryService>>()));
_directoryService = new DirectoryService(Mock.Of<ILogger<IDirectoryService>>());
_temporaryDirectory = new TemporaryDirectory(_directoryService);

CreateFileSystemInfos(
_temporaryDirectory,
Expand All @@ -52,6 +54,7 @@ public GlobbingTests()
public void Dispose()
{
_temporaryDirectory.Dispose();
_directoryService.Dispose();

GC.SuppressFinalize(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ public async Task SignAsync_WhenFileIsZipContainerWithNestedContentAndContainers
[Fact]
public async Task SignAsync_WhenFileIsZipContainerAndGlobAndAntiGlobPatternsAreUsed_SignsOnlyMatchingFiles()
{
const string fileListContents =
const string fileListContents =
@"**/*.dll
**/*.exe
!**/*.txt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,30 @@
namespace Sign.Core.Test
{
[Collection(SigningTestsCollection.Name)]
public class AzureSignToolSignerTests
public sealed class AzureSignToolSignerTests : IDisposable
{
private readonly TrustedCertificateFixture _certificateFixture;
private readonly DirectoryService _directoryService = new(Mock.Of<ILogger<IDirectoryService>>());
private readonly DirectoryService _directoryService;
private readonly AzureSignToolSigner _signer;

public AzureSignToolSignerTests(TrustedCertificateFixture certificateFixture)
{
ArgumentNullException.ThrowIfNull(certificateFixture, nameof(certificateFixture));

_certificateFixture = certificateFixture;
_directoryService = new(Mock.Of<ILogger<IDirectoryService>>());
_signer = new AzureSignToolSigner(
Mock.Of<IToolConfigurationProvider>(),
Mock.Of<ISignatureAlgorithmProvider>(),
Mock.Of<ICertificateProvider>(),
Mock.Of<ILogger<IDataFormatSigner>>());
}

public void Dispose()
{
_directoryService.Dispose();
}

[Fact]
public void CanSign_WhenFileIsNull_Throws()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ namespace Sign.Core.Test
{
public sealed class ClickOnceSignerTests : IDisposable
{
private readonly DirectoryService _directoryService = new(Mock.Of<ILogger<IDirectoryService>>());
private readonly DirectoryService _directoryService;
private readonly ClickOnceSigner _signer;

public ClickOnceSignerTests()
{
_directoryService = new(Mock.Of<ILogger<IDirectoryService>>());
_signer = new ClickOnceSigner(
Mock.Of<ISignatureAlgorithmProvider>(),
Mock.Of<ICertificateProvider>(),
Expand Down
3 changes: 1 addition & 2 deletions test/Sign.Core.Test/DataFormatSigners/NuGetSignerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ public async Task SignAsync_WhenSigningFails_Throws()
matcher: null,
antiMatcher: null);

DirectoryService directoryService = new(Mock.Of<ILogger<IDirectoryService>>());

using (DirectoryService directoryService = new(Mock.Of<ILogger<IDirectoryService>>()))
using (TemporaryDirectory temporaryDirectory = new(directoryService))
{
FileInfo nupkgFile = TestFileCreator.CreateEmptyZipFile(temporaryDirectory, fileExtension: ".nupkg");
Expand Down
5 changes: 1 addition & 4 deletions test/Sign.Core.Test/DataFormatSigners/VsixSignerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ public async Task SignAsync_WhenSigningFails_Throws()
matcher: null,
antiMatcher: null);

DirectoryService directoryService = new(Mock.Of<ILogger<IDirectoryService>>());

using (DirectoryService directoryService = new(Mock.Of<ILogger<IDirectoryService>>()))
using (TemporaryDirectory temporaryDirectory = new(directoryService))
{
FileInfo vsixFile = TestFileCreator.CreateEmptyZipFile(temporaryDirectory, fileExtension: ".vsix");
Expand Down Expand Up @@ -155,7 +154,5 @@ public async Task SignAsync_WhenSigningFails_Throws()
}
}
}


}
}
Loading