@oxy.so/core 7.30.0 → 7.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/identity.js +146 -23
- package/dist/cjs/crypto/identityMarker.js +15 -0
- package/dist/cjs/crypto/index.js +7 -2
- package/dist/cjs/crypto/keyManager.js +7 -10
- package/dist/cjs/crypto/keychainGroupMigration.js +327 -160
- package/dist/cjs/crypto/organizationKeys.js +33 -5
- package/dist/cjs/crypto/retiredKeys.js +80 -18
- package/dist/cjs/session/authStateStore.js +13 -0
- package/dist/cjs/session/index.js +5 -2
- package/dist/cjs/utils/keychainAccessGroups.js +208 -51
- package/dist/esm/api/identity.js +146 -23
- package/dist/esm/crypto/identityMarker.js +14 -0
- package/dist/esm/crypto/index.js +3 -3
- package/dist/esm/crypto/keyManager.js +9 -12
- package/dist/esm/crypto/keychainGroupMigration.js +327 -162
- package/dist/esm/crypto/organizationKeys.js +34 -6
- package/dist/esm/crypto/retiredKeys.js +76 -17
- package/dist/esm/session/authStateStore.js +12 -0
- package/dist/esm/session/index.js +1 -1
- package/dist/esm/utils/keychainAccessGroups.js +205 -51
- package/dist/types/api/identity.d.ts +36 -0
- package/dist/types/crypto/identityMarker.d.ts +8 -0
- package/dist/types/crypto/index.d.ts +4 -4
- package/dist/types/crypto/keychainGroupMigration.d.ts +28 -6
- package/dist/types/crypto/organizationKeys.d.ts +4 -2
- package/dist/types/crypto/retiredKeys.d.ts +30 -4
- package/dist/types/session/authStateStore.d.ts +9 -0
- package/dist/types/session/index.d.ts +2 -2
- package/dist/types/utils/keychainAccessGroups.d.ts +108 -26
- package/package.json +2 -2
- package/src/api/identity.ts +185 -40
- package/src/crypto/identityMarker.ts +15 -0
- package/src/crypto/index.ts +10 -1
- package/src/crypto/keyManager.ts +9 -15
- package/src/crypto/keychainGroupMigration.ts +396 -186
- package/src/crypto/organizationKeys.ts +38 -6
- package/src/crypto/retiredKeys.ts +87 -17
- package/src/session/authStateStore.ts +14 -0
- package/src/session/index.ts +8 -1
- package/src/utils/keychainAccessGroups.ts +276 -52
|
@@ -11,9 +11,9 @@ import { isDev, logger } from '../logger/index.js';
|
|
|
11
11
|
import { deriveScopedSeedFromKey, signSocialReceiveDigest } from './identityDerivations.js';
|
|
12
12
|
import { registerIdentitySignerStore } from './identitySigner.js';
|
|
13
13
|
import { getOrganizationPrivateKey, isOrganizationAccountId } from './organizationKeys.js';
|
|
14
|
-
import {
|
|
14
|
+
import { getRetiredPrivateKey, retiredKeyScope } from './retiredKeys.js';
|
|
15
15
|
import { groupedKeychainStore, resolveKeychainAccess, } from '../utils/keychainAccessGroups.js';
|
|
16
|
-
import {
|
|
16
|
+
import { prepareKeychainAccess } from './keychainGroupMigration.js';
|
|
17
17
|
import { RECOVERY_MNEMONIC_KEYCHAIN_SERVICE, RECOVERY_MNEMONIC_STORAGE_KEY, STORAGE_KEYS, V2_BACKUP_KEYCHAIN_SERVICE, V2_PRIMARY_KEYCHAIN_SERVICE, V2_STORAGE_KEYS, } from './keychainItems.js';
|
|
18
18
|
import { clearIdentityMarker, readIdentityMarker, updateIdentityMarker, writeIdentityMarker, } from './identityMarker.js';
|
|
19
19
|
import { DEVICE_BACKUP_VERSION, parseDeviceBackup, serializeDeviceBackup, } from './deviceBackup.js';
|
|
@@ -172,9 +172,7 @@ async function loadRawSecureStore() {
|
|
|
172
172
|
async function keychainItemStore(item) {
|
|
173
173
|
const raw = await loadRawSecureStore();
|
|
174
174
|
const access = await resolveKeychainAccess();
|
|
175
|
-
|
|
176
|
-
await ensureKeychainGroupsMigrated();
|
|
177
|
-
}
|
|
175
|
+
await prepareKeychainAccess(access);
|
|
178
176
|
return groupedKeychainStore(raw, access, item);
|
|
179
177
|
}
|
|
180
178
|
/** The store for the identity slots (primary, backup, legacy, phrase): Commons only on iOS. */
|
|
@@ -2050,13 +2048,12 @@ export class KeyManager {
|
|
|
2050
2048
|
if (force) {
|
|
2051
2049
|
await KeyManager._bestEffortDeleteBackupsAllGenerations(store);
|
|
2052
2050
|
await KeyManager._clearSharedSlot(store);
|
|
2053
|
-
// The
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
}
|
|
2051
|
+
// The retired ring is NOT cleared (R4-4): it is money under the person's
|
|
2052
|
+
// previous keys, and "Start over" or a forced delete must not cost it.
|
|
2053
|
+
// The same person restoring their identity finds it again; a different
|
|
2054
|
+
// identity on this phone cannot use it (each entry is checked against
|
|
2055
|
+
// that account's key history before use). Only deleting the Oxy ACCOUNT
|
|
2056
|
+
// clears it, explicitly (`forgetRetiredIdentityKeys`, Commons' flow).
|
|
2060
2057
|
}
|
|
2061
2058
|
// The device backup goes on EVERY delete, forced or not: it is restored
|
|
2062
2059
|
// silently, so leaving it would bring a deleted identity back on the next
|