agens-no / EllipticCurveKeyPair

Sign, verify, encrypt and decrypt using the Secure Enclave
Other
709 stars 115 forks source link

no prompts shown for face id auth on simulator #38

Open lsanil opened 5 years ago

lsanil commented 5 years ago

Thank you for great library. Learned a lot.

I am trying the sample on iOS simulator via XCode Version 10.1 (10B61). I configured Face ID in simulator. But I can't get Face ID prompt working for both sign or decrypt operations. Has anything changed recently in simulator behavior?

iOS device I selected in simulator: iPhoneXS Max Xcode version: 10.1 (10B61) Mac OSX version: macOS High Siera Version 10.13.6

hfossli commented 5 years ago

How does your config look? Can you share some code?

lsanil commented 5 years ago

sure, thank you for your reply. I downloaded the sample and tried on iOS simulator. Here is the config

 struct Shared {
        static let keypair: EllipticCurveKeyPair.Manager = {
            EllipticCurveKeyPair.logger = { print($0) }
            let publicAccessControl = EllipticCurveKeyPair.AccessControl(protection: kSecAttrAccessibleAlwaysThisDeviceOnly, flags: [])
            let privateAccessControl = EllipticCurveKeyPair.AccessControl(protection: kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly, flags: {
                return EllipticCurveKeyPair.Device.hasSecureEnclave ? [.userPresence, .privateKeyUsage] : [.userPresence]
            }())
            let config = EllipticCurveKeyPair.Config(
                publicLabel: "no.agens.sign.public",
                privateLabel: "no.agens.sign.private",
                operationPrompt: "Sign transaction",
                publicKeyAccessControl: publicAccessControl,
                privateKeyAccessControl: privateAccessControl,
                token: .secureEnclaveIfAvailable)
            return EllipticCurveKeyPair.Manager(config: config)
        }()
    }
lsanil commented 5 years ago

it looks it is issue only on simulator, on real iOS device, see this working properly.

hfossli commented 5 years ago

I don't remember if this is expected behavior. I think it is, but I am not entirely sure. What happens if you trigger LAContext methods on simulator? Does it show any UI?

Ashokkumarakg123 commented 3 years ago

What happens if you trigger LAContext methods on simulator? Does it show any UI?

yes it also appear on simulator.