badmfck-api-server 4.0.75 → 4.0.76
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.
|
@@ -43,9 +43,9 @@ class MicroserviceClient extends BaseService_1.BaseService {
|
|
|
43
43
|
"x-microservice-ts": ts,
|
|
44
44
|
"x-microservice-nonce": nonce
|
|
45
45
|
};
|
|
46
|
-
const
|
|
46
|
+
const rawSecret = Buffer.from(this.options.securityKey, "base64");
|
|
47
|
+
const key = crypto_1.default.createHash("sha256").update(rawSecret).digest();
|
|
47
48
|
const hash = crypto_1.default.createHash("sha256").update(nonce + ts + this.options.securityKey).digest();
|
|
48
|
-
const key = secret;
|
|
49
49
|
const iv = hash.subarray(0, 12);
|
|
50
50
|
const aad = Buffer.from(`${ts}.${nonce}.${this.options.id}`, "utf8");
|
|
51
51
|
const data = Buffer.from(JSON.stringify(req), "utf8");
|
|
@@ -46,9 +46,9 @@ class MicroserviceHost extends BaseService_1.BaseService {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
try {
|
|
49
|
-
const
|
|
49
|
+
const rawSecret = Buffer.from(this.options.securityKey, "base64");
|
|
50
|
+
const key = crypto_1.default.createHash("sha256").update(rawSecret).digest();
|
|
50
51
|
const hash = crypto_1.default.createHash("sha256").update(nonce + ts + this.options.securityKey).digest();
|
|
51
|
-
const key = secret;
|
|
52
52
|
const iv = hash.subarray(0, 12);
|
|
53
53
|
const aad = Buffer.from(`${ts}.${nonce}.${this.options.id}`, "utf8");
|
|
54
54
|
const tag = Buffer.from(req.data.tag, "base64");
|