@onekeyfe/hwk-trezor-core 1.2.8-alpha.13 → 1.2.8-alpha.131

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.js CHANGED
@@ -11276,7 +11276,8 @@ async function receive(receiver, protocol) {
11276
11276
  } catch (e) {
11277
11277
  console.warn("Protocol decode failed", {
11278
11278
  error: e.message,
11279
- payload: readResult.payload.toString("hex")
11279
+ payloadLength: readResult.payload.length,
11280
+ payloadHead: readResult.payload.subarray(0, 2).toString("hex")
11280
11281
  });
11281
11282
  return error({ code: PROTOCOL_MALFORMED, message: e.message });
11282
11283
  }
@@ -12139,6 +12140,11 @@ var TrezorDeviceSession = class {
12139
12140
  requestData = {};
12140
12141
  continue;
12141
12142
  }
12143
+ if ((response.type === "PinMatrixRequest" || response.type === "PassphraseRequest") && this.connectionType === "ble" && this.protocol === "v1") {
12144
+ this.core = void 0;
12145
+ this.currentFeatures = void 0;
12146
+ throw thpPairingRefused("Trezor Bluetooth requires the encrypted THP protocol");
12147
+ }
12142
12148
  if (response.type === "PinMatrixRequest") {
12143
12149
  const pin = await this.handlePinMatrixRequest(
12144
12150
  response.message
@@ -12259,7 +12265,7 @@ var TrezorDeviceSession = class {
12259
12265
  const response = await this.core.call("Initialize", {});
12260
12266
  this.currentFeatures = expectMessage(response, "Features").message;
12261
12267
  this.thpAppSessionActive = false;
12262
- if (passphraseMode === "empty" && this.currentFeatures?.passphrase_protection == null) {
12268
+ if (passphraseMode === "empty") {
12263
12269
  expectMessage(
12264
12270
  await this.call("GetAddress", {
12265
12271
  address_n: [2147483692, 2147483649, 2147483648, 0, 0],