@stacks/storage 6.14.1-next.38 → 6.14.1-next.69

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stacks/storage",
3
- "version": "6.14.1-next.38+3d92cc71",
3
+ "version": "6.14.1-next.69+f5e43ce6",
4
4
  "description": "Stacks storage library",
5
5
  "license": "MIT",
6
6
  "author": "Hiro Systems PBC (https://hiro.so)",
@@ -20,10 +20,10 @@
20
20
  "typecheck:watch": "npm run typecheck -- --watch"
21
21
  },
22
22
  "dependencies": {
23
- "@stacks/auth": "^6.14.1-next.38+3d92cc71",
24
- "@stacks/common": "^6.14.1-next.38+3d92cc71",
25
- "@stacks/encryption": "^6.14.1-next.38+3d92cc71",
26
- "@stacks/network": "^6.14.1-next.38+3d92cc71",
23
+ "@stacks/auth": "^6.14.1-next.69+f5e43ce6",
24
+ "@stacks/common": "^6.14.1-next.69+f5e43ce6",
25
+ "@stacks/encryption": "^6.14.1-next.69+f5e43ce6",
26
+ "@stacks/network": "^6.14.1-next.69+f5e43ce6",
27
27
  "base64-js": "^1.5.1",
28
28
  "jsontokens": "^4.0.1"
29
29
  },
@@ -55,5 +55,5 @@
55
55
  "bugs": {
56
56
  "url": "https://github.com/blockstack/blockstack.js/issues"
57
57
  },
58
- "gitHead": "3d92cc71fbdc199225fd71111e890ac55ae28022"
58
+ "gitHead": "f5e43ce648e407995a1736e4f15ef3406e0c56c6"
59
59
  }
package/src/hub.ts CHANGED
@@ -9,11 +9,11 @@ import {
9
9
  NotEnoughProofError,
10
10
  PayloadTooLargeError,
11
11
  PreconditionFailedError,
12
+ PRIVATE_KEY_BYTES_COMPRESSED,
12
13
  utf8ToBytes,
13
14
  ValidationError,
14
15
  } from '@stacks/common';
15
16
  import {
16
- compressPrivateKey,
17
17
  ecSign,
18
18
  getPublicKeyFromPrivate,
19
19
  hashSha256Sync,
@@ -151,7 +151,9 @@ function makeLegacyAuthToken(challengeText: string, signerKeyHex: string): strin
151
151
  }
152
152
  if (parsedChallenge[0] === 'gaiahub' && parsedChallenge[3] === 'blockstack_storage_please_sign') {
153
153
  const digest = hashSha256Sync(utf8ToBytes(challengeText));
154
- const signatureBytes = ecSign(digest, compressPrivateKey(signerKeyHex));
154
+ const compressedPrivateKey =
155
+ signerKeyHex.length === PRIVATE_KEY_BYTES_COMPRESSED * 2 ? signerKeyHex : `${signerKeyHex}01`;
156
+ const signatureBytes = ecSign(digest, compressedPrivateKey);
155
157
  // We only want the DER encoding so use toDERHex provided by @noble/secp256k1
156
158
  const signature = Signature.fromCompact(bytesToHex(signatureBytes)).toDERHex();
157
159