Skip to content
Open
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
5 changes: 1 addition & 4 deletions src/cyclonedx/Commands/Add/AddFilesCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.CommandLine;
using System.CommandLine.Invocation;
using System.Globalization;
using System.CommandLine.NamingConventionBinder;
using System.IO;
using System.Linq;
using System.Reflection;
Expand All @@ -28,8 +27,6 @@
using System.Threading.Tasks;
using AntPathMatching;
using CycloneDX.Models;
using CycloneDX.Cli.Commands;
using System.CommandLine.NamingConventionBinder;

namespace CycloneDX.Cli.Commands.Add
{
Expand Down
3 changes: 1 addition & 2 deletions src/cyclonedx/Commands/Sign/SignBomCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@
using System;
using System.Diagnostics.Contracts;
using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.Globalization;
using System.IO;
using System.Security.Cryptography;
using System.Security.Cryptography.Xml;
using System.Threading.Tasks;
using System.Xml;
using System.CommandLine.NamingConventionBinder;

namespace CycloneDX.Cli.Commands.Sign
{
Expand Down
5 changes: 1 addition & 4 deletions src/cyclonedx/Commands/Sign/SignFileCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,10 @@
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.Contracts;
using System.CommandLine;
using System.CommandLine.Invocation;
using System.Globalization;
using System.CommandLine.NamingConventionBinder;
using System.IO;
using System.Security.Cryptography;
using System.Threading.Tasks;
using System.Xml;
using System.CommandLine.NamingConventionBinder;

namespace CycloneDX.Cli.Commands.Sign
{
Expand Down
6 changes: 0 additions & 6 deletions src/cyclonedx/Commands/ValidateCommandOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright (c) OWASP Foundation. All Rights Reserved.
using System;
using System.CommandLine;
using System.CommandLine.Invocation;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using CycloneDX.Models;

namespace CycloneDX.Cli.Commands
{
Expand Down
3 changes: 1 addition & 2 deletions src/cyclonedx/Commands/Verify/VerifyAllCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@
using System;
using System.Diagnostics.Contracts;
using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.Globalization;
using System.IO;
using System.Security.Cryptography;
using System.Security.Cryptography.Xml;
using System.Threading.Tasks;
using System.Xml;
using System.CommandLine.NamingConventionBinder;

namespace CycloneDX.Cli.Commands.Verify
{
Expand Down
3 changes: 1 addition & 2 deletions src/cyclonedx/Commands/Verify/VerifyFileCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@
using System;
using System.Diagnostics.Contracts;
using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.IO;
using System.Security.Cryptography;
using System.Threading.Tasks;
using System.CommandLine.NamingConventionBinder;

namespace CycloneDX.Cli.Commands.Verify
{
Expand Down
6 changes: 3 additions & 3 deletions src/cyclonedx/cyclonedx.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CoderPatros.AntPathMatching" Version="0.1.1" />
<PackageReference Include="CsvHelper" Version="29.0.0" />
<PackageReference Include="CoderPatros.AntPathMatching" Version="1.0.0" />
<PackageReference Include="CsvHelper" Version="33.1.0" />
<PackageReference Include="CycloneDX.Utils" Version="10.0.0" />
<PackageReference Include="CycloneDX.Spdx.Interop" Version="10.0.0" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageReference Include="System.CommandLine.NamingConventionBinder" Version="2.0.0-beta4.22272.1" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="6.0.1" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="8.0.2" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions tests/cyclonedx.tests/ConvertTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public async Task Convert(string inputFilename, ConvertFormat inputFormat, strin
InputFormat = inputFormat,
OutputFormat = outputFormat,
OutputVersion = outputVersion,
}).ConfigureAwait(false);
}).ConfigureAwait(true);

Assert.Equal(0, exitCode);
var bom = File.ReadAllText(fullOutputPath);
Expand All @@ -122,7 +122,7 @@ public async Task ConvertToSpdxJson(ConvertFormat outputFormat)
InputFormat = ConvertFormat.autodetect,
OutputFormat = outputFormat

}).ConfigureAwait(false);
}).ConfigureAwait(true);

Assert.Equal(0, exitCode);
var bom = File.ReadAllText(outputFilename);
Expand All @@ -146,7 +146,7 @@ public async Task ConvertFromSpdxJson(ConvertFormat inputFormat)
InputFormat = inputFormat,
OutputFormat = ConvertFormat.xml,

}).ConfigureAwait(false);
}).ConfigureAwait(true);

Assert.Equal(0, exitCode);
var bom = File.ReadAllText(outputFilename);
Expand Down
2 changes: 1 addition & 1 deletion tests/cyclonedx.tests/MergeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public async Task Merge(
options.InputFiles.Add(Path.Combine("Resources", "Merge", inputFilename));
}

var exitCode = await MergeCommand.Merge(options).ConfigureAwait(false);
var exitCode = await MergeCommand.Merge(options).ConfigureAwait(true);

Assert.Equal(0, exitCode);
var bom = File.ReadAllText(fullOutputPath);
Expand Down
2 changes: 1 addition & 1 deletion tests/cyclonedx.tests/SignBomTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public async Task SignXmlBom()
{
BomFile = testFilename,
KeyFile = Path.Combine("Resources", "private.key"),
}).ConfigureAwait(false);
}).ConfigureAwait(true);

Assert.Equal(ExitCode.Ok, (ExitCode)exitCode);

Expand Down
6 changes: 3 additions & 3 deletions tests/cyclonedx.tests/SignFileTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ public async Task SignFile()
using (var tempDirectory = new TempDirectory())
{
var testFilename = Path.Combine(tempDirectory.DirectoryPath, "bom.xml");
var fileContents = await File.ReadAllTextAsync(Path.Combine("Resources", "bom-1.3.xml")).ConfigureAwait(false);
var fileContents = await File.ReadAllTextAsync(Path.Combine("Resources", "bom-1.3.xml")).ConfigureAwait(true);
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
fileContents = fileContents.Replace("\r\n", "\n");
}
await File.WriteAllTextAsync(testFilename, fileContents).ConfigureAwait(false);
await File.WriteAllTextAsync(testFilename, fileContents).ConfigureAwait(true);

var exitCode = await SignFileCommand.SignFile(new SignFileCommandOptions
{
File = testFilename,
KeyFile = Path.Combine("Resources", "private.key"),
}).ConfigureAwait(false);
}).ConfigureAwait(true);

Assert.Equal(ExitCode.Ok, (ExitCode)exitCode);

Expand Down
2 changes: 1 addition & 1 deletion tests/cyclonedx.tests/ValidateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public async Task Validate(string inputFilename, ValidationBomFormat inputFormat
InputFormat = inputFormat,
InputVersion = inputVersion,
FailOnErrors = true,
}).ConfigureAwait(false);
}).ConfigureAwait(true);

if (valid)
{
Expand Down
4 changes: 2 additions & 2 deletions tests/cyclonedx.tests/VerifyAllTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public async Task OriginalBomSignatureVerifies()
{
BomFile = Path.Combine("Resources", "signed-bom.xml"),
KeyFile = Path.Combine("Resources", "public.key")
}).ConfigureAwait(false);
}).ConfigureAwait(true);

Assert.Equal(ExitCode.Ok, (ExitCode)exitCode);
}
Expand All @@ -44,7 +44,7 @@ public async Task ModifiedBomFailsSignatureVerification()
{
BomFile = Path.Combine("Resources", "signed-bom-modified.xml"),
KeyFile = Path.Combine("Resources", "public.key")
}).ConfigureAwait(false);
}).ConfigureAwait(true);

Assert.Equal(ExitCode.SignatureFailedVerification, (ExitCode)exitCode);
}
Expand Down
12 changes: 6 additions & 6 deletions tests/cyclonedx.tests/VerifyFileTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ public async Task ValidSignatureVerifies()
{
var testFilename = Path.Combine(tempDirectory.DirectoryPath, "bom.xml");

var fileContents = await File.ReadAllTextAsync(Path.Combine("Resources", "bom-1.3.xml")).ConfigureAwait(false);
var fileContents = await File.ReadAllTextAsync(Path.Combine("Resources", "bom-1.3.xml")).ConfigureAwait(true);
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
fileContents = fileContents.Replace("\r\n", "\n");
}
await File.WriteAllTextAsync(testFilename, fileContents).ConfigureAwait(false);
await File.WriteAllTextAsync(testFilename, fileContents).ConfigureAwait(true);

var exitCode = await VerifyFileCommand.VerifyFile(new VerifyFileCommandOptions
{
File = testFilename,
KeyFile = Path.Combine("Resources", "public.key"),
SignatureFile = Path.Combine("Resources", "bom-1.3.xml.valid.sig"),
}).ConfigureAwait(false);
}).ConfigureAwait(true);

Assert.Equal(ExitCode.Ok, (ExitCode)exitCode);
}
Expand All @@ -57,19 +57,19 @@ public async Task InvalidSignatureFailsVerification()
{
var testFilename = Path.Combine(tempDirectory.DirectoryPath, "bom.xml");

var fileContents = await File.ReadAllTextAsync(Path.Combine("Resources", "bom-1.3.xml")).ConfigureAwait(false);
var fileContents = await File.ReadAllTextAsync(Path.Combine("Resources", "bom-1.3.xml")).ConfigureAwait(true);
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
fileContents = fileContents.Replace("\r\n", "\n");
}
await File.WriteAllTextAsync(testFilename, fileContents).ConfigureAwait(false);
await File.WriteAllTextAsync(testFilename, fileContents).ConfigureAwait(true);

var exitCode = await VerifyFileCommand.VerifyFile(new VerifyFileCommandOptions
{
File = testFilename,
KeyFile = Path.Combine("Resources", "public.key"),
SignatureFile = Path.Combine("Resources", "bom-1.3.xml.invalid.sig"),
}).ConfigureAwait(false);
}).ConfigureAwait(true);

Assert.Equal(ExitCode.SignatureFailedVerification, (ExitCode)exitCode);
}
Expand Down
10 changes: 5 additions & 5 deletions tests/cyclonedx.tests/cyclonedx.tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="Snapshooter.Xunit" Version="0.7.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="Snapshooter.Xunit" Version="1.0.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PackageReference Include="coverlet.collector" Version="6.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down