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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions docs/FIDO2-INTEGRATION-TEST-PROGRESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Successfully debugged and fixed the FIDO2 integration tests. All 42 tests now pa
## Fixes Applied

### 1. Linux HID Report ID Bug
**File:** `Yubico.YubiKit.Core/src/Hid/Linux/LinuxHidIOReportConnection.cs`
**File:** `Yubico.YubiKit.Core/src/Transports/Hid/Linux/LinuxHidIOReportConnection.cs`

**Problem:** Linux hidraw requires prepending a report ID byte (0x00) on writes, but the code was writing the 64-byte packet directly.

Expand Down Expand Up @@ -91,7 +91,7 @@ data.CopyTo(writeBuffer[1..]);

## Files Modified

1. `Yubico.YubiKit.Core/src/Hid/Linux/LinuxHidIOReportConnection.cs` - HID report ID fix
1. `Yubico.YubiKit.Core/src/Transports/Hid/Linux/LinuxHidIOReportConnection.cs` - HID report ID fix
2. `Yubico.YubiKit.Fido2/src/Pin/PinUvAuthProtocolV2.cs` - Token length fix
3. `Yubico.YubiKit.Fido2/src/Pin/PinUvAuthProtocolV1.cs` - Token length fix
4. `Yubico.YubiKit.Fido2/src/Credentials/PublicKeyCredentialTypes.cs` - Optional user fields
Expand Down
8 changes: 4 additions & 4 deletions docs/LOGGING.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ YubiKit uses the following log categories (class names):

| Category | Description |
|----------|-------------|
| `Yubico.YubiKit.Core.DeviceMonitorService` | Device arrival/removal events |
| `Yubico.YubiKit.Core.DeviceListenerService` | Background device cache updates |
| `Yubico.YubiKit.Core.DeviceRepositoryCached` | Device cache operations |
| `Yubico.YubiKit.Core.SmartCard.*` | Smart card/PCSC operations |
| `Yubico.YubiKit.Core.Devices.*` | Device discovery, metadata, and cache operations |
| `Yubico.YubiKit.Core.Transports.SmartCard.*` | Smart card/PC/SC transport operations |
| `Yubico.YubiKit.Core.Protocols.SmartCard.*` | APDU and SCP protocol operations |
| `Yubico.YubiKit.Core.Transports.Hid.*` | HID device and transport operations |
| `Yubico.YubiKit.Management.ManagementSession` | Management application commands |
| `Yubico.YubiKit.Piv.PivSession` | PIV application commands |
| `Yubico.YubiKit.Fido2.Fido2Session` | FIDO2 application commands |
Expand Down
16 changes: 8 additions & 8 deletions docs/architecture/physical-device-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ See also: [event-driven device discovery](./event-driven-device-discovery.md) an

## One IYubiKey Per Physical Device

`IYubiKey` (defined in `src/Core/src/Interfaces/IYubiKey.cs`) is intentionally small:
`IYubiKey` (defined in `src/Core/src/Abstractions/IYubiKey.cs`) is intentionally small:

- `string DeviceId` — a stable identifier for the physical device.
- `ConnectionType AvailableConnections` — the concrete interfaces this device exposes, any combination of
Expand All @@ -39,7 +39,7 @@ none.

```csharp
using Yubico.YubiKit.Core;
using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Devices;

// One IYubiKey per physical device, even when CCID + HID FIDO + HID OTP are all present.
var devices = await YubiKeyManager.FindAllAsync(ConnectionType.All, forceRescan: true);
Expand Down Expand Up @@ -82,9 +82,9 @@ platforms. This is a known platform residual tracked outside the composite-devic
Open a specific interface with the typed overload:

```csharp
using Yubico.YubiKit.Core.SmartCard;
using Yubico.YubiKit.Core.Hid.Fido;
using Yubico.YubiKit.Core.Hid.Interfaces;
using Yubico.YubiKit.Core.Protocols.Fido.Hid;
using Yubico.YubiKit.Core.Transports.Hid;
using Yubico.YubiKit.Core.Transports.SmartCard;

await using var smartCard = await device.ConnectAsync<ISmartCardConnection>();
await using var fido = await device.ConnectAsync<IFidoHidConnection>();
Expand All @@ -97,7 +97,7 @@ interface device, use the typed overload above or an applet session extension (b

## Read-Only Metadata Ownership

Read-only physical-device metadata lives in **Core** (`Yubico.YubiKit.Core.YubiKey`): `DeviceInfo`,
Read-only physical-device metadata lives in **Core** (`Yubico.YubiKit.Core.Devices`): `DeviceInfo`,
`FormFactor`, `DeviceCapabilities`, `DeviceFlags`, `VersionQualifier`, and `VersionQualifierType`. This lets
Core describe a physical device without depending on the Management module. Reading the metadata from a
device uses the Management extension, which opens a transient session:
Expand Down Expand Up @@ -175,7 +175,7 @@ connection type and enumerated one row per interface. In v2:
| One `IYubiKey` per interface; multiple rows for one physical key | One `IYubiKey` per physical key; interfaces in `AvailableConnections` |
| Scalar `yubiKey.ConnectionType` to decide routing | `yubiKey.AvailableConnections` + `yubiKey.SupportsConnection(...)` |
| Parameterless `ConnectAsync()` picks "the" transport | `ConnectAsync<TConnection>()` for a specific interface; parameterless throws on multi-interface devices |
| Reaching for Management types to read metadata | Read-only metadata types now in `Yubico.YubiKit.Core.YubiKey`; read via `GetDeviceInfoAsync()` |
| Reaching for Management types to read metadata | Read-only metadata types now in `Yubico.YubiKit.Core.Devices`; read via `GetDeviceInfoAsync()` |
| Applet extension assumed a single transport | Applet extensions select via documented default order + optional `preferredConnection` |

Practical steps:
Expand All @@ -186,4 +186,4 @@ Practical steps:
extension.
3. Where you need a specific transport, pass `preferredConnection`; otherwise rely on the documented default
order (and held-transport fallback).
4. Update metadata type references to `Yubico.YubiKit.Core.YubiKey`.
4. Update metadata type references to `Yubico.YubiKit.Core.Devices`.
2 changes: 1 addition & 1 deletion docs/todo-update-codeanalysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Upgrading introduces 189 new analyzer errors, primarily:

## Scope
Files with known violations:
- `Yubico.YubiKit.Core/src/SmartCard/Scp/ScpState.Scp11.cs` - Multiple CA2000 (Tlv, ECDiffieHellman disposal)
- `Yubico.YubiKit.Core/src/Protocols/SmartCard/Scp/ScpState.Scp11.cs` - Multiple CA2000 (Tlv, ECDiffieHellman disposal)
- `Yubico.YubiKit.Core/src/DependencyInjection.cs` - CA1724 naming conflict

## Action
Expand Down
4 changes: 2 additions & 2 deletions docs/usage/device-discovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This guide covers how to discover and monitor YubiKey devices using the static `
## Quick Start

```csharp
using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Devices;

// Find all connected YubiKeys
var devices = await YubiKeyManager.FindAllAsync();
Expand Down Expand Up @@ -62,7 +62,7 @@ For applications that need to react to device connections/disconnections:

```csharp
using System.Reactive.Linq;
using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Devices;

// Subscribe to device events
using var subscription = YubiKeyManager.DeviceChanges.Subscribe(e =>
Expand Down
12 changes: 6 additions & 6 deletions docs/vslsp-proposals.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ names, interface hierarchy.

### What happened

The Engineer called `get_code_structure` on `src/Core/src/Hid/Otp/`. It returned 6
The Engineer called `get_code_structure` on `src/Core/src/Protocols/Otp/Hid/`. It returned 6
types but **0 methods** for `OtpHidProtocol`. The method `WaitForReadyToReadAsync` —
the center of the entire bug — was invisible.

Expand All @@ -39,7 +39,7 @@ Add a `visibility` parameter:

```json
mcp__vslsp__get_code_structure({
"path": "/abs/path/src/Core/src/Hid/Otp/",
"path": "/abs/path/src/Core/src/Protocols/Otp/Hid/",
"language": "csharp",
"depth": "signatures",
"visibility": "all"
Expand Down Expand Up @@ -76,7 +76,7 @@ mcp__vslsp__find_symbol({
{
"name": "WaitForReadyToReadAsync",
"kind": "method",
"file": "/abs/path/src/Core/src/Hid/Otp/OtpHidProtocol.cs",
"file": "/abs/path/src/Core/src/Protocols/Otp/Hid/OtpHidProtocol.cs",
"line": 151,
"signature": "private async Task<(ReadOnlyMemory<byte>, bool)> WaitForReadyToReadAsync(int, CancellationToken)"
}
Expand Down Expand Up @@ -109,20 +109,20 @@ mcp__vslsp__find_usages({
"solution": "/abs/path/Yubico.YubiKit.sln",
"symbol": "WaitForReadyToReadAsync"
// OR — precise form:
// "file": "/abs/path/src/Core/src/Hid/Otp/OtpHidProtocol.cs",
// "file": "/abs/path/src/Core/src/Protocols/Otp/Hid/OtpHidProtocol.cs",
// "line": 151,
// "column": 52
})

// Output
{
"definition": {
"file": "/abs/path/src/Core/src/Hid/Otp/OtpHidProtocol.cs",
"file": "/abs/path/src/Core/src/Protocols/Otp/Hid/OtpHidProtocol.cs",
"line": 151
},
"usages": [
{
"file": "/abs/path/src/Core/src/Hid/Otp/OtpHidProtocol.cs",
"file": "/abs/path/src/Core/src/Protocols/Otp/Hid/OtpHidProtocol.cs",
"line": 132,
"context": "var (firstReport, hasData) = await WaitForReadyToReadAsync(programmingSequence, cancellationToken)"
}
Expand Down
2 changes: 1 addition & 1 deletion experiments/DebugSlotMetadata/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Purpose: Understand why ImportSubjectPublicKeyInfo fails with "ASN1 corrupted data"

using System.Security.Cryptography;
using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Devices;
using Yubico.YubiKit.Piv;

Console.WriteLine("=== PIV Slot Metadata Debug ===\n");
Expand Down
4 changes: 2 additions & 2 deletions experiments/DeviceMonitor/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

using System.Reactive.Linq;
using Yubico.YubiKit.Core;
using Yubico.YubiKit.Core.Interfaces;
using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Abstractions;
using Yubico.YubiKit.Core.Devices;
using Yubico.YubiKit.Management;

Console.WriteLine("╔══════════════════════════════════════════════════════════════╗");
Expand Down
2 changes: 1 addition & 1 deletion sign.cs
Original file line number Diff line number Diff line change
Expand Up @@ -530,4 +530,4 @@ void PrintSubHeader(string message)
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine($"📦 {message}");
Console.ResetColor();
}
}
2 changes: 1 addition & 1 deletion src/Cli.Commands/src/Fido/FidoCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Text;
using Yubico.YubiKit.Cli.Commands.Infrastructure;
using Yubico.YubiKit.Cli.Shared.Output;
using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Devices;
using Yubico.YubiKit.Fido2;
using Yubico.YubiKit.Fido2.BioEnrollment;
using Yubico.YubiKit.Fido2.Config;
Expand Down
2 changes: 1 addition & 1 deletion src/Cli.Commands/src/HsmAuth/HsmAuthCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Security.Cryptography;
using Yubico.YubiKit.Cli.Commands.Infrastructure;
using Yubico.YubiKit.Cli.Shared.Output;
using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Devices;
using Yubico.YubiKit.YubiHsm;

namespace Yubico.YubiKit.Cli.Commands.HsmAuth;
Expand Down
2 changes: 1 addition & 1 deletion src/Cli.Commands/src/Infrastructure/YkCommandBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Spectre.Console.Cli;
using Yubico.YubiKit.Cli.Shared.Cli;
using Yubico.YubiKit.Cli.Shared.Output;
using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Devices;
using Yubico.YubiKit.Management;

namespace Yubico.YubiKit.Cli.Commands.Infrastructure;
Expand Down
4 changes: 2 additions & 2 deletions src/Cli.Commands/src/Infrastructure/YkDeviceContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Licensed under the Apache License, Version 2.0.

using Yubico.YubiKit.Cli.Shared.Device;
using Yubico.YubiKit.Core.Interfaces;
using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Abstractions;
using Yubico.YubiKit.Core.Devices;
using Yubico.YubiKit.Management;

namespace Yubico.YubiKit.Cli.Commands.Infrastructure;
Expand Down
4 changes: 2 additions & 2 deletions src/Cli.Commands/src/Infrastructure/YkDeviceSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Licensed under the Apache License, Version 2.0.

using Yubico.YubiKit.Cli.Shared.Device;
using Yubico.YubiKit.Core.Interfaces;
using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Abstractions;
using Yubico.YubiKit.Core.Devices;

namespace Yubico.YubiKit.Cli.Commands.Infrastructure;

Expand Down
2 changes: 1 addition & 1 deletion src/Cli.Commands/src/Management/ManagementConfigCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Spectre.Console.Cli;
using Yubico.YubiKit.Cli.Commands.Infrastructure;
using Yubico.YubiKit.Cli.Shared.Output;
using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Devices;
using Yubico.YubiKit.Management;

namespace Yubico.YubiKit.Cli.Commands.Management;
Expand Down
2 changes: 1 addition & 1 deletion src/Cli.Commands/src/Management/ManagementInfoCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Spectre.Console.Cli;
using Yubico.YubiKit.Cli.Commands.Infrastructure;
using Yubico.YubiKit.Cli.Shared.Output;
using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Devices;
using Yubico.YubiKit.Management;

namespace Yubico.YubiKit.Cli.Commands.Management;
Expand Down
2 changes: 1 addition & 1 deletion src/Cli.Commands/src/Management/ManagementResetCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.ComponentModel;
using Yubico.YubiKit.Cli.Commands.Infrastructure;
using Yubico.YubiKit.Cli.Shared.Output;
using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Devices;
using Yubico.YubiKit.Management;

namespace Yubico.YubiKit.Cli.Commands.Management;
Expand Down
2 changes: 1 addition & 1 deletion src/Cli.Commands/src/Oath/OathCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Text;
using Yubico.YubiKit.Cli.Commands.Infrastructure;
using Yubico.YubiKit.Cli.Shared.Output;
using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Devices;
using Yubico.YubiKit.Oath;
using static Yubico.YubiKit.Cli.Commands.Oath.OathHelpers;

Expand Down
2 changes: 1 addition & 1 deletion src/Cli.Commands/src/OpenPgp/OpenPgpAccessCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Text;
using Yubico.YubiKit.Cli.Commands.Infrastructure;
using Yubico.YubiKit.Cli.Shared.Output;
using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Devices;
using Yubico.YubiKit.OpenPgp;
using static Yubico.YubiKit.Cli.Commands.OpenPgp.OpenPgpHelpers;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using System.Text;
using Yubico.YubiKit.Cli.Commands.Infrastructure;
using Yubico.YubiKit.Cli.Shared.Output;
using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Devices;
using Yubico.YubiKit.OpenPgp;
using static Yubico.YubiKit.Cli.Commands.OpenPgp.OpenPgpHelpers;

Expand Down
2 changes: 1 addition & 1 deletion src/Cli.Commands/src/OpenPgp/OpenPgpInfoCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Spectre.Console.Cli;
using Yubico.YubiKit.Cli.Commands.Infrastructure;
using Yubico.YubiKit.Cli.Shared.Output;
using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Devices;
using Yubico.YubiKit.OpenPgp;

namespace Yubico.YubiKit.Cli.Commands.OpenPgp;
Expand Down
2 changes: 1 addition & 1 deletion src/Cli.Commands/src/OpenPgp/OpenPgpKeysCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Text;
using Yubico.YubiKit.Cli.Commands.Infrastructure;
using Yubico.YubiKit.Cli.Shared.Output;
using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Devices;
using Yubico.YubiKit.OpenPgp;
using static Yubico.YubiKit.Cli.Commands.OpenPgp.OpenPgpHelpers;

Expand Down
2 changes: 1 addition & 1 deletion src/Cli.Commands/src/OpenPgp/OpenPgpResetCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.ComponentModel;
using Yubico.YubiKit.Cli.Commands.Infrastructure;
using Yubico.YubiKit.Cli.Shared.Output;
using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Devices;
using Yubico.YubiKit.OpenPgp;

namespace Yubico.YubiKit.Cli.Commands.OpenPgp;
Expand Down
2 changes: 1 addition & 1 deletion src/Cli.Commands/src/Otp/OtpCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Text;
using Yubico.YubiKit.Cli.Commands.Infrastructure;
using Yubico.YubiKit.Cli.Shared.Output;
using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Devices;
using Yubico.YubiKit.YubiOtp;

namespace Yubico.YubiKit.Cli.Commands.Otp;
Expand Down
2 changes: 1 addition & 1 deletion src/Cli.Commands/src/Piv/PivCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Security.Cryptography;
using Yubico.YubiKit.Cli.Commands.Infrastructure;
using Yubico.YubiKit.Cli.Shared.Output;
using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Devices;
using Yubico.YubiKit.Piv;

namespace Yubico.YubiKit.Cli.Commands.Piv;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
// Licensed under the Apache License, Version 2.0.

using Yubico.YubiKit.Cli.Commands.Infrastructure;
using Yubico.YubiKit.Core.Hid.Fido;
using Yubico.YubiKit.Core.Hid.Interfaces;
using Yubico.YubiKit.Core.Interfaces;
using Yubico.YubiKit.Core.SmartCard;
using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Protocols.Fido.Hid;
using Yubico.YubiKit.Core.Transports.Hid;
using Yubico.YubiKit.Core.Abstractions;
using Yubico.YubiKit.Core.Protocols.SmartCard.Apdu;
using Yubico.YubiKit.Core.Transports.SmartCard;
using Yubico.YubiKit.Core.Devices;
using Yubico.YubiKit.Management;

namespace Yubico.YubiKit.Cli.Commands.UnitTests.Infrastructure;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text;
using Yubico.YubiKit.Cli.Commands.Oath;
using Yubico.YubiKit.Cli.Shared.Output;
using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Devices;
using Yubico.YubiKit.Oath;

namespace Yubico.YubiKit.Cli.Commands.UnitTests.Oath;
Expand Down
2 changes: 1 addition & 1 deletion src/Cli.Shared/src/Cli/CommandHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Devices;

namespace Yubico.YubiKit.Cli.Shared.Cli;

Expand Down
2 changes: 1 addition & 1 deletion src/Cli.Shared/src/Cli/SessionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
using Spectre.Console;
using Yubico.YubiKit.Cli.Shared.Device;
using Yubico.YubiKit.Cli.Shared.Output;
using Yubico.YubiKit.Core.Interfaces;
using Yubico.YubiKit.Core.Abstractions;

namespace Yubico.YubiKit.Cli.Shared.Cli;

Expand Down
2 changes: 1 addition & 1 deletion src/Cli.Shared/src/Device/ConnectionTypeFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Yubico.YubiKit.Core.YubiKey;
using Yubico.YubiKit.Core.Devices;

namespace Yubico.YubiKit.Cli.Shared.Device;

Expand Down
Loading
Loading