Skip to content

TOTP support for Vault#38

Draft
RedBugGamer wants to merge 4 commits intoSzybet:masterfrom
RedBugGamer:master
Draft

TOTP support for Vault#38
RedBugGamer wants to merge 4 commits intoSzybet:masterfrom
RedBugGamer:master

Conversation

@RedBugGamer
Copy link
Copy Markdown

I added a TOTP folder to the encrypted Vault and an encryption script for littlefs generation. It encrypts the .txt files(each containing one base 32 key) in resources/personal/vault/totp/.

It currently does technically work but it is very unoptimized and i do have some issues with the back button. Specifically i can't leave the TOTP folder using a single back press and after leaving the totpValue place the Menu doesn't get redrawn fully but still works(scrolling and selecting).

I'd love to hear some ideas on fixing those issues before i finalize this pull request.

@Szybet
Copy link
Copy Markdown
Owner

Szybet commented May 23, 2025

Some minor notes about the code:

  • Move the include TOTP where all external libraries are included, add an additional #if VAULT there
  • Split this functions with comments as in idk, // Vault // Images // Totp or something
    image

As for your issues:

i do have some issues with the back button. Specifically i can't leave the TOTP folder using a single back press and after leaving the totpValue place the Menu doesn't get redrawn fully but still works(scrolling and selecting).

if (foundMenuItemName == "")
{
entryMenu buttons[itemsInDir];
File root = LittleFS.open("/vault/");
File file = root.openNextFile();
int counter = 0;
while (file)
{
if (file.isDirectory() == false)
{
buttons[counter] = {String(file.name()), &emptyImgPack, switchBack};
counter = counter + 1;
}
file = root.openNextFile();
}
file.close();
root.close();
initMenu(buttons, itemsInDir, "Vault");
generalSwitch(vaultMenu);
}
else
{
showVaultImage(foundMenuItemName);
generalSwitch(vaultImage);
lastMenuSelected = "";
}

The whole "Vault manager" works in such a way that based on if the key is supplied is correct and what was the previous menu name selected, if it was a valid vault file, show the file, if not, show the menu again. This happens also on back button, it probably gets confused in your code

I propose, for both UI and code, split apart the menu for vault that after supplying the correct key, it shows a menu where you can choose TOTP or images, then reuse the functions but split apart the menu / ui because now it's a bit of a mess, then we can look for a solution (as the code for images was never designed to support more than that)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants