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 @@ -19,7 +19,6 @@ import { verifyClientSupported } from '../session/version.js'; import type { Viewer } from '../session/viewer.js'; import { fetchCallUpdateOlmAccount } from '../updaters/olm-account-updater.js'; -import { validateAccountPrekey } from '../utils/olm-utils.js'; type AccountKeysSet = { +identityKeys: string, @@ -50,7 +49,6 @@ ): Promise { const identityKeys = account.identity_keys(); - await validateAccountPrekey(account); const prekey = account.prekey(); const prekeySignature = account.prekey_signature(); diff --git a/keyserver/src/user/login.js b/keyserver/src/user/login.js --- a/keyserver/src/user/login.js +++ b/keyserver/src/user/login.js @@ -14,10 +14,7 @@ } from './identity.js'; import { getMessageForException } from '../responders/utils.js'; import { fetchCallUpdateOlmAccount } from '../updaters/olm-account-updater.js'; -import { - getAccountPrekeysSet, - validateAccountPrekey, -} from '../utils/olm-utils.js'; +import { getAccountPrekeysSet } from '../utils/olm-utils.js'; type UserCredentials = { +username: string, +password: string }; @@ -31,7 +28,6 @@ function retrieveAccountKeysSet(account: OlmAccount): AccountKeysSet { const identityKeys = account.identity_keys(); - validateAccountPrekey(account); const { prekey, prekeySignature } = getAccountPrekeysSet(account); if (!prekeySignature || !prekey) { diff --git a/keyserver/src/utils/olm-utils.js b/keyserver/src/utils/olm-utils.js --- a/keyserver/src/utils/olm-utils.js +++ b/keyserver/src/utils/olm-utils.js @@ -134,15 +134,6 @@ return cachedOLMUtility; } -function validateAccountPrekey(account: OlmAccount) { - if (shouldRotatePrekey(account)) { - account.generate_prekey(); - } - if (shouldForgetPrekey(account)) { - account.forget_old_prekey(); - } -} - async function uploadNewOneTimeKeys(numberOfKeys: number) { const [rustAPI, identityInfo, deviceID] = await Promise.all([ getRustAPI(), @@ -266,7 +257,6 @@ getOlmUtility, unpickleOlmAccount, unpickleOlmSession, - validateAccountPrekey, uploadNewOneTimeKeys, getContentSigningKey, getAccountPrekeysSet,