Page MenuHomePhabricator

D9450.diff
No OneTemporary

D9450.diff

diff --git a/keyserver/src/responders/keys-responders.js b/keyserver/src/responders/keys-responders.js
--- a/keyserver/src/responders/keys-responders.js
+++ b/keyserver/src/responders/keys-responders.js
@@ -20,7 +20,7 @@
import type { Viewer } from '../session/viewer.js';
import { fetchCallUpdateOlmAccount } from '../updaters/olm-account-updater.js';
-type AccountKeysSet = {
+type SessionInitializationKeysSet = {
+identityKeys: string,
...OlmSessionInitializationInfo,
};
@@ -44,16 +44,16 @@
return await fetchSessionPublicKeys(request.session);
}
-async function retrieveAccountKeysSet(
+function retrieveSessionInitializationKeysSet(
account: OlmAccount,
-): Promise<AccountKeysSet> {
+): SessionInitializationKeysSet {
const identityKeys = account.identity_keys();
const prekey = account.prekey();
const prekeySignature = account.prekey_signature();
if (!prekeySignature) {
- throw new ServerError('prekey_validation_failure');
+ throw new ServerError('invalid_prekey');
}
account.generate_one_time_keys(1);
@@ -73,7 +73,10 @@
prekey: notificationsPrekey,
prekeySignature: notificationsPrekeySignature,
oneTimeKey: notificationsOneTimeKey,
- } = await fetchCallUpdateOlmAccount('notifications', retrieveAccountKeysSet);
+ } = await fetchCallUpdateOlmAccount(
+ 'notifications',
+ retrieveSessionInitializationKeysSet,
+ );
const contentAccountCallback = async (account: OlmAccount) => {
const {
@@ -81,7 +84,7 @@
oneTimeKey,
prekey,
prekeySignature,
- } = await retrieveAccountKeysSet(account);
+ } = await retrieveSessionInitializationKeysSet(account);
const identityKeysBlob = {
primaryIdentityPublicKeys: JSON.parse(contentIdentityKeys),

File Metadata

Mime Type
text/plain
Expires
Sat, Sep 28, 9:21 PM (10 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2198016
Default Alt Text
D9450.diff (1 KB)

Event Timeline