EllipticCurveKeyPair icon indicating copy to clipboard operation
EllipticCurveKeyPair copied to clipboard

SecItemCopyMatching not works in iphone 12

Open MajidAlNuumani opened this issue 4 years ago • 6 comments

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.

MajidAlNuumani avatar Jan 12 '21 10:01 MajidAlNuumani

Threading issues?

Håvard

  1. jan. 2021 kl. 11:20 skrev MajidAlNuumani [email protected]:

 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.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

hfossli avatar Jan 12 '21 11:01 hfossli

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?

MajidAlNuumani avatar Jan 13 '21 08:01 MajidAlNuumani

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

hfossli avatar Jan 13 '21 12:01 hfossli

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

MajidAlNuumani avatar Jan 13 '21 14:01 MajidAlNuumani

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 avatar Jan 14 '21 08:01 MajidAlNuumani

Can any one help in this issue?

MajidAlNuumani avatar Jan 18 '21 06:01 MajidAlNuumani