Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3399200
D12109.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D12109.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D12109: [native][web] Fetch AES key and device ID in parallel in generateQRCode
Attached
Detach File
Event Timeline
Log In to Comment