Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SecItemCopyMatching not works in iphone 12 #53

Open
MajidAlNuumani opened this issue Jan 12, 2021 · 6 comments
Open

SecItemCopyMatching not works in iphone 12 #53

MajidAlNuumani opened this issue Jan 12, 2021 · 6 comments

Comments

@MajidAlNuumani
Copy link

MajidAlNuumani commented Jan 12, 2021

I face issue with Face Id in some of iphone 12 pro and pro max the issue happen in SecKeyCreateSignature not generate signature but it works fine in different iphones like iphone 11.

even I cannot get the Face Id prompt.

my app not show in Face id & Passcode -> other apps.

In iphone 12 pro not in all device happen only a few devices.

@hfossli
Copy link
Contributor

hfossli commented Jan 12, 2021 via email

@MajidAlNuumani
Copy link
Author

I am not sure but here is my code:

Singing data code:
private func Signing(dataToBeSigned: String) -> String { do { let digest = dataToBeSigned.data(using: .utf8)! let singedData = try Shared.keypair.sign(digest, hash: .sha256) let signature = singedData.base64EncodedString() return signature } catch { return "Cannot sign data" } }

I call it from this code:
if(call.method == "Register") { guard let args = call.arguments else { return } if let myArgs = args as? [String: Any], let blaBla1 = myArgs["blaBla1"] as? String, let BlaBla2 = myArgs["BlaBla2"] as? String { let signatureBla1 = self?.Signing(dataToBeSigned: blaBla1) let signatureBla2 = self?.Signing(dataToBeSigned: BlaBla2) let publicKey = self?.getPublicKey() var list = [String]() list.append(publicKey!) list.append(signatureBla1!) list.append(signatureBla2!) result(list) } else { result("iOS could not extract flutter arguments in method: (sendParams)") } self?.Register(result: result)

call.method == "Register" is use to call Register Function from Flutter using MethodChannel.

Can you help if this issue happen because of threads?

@hfossli
Copy link
Contributor

hfossli commented Jan 13, 2021

I would check that all the if let's are valid and unwrapped correctly. I don't understand if this compiles because dataToBeSigned expects Data not String

@MajidAlNuumani
Copy link
Author

Yes but I convert it to Data in Signing function here dataToBeSigned.data(using: .utf8)!

@MajidAlNuumani
Copy link
Author

MajidAlNuumani commented Jan 14, 2021

Hello All,

I got an update in this thread.

I got status error -25300 when call this:

let status = SecItemCopyMatching(query as CFDictionary, &raw)

Any help why this happen in some of iPhone 12 pro and most of iPhone 12 pro max?

@MajidAlNuumani MajidAlNuumani changed the title Face Id not work SecItemCopyMatching not works in iphone 12 Jan 14, 2021
@MajidAlNuumani
Copy link
Author

Can any one help in this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants