nodio-cli 1.0.11 → 1.0.12
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/user/commands.js +11 -2
package/package.json
CHANGED
package/src/user/commands.js
CHANGED
|
@@ -340,8 +340,17 @@ async function downloadFile(options) {
|
|
|
340
340
|
throw new Error(`failed to fetch valid replica for shard ${shard.shardId}`);
|
|
341
341
|
}
|
|
342
342
|
|
|
343
|
-
|
|
344
|
-
|
|
343
|
+
try {
|
|
344
|
+
const plain = decryptAes256Gcm(encryptedBuffer, keyBuffer, shardMeta.iv, shardMeta.authTag);
|
|
345
|
+
plainParts.push(plain);
|
|
346
|
+
} catch (error) {
|
|
347
|
+
if (String(error.message || '').includes('unsupported state or unable to authenticate data')) {
|
|
348
|
+
throw new Error(
|
|
349
|
+
`decryption failed for shard ${shard.shardId}: key is incorrect or metadata/key mismatch (double-check key-base64 copy)`
|
|
350
|
+
);
|
|
351
|
+
}
|
|
352
|
+
throw error;
|
|
353
|
+
}
|
|
345
354
|
}
|
|
346
355
|
|
|
347
356
|
const reconstructed = Buffer.concat(plainParts);
|