From 4ab3783a15d0cfc5ca211f861c82403065c15044 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Sun, 7 Nov 2021 12:24:42 -0800 Subject: [PATCH 1/2] Switch to Xcode 13.1 (#254) * Update release.yml * Update test.yml --- .github/workflows/release.yml | 4 ++-- .github/workflows/test.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4e2fba8..f6d49ba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} run: ./.github/scripts/signing.sh - name: Set Environment - run: sudo xcrun xcode-select -s /Applications/Xcode_13.0.app + run: sudo xcrun xcode-select -s /Applications/Xcode_13.1.app - name: Test run: xcrun xcodebuild test -project Secretive.xcodeproj -scheme Secretive build: @@ -38,7 +38,7 @@ jobs: APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} run: ./.github/scripts/signing.sh - name: Set Environment - run: sudo xcrun xcode-select -s /Applications/Xcode_13.0.app + run: sudo xcrun xcode-select -s /Applications/Xcode_13.1.app - name: Update Build Number env: TAG_NAME: ${{ github.ref }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7076468..95579d8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,6 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set Environment - run: sudo xcrun xcode-select -s /Applications/Xcode_13.0.app + run: sudo xcrun xcode-select -s /Applications/Xcode_13.1.app - name: Test run: xcrun xcodebuild test -project Secretive.xcodeproj -scheme Secretive From faed5514e28b5cc239786487e9c3773c1eb3a793 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Sun, 7 Nov 2021 12:27:18 -0800 Subject: [PATCH 2/2] Add driver name when on macOS 12.0 (#223) --- SecretKit/SmartCard/SmartCardStore.swift | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/SecretKit/SmartCard/SmartCardStore.swift b/SecretKit/SmartCard/SmartCardStore.swift index 236ec0c..e56c862 100644 --- a/SecretKit/SmartCard/SmartCardStore.swift +++ b/SecretKit/SmartCard/SmartCardStore.swift @@ -9,7 +9,6 @@ extension SmartCard { public class Store: SecretStore { - // TODO: Read actual smart card name, eg "YubiKey 5c" @Published public var isAvailable: Bool = false public let id = UUID() public private(set) var name = NSLocalizedString("Smart Card", comment: "Smart Card") @@ -103,12 +102,22 @@ extension SmartCard.Store { private func loadSecrets() { guard let tokenID = tokenID else { return } - // Hack to read name if there's only one smart card - let slotNames = TKSmartCardSlotManager().slotNames - if watcher.nonSecureEnclaveTokens.count == 1 && slotNames.count == 1 { - name = slotNames.first! + + let fallbackName = NSLocalizedString("Smart Card", comment: "Smart Card") + if #available(macOS 12.0, *) { + if let driverName = watcher.tokenInfo(forTokenID: tokenID)?.driverName { + name = driverName + } else { + name = fallbackName + } } else { - name = NSLocalizedString("Smart Card", comment: "Smart Card") + // Hack to read name if there's only one smart card + let slotNames = TKSmartCardSlotManager().slotNames + if watcher.nonSecureEnclaveTokens.count == 1 && slotNames.count == 1 { + name = slotNames.first! + } else { + name = fallbackName + } } let attributes = [