Skip to content

Commit aef8022

Browse files
committed
Fix warnings
1 parent b7fdef6 commit aef8022

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

FullStackTests/Tests/PIVFullStackTests.swift

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ struct PIVFullStackTests {
148148
)
149149

150150
// Convert YubiKit public key to CryptoKit for verification
151-
let cryptoKitPublicKey = try Signing.PublicKey(rawRepresentation: ed25519PublicKey.keyData)
151+
let cryptoKitPublicKey = try Curve25519.Signing.PublicKey(rawRepresentation: ed25519PublicKey.keyData)
152152
#expect(cryptoKitPublicKey.isValidSignature(signature, for: testMessage))
153153
}
154154
}
@@ -211,7 +211,7 @@ struct PIVFullStackTests {
211211
}
212212

213213
// Generate X25519 key using CryptoKit
214-
let cryptoKitPrivateKey = KeyAgreement.PrivateKey()
214+
let cryptoKitPrivateKey = Curve25519.KeyAgreement.PrivateKey()
215215
let cryptoKitPublicKey = cryptoKitPrivateKey.publicKey
216216

217217
// Convert to YubiKit format
@@ -226,7 +226,7 @@ struct PIVFullStackTests {
226226

227227
// Calculate shared secret using CryptoKit
228228
let softwareSecret = try cryptoKitPrivateKey.sharedSecretFromKeyAgreement(
229-
with: KeyAgreement.PublicKey(rawRepresentation: yubiKeyPublicKey.keyData)
229+
with: Curve25519.KeyAgreement.PublicKey(rawRepresentation: yubiKeyPublicKey.keyData)
230230
)
231231
let softwareSecretData = softwareSecret.withUnsafeBytes { Data($0) }
232232

@@ -313,7 +313,7 @@ struct PIVFullStackTests {
313313
try requireFeatureSupport(PIVSessionFeature.ed25519, in: session)
314314

315315
// Generate Ed25519 key using CryptoKit
316-
let cryptoKitPrivateKey = Signing.PrivateKey()
316+
let cryptoKitPrivateKey = Curve25519.Signing.PrivateKey()
317317
let cryptoKitPublicKey = cryptoKitPrivateKey.publicKey
318318

319319
// Convert to YubiKit format
@@ -355,7 +355,7 @@ struct PIVFullStackTests {
355355
try requireFeatureSupport(PIVSessionFeature.x25519, in: session)
356356

357357
// Generate X25519 key using CryptoKit
358-
let cryptoKitPrivateKey = KeyAgreement.PrivateKey()
358+
let cryptoKitPrivateKey = Curve25519.KeyAgreement.PrivateKey()
359359
let cryptoKitPublicKey = cryptoKitPrivateKey.publicKey
360360

361361
// Convert to YubiKit format
@@ -379,7 +379,7 @@ struct PIVFullStackTests {
379379
#expect(keyType == PIV.X25519Key.x25519)
380380

381381
// Test key agreement with the imported key
382-
let otherCryptoKitPrivateKey = KeyAgreement.PrivateKey()
382+
let otherCryptoKitPrivateKey = Curve25519.KeyAgreement.PrivateKey()
383383
let otherCryptoKitPublicKey = otherCryptoKitPrivateKey.publicKey
384384
let otherPublicKeyData = otherCryptoKitPublicKey.rawRepresentation
385385

@@ -535,7 +535,6 @@ struct PIVFullStackTests {
535535
#expect(attestKey == publicKey)
536536
} else {
537537
// Just verify that the certificate was generated successfully
538-
#expect(cert.der != nil)
539538
#expect(cert.der.count > 0)
540539
}
541540
}

YubiKit/YubiKit/Management/DeviceConfig.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import CryptoTokenKit
1616
import Foundation
1717

1818
/// Describes the configuration of a YubiKey which can be altered via the Management application.
19-
public struct DeviceConfig {
19+
public struct DeviceConfig: Sendable {
2020

2121
/// The timeout used when in CCID-only mode with flag eject enabled.
2222
public let autoEjectTimeout: TimeInterval?

YubiKit/YubiKit/Management/DeviceInfo.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ import CryptoTokenKit
1616
import Foundation
1717

1818
/// Identifies the type of data transport a YubiKey is using.
19-
public enum DeviceTransport {
19+
public enum DeviceTransport: Sendable {
2020
case usb, nfc
2121
}
2222

2323
/// The physical form factor of a YubiKey.
24-
public enum FormFactor: UInt8 {
24+
public enum FormFactor: UInt8, Sendable {
2525
/// Used when information about the YubiKey's form factor isn't available.
2626
case unknown = 0x00
2727
/// A keychain-sized YubiKey with a USB-A connector.
@@ -41,7 +41,7 @@ public enum FormFactor: UInt8 {
4141
}
4242

4343
/// Contains metadata, including Device Configuration, of a YubiKey.
44-
public struct DeviceInfo: CustomStringConvertible {
44+
public struct DeviceInfo: Sendable, CustomStringConvertible {
4545

4646
public var description: String {
4747
"""

YubiKit/YubiKit/PIV/PIVDataTypes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public enum PIV {
210210
}
211211

212212
/// Metadata about a Bio multi-protocol YubiKey.
213-
public struct BioMetadata {
213+
public struct BioMetadata: Sendable {
214214
/// Indicates whether biometrics are configured or not (fingerprints enrolled or not).
215215
///
216216
/// A false return value indicates a YubiKey Bio without biometrics configured and hence the

0 commit comments

Comments
 (0)