mirror of
https://github.com/maxgoedjen/secretive.git
synced 2025-04-18 05:22:11 +00:00
Add driver name when on macOS 12.0
This commit is contained in:
parent
c5bd4c2189
commit
341b6d9405
@ -103,12 +103,22 @@ extension SmartCard.Store {
|
|||||||
|
|
||||||
private func loadSecrets() {
|
private func loadSecrets() {
|
||||||
guard let tokenID = tokenID else { return }
|
guard let tokenID = tokenID else { return }
|
||||||
// Hack to read name if there's only one smart card
|
|
||||||
let slotNames = TKSmartCardSlotManager().slotNames
|
let fallbackName = NSLocalizedString("Smart Card", comment: "Smart Card")
|
||||||
if watcher.nonSecureEnclaveTokens.count == 1 && slotNames.count == 1 {
|
if #available(macOS 12.0, *) {
|
||||||
name = slotNames.first!
|
if let driverName = watcher.tokenInfo(forTokenID: tokenID)?.driverName {
|
||||||
|
name = driverName
|
||||||
|
} else {
|
||||||
|
name = fallbackName
|
||||||
|
}
|
||||||
} else {
|
} 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 = [
|
let attributes = [
|
||||||
|
Loading…
Reference in New Issue
Block a user