workflow/backup: password protect
#include <ui/screen_stack.h>
#include <workflow/backup.h>
#include <workflow/confirm.h>
+#include <workflow/password_enter.h>
#include <workflow/sdcard.h>
#include <workflow/status.h>
+#include <workflow/unlock.h>
#define MAX_EAST_UTC_OFFSET (50400) // 14 hours in seconds
#define MAX_WEST_UTC_OFFSET (-43200) // 12 hours in seconds
@@ -106,6 +108,18 @@ bool workflow_backup_create(const CreateBackupRequest* request)
};
sdcard_handle(&sd);
+ if (!workflow_confirm("", "I understand that\nthe backup is NOT\npassword protected", false)) {
+ return false;
+ }
+
+ char password[SET_PASSWORD_MAX_PASSWORD_LENGTH] = {0};
+ password_enter("Unlocking device\nrequired", password);
+ keystore_error_t unlock_result = workflow_unlock_and_handle_error(password);
+ util_zero(password, sizeof(password));
+ if (unlock_result != KEYSTORE_OK) {
+ return false;
+ }
+
if (!_confirm_time(request)) {
return false;
}
