Page MenuHomePhabricator

D12109.diff
No OneTemporary

D12109.diff

diff --git a/native/qr-code/qr-code-screen.react.js b/native/qr-code/qr-code-screen.react.js
--- a/native/qr-code/qr-code-screen.react.js
+++ b/native/qr-code/qr-code-screen.react.js
@@ -77,13 +77,14 @@
const generateQRCode = React.useCallback(async () => {
try {
- const rawAESKey: Uint8Array = await AES.generateKey();
+ const [ed25519, rawAESKey] = await Promise.all([
+ getContentSigningKey(),
+ AES.generateKey(),
+ ]);
const aesKeyAsHexString: string = uintArrayToHexString(rawAESKey);
- const ed25519Key: string = await getContentSigningKey();
-
- setUnauthorizedDeviceID(ed25519Key);
- setQRData({ deviceID: ed25519Key, aesKey: aesKeyAsHexString });
+ setUnauthorizedDeviceID(ed25519);
+ setQRData({ deviceID: ed25519, aesKey: aesKeyAsHexString });
} catch (err) {
console.error('Failed to generate QR Code:', err);
}
diff --git a/web/account/qr-code-login.react.js b/web/account/qr-code-login.react.js
--- a/web/account/qr-code-login.react.js
+++ b/web/account/qr-code-login.react.js
@@ -104,12 +104,10 @@
const generateQRCode = React.useCallback(async () => {
try {
- const ed25519 = await getContentSigningKey();
- if (!ed25519) {
- return;
- }
-
- const rawAESKey: Uint8Array = await generateKeyCommon(crypto);
+ const [ed25519, rawAESKey] = await Promise.all([
+ getContentSigningKey(),
+ generateKeyCommon(crypto),
+ ]);
const aesKeyAsHexString: string = uintArrayToHexString(rawAESKey);
setUnauthorizedDeviceID(ed25519);

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 3, 2:18 AM (21 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2609793
Default Alt Text
D12109.diff (1 KB)

Event Timeline