Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Crash for users setting up new devices (broken keychain) #36

Closed
tristan-warner-smith opened this issue Feb 7, 2024 · 1 comment
Closed
Assignees
Labels
bug Something isn't working 🔍 need triage

Comments

@tristan-warner-smith
Copy link
Contributor

Describe the bug
A minority of users who swap devices, for whom apps using Magic SDK are automatically re-installed restore the keychain content, but do not enable access to it due to biometric signature differences.

This causes the DPop.swift line let signature = try! privateKey.signature(for: signingInputData) to crash irrecoverably.
In this case try retrieveKeyFromKeychain does not throw.

I raised a hopeful PR to patch the symptom but here's the Apple Forum reference that says they're aware of this issue but that you have you handle it yourself.

In the PR I prevent the crash, I'm not sure if this means you'll recreate the token later, or if the key would need to be explicitly removed as mentioned in the Apple Forum post above.

To Reproduce
Steps to reproduce the behavior:

  1. Install an app with an active, cached auth credential from the Magic SDK
  2. Buy a new device and use restore
  3. Attempt to access a login flow that references Magic.getIdToken
  4. See crash

Expected behavior
No crashes, a self-healing recoverable flow

Screenshots
If applicable, add screenshots to help explain your problem.
image
image

Environment

  • Package Version: 10.0.0
  • XCode Version: 15.2
  • Swift Version: 5.8
  • Simulator / Device OS: Device no OS specificity, os bug seems to have existed for several versions

Additional context

@tristan-warner-smith tristan-warner-smith changed the title Users Crash for users setting up new devices with transferred apps Feb 7, 2024
@tristan-warner-smith tristan-warner-smith changed the title Crash for users setting up new devices with transferred apps Crash for users setting up new devices (broken keychain) Feb 7, 2024
@Ariflo Ariflo assigned Ariflo and unassigned Ethella Feb 7, 2024
@romin-halltari romin-halltari added the bug Something isn't working label Feb 12, 2024
@Ariflo
Copy link
Contributor

Ariflo commented Feb 21, 2024

Fixed: #35

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working 🔍 need triage
Projects
None yet
Development

No branches or pull requests

4 participants