Skip to content

Commit f077510

Browse files
authored
Merge branch 'develop' into dennisdyallo/fixes-182
2 parents 93d8d7b + 90ed378 commit f077510

File tree

15 files changed

+412
-735
lines changed

15 files changed

+412
-735
lines changed

.github/workflows/build-pull-requests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ jobs:
5252
with:
5353
global-json-file: global.json
5454

55-
- name: Add local NuGet repository
55+
# Add local NuGet repository so that we can use internal pre-release versions
56+
- name: Add local NuGet repository for prerelease versions
5657
run: dotnet nuget add source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/Yubico/index.json"
5758

5859
- name: Build Yubico.NET.SDK.sln

.github/workflows/build.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,23 @@ jobs:
8080
- uses: actions/setup-dotnet@v4
8181
with:
8282
global-json-file: "./global.json"
83-
- name: Add local NuGet repository
83+
84+
# Add local NuGet repository if version is not a plain release (i.e., has a suffix, e.g., -prerelease)
85+
- name: Add local NuGet repository for non-release versions
86+
if: ${{ github.event.inputs.version && (contains(github.event.inputs.version, '-')) }}
8487
run: dotnet nuget add source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/Yubico/index.json"
8588

86-
- name: Modify version for internal builds
87-
if: ${{ github.event.inputs.push-to-dev == 'true' }}
89+
- name: Set build version
90+
if: ${{ github.event.inputs.version }}
8891
run: |
8992
$file = gci ./build/Versions.props
9093
$versionProp = [xml](gc $file.FullName)
91-
$versionProp.Project.PropertyGroup.YubicoCoreVersion = "${{ github.event.inputs.version }}"
92-
$versionProp.Project.PropertyGroup.YubicoYubiKeyVersion = "${{ github.event.inputs.version }}"
94+
$versionProp.Project.PropertyGroup.CommonVersion = "${{ github.event.inputs.version }}"
9395
$versionProp.Save($file.FullName)
9496
9597
# Build the project
9698
- name: Build Yubico.NET.SDK.sln
97-
run: dotnet pack --configuration Release --nologo --verbosity minimal Yubico.NET.SDK.sln
99+
run: dotnet pack --configuration Release --nologo --verbosity minimal -p:treatWarningsAsErrors=true Yubico.NET.SDK.sln
98100

99101
# Build the documentation
100102
- name: Build docs
@@ -251,4 +253,4 @@ jobs:
251253
echo "| --- | --- |" >> $GITHUB_STEP_SUMMARY
252254
echo "| **Image Tag** | \`${{ env.DOCS_IMAGE_TAG }}\` |" >> $GITHUB_STEP_SUMMARY
253255
echo "| **Image Hash** | \`${{ env.DOCS_IMAGE_HASH }}\` |" >> $GITHUB_STEP_SUMMARY
254-
fi
256+
fi

Yubico.YubiKey/examples/Fido2SampleCode/YubiKeyOperations/Fido2Reset.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public ResponseStatus RunFido2Reset(Func<KeyEntryData, bool> KeyCollector)
8686
// Wait for CheckReinsert to complete, or else the task times out.
8787
// If it returns false, the YubiKey was not reinserted within the
8888
// time limit, so return false.
89-
if (!reinsert.Wait(ReinsertTimeoutSeconds * 1000))
89+
if (!reinsert.Wait(ReinsertTimeoutSeconds * 1000)) // Reinsert the YubiKey at this step.
9090
{
9191
return ResponseStatus.ConditionsNotSatisfied;
9292
}

Yubico.YubiKey/examples/SharedSampleCode/SharedSampleCode.csproj

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,9 @@ limitations under the License. -->
2323
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
2424
<NoWarn>@(NoWarn);NU5105;NU5104</NoWarn>
2525
</PropertyGroup>
26-
27-
<!--
28-
To test against local YubiKey library changes, uncomment the following line and adjust the path as needed
29-
and comment out the Yubico.YubiKey PackageReference line below that references the wildcard version (which would then be fetched from the NuGet servers).
26+
3027
<ItemGroup>
3128
<ProjectReference Include="..\..\src\Yubico.YubiKey.csproj" />
32-
</ItemGroup>-->
33-
34-
<ItemGroup>
35-
<PackageReference Include="Yubico.YubiKey" Version="1.*-*" />
3629
</ItemGroup>
37-
30+
3831
</Project>

Yubico.YubiKey/src/Yubico/YubiKey/ApplicationSession.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ protected IYubiKeyConnection GetConnection(
8686
{
8787
string scpType = keyParameters switch
8888
{
89-
Scp03KeyParameters _ when application == YubiKeyApplication.Oath && yubiKey.HasFeature(YubiKeyFeature.Scp03Oath)
89+
Scp03KeyParameters when application == YubiKeyApplication.Oath && yubiKey.HasFeature(YubiKeyFeature.Scp03Oath)
9090
=> "SCP03",
91-
Scp03KeyParameters _ when yubiKey.HasFeature(YubiKeyFeature.Scp03)
91+
Scp03KeyParameters when yubiKey.HasFeature(YubiKeyFeature.Scp03)
9292
=> "SCP03",
93-
Scp11KeyParameters _ when yubiKey.HasFeature(YubiKeyFeature.Scp11)
93+
Scp11KeyParameters when yubiKey.HasFeature(YubiKeyFeature.Scp11)
9494
=> "SCP11",
9595
null => string.Empty,
9696
_ => throw new InvalidOperationException("The YubiKey does not support the requested SCP connection.")

Yubico.YubiKey/src/Yubico/YubiKey/ConnectionFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public IYubiKeyConnection CreateConnection(YubiKeyApplication application)
120120
return new KeyboardConnection(_hidKeyboardDevice);
121121
}
122122

123-
bool isFidoApplication = application == YubiKeyApplication.Fido2 || application == YubiKeyApplication.FidoU2f;
123+
bool isFidoApplication = application is YubiKeyApplication.Fido2 or YubiKeyApplication.FidoU2f;
124124
if (_hidFidoDevice != null && isFidoApplication)
125125
{
126126
_log.LogDebug("Connecting via the FIDO interface.");

Yubico.YubiKey/src/Yubico/YubiKey/KeyboardConnection.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
using System;
1616
using Yubico.Core.Devices.Hid;
17-
using Yubico.Core.Iso7816;
1817
using Yubico.YubiKey.Pipelines;
1918

2019
namespace Yubico.YubiKey

Yubico.YubiKey/src/Yubico/YubiKey/Otp/Commands/ReadStatusResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public OtpStatus GetData()
8181
ShortPressRequiresTouch = (responseApduSpan[4] & ShortPressTouchMask) != 0,
8282
LongPressRequiresTouch = (responseApduSpan[4] & LongPressTouchMask) != 0,
8383
LedBehaviorInverted = (responseApduSpan[4] & LedInvertedMask) != 0,
84-
TouchLevel = responseApduSpan[5],
84+
TouchLevel = responseApduSpan[5]
8585
};
8686
}
8787
}

Yubico.YubiKey/src/Yubico/YubiKey/Otp/OtpSession.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
using System;
1616
using System.Globalization;
1717
using Yubico.Core.Logging;
18-
using Yubico.YubiKey.Oath;
1918
using Yubico.YubiKey.Otp.Commands;
2019
using Yubico.YubiKey.Otp.Operations;
2120
using Yubico.YubiKey.Scp;

build/sign.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ function Process-ZipPackage {
202202
Get-ChildItem -Path $extractPath -Recurse -Filter "*.nuspec" |
203203
ForEach-Object {
204204
Write-Host " 📥 Packing: $($_.Name)"
205-
$output = & $NuGetPath pack $_.FullName -OutputDirectory $Directories.Packages 2>&1
206-
205+
$output = & $NuGetPath pack $_.FullName -OutputDirectory $Directories.Packages -p TreatWarningsAsErrors=true 2>&1
206+
207207
if ($LASTEXITCODE -ne 0) {
208208
$output | ForEach-Object { Write-Host $_ }
209209
throw "Packing failed for file: $($_.FullName)"

0 commit comments

Comments
 (0)