Skip to content

Commit

Permalink
Picopass: populate key change input with first key of user dictionary (
Browse files Browse the repository at this point in the history
  • Loading branch information
bettse authored Sep 27, 2023
1 parent 3bc236c commit 7e7df47
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion picopass/scenes/picopass_scene_key_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,16 @@ bool picopass_scene_key_menu_on_event(void* context, SceneManagerEvent event) {
scene_manager_next_scene(picopass->scene_manager, PicopassSceneWriteKey);
consumed = true;
} else if(event.event == SubmenuIndexWriteCustom) {
// If user dictionary, prepopulate with the first key
if(iclass_elite_dict_check_presence(IclassEliteDictTypeUser)) {
IclassEliteDict* dict = iclass_elite_dict_alloc(IclassEliteDictTypeUser);
iclass_elite_dict_get_next_key(dict, picopass->byte_input_store);
iclass_elite_dict_free(dict);
}

scene_manager_set_scene_state(
picopass->scene_manager, PicopassSceneKeyMenu, SubmenuIndexWriteCustom);
// Key and elite_kdf = true are both set in key_input scene
// Key and elite_kdf = true are both set in key_input scene after the value is input
scene_manager_next_scene(picopass->scene_manager, PicopassSceneKeyInput);
consumed = true;
}
Expand Down

0 comments on commit 7e7df47

Please sign in to comment.