File tree 3 files changed +5
-5
lines changed
packages/profile-sync-controller/src
3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import type {
11
11
StateMetadata ,
12
12
} from '@metamask/base-controller' ;
13
13
import { BaseController } from '@metamask/base-controller' ;
14
- import { encrypt } from '@metamask/eth-sig-util' ;
14
+ import { encrypt as ERC1024Encrypt } from '@metamask/eth-sig-util' ;
15
15
import {
16
16
type KeyringControllerGetStateAction ,
17
17
type KeyringControllerLockEvent ,
@@ -386,7 +386,7 @@ export default class UserStorageController extends BaseController<
386
386
return await this . #snapDecryptMessage( ciphertext ) ;
387
387
} ,
388
388
encryptMessage : async ( message : string , publicKeyHex : string ) => {
389
- const erc1024Payload = encrypt ( {
389
+ const erc1024Payload = ERC1024Encrypt ( {
390
390
// eth-sig-util expects the public key to be in base64 format
391
391
publicKey : byteArrayToBase64 ( hexToBytes ( publicKeyHex ) ) ,
392
392
data : message ,
Original file line number Diff line number Diff line change 1
1
import type { NotNamespacedBy } from '@metamask/base-controller' ;
2
2
import { Messenger } from '@metamask/base-controller' ;
3
- import { decrypt , type EthEncryptedData } from '@metamask/eth-sig-util' ;
3
+ import { decrypt as ERC1024Decrypt , type EthEncryptedData } from '@metamask/eth-sig-util' ;
4
4
import type { EthKeyring } from '@metamask/keyring-internal-api' ;
5
5
6
6
import type {
@@ -112,7 +112,7 @@ export function mockUserStorageMessenger(
112
112
Promise . resolve ( MOCK_ENCRYPTION_PUBLIC_KEY ) ,
113
113
) ;
114
114
const mockDecryptMessage = jest . fn ( ( data : EthEncryptedData ) => {
115
- return decrypt ( {
115
+ return ERC1024Decrypt ( {
116
116
encryptedData : data ,
117
117
privateKey : MOCK_ENCRYPTION_PRIVATE_KEY ,
118
118
} ) ;
Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ export class UserStorage {
160
160
return storageKey ;
161
161
}
162
162
// if no cache, fetch raw entry and decrypt using SRP storage key
163
- // using the SRP public key as a salt to avoid collisions.
163
+ // using the SRP encryption public key just as a salt to avoid collisions.
164
164
const srpKey = await this . config . encryption ?. getEncryptionPublicKey ( ) ;
165
165
let profileStorageKeyPath = null ;
166
166
if ( srpKey ) {
You can’t perform that action at this time.
0 commit comments