Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Picopass: populate key change input with first key of user dictionary #54

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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