Commit 8b2afaa
committed
refactor(sdk-core): clean up backup key fallback in upgradeEncryption (WCN-174)
The retry-with-original-passphrase fallback is specific to keys encrypted
at wallet creation (backup key, boxA, boxB — these are never re-encrypted
on password change). It doesn't belong on the generic Keychains.reencryptAsV2
primitive, which was leaking backup-key context into its error message.
- Keychains.reencryptAsV2 is now a pure primitive: decrypt with
passphrase, re-encrypt as v2, surface errors directly
- Fallback moves to a private Wallet.reencryptCreationTimeKey helper,
used only for backup/boxA/boxB paths where the semantics apply
- Error messages now name the specific key that failed to decrypt
TICKET: WCN-1741 parent 364e027 commit 8b2afaa
4 files changed
Lines changed: 59 additions & 46 deletions
File tree
- modules
- bitgo/test/v2/unit
- sdk-core/src/bitgo
- keychain
- wallet
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1197 | 1197 | | |
1198 | 1198 | | |
1199 | 1199 | | |
1200 | | - | |
| 1200 | + | |
1201 | 1201 | | |
1202 | 1202 | | |
1203 | 1203 | | |
| |||
1207 | 1207 | | |
1208 | 1208 | | |
1209 | 1209 | | |
1210 | | - | |
1211 | | - | |
1212 | | - | |
1213 | | - | |
1214 | | - | |
1215 | | - | |
1216 | | - | |
1217 | | - | |
1218 | | - | |
1219 | | - | |
1220 | | - | |
1221 | | - | |
1222 | | - | |
1223 | | - | |
1224 | | - | |
1225 | | - | |
1226 | | - | |
1227 | | - | |
1228 | | - | |
1229 | | - | |
1230 | | - | |
1231 | | - | |
1232 | | - | |
1233 | | - | |
1234 | 1210 | | |
1235 | 1211 | | |
1236 | 1212 | | |
| |||
1240 | 1216 | | |
1241 | 1217 | | |
1242 | 1218 | | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
1243 | 1224 | | |
1244 | 1225 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | | - | |
| 252 | + | |
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
216 | | - | |
217 | | - | |
| 215 | + | |
| 216 | + | |
218 | 217 | | |
219 | 218 | | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
220 | 222 | | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
| 223 | + | |
| 224 | + | |
235 | 225 | | |
236 | 226 | | |
237 | 227 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3523 | 3523 | | |
3524 | 3524 | | |
3525 | 3525 | | |
3526 | | - | |
| 3526 | + | |
| 3527 | + | |
| 3528 | + | |
| 3529 | + | |
| 3530 | + | |
| 3531 | + | |
3527 | 3532 | | |
3528 | 3533 | | |
3529 | 3534 | | |
| |||
3558 | 3563 | | |
3559 | 3564 | | |
3560 | 3565 | | |
3561 | | - | |
| 3566 | + | |
| 3567 | + | |
| 3568 | + | |
| 3569 | + | |
| 3570 | + | |
| 3571 | + | |
3562 | 3572 | | |
3563 | 3573 | | |
3564 | 3574 | | |
3565 | 3575 | | |
3566 | 3576 | | |
3567 | | - | |
| 3577 | + | |
| 3578 | + | |
| 3579 | + | |
| 3580 | + | |
| 3581 | + | |
| 3582 | + | |
3568 | 3583 | | |
3569 | 3584 | | |
3570 | 3585 | | |
| |||
3587 | 3602 | | |
3588 | 3603 | | |
3589 | 3604 | | |
| 3605 | + | |
| 3606 | + | |
| 3607 | + | |
| 3608 | + | |
| 3609 | + | |
| 3610 | + | |
| 3611 | + | |
| 3612 | + | |
| 3613 | + | |
| 3614 | + | |
| 3615 | + | |
| 3616 | + | |
| 3617 | + | |
| 3618 | + | |
| 3619 | + | |
| 3620 | + | |
| 3621 | + | |
| 3622 | + | |
| 3623 | + | |
| 3624 | + | |
| 3625 | + | |
| 3626 | + | |
| 3627 | + | |
| 3628 | + | |
| 3629 | + | |
| 3630 | + | |
| 3631 | + | |
3590 | 3632 | | |
3591 | 3633 | | |
3592 | 3634 | | |
| |||
0 commit comments