node-opcua-crypto 4.9.3 → 4.10.0

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.
@@ -92,7 +92,7 @@ import {
92
92
  verifyChunkSignature,
93
93
  verifyChunkSignatureWithDerivedKeys,
94
94
  verifyMessageChunkSignature
95
- } from "../chunk-VAMKYXNP.mjs";
95
+ } from "../chunk-46EEAYVO.mjs";
96
96
  export {
97
97
  CertificatePurpose,
98
98
  PaddingAlgorithm,
@@ -70,8 +70,7 @@ var import_assert2 = __toESM(require("assert"));
70
70
  // source/asn1.ts
71
71
  var import_assert = __toESM(require("assert"));
72
72
  function readTag(buf, pos) {
73
- (0, import_assert.default)(buf instanceof Buffer);
74
- (0, import_assert.default)(Number.isFinite(pos) && pos >= 0);
73
+ const start = pos;
75
74
  if (buf.length <= pos) {
76
75
  throw new Error("Invalid position : buf.length=" + buf.length + " pos =" + pos);
77
76
  }
@@ -87,7 +86,7 @@ function readTag(buf, pos) {
87
86
  pos += 1;
88
87
  }
89
88
  }
90
- return { tag, position: pos, length };
89
+ return { start, tag, position: pos, length };
91
90
  }
92
91
 
93
92
  // source/crypto_explore_certificate.ts
@@ -319,19 +318,20 @@ var x509 = __toESM(require("@peculiar/x509"));
319
318
  var import_webcrypto = require("@peculiar/webcrypto");
320
319
  var import_crypto3 = __toESM(require("crypto"));
321
320
  var x5092 = __toESM(require("@peculiar/x509"));
321
+ var doDebug2 = false;
322
322
  var _crypto;
323
323
  var ignoreCrypto = process.env.IGNORE_SUBTLE_FROM_CRYPTO;
324
324
  if (typeof window === "undefined") {
325
325
  _crypto = import_crypto3.default;
326
326
  if (!_crypto?.subtle || ignoreCrypto) {
327
327
  _crypto = new import_webcrypto.Crypto();
328
- console.warn("using @peculiar/webcrypto");
328
+ doDebug2 && console.warn("using @peculiar/webcrypto");
329
329
  } else {
330
- console.warn("using nodejs crypto (native)");
330
+ doDebug2 && console.warn("using nodejs crypto (native)");
331
331
  }
332
332
  x509.cryptoProvider.set(_crypto);
333
333
  } else {
334
- console.warn("using browser crypto (native)");
334
+ doDebug2 && console.warn("using browser crypto (native)");
335
335
  _crypto = crypto;
336
336
  x509.cryptoProvider.set(crypto);
337
337
  }