This commit is contained in:
Max Goedjen 2021-11-06 16:08:54 -07:00
parent 88b7ef82da
commit ec2165f898
No known key found for this signature in database
GPG Key ID: E58C21DD77B9B8E8
1 changed files with 8 additions and 3 deletions

View File

@ -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,