mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-12 10:38:36 -07:00
Desktop: Sanity check PIN length for good measure
This commit is contained in:
@@ -10,6 +10,8 @@
|
|||||||
- Seader: Card parsing and saving UI and logic improvements (by @bettse)
|
- Seader: Card parsing and saving UI and logic improvements (by @bettse)
|
||||||
|
|
||||||
### Fixed:
|
### Fixed:
|
||||||
- Desktop: Fix disabling keybinds (by @Willy-JL)
|
- Desktop:
|
||||||
|
- Fix disabling keybinds (by @Willy-JL)
|
||||||
|
- Sanity check PIN length for good measure (by @Willy-JL)
|
||||||
- Settings: Fix duplicates in Power Settings when opening submenus (by @Willy-JL)
|
- Settings: Fix duplicates in Power Settings when opening submenus (by @Willy-JL)
|
||||||
- RGB Backlight: Fix config migration (by @Willy-JL)
|
- RGB Backlight: Fix config migration (by @Willy-JL)
|
||||||
|
|||||||
@@ -44,7 +44,8 @@ static uint32_t desktop_pin_code_pack(const DesktopPinCode* pin_code) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool desktop_pin_code_is_set(void) {
|
bool desktop_pin_code_is_set(void) {
|
||||||
return furi_hal_rtc_get_pin_value() >> DESKTOP_PIN_CODE_LENGTH_OFFSET;
|
uint8_t length = furi_hal_rtc_get_pin_value() >> DESKTOP_PIN_CODE_LENGTH_OFFSET;
|
||||||
|
return length >= DESKTOP_PIN_CODE_MIN_LEN && length <= DESKTOP_PIN_CODE_MAX_LEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
void desktop_pin_code_set(const DesktopPinCode* pin_code) {
|
void desktop_pin_code_set(const DesktopPinCode* pin_code) {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#define DESKTOP_PIN_CODE_MIN_LEN (4)
|
||||||
#define DESKTOP_PIN_CODE_MAX_LEN (10)
|
#define DESKTOP_PIN_CODE_MAX_LEN (10)
|
||||||
|
|
||||||
#define DESKTOP_SETTINGS_RUN_PIN_SETUP_ARG "run_pin_setup"
|
#define DESKTOP_SETTINGS_RUN_PIN_SETUP_ARG "run_pin_setup"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#define DEFAULT_PIN_X 64
|
#define DEFAULT_PIN_X 64
|
||||||
#define DEFAULT_PIN_Y 32
|
#define DEFAULT_PIN_Y 32
|
||||||
|
|
||||||
#define MIN_PIN_LENGTH 4
|
#define MIN_PIN_LENGTH DESKTOP_PIN_CODE_MIN_LEN
|
||||||
#define MAX_PIN_LENGTH DESKTOP_PIN_CODE_MAX_LEN
|
#define MAX_PIN_LENGTH DESKTOP_PIN_CODE_MAX_LEN
|
||||||
|
|
||||||
struct DesktopViewPinInput {
|
struct DesktopViewPinInput {
|
||||||
|
|||||||
Reference in New Issue
Block a user