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
5 changes: 5 additions & 0 deletions Test/Attestation/None.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Fido2NetLib.Cbor;
using Fido2NetLib.Exceptions;
using Fido2NetLib.Objects;
using System.Runtime.InteropServices;

namespace Test.Attestation;

Expand All @@ -19,6 +20,10 @@ public void TestNone()
{
Fido2Tests._validCOSEParameters.ForEach(async ((COSE.KeyType, COSE.Algorithm, COSE.EllipticCurve) param) =>
{
// No support for P256K on OSX
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) && param.Item3 == COSE.EllipticCurve.P256K)
return;

_attestationObject.Add("attStmt", new CborMap());
_credentialPublicKey = Fido2Tests.MakeCredentialPublicKey(param);
Fido2.CredentialMakeResult res = null;
Expand Down
9 changes: 9 additions & 0 deletions Test/Attestation/Packed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Fido2NetLib.Cbor;
using Fido2NetLib.Exceptions;
using Fido2NetLib.Objects;
using System.Runtime.InteropServices;

namespace Test.Attestation;

Expand All @@ -24,6 +25,10 @@ public void TestSelf()
{
var (type, alg, crv) = param;

// No support for P256K on OSX
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) && crv == COSE.EllipticCurve.P256K)
return;

var signature = SignData(type, alg, crv);

_attestationObject.Set("attStmt", new CborMap {
Expand Down Expand Up @@ -193,6 +198,10 @@ public void TestFull()
return;
}

// No support for P256K on OSX
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) && curve == COSE.EllipticCurve.P256K)
return;

X509Certificate2 attestnCert;
DateTimeOffset notBefore = DateTimeOffset.UtcNow;
DateTimeOffset notAfter = notBefore.AddDays(2);
Expand Down
7 changes: 6 additions & 1 deletion Test/Fido2Tests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Buffers.Binary;
using System.Buffers.Binary;
using System.Formats.Asn1;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
Expand Down Expand Up @@ -809,6 +810,10 @@ public void TestAssertionResponse()
{
var (type, alg, curve) = param;

// No support for P256K on OSX
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) && curve == COSE.EllipticCurve.P256K)
return;

if (curve != default)
{
avr = await MakeAssertionResponseAsync(type, alg, curve);
Expand Down
50 changes: 43 additions & 7 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: $(Rev:r)

variables:
BuildConfiguration: Release
TargetVmImage: windows-latest
TargetWindowsVMImage: windows-latest
DOTNET_CLI_TELEMETRY_OPTOUT: '1'

jobs:
# Publish the demo website
# Publish the demo website for windows-latest
- job: demo
displayName: Demo build
pool:
vmImage: $(TargetVmImage)
vmImage: $(TargetWindowsVMImage)
steps:
- task: UseDotNet@2
displayName: 'Use .NET 6.0 SDK'
Expand Down Expand Up @@ -42,11 +42,11 @@ jobs:
pathToPublish: $(build.ArtifactStagingDirectory)/net6.0
artifactName: Demo .Net 6.0

# Run unit tests
- job: tests
displayName: Unit tests
# Run unit tests for windows-latest and publish coverage
- job: test-windows
displayName: Unit test windows
pool:
vmImage: $(TargetVmImage)
vmImage: $(TargetWindowsVMImage)
steps:
- task: UseDotNet@2
displayName: 'Use .NET 6.0 SDK'
Expand Down Expand Up @@ -89,3 +89,39 @@ jobs:
inputs:
targetType: 'inline'
script: 'bash <(curl -s https://codecov.io/bash) -Z -t 0b864a87-d3bc-4130-b942-81909f1064c0 -f CodeCoverage/Cobertura.xml'

# Run unit tests for mac/linux
- job: test-mac-linux
displayName: Unit test mac/linux
strategy:
matrix:
linux:
imageName: 'ubuntu-latest'
mac:
imageName: 'macOS-latest'
pool:
vmImage: $(imageName)
steps:
- task: UseDotNet@2
displayName: 'Use .NET 6.0 SDK'
inputs:
packageType: 'sdk'
version: '6.0.x'
installationPath: $(Agent.ToolsDirectory)/dotnet-unit-tests
- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
inputs:
command: restore
projects: 'Test/Test.csproj'
- task: DotNetCoreCLI@2
displayName: 'dotnet build $(buildConfiguration)'
inputs:
command: build
arguments: '--configuration $(buildConfiguration) --no-restore --nologo "-p:Version=$(Build.BuildNumber)-development"'
projects: 'Test/Test.csproj'
- task: DotNetCoreCLI@2
displayName: Run unit tests
inputs:
command: test
projects: 'Test/Test.csproj'
arguments: '--configuration $(buildConfiguration) --no-restore --no-build --nologo