@calimero-network/mero-js 24.4.0 → 24.4.1

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/dist/index.cjs CHANGED
@@ -3929,6 +3929,12 @@ async function verifyDeviceCredential(credential) {
3929
3929
  `this credential names account ${parsed.account}, but its root key derives ${derived} \u2014 the certificate was re-pointed at another account`
3930
3930
  );
3931
3931
  }
3932
+ const nonce2 = fromHex(parsed.device, "device", 32).subarray(0, 16);
3933
+ if (await mintDeviceId(parsed.account, nonce2) !== parsed.device) {
3934
+ throw new Error(
3935
+ `this credential names device ${parsed.device}, which was not minted for account ${parsed.account}; core refuses it`
3936
+ );
3937
+ }
3932
3938
  const signed = await verifySignature(
3933
3939
  parsed.rootPublicKey,
3934
3940
  fromHex(parsed.signature, "signature", 64),