@thezelijah/majik-message 1.0.8 → 1.0.9
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.
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { autogenerateID } from "./utils";
|
|
2
1
|
import { hash } from "@stablelib/sha256";
|
|
3
2
|
import { arrayToBase64 } from "../../utils/utilities";
|
|
4
3
|
/**
|
|
@@ -67,12 +66,11 @@ export class MajikMessageIdentity {
|
|
|
67
66
|
}
|
|
68
67
|
const label = options?.label || account?.meta?.label || user.displayName;
|
|
69
68
|
assertString(label, "label");
|
|
70
|
-
const generatedID = autogenerateID();
|
|
71
69
|
const timestamp = new Date().toISOString();
|
|
72
70
|
const publicKey = account.publicKeyBase64;
|
|
73
|
-
const phash = sha256(`${user.id}:${publicKey}:${
|
|
71
|
+
const phash = sha256(`${user.id}:${publicKey}:${account.id}`);
|
|
74
72
|
return new MajikMessageIdentity({
|
|
75
|
-
id:
|
|
73
|
+
id: account.id,
|
|
76
74
|
userId: user.id,
|
|
77
75
|
publicKey: publicKey,
|
|
78
76
|
phash,
|
package/dist/majik-message.js
CHANGED
|
@@ -335,6 +335,7 @@ export class MajikMessage {
|
|
|
335
335
|
*/
|
|
336
336
|
async decryptEnvelope(envelope, bypassIdentity = false) {
|
|
337
337
|
const fingerprint = envelope.extractFingerprint();
|
|
338
|
+
console.log("Fingerprint: ", fingerprint);
|
|
338
339
|
const authorizedAccount = this.listContacts(true).find((a) => a.fingerprint === fingerprint);
|
|
339
340
|
if (!authorizedAccount) {
|
|
340
341
|
throw new Error("No matching own account to decrypt this envelope");
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@thezelijah/majik-message",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"description": "Encrypt and decrypt messages on any website. Secure chats with keypairs and seed-based accounts. Open source.",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.9",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"author": "Zelijah",
|
|
8
8
|
"main": "./dist/index.js",
|