voidlogue-crypto 2.0.3 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/vault.ts +18 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "voidlogue-crypto",
3
- "version": "2.0.3",
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
@@ -175,8 +175,13 @@ export const Vault = {
175
175
 
176
176
  localStorage.setItem(`voidlogue_conv_${roomHash}`, JSON.stringify(blob));
177
177
 
178
- const labelEntry = await encryptLabel(hint, key);
179
- await this._updateIndex(roomHash, labelEntry);
178
+ // Only add labelled conversations to the index.
179
+ // Ghost (unlabelled) convos are stored in localStorage under their key
180
+ // but must NOT appear in the convlist so they stay hidden from the UI.
181
+ if (hint.trim()) {
182
+ const labelEntry = await encryptLabel(hint, key);
183
+ await this._updateIndex(roomHash, labelEntry);
184
+ }
180
185
  return true;
181
186
  },
182
187
 
@@ -254,16 +259,18 @@ export const Vault = {
254
259
  roomHash: string,
255
260
  email: string,
256
261
  codename: string,
257
- newPin: string
262
+ newPin: string,
263
+ existingHintEntry?: LabelEntry
258
264
  ): Promise<boolean> {
259
- const entry = this._getEncryptedHint(roomHash);
260
- return this.save(
261
- roomHash,
262
- email,
263
- codename,
264
- newPin,
265
- entry ? '(restored)' : ''
266
- );
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;
267
274
  },
268
275
 
269
276
  async updateLabel(