mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-09 14:22:53 +00:00
Add NIP-44 verification to DM decrypt worker
This commit is contained in:
1 parent
2b79021184
commit
4cc51d7a79
5 files changed
+76
-8
No files matched your search
@@ -82,6 +82,7 @@ export function decryptDmInWorker({
|
||||
privateKey,
|
||||
targetPubkey,
|
||||
ciphertext,
|
||||
event,
|
||||
timeoutMs = DEFAULT_TIMEOUT_MS,
|
||||
} = {}) {
|
||||
const worker = ensureWorker();
|
||||
@@ -95,6 +96,7 @@ export function decryptDmInWorker({
|
||||
typeof targetPubkey === "string" ? targetPubkey.trim() : "";
|
||||
const payloadCiphertext = typeof ciphertext === "string" ? ciphertext : "";
|
||||
const payloadScheme = typeof scheme === "string" ? scheme : "";
|
||||
const payloadEvent = event && typeof event === "object" ? event : null;
|
||||
|
||||
if (!trimmedPrivateKey || !trimmedTarget || !payloadCiphertext) {
|
||||
return Promise.reject(new Error("dm-worker-invalid-input"));
|
||||
@@ -115,6 +117,7 @@ export function decryptDmInWorker({
|
||||
privateKey: trimmedPrivateKey,
|
||||
targetPubkey: trimmedTarget,
|
||||
ciphertext: payloadCiphertext,
|
||||
event: payloadEvent,
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user