Commit e717139
authored
fix: properly decrypt legacy state blobs (#2472)
Fixes a problem where encrypted state blobs produced before
`keyMetadata` was added would fail to decrypt.
The encryptor would attempt to use the latest key derivation parameters
when no `keyMetadata` was passed in, causing a failure to decrypt:
https://github.com/MetaMask/metamask-extension/blob/ed5ec2d28f7e118803c6fdc74abe90db4e00f480/app/scripts/lib/encryptor-factory.ts#L78-L82
This PR simply falls back to the legacy key derivation parameters
whenever `keyMetadata` isn't present strictly for decryption purposes.
The default key derivation parameters are still in use for all
encryption.1 parent 1bf7e4f commit e717139
4 files changed
Lines changed: 52 additions & 3 deletions
File tree
- packages/snaps-controllers
- src/snaps
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
| |||
8178 | 8179 | | |
8179 | 8180 | | |
8180 | 8181 | | |
| 8182 | + | |
| 8183 | + | |
| 8184 | + | |
| 8185 | + | |
| 8186 | + | |
| 8187 | + | |
| 8188 | + | |
| 8189 | + | |
| 8190 | + | |
| 8191 | + | |
| 8192 | + | |
| 8193 | + | |
| 8194 | + | |
| 8195 | + | |
| 8196 | + | |
| 8197 | + | |
| 8198 | + | |
| 8199 | + | |
| 8200 | + | |
| 8201 | + | |
| 8202 | + | |
| 8203 | + | |
| 8204 | + | |
| 8205 | + | |
| 8206 | + | |
| 8207 | + | |
| 8208 | + | |
| 8209 | + | |
| 8210 | + | |
| 8211 | + | |
| 8212 | + | |
| 8213 | + | |
| 8214 | + | |
| 8215 | + | |
| 8216 | + | |
| 8217 | + | |
8181 | 8218 | | |
8182 | 8219 | | |
8183 | 8220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
132 | 135 | | |
133 | 136 | | |
134 | 137 | | |
| |||
1676 | 1679 | | |
1677 | 1680 | | |
1678 | 1681 | | |
1679 | | - | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
1680 | 1685 | | |
1681 | 1686 | | |
1682 | 1687 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
0 commit comments