瀏覽代碼

Merge totp from https://github.com/akopachov/flipper-zero_authenticator

Willy-JL 1 年之前
父節點
當前提交
bb84d4d2f0

+ 1 - 1
totp/.gitsubtree

@@ -1,2 +1,2 @@
 https://github.com/xMasterX/all-the-plugins dev base_pack/totp 6925308df62214abd3e19982444dc733cf098d92
-https://github.com/akopachov/flipper-zero_authenticator master totp b147fbb3e9055fa8e119f69d4e9e84c0740b9d4e
+https://github.com/akopachov/flipper-zero_authenticator master totp a3f0584d97a4f9fb69c9670e9c2f07cc067b34d9

+ 475 - 0
totp/.ofwcatalog/CHANGELOG.md

@@ -0,0 +1,475 @@
+# Changelog
+
+## v5.16.1 - 22 Oct 2024
+
+* Fixed compatibility with latest FW changes ([#243](https://github.com/akopachov/flipper-zero_authenticator/issues/243))
+
+## v5.16.0 - 29 Aug 2024
+
+* feat: confirm totp export on the device ([#240](https://github.com/akopachov/flipper-zero_authenticator/issues/240))
+
+## v5.15.1 - 21 Aug 2024
+
+* refactor: removed all the references to Xtreme FW as it is dead
+* fix: BT key files name format is wrong
+
+## v5.15.0 - 10 Jul 2024
+
+* feat: added support of multiple BT profiles ([#237](https://github.com/akopachov/flipper-zero_authenticator/issues/237))
+
+## v5.14.1 - 29 May 2024
+
+* fix: totp export command uses the wrong format to print url-encoded symbol.
+
+## v5.14.0 - 23 Apr 2024
+
+* fix: unable to add new token if type token secret for a longer than a minute ([#231](https://github.com/akopachov/flipper-zero_authenticator/issues/231))
+
+## v5.13.0 - 11 Mar 2024
+
+* fix: HOTP counter increment is not working ([#226](https://github.com/akopachov/flipper-zero_authenticator/issues/226))
+* feat: updated wolfSSL library to the latest version [5.6.6](https://github.com/wolfSSL/wolfssl/releases/tag/v5.6.6-stable)
+* feat: updated code to make it compatible with latest FW changes (BT refactoring)
+
+## v5.11.0 - 5 Feb 2024
+
+* feat: implemented standard navigation patterns ([#223](https://github.com/akopachov/flipper-zero_authenticator/issues/223))
+
+## v5.10.0 - 8 Jan 2024
+
+* Implemented export functionality ([#219](https://github.com/akopachov/flipper-zero_authenticator/issues/219))
+
+## v5.9.1 - 23 Nov 2023
+
+* Added checks for unsupported crypto methods
+* Added release artifacts supporting old crypto methods
+
+## v5.9.0 - 22 Nov 2023
+
+* Implemented [#217](https://github.com/akopachov/flipper-zero_authenticator/issues/217)
+
+## v5.8.0 - 20 Nov 2023
+
+* Implemented [#215](https://github.com/akopachov/flipper-zero_authenticator/issues/215)
+
+## v5.7.0 - 3 Nov 2023
+
+* Updated WolfSSL to [v5.6.4](https://github.com/wolfSSL/wolfssl/releases/tag/v5.6.4-stable)
+* Cosmetic fix to "totp help" CLI command output text
+
+## v5.6.0 - 30 Oct 2023
+
+* Fixed [#212](https://github.com/akopachov/flipper-zero_authenticator/issues/212)
+
+## v5.5.0 - 26 Sep 2023
+
+* Implemented counter-based tokens (HOTP) ([#205](https://github.com/akopachov/flipper-zero_authenticator/issues/205))
+* Migrated build pipelines to uFBT ([#203](https://github.com/akopachov/flipper-zero_authenticator/issues/203))
+
+## v5.0.0 - 13 Sep 2023
+
+* Implemented [#198](https://github.com/akopachov/flipper-zero_authenticator/issues/198)
+* Implemented [#200](https://github.com/akopachov/flipper-zero_authenticator/issues/200)
+
+## v4.1.0 - 28 Aug 2023
+
+* Implemented [#195](https://github.com/akopachov/flipper-zero_authenticator/issues/195)
+* Added "totp version" CLI command
+
+## v4.0.0 - 9 Aug 2023
+
+* Dropped homebrew hashing algo implementations and replaced them with [WolfSSL](https://github.com/wolfSSL/wolfssl/) library ([#185](https://github.com/akopachov/flipper-zero_authenticator/issues/185))
+* Updated crypto algorithms to use PBKDF2 instead of plain HMAC to generate IV.
+* Fixed CLI bugs when dealing with conf file and folders
+
+## v3.2.0 - 2 Aug 2023
+
+* Implemented [#177](https://github.com/akopachov/flipper-zero_authenticator/issues/177)
+* Fixed [#178](https://github.com/akopachov/flipper-zero_authenticator/issues/178)
+* Refactoring
+
+## v3.1.0 - 31 Jul 2023
+
+* Implemented [#171](https://github.com/akopachov/flipper-zero_authenticator/issues/171)
+
+## v3.0.2 - 28 Jul 2023
+
+* Fixed [#169](https://github.com/akopachov/flipper-zero_authenticator/issues/169)
+* Fixed [#172](https://github.com/akopachov/flipper-zero_authenticator/issues/172)
+
+## v3.0.0 - 26 Jul 2023
+
+* Implemented better encryption [#167](https://github.com/akopachov/flipper-zero_authenticator/issues/167)
+
+## v2.3.0 - 18 Jul 2023
+
+* Implemented [#165](https://github.com/akopachov/flipper-zero_authenticator/issues/165)
+* Just a bit of refactoring
+
+
+## v2.2.3 - 10 Jul 2023
+
+* Refactoring [#162](https://github.com/akopachov/flipper-zero_authenticator/issues/158) 
+* Updated repo to match [OFW catalog](https://github.com/flipperdevices/flipper-application-catalog/) requirements
+
+
+## v2.2.2 - 19 Jun 2023
+
+* Fixed [#158](https://github.com/akopachov/flipper-zero_authenticator/issues/158) 
+* Cosmetic refactoring
+
+
+
+## v2.2.1 - 06 Jun 2023
+
+* Fixed [#155](https://github.com/akopachov/flipper-zero_authenticator/issues/155) 
+* Refactoring
+
+
+
+## v2.2.0 - 05 Jun 2023
+
+* Fixed [#153](https://github.com/akopachov/flipper-zero_authenticator/issues/153) 
+* Updated firmware submodules
+
+
+
+## v2.1.1 - 30 May 2023
+
+* Updated firmware submodules
+* Added some new fonts for supporters 
+
+
+
+## v2.1.0 - 24 May 2023
+
+* Implemented [#148](https://github.com/akopachov/flipper-zero_authenticator/issues/148) 
+* 🧹 Refactoring
+* ** Added nice custom fonts for supporters **
+
+
+
+## v2.0.3 - 29 Apr 2023
+
+* Fixed [#146](https://github.com/akopachov/flipper-zero_authenticator/issues/146) 
+* Updated firmware references
+
+
+
+## v2.0.2 - 28 Apr 2023
+
+* Refactoring & minor improvements
+
+
+
+## v2.0.1 - 26 Apr 2023
+
+* Fixed few bugs I found during day 1 of v2.0.0
+* Refactoring
+* Updated firmware submodules
+
+
+
+## v2.0.0 - 25 Apr 2023
+
+* Reworked token list to make app work smooth with bigger lists of tokens. So right now you can add as much tokens as you need.
+* Improved token list operations to make them more reliable
+* Refactoring
+* Updated firmware submodules
+
+
+
+## v1.9.2 - 13 Apr 2023
+
+* Updated firmware submodules
+
+
+
+## v1.9.1 - 13 Apr 2023
+
+* Improved TOTP code rendering method
+* Added "--clean" flag to custom FBT
+
+
+
+## v1.9.0 - 12 Apr 2023
+
+* Moved token generation into separate thread
+* Refactoring and code cleanup
+
+
+
+## v1.8.8 - 11 Apr 2023
+
+* Xtreme: fixed BT name length according to latest XFW changes (by [@Willy-JL](https://github.com/Willy-JL))
+* Updated firmware submodules
+
+
+
+## v1.8.7 - 07 Apr 2023
+
+* Backup conf file before running "totp pin set" and "totp pin remove" CLI commands ([#123](https://github.com/akopachov/flipper-zero_authenticator/issues/123))
+* Some refactoring ([#120](https://github.com/akopachov/flipper-zero_authenticator/issues/120))
+
+
+
+## v1.8.6 - 06 Apr 2023
+
+* Updated firmware submodules [#118](https://github.com/akopachov/flipper-zero_authenticator/issues/118) 
+
+
+
+## v1.8.5 - 05 Apr 2023
+
+* Fixed [#116](https://github.com/akopachov/flipper-zero_authenticator/issues/116) 
+
+
+
+## v1.8.4 - 05 Apr 2023
+
+* Added Steam guard token support ([#111](https://github.com/akopachov/flipper-zero_authenticator/issues/111))
+* Added Base64-encoded token support
+* Custom font for token
+* Refactoring
+
+
+
+## v1.8.3 - 03 Apr 2023
+
+* Build artifact for [Xtreme](https://github.com/ClaraCrazy/Flipper-Xtreme) firmware ([#113](https://github.com/akopachov/flipper-zero_authenticator/issues/113))
+* Xtreme: custom BT name & MAC which should resolve [#98](https://github.com/akopachov/flipper-zero_authenticator/issues/98)
+
+
+
+## v1.8.2 - 31 Mar 2023
+
+* Implemented [#106](https://github.com/akopachov/flipper-zero_authenticator/issues/106) 
+
+
+
+## v1.8.1 - 31 Mar 2023
+
+* Implemented [#102](https://github.com/akopachov/flipper-zero_authenticator/issues/102) 
+* Implemented [#103](https://github.com/akopachov/flipper-zero_authenticator/issues/103) 
+* Refactoring
+* Minor fixes
+
+
+
+## v1.8.0 - 30 Mar 2023
+
+* Implemented [#95](https://github.com/akopachov/flipper-zero_authenticator/issues/95) 
+* New CLI commands "totp update", "totp lsattr"
+* Refactoring
+
+
+
+## v1.7.1 - 22 Mar 2023
+
+* Updated firmware submodules
+
+
+
+## v1.7.0 - 21 Mar 2023
+
+* Implemented [#89](https://github.com/akopachov/flipper-zero_authenticator/issues/89) 
+* Refactoring
+
+
+
+## v1.6.5 - 09 Mar 2023
+
+* Updated firmware references
+* Updated code to make it compatible with latest firmware changes
+
+
+
+## v1.6.4 - 01 Mar 2023
+
+* Updated firmware references
+
+
+
+## v1.6.3 - 16 Feb 2023
+
+* Fixed [#76](https://github.com/akopachov/flipper-zero_authenticator/issues/76) 
+* Fixed [#77](https://github.com/akopachov/flipper-zero_authenticator/issues/77)
+* Made CLI console output colorful
+* Few refactoring
+
+
+
+## v1.6.2 - 13 Feb 2023
+
+* Updated submodules to make app compatible with latest firmware
+* Cosmetic code changes
+
+
+
+## v1.6.1 - 07 Feb 2023
+
+* Implemented [#70](https://github.com/akopachov/flipper-zero_authenticator/issues/70) 
+
+
+
+## v1.6.0 - 18 Jan 2023
+
+* Implemented [#65](https://github.com/akopachov/flipper-zero_authenticator/issues/65) 
+
+
+
+## v1.5.6 - 09 Jan 2023
+
+* Updated firmwares
+
+
+
+## v1.5.5 - 04 Jan 2023
+
+* Implemented [#58](https://github.com/akopachov/flipper-zero_authenticator/issues/58) 
+* A bit of refactoring
+
+
+
+## v1.5.4 - 02 Jan 2023
+
+* Fixed [#53](https://github.com/akopachov/flipper-zero_authenticator/issues/53) 
+
+
+
+## v1.5.3 - 30 Dec 2022
+
+* Fixed [#51](https://github.com/akopachov/flipper-zero_authenticator/issues/51) 
+
+
+
+## v1.5.2 - 21 Dec 2022
+
+* Config file moved to "/ext/authenticator/totp.conf"
+* Improved the way how config file is getting handled
+* Improved user notification if on error during config file open\read\update
+
+
+
+## v1.5.1 - 01 Dec 2022
+
+* Implemented [#44](https://github.com/akopachov/flipper-zero_authenticator/issues/44) to be compatible with latest API changes
+
+
+
+## v1.5.0 - 23 Nov 2022
+
+* Implemented [#36](https://github.com/akopachov/flipper-zero_authenticator/issues/36) 
+* Refactoring
+
+
+
+## v1.4.0 - 21 Nov 2022
+
+* Implemented [#10](https://github.com/akopachov/flipper-zero_authenticator/issues/10) 
+* Refactoring
+
+
+
+## v1.3.1 - 18 Nov 2022
+
+* Implemented [#30](https://github.com/akopachov/flipper-zero_authenticator/issues/30) 
+* Cosmetic improvements
+
+
+
+## v1.3.0 - 17 Nov 2022
+
+* Implemented [#26](https://github.com/akopachov/flipper-zero_authenticator/issues/26) 
+* Implemented [#28](https://github.com/akopachov/flipper-zero_authenticator/issues/28) 
+* Improved HID worker code
+* Improved navigation using "long press" event
+* Refactoring
+
+
+
+## v1.2.1 - 10 Nov 2022
+
+* Fixed [#24](https://github.com/akopachov/flipper-zero_authenticator/issues/24)
+* Small improvement to the USB mode restore code
+
+
+
+## v1.2.0 - 10 Nov 2022
+
+* Implemented [#21](https://github.com/akopachov/flipper-zero_authenticator/issues/21) 
+
+
+
+## v1.1.2 - 07 Nov 2022
+
+* Integrated PVS Studio scanner and fixed all its complains
+* Updated firmwares
+* Refactoring
+* Dead code eliminated to fix "COMPACT=1 DEBUG=0" build
+* Build artifacts are done with "COMPACT=1 DEBUG=0" build settings
+
+
+
+## v1.1.1 - 02 Nov 2022
+
+* Latest firmwares
+* Refactoring
+* Sonar scan issues fixed
+
+
+
+## v1.1.0 - 26 Oct 2022
+
+* CLI added (thanks to [@br0ziliy](https://github.com/br0ziliy)). [#11](https://github.com/akopachov/flipper-zero_authenticator/issues/11) 
+* Updated firmware submodules to latest
+* Refactoring
+
+
+
+## v1.0.1 - 21 Oct 2022
+
+* Fixed issue [#8](https://github.com/akopachov/flipper-zero_authenticator/issues/8) 
+* Refactoring
+
+
+
+## v1.0.0 - 17 Oct 2022
+
+* Made PIN optional
+* Submodules updated
+* Refactoring
+* Few fixes
+
+
+
+## v0.0.6 - 13 Oct 2022
+
+* Added timezone configuration UI
+* Removed CLI app POC
+* Minor fixes
+
+
+
+## v0.0.5 - 10 Oct 2022
+
+* Separate builds for Official and Unleashed firmwares
+* Updated code to FuriString
+
+
+
+## v0.0.4 - 05 Oct 2022
+
+* Moved TOTP app to separate folder to segregate it from flipper_firmware code and make it clearer
+* Code refactoring
+* Added SHA1, SHA256 and SHA512 hashing algos
+* Minor improvements
+
+
+## v0.0.2
+
+Ability to add more than one token
+
+## v0.0.1
+
+First POC. SHA1 hashing algorithm and one token.

+ 22 - 0
totp/.ofwcatalog/DESCRIPTION.md

@@ -0,0 +1,22 @@
+Flipper Authenticator is a software-based authenticator that implements multi-factor authentication services using the time-based one-time password (TOTP; specified in [RFC 6238](https://www.rfc-editor.org/rfc/rfc6238)) and HMAC-based One-time Password algorithm (HOTP; specified in [RFC 4226](https://www.rfc-editor.org/rfc/rfc4226)), for authenticating users of software applications.
+
+It is like [Google Authenticator](https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2), but for [Flipper Zero](https://flipperzero.one/) device.
+
+## Companion app
+
+There is a companion app for desktop allowing you to interact with Flipper Authenticator in a more user-friendly way. The latest builds as well as all the information about it can be found in its official repo [here](https://github.com/akopachov/flipper-zero_authenticator-companion)
+
+## Want to say thank you?
+
+* Buy me a coffee [here](https://ko-fi.com/akopachov) (No account needed, one-time)
+* Become a patron at [Patreon](https://patreon.com/akopachov) (Account needed)
+* [Z.Cash](https://z.cash/): t1PCzJrd96RUfzjzhBERfXEFvSi7W6V86hM
+* [USDT](https://tether.to): 0xa12163eD56e35d3B38F7087B573384E40b2785e1
+* [DOGE](https://dogecoin.com/): DAa3nu1RCWwxZdAnGVga77bgxDFP1nhahj
+* [TON](https://ton.org/): EQCSBzoTb1B7RhXnka5RegmdjHR3gQwRVgZHNPPqzjjvlW9T
+
+## Have questions?
+
+Checkout [FAQ](https://github.com/akopachov/flipper-zero_authenticator/wiki/FAQ) or start a discussion [here](https://github.com/akopachov/flipper-zero_authenticator/discussions). You may also find help on your firmware Discord server.
+
+If you would like to talk to the author directly, you can always contact me via [Discord](https://discordapp.com/users/943839672436662283), [Telegram](https://t.me/akopachov) or [Signal](https://signal.me/#eu/awO0hlh9qSAynfctObaziRFXg1f8o6ebxD6r1I3D9rIwwnDd34tKlYZQ6lLIzM10)

二進制
totp/.ofwcatalog/screenshot_1.png


二進制
totp/.ofwcatalog/screenshot_2.png


二進制
totp/.ofwcatalog/screenshot_3.png


二進制
totp/.ofwcatalog/screenshot_4.png


二進制
totp/.ofwcatalog/screenshot_5.png


+ 1 - 1
totp/application.fam

@@ -7,7 +7,7 @@ App(
     requires=["gui", "cli", "dialogs", "storage", "input", "notification", "bt"],
     stack_size=2 * 1024,
     order=20,
-    fap_version="5.160",
+    fap_version="5.161",
     fap_author="Alexander Kopachov (@akopachov)",
     fap_description="Software-based TOTP/HOTP authenticator for Flipper Zero device",
     fap_weburl="https://github.com/akopachov/flipper-zero_authenticator",

+ 7 - 1
totp/cli/cli_helpers.h

@@ -2,6 +2,12 @@
 
 #include <stdio.h>
 
+#if __has_include(<cli/cli_ansi.h>)
+#include <cli/cli_ansi.h>
+#else
+#include "../lib/polyfills/cli_ansi.h"
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -62,4 +68,4 @@ extern "C" {
 
 #ifdef __cplusplus
 }
-#endif
+#endif

+ 0 - 1
totp/cli/cli_shared_methods.h

@@ -1,7 +1,6 @@
 #pragma once
 
 #include <cli/cli.h>
-#include <cli/cli_ansi.h>
 #include "../types/plugin_state.h"
 
 #ifdef __cplusplus

+ 1 - 1
totp/cli/plugins/delete/delete.c

@@ -92,4 +92,4 @@ static const FlipperAppPluginDescriptor plugin_descriptor = {
 
 const FlipperAppPluginDescriptor* totp_cli_delete_plugin_ep() {
     return &plugin_descriptor;
-}
+}

+ 7 - 2
totp/cli/plugins/version/version.c

@@ -8,7 +8,12 @@ static void handle(PluginState* plugin_state, FuriString* args, Cli* cli) {
     UNUSED(cli);
     UNUSED(plugin_state);
     TOTP_CLI_PRINTF(
-        "%" PRIu8 ".%" PRIu8 ".%" PRIu8 "\r\n",
+        "%" PRIu8 ".%" PRIu8 ".%" PRIu8 
+#ifdef TOTP_APP_VERSION_META
+        "+"
+        TOTP_APP_VERSION_META
+#endif
+        "\r\n",
         TOTP_APP_VERSION_MAJOR,
         TOTP_APP_VERSION_MINOR,
         TOTP_APP_VERSION_PATCH);
@@ -24,4 +29,4 @@ static const FlipperAppPluginDescriptor plugin_descriptor = {
 
 const FlipperAppPluginDescriptor* totp_cli_version_plugin_ep() {
     return &plugin_descriptor;
-}
+}

+ 28 - 0
totp/lib/polyfills/cli_ansi.h

@@ -0,0 +1,28 @@
+// Just a temporary polyfill until this cli/cli_ansi.h spread across all the FW and brances
+#pragma once
+
+typedef enum {
+    CliKeyUnrecognized = 0,
+
+    CliKeySOH = 0x01,
+    CliKeyETX = 0x03,
+    CliKeyEOT = 0x04,
+    CliKeyBell = 0x07,
+    CliKeyBackspace = 0x08,
+    CliKeyTab = 0x09,
+    CliKeyLF = 0x0A,
+    CliKeyCR = 0x0D,
+    CliKeyETB = 0x17,
+    CliKeyEsc = 0x1B,
+    CliKeyUS = 0x1F,
+    CliKeySpace = 0x20,
+    CliKeyDEL = 0x7F,
+
+    CliKeySpecial = 0x80,
+    CliKeyLeft,
+    CliKeyRight,
+    CliKeyUp,
+    CliKeyDown,
+    CliKeyHome,
+    CliKeyEnd,
+} CliKey;

+ 1 - 1
totp/version.h

@@ -2,4 +2,4 @@
 
 #define TOTP_APP_VERSION_MAJOR (5)
 #define TOTP_APP_VERSION_MINOR (16)
-#define TOTP_APP_VERSION_PATCH (0)
+#define TOTP_APP_VERSION_PATCH (1)