Commit 3f2a950
Prevent overwriting encryption keys (#603)
* Lazily load encryption key to avoid fresh-install reset race (#601)
Delay encryption key initialization until first use, preventing key creation before fresh-install keychain reset during SDK configure.
Co-authored-by: Łukasz Śliwiński <lukasz.sliwinski@withintent.com>
* Add guardrails around encryption key retrieval to ensure we don't overwrite a key just because the keychain was not yet available
* Update test
* Lint
---------
Co-authored-by: Sailor-Saturn <46728174+Sailor-Saturn@users.noreply.github.com>
Co-authored-by: Łukasz Śliwiński <lukasz.sliwinski@withintent.com>1 parent 9a8b6bf commit 3f2a950
File tree
4 files changed
+46
-12
lines changed- Sources/StytchCore
- KeychainClient
- Tests/StytchCoreTests
4 files changed
+46
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
Lines changed: 31 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
14 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
15 | 40 | | |
16 | 41 | | |
17 | 42 | | |
| |||
25 | 50 | | |
26 | 51 | | |
27 | 52 | | |
28 | | - | |
29 | 53 | | |
30 | 54 | | |
31 | 55 | | |
32 | 56 | | |
33 | 57 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | 58 | | |
41 | 59 | | |
42 | 60 | | |
| |||
45 | 63 | | |
46 | 64 | | |
47 | 65 | | |
48 | | - | |
| 66 | + | |
49 | 67 | | |
50 | 68 | | |
51 | 69 | | |
52 | | - | |
| 70 | + | |
53 | 71 | | |
54 | 72 | | |
55 | 73 | | |
56 | 74 | | |
57 | | - | |
| 75 | + | |
| 76 | + | |
58 | 77 | | |
59 | | - | |
| 78 | + | |
60 | 79 | | |
61 | 80 | | |
62 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
72 | 79 | | |
73 | 80 | | |
74 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
9 | 15 | | |
10 | 16 | | |
11 | 17 | | |
| |||
0 commit comments