voidlogue-crypto 2.0.4 → 2.0.5
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/package.json +1 -1
- package/src/vault.ts +11 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "voidlogue-crypto",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "Open-source client-side cryptographic primitives for Voidlogue — published for independent audit and verification of privacy claims.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
package/src/vault.ts
CHANGED
|
@@ -259,18 +259,18 @@ export const Vault = {
|
|
|
259
259
|
roomHash: string,
|
|
260
260
|
email: string,
|
|
261
261
|
codename: string,
|
|
262
|
-
newPin: string
|
|
262
|
+
newPin: string,
|
|
263
|
+
existingHintEntry?: LabelEntry
|
|
263
264
|
): Promise<boolean> {
|
|
264
|
-
|
|
265
|
-
//
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
);
|
|
265
|
+
// Save as ghost (no hint) — avoids re-encrypting the label under the new
|
|
266
|
+
// PIN key, which would create a new index entry and make ghosts visible.
|
|
267
|
+
const ok = await this.save(roomHash, email, codename, newPin, '');
|
|
268
|
+
// If the caller supplies the original encrypted label entry, restore it
|
|
269
|
+
// verbatim — no re-encryption needed since labels are keyed independently.
|
|
270
|
+
if (ok && existingHintEntry?.encrypted) {
|
|
271
|
+
await this._updateIndex(roomHash, existingHintEntry);
|
|
272
|
+
}
|
|
273
|
+
return ok;
|
|
274
274
|
},
|
|
275
275
|
|
|
276
276
|
async updateLabel(
|