1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-16 03:18:09 +00:00

msg: GetFeatures should always return passphrase_protection, needs_backup, unfinished_backup and no_backup, even if the value is not available in storage.

This commit is contained in:
Andrew Kozlik 2019-02-14 18:59:31 +01:00 committed by Pavol Rusnak
parent d5e18a489a
commit b4c0b59c89
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -47,7 +47,7 @@ void fsm_msgGetFeatures(const GetFeatures *msg)
resp->has_patch_version = true; resp->patch_version = VERSION_PATCH;
resp->has_device_id = true; strlcpy(resp->device_id, config_uuid_str, sizeof(resp->device_id));
resp->has_pin_protection = true; resp->pin_protection = config_hasPin();
resp->has_passphrase_protection = config_getPassphraseProtection(&(resp->passphrase_protection));
resp->has_passphrase_protection = true; config_getPassphraseProtection(&(resp->passphrase_protection));
#ifdef SCM_REVISION
int len = sizeof(SCM_REVISION) - 1;
resp->has_revision = true; memcpy(resp->revision.bytes, SCM_REVISION, len); resp->revision.size = len;
@ -60,9 +60,9 @@ void fsm_msgGetFeatures(const GetFeatures *msg)
resp->has_imported = config_getImported(&(resp->imported));
resp->has_pin_cached = true; resp->pin_cached = session_isUnlocked() && config_hasPin();
resp->has_passphrase_cached = true; resp->passphrase_cached = session_isPassphraseCached();
resp->has_needs_backup = config_getNeedsBackup(&(resp->needs_backup));
resp->has_unfinished_backup = config_getUnfinishedBackup(&(resp->unfinished_backup));
resp->has_no_backup = config_getNoBackup(&(resp->no_backup));
resp->has_needs_backup = true; config_getNeedsBackup(&(resp->needs_backup));
resp->has_unfinished_backup = true; config_getUnfinishedBackup(&(resp->unfinished_backup));
resp->has_no_backup = true; config_getNoBackup(&(resp->no_backup));
resp->has_flags = config_getFlags(&(resp->flags));
resp->has_model = true; strlcpy(resp->model, "1", sizeof(resp->model));