Require more provisioning fields when linking
This commit is contained in:
parent
534029d2e6
commit
8d07fa840c
1 changed files with 8 additions and 9 deletions
|
@ -124,7 +124,7 @@ type CreateAccountSharedOptionsType = Readonly<{
|
||||||
aciKeyPair: KeyPairType;
|
aciKeyPair: KeyPairType;
|
||||||
pniKeyPair: KeyPairType;
|
pniKeyPair: KeyPairType;
|
||||||
profileKey: Uint8Array;
|
profileKey: Uint8Array;
|
||||||
masterKey: Uint8Array | undefined;
|
masterKey: Uint8Array;
|
||||||
backupFile?: Uint8Array;
|
backupFile?: Uint8Array;
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
@ -428,8 +428,9 @@ export default class AccountManager extends EventTarget {
|
||||||
!provisionMessage.provisioningCode ||
|
!provisionMessage.provisioningCode ||
|
||||||
!provisionMessage.aciKeyPair ||
|
!provisionMessage.aciKeyPair ||
|
||||||
!provisionMessage.pniKeyPair ||
|
!provisionMessage.pniKeyPair ||
|
||||||
!provisionMessage.profileKey ||
|
|
||||||
!provisionMessage.aci ||
|
!provisionMessage.aci ||
|
||||||
|
!Bytes.isNotEmpty(provisionMessage.profileKey) ||
|
||||||
|
!Bytes.isNotEmpty(provisionMessage.masterKey) ||
|
||||||
!isUntaggedPniString(provisionMessage.untaggedPni)
|
!isUntaggedPniString(provisionMessage.untaggedPni)
|
||||||
) {
|
) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
@ -1261,13 +1262,11 @@ export default class AccountManager extends EventTarget {
|
||||||
if (userAgent) {
|
if (userAgent) {
|
||||||
await storage.put('userAgent', userAgent);
|
await storage.put('userAgent', userAgent);
|
||||||
}
|
}
|
||||||
if (masterKey) {
|
await storage.put('masterKey', Bytes.toBase64(masterKey));
|
||||||
await storage.put('masterKey', Bytes.toBase64(masterKey));
|
await storage.put(
|
||||||
await storage.put(
|
'storageKey',
|
||||||
'storageKey',
|
Bytes.toBase64(deriveStorageServiceKey(masterKey))
|
||||||
Bytes.toBase64(deriveStorageServiceKey(masterKey))
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
await storage.put('read-receipt-setting', Boolean(readReceipts));
|
await storage.put('read-receipt-setting', Boolean(readReceipts));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue