diff --git a/keyserver/src/keyserver.js b/keyserver/src/keyserver.js --- a/keyserver/src/keyserver.js +++ b/keyserver/src/keyserver.js @@ -84,7 +84,7 @@ if (shouldDisplayQRCodeInTerminal) { try { - const aes256Key = crypto.randomBytes(32); + const aes256Key = crypto.randomBytes(32).toString('hex'); const ed25519Key = 'ed25519Key'; const url = qrCodeLinkURL(aes256Key, ed25519Key); diff --git a/lib/facts/links.js b/lib/facts/links.js --- a/lib/facts/links.js +++ b/lib/facts/links.js @@ -6,7 +6,7 @@ } /* QR Code */ -function qrCodeLinkURL(aes256Param: Uint8Array, ed25519Param: string): string { +function qrCodeLinkURL(aes256Param: string, ed25519Param: string): string { const keys = { aes256: aes256Param, ed25519: ed25519Param, 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 @@ -5,6 +5,7 @@ import QRCode from 'react-native-qrcode-svg'; import { qrCodeLinkURL } from 'lib/facts/links.js'; +import { uintArrayToHexString } from 'lib/media/data-utils.js'; import type { QRCodeSignInNavigationProp } from './qr-code-sign-in-navigator.react.js'; import type { NavigationRoute } from '../navigation/route-names.js'; @@ -23,7 +24,9 @@ const generateQRCode = React.useCallback(async () => { try { - const aes256Key: Uint8Array = await AES.generateKey(); + const aes256: Uint8Array = await AES.generateKey(); + const aes256Key: string = uintArrayToHexString(aes256); + const ed25519Key: string = await getContentSigningKey(); const url = qrCodeLinkURL(aes256Key, ed25519Key); 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 @@ -4,6 +4,7 @@ import * as React from 'react'; import { qrCodeLinkURL } from 'lib/facts/links.js'; +import { uintArrayToHexString } from 'lib/media/data-utils.js'; import css from './qr-code-login.css'; import { generateKey } from '../media/aes-crypto-utils.js'; @@ -21,7 +22,9 @@ return; } - const aes256Key: Uint8Array = await generateKey(); + const aes256: Uint8Array = await generateKey(); + const aes256Key: string = uintArrayToHexString(aes256); + const url = qrCodeLinkURL(aes256Key, ed25519Key); setQrCodeValue(url); } catch (err) {