@onekeyfe/hwk-trezor-core 1.2.2-alpha.9 → 1.2.2
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 +9 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -12209,12 +12209,19 @@ var TrezorDeviceSession = class {
|
|
|
12209
12209
|
const { deriveCardano, passphraseMode } = normalizeCreateAppSessionOptions(options);
|
|
12210
12210
|
this.passphraseMode = passphraseMode;
|
|
12211
12211
|
this.log("info", "thp.appSession.create.start", { deriveCardano, passphraseMode });
|
|
12212
|
-
const sessionId = this.thpState.createNewSessionId();
|
|
12213
12212
|
const passphraseProtected = this.currentFeatures?.passphrase_protection === true;
|
|
12213
|
+
const passphraseAlwaysOnDevice = this.currentFeatures?.passphrase_always_on_device === true;
|
|
12214
|
+
this.log("info", "thp.appSession.create.passphrasePolicy", {
|
|
12215
|
+
passphraseProtected,
|
|
12216
|
+
passphraseAlwaysOnDevice
|
|
12217
|
+
});
|
|
12218
|
+
const sessionId = this.thpState.createNewSessionId();
|
|
12214
12219
|
let passphraseArg = {
|
|
12215
12220
|
passphrase: ""
|
|
12216
12221
|
};
|
|
12217
|
-
if (
|
|
12222
|
+
if (passphraseAlwaysOnDevice && passphraseMode === "prompt") {
|
|
12223
|
+
passphraseArg = { on_device: true };
|
|
12224
|
+
} else if (passphraseProtected && passphraseMode === "prompt" && this.thpOptions?.onPassphraseRequest) {
|
|
12218
12225
|
const res = await this.thpOptions.onPassphraseRequest();
|
|
12219
12226
|
passphraseArg = res?.on_device ? { on_device: true } : { passphrase: normalizePassphrase(res?.passphrase) };
|
|
12220
12227
|
}
|