From ec2165f898fc6904c0d18b0378d4e9ea2b09cc9d Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Sat, 6 Nov 2021 16:08:54 -0700 Subject: [PATCH] Test --- SecretKit/SecureEnclave/SecureEnclaveStore.swift | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/SecretKit/SecureEnclave/SecureEnclaveStore.swift b/SecretKit/SecureEnclave/SecureEnclaveStore.swift index 2e42783..57e16a7 100644 --- a/SecretKit/SecureEnclave/SecureEnclaveStore.swift +++ b/SecretKit/SecureEnclave/SecureEnclaveStore.swift @@ -7,6 +7,14 @@ extension SecureEnclave { public class Store: SecretStoreModifiable { + private let context: LAContext = { + let context = LAContext() + context.localizedReason = "test" + context.localizedCancelTitle = "Deny" + context.touchIDAuthenticationAllowableReuseDuration = 60 * 60 + return context + }() + public var isAvailable: Bool { // For some reason, as of build time, CryptoKit.SecureEnclave.isAvailable always returns false // error msg "Received error sending GET UNIQUE DEVICE command" @@ -94,9 +102,6 @@ extension SecureEnclave { } public func sign(data: Data, with secret: SecretType, for provenance: SigningRequestProvenance) throws -> Data { - let context = LAContext() - context.localizedReason = "sign a request from \"\(provenance.origin.displayName)\" using secret \"\(secret.name)\"" - context.localizedCancelTitle = "Deny" let attributes = [ kSecClass: kSecClassKey, kSecAttrKeyClass: kSecAttrKeyClassPrivate,