sm-crypto-v2 1.9.0 → 1.9.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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.9.1](https://github.com/Cubelrti/sm-crypto-v2/compare/v1.9.0...v1.9.1) (2024-07-09)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **asn1:** correct the implementation of the long version of L encoding in asn.1 ([55569c5](https://github.com/Cubelrti/sm-crypto-v2/commit/55569c55235c0a82525b142ea9a4f8a2669654ce))
11
+
5
12
  ## [1.9.0](https://github.com/Cubelrti/sm-crypto-v2/compare/v1.7.0...v1.9.0) (2023-12-27)
6
13
 
7
14
 
package/dist/index.js CHANGED
@@ -167,7 +167,11 @@ var DERSequence = class extends ASN1Object {
167
167
  function getLenOfL(str, start) {
168
168
  if (+str[start + 2] < 8)
169
169
  return 1;
170
- return +str.substring(start + 2, start + 4) & 127 + 1;
170
+ const encoded = str.slice(start + 2, start + 6);
171
+ const headHex = encoded.slice(0, 2);
172
+ const head = parseInt(headHex, 16);
173
+ const nHexLength = (head - 128) * 2;
174
+ return nHexLength;
171
175
  }
172
176
  function getL(str, start) {
173
177
  const len = getLenOfL(str, start);
package/dist/index.mjs CHANGED
@@ -135,7 +135,11 @@ var DERSequence = class extends ASN1Object {
135
135
  function getLenOfL(str, start) {
136
136
  if (+str[start + 2] < 8)
137
137
  return 1;
138
- return +str.substring(start + 2, start + 4) & 127 + 1;
138
+ const encoded = str.slice(start + 2, start + 6);
139
+ const headHex = encoded.slice(0, 2);
140
+ const head = parseInt(headHex, 16);
141
+ const nHexLength = (head - 128) * 2;
142
+ return nHexLength;
139
143
  }
140
144
  function getL(str, start) {
141
145
  const len = getLenOfL(str, start);
@@ -975,7 +975,11 @@ var DERSequence = /*#__PURE__*/ function(ASN1Object) {
975
975
  }(ASN1Object);
976
976
  function getLenOfL(str, start) {
977
977
  if (+str[start + 2] < 8) return 1;
978
- return +str.substring(start + 2, start + 4) & 127 + 1;
978
+ var encoded = str.slice(start + 2, start + 6);
979
+ var headHex = encoded.slice(0, 2);
980
+ var head = parseInt(headHex, 16);
981
+ var nHexLength = (head - 128) * 2;
982
+ return nHexLength;
979
983
  }
980
984
  function getL(str, start) {
981
985
  var len = getLenOfL(str, start);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sm-crypto-v2",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "sm-crypto-v2",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",