@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.mjs
CHANGED
|
@@ -12194,12 +12194,19 @@ var TrezorDeviceSession = class {
|
|
|
12194
12194
|
const { deriveCardano, passphraseMode } = normalizeCreateAppSessionOptions(options);
|
|
12195
12195
|
this.passphraseMode = passphraseMode;
|
|
12196
12196
|
this.log("info", "thp.appSession.create.start", { deriveCardano, passphraseMode });
|
|
12197
|
-
const sessionId = this.thpState.createNewSessionId();
|
|
12198
12197
|
const passphraseProtected = this.currentFeatures?.passphrase_protection === true;
|
|
12198
|
+
const passphraseAlwaysOnDevice = this.currentFeatures?.passphrase_always_on_device === true;
|
|
12199
|
+
this.log("info", "thp.appSession.create.passphrasePolicy", {
|
|
12200
|
+
passphraseProtected,
|
|
12201
|
+
passphraseAlwaysOnDevice
|
|
12202
|
+
});
|
|
12203
|
+
const sessionId = this.thpState.createNewSessionId();
|
|
12199
12204
|
let passphraseArg = {
|
|
12200
12205
|
passphrase: ""
|
|
12201
12206
|
};
|
|
12202
|
-
if (
|
|
12207
|
+
if (passphraseAlwaysOnDevice && passphraseMode === "prompt") {
|
|
12208
|
+
passphraseArg = { on_device: true };
|
|
12209
|
+
} else if (passphraseProtected && passphraseMode === "prompt" && this.thpOptions?.onPassphraseRequest) {
|
|
12203
12210
|
const res = await this.thpOptions.onPassphraseRequest();
|
|
12204
12211
|
passphraseArg = res?.on_device ? { on_device: true } : { passphrase: normalizePassphrase(res?.passphrase) };
|
|
12205
12212
|
}
|