done changing passwords on the fly
This commit is contained in:
1 parent
be92c14ee6
commit
c2ebaab825
6 files changed
+100
-67
No files matched your search
@@ -1,15 +1,21 @@
|
|||||||
# RED_CRYPTO ver 0.7.1
|
# RED_CRYPTO ver 0.7.3
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
Password manager for (almost) any QMK-compatible keyboards.
|
Password manager for (almost) any QMK-compatible keyboards.
|
||||||
|
|
||||||
|
There are two versions:
|
||||||
|
- hard-coded passwords in `keymap.c`, change branch to `hard-coded-storage` or releases
|
||||||
|
- storing passwords in EEPROM with adding and editing via `RED_MENU`, change branch to `eeprom-storage` or releases
|
||||||
|
|
||||||
## Alert
|
## Alert
|
||||||
|
|
||||||
> Now red_crypto supports STM32 EEPROM.
|
> Now red_crypto supports STM32 EEPROM.
|
||||||
|
>
|
||||||
|
> Tested on Keychron K9 Pro with STM32L4xx with virtual EEPROM
|
||||||
|
|
||||||
See chapter about [Memory issue](#memory-issue) and [Memory usage](#memory-usage).
|
See chapter about [Memory issue](#memory-issue) and [Memory usage](#memory-usage).
|
||||||
I recommend using at the beginning internal FLASH or EEPROM, because you have some resources to realize the need for external memory. Or you can do not change your passwords, if there are very strong one's.
|
I recommend using at the beginning internal FLASH or EEPROM, because you have some resources not to need external memory. Or you can do not change your passwords, if there are very strong one's.
|
||||||
|
|
||||||
> Red_crypto will remind you constanly about using internal memory.
|
> Red_crypto will remind you constanly about using internal memory.
|
||||||
|
|
||||||
@@ -27,8 +33,15 @@ I recommend using at the beginning internal FLASH or EEPROM, because you have so
|
|||||||
- [x] use SHA256 for hashing key to set key length to 32 bytes
|
- [x] use SHA256 for hashing key to set key length to 32 bytes
|
||||||
- [x] expand stored passwords length from 16 byte to 64
|
- [x] expand stored passwords length from 16 byte to 64
|
||||||
- [x] expand number of stored passwords (manual adding new keys)
|
- [x] expand number of stored passwords (manual adding new keys)
|
||||||
- [ ] add menu to see stored passwords, rewrite one's, name one's, update master password (via any text editor, raw_hid is disabled)
|
- [x] add menu to managing stored passwords
|
||||||
- [x] write new passwords to EEPROM without flashing firmware
|
- [x] adding new passwords via menu to EEPROM without flashing firmware
|
||||||
|
- [x] add feature to edit passwords in EEPROM
|
||||||
|
- [ ] add feature to backspacing while adding password
|
||||||
|
- [ ] add feature to name passwords in EEPROM
|
||||||
|
- [ ] add feature to update master password in EEPROM
|
||||||
|
- [ ] add feature to count memory usage
|
||||||
|
- [ ] add feature to see how many passwords you can store
|
||||||
|
- [ ] add feature to interactive choosing passwords with arrows
|
||||||
- [ ] add support Streebog
|
- [ ] add support Streebog
|
||||||
- [ ] add CBC mode for Kuznechik, it will increase security
|
- [ ] add CBC mode for Kuznechik, it will increase security
|
||||||
- [ ] add addition procedures for Kuznechik (is it really need?)
|
- [ ] add addition procedures for Kuznechik (is it really need?)
|
||||||
@@ -57,7 +70,7 @@ include keyboards/<your keyboard>/<path to your keymap folder>/red_crypto/red_cr
|
|||||||
#define USE_KUZNECHIK_8
|
#define USE_KUZNECHIK_8
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want use SHA256 of your key to encrypt passwords, define this in `config.h`.
|
If you want (and if you can) use SHA256 of your key to encrypt passwords, define this in `config.h`.
|
||||||
|
|
||||||
```c
|
```c
|
||||||
#define USE_SHA256_KEY
|
#define USE_SHA256_KEY
|
||||||
@@ -70,23 +83,9 @@ Change storage size (default `5`) and maximum password length (default `64`).
|
|||||||
#define INIT_STORAGE_PASS_LEN 64 // use a multiple of 16, e.g. 16, 32, 64... but don't forget about available memory!
|
#define INIT_STORAGE_PASS_LEN 64 // use a multiple of 16, e.g. 16, 32, 64... but don't forget about available memory!
|
||||||
```
|
```
|
||||||
|
|
||||||
5. Encrypt your passwords with chosen algorithm (AES, Kuznechik). Now available only Kuznechik. You can use `CyberChef`.
|
5. Adding passwords now in menu. Look [Usage](#usage).
|
||||||
|
|
||||||
> Don't use web version! We are here for security, right?
|
6. Add new layer or set new keys everywhere you want.
|
||||||
|
|
||||||
If you've enabled SHA256 for key, choose `SHA2`, then `SHA256` mode and `64` rounds. Hash your key, then copy it to next step.
|
|
||||||
|
|
||||||
Choose `GOST Encrypt`, then choose type `GOST R 34.12 (Kuznechik, 2015)`, not `Magma`. Choose mode `ECB`. Now there is no other modes for `Kuznechik`.
|
|
||||||
|
|
||||||
> Don't forget IV for GOST
|
|
||||||
```
|
|
||||||
94208510C2C001FB01C0C21085209401
|
|
||||||
```
|
|
||||||
|
|
||||||
6. Adding passwords now in menu. Look [Usage](#usage).
|
|
||||||
|
|
||||||
|
|
||||||
7. Add new layer or set new keyes everywhere you want.
|
|
||||||
|
|
||||||
- `RED_CRY_M` - execute reading password for encrypted passwords. After entering password, tap this key again. Now, you can use `RED_PASSX` keys.
|
- `RED_CRY_M` - execute reading password for encrypted passwords. After entering password, tap this key again. Now, you can use `RED_PASSX` keys.
|
||||||
- `RED_PASSX` - where `X` is number of your password in database. After tapping, keyboard send decrypted password.
|
- `RED_PASSX` - where `X` is number of your password in database. After tapping, keyboard send decrypted password.
|
||||||
@@ -94,7 +93,7 @@ Choose `GOST Encrypt`, then choose type `GOST R 34.12 (Kuznechik, 2015)`, not `M
|
|||||||
- `RED_RNG` - use 32 times function named `tap_random_base64` from QMK. It's for generating random strings. But now random seed is not unique for every keyboard's power on.
|
- `RED_RNG` - use 32 times function named `tap_random_base64` from QMK. It's for generating random strings. But now random seed is not unique for every keyboard's power on.
|
||||||
- `RED_TEST` - execute test functions of every algorithm with. Available only with `#define TEST_FUNCTIONS_ENABLED` and `COMMAND_ENABLE=yes`. You can see output via `hid_listen`.
|
- `RED_TEST` - execute test functions of every algorithm with. Available only with `#define TEST_FUNCTIONS_ENABLED` and `COMMAND_ENABLE=yes`. You can see output via `hid_listen`.
|
||||||
|
|
||||||
8. Add some code to **keymap.c**.
|
7. Add some code to **keymap.c**.
|
||||||
|
|
||||||
Copy this function above **process_record_user**. It is initializing EEPROM of STM32.
|
Copy this function above **process_record_user**. It is initializing EEPROM of STM32.
|
||||||
|
|
||||||
@@ -105,16 +104,16 @@ void keyboard_post_init_user(void) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Copy this string to function **process_record_user** in **keymap.c** before all your code. It uses "switch case" construction inside.
|
Copy this string to at the beginning of function **process_record_user** in **keymap.c**. It uses "switch case" construction inside.
|
||||||
|
|
||||||
```c
|
```c
|
||||||
uint8_t crypto_return = crypto_process_record_user(keycode, event, encrypted_passwords);
|
uint8_t crypto_return = crypto_process_record_user(keycode, record);
|
||||||
if (crypto_return == 1){
|
if (crypto_return == RED_KEY_READ){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
9. Compile and flash your keyboard.
|
8. Compile and flash your keyboard.
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
@@ -126,13 +125,17 @@ Now you can use `RED_PASSX` to send decrypted passwords. And you can use menu vi
|
|||||||
|
|
||||||
### Adding passwords
|
### Adding passwords
|
||||||
|
|
||||||
You must firstly enter master key.
|
You must firstly enter master key to enter in **crypto mode**.
|
||||||
|
|
||||||
You should open any program with text box (notepad, telegram, html text box). Then tap `RED_MENU` and you will see menu.
|
You should open any program with text box (notepad, telegram, html text box). Then tap `RED_MENU` and you will see menu.
|
||||||
|
|
||||||
Choose `add password`. Enter password, tap `Enter`.
|
Choose `6-Add password` with entering `6`. Enter password, tap `Enter` and `Enter`.
|
||||||
|
|
||||||
|
### Changing passwords
|
||||||
|
|
||||||
|
Open menu with `RED_MENU`, choose `4-Change password in storage` with entering `4`.
|
||||||
|
Choose **index** in hex from 0 to F. Now you can change first 16 password.
|
||||||
|
Enter new password, tap `Enter` and `Enter`.
|
||||||
|
|
||||||
## Memory usage
|
## Memory usage
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ uint8_t write_keycode(uint8_t up_key, uint8_t low_key, keyrecord_t *record, uint
|
|||||||
readed_key[*count_char_key] = low_key;
|
readed_key[*count_char_key] = low_key;
|
||||||
}
|
}
|
||||||
#ifdef USE_RED_CRY_DEBUG
|
#ifdef USE_RED_CRY_DEBUG
|
||||||
dprintf("%d", readed_key[*count_char_key]);
|
dprintf("%d ", readed_key[*count_char_key]);
|
||||||
#endif
|
#endif
|
||||||
*count_char_key = *count_char_key + 1;
|
*count_char_key = *count_char_key + 1;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -258,13 +258,14 @@ void kuz_decrypt_block(kuz_key_t *key, void *blk)
|
|||||||
void print_w128(w128_t *x)
|
void print_w128(w128_t *x)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
printf("\n");
|
||||||
for (i = 0; i < 16; i++)
|
for (i = 0; i < 16; i++)
|
||||||
printf(" %02X", x->b[i]);
|
printf(" %02X", x->b[i]);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
};
|
};
|
||||||
|
|
||||||
void print_chars_w128(w128_t *x) {
|
void print_chars_w128(w128_t *x) {
|
||||||
|
printf("\n");
|
||||||
for (uint8_t i = 0; i < 16; i++) {
|
for (uint8_t i = 0; i < 16; i++) {
|
||||||
if (x->b[i] == 0x00) break;
|
if (x->b[i] == 0x00) break;
|
||||||
printf("%c", x->b[i]);
|
printf("%c", x->b[i]);
|
||||||
|
|||||||
+3
-2
@@ -40,7 +40,7 @@ void crypto_eeprom_init() {
|
|||||||
enc_pass.init_var[2] = 'D';
|
enc_pass.init_var[2] = 'D';
|
||||||
enc_pass.version[0] = '0';
|
enc_pass.version[0] = '0';
|
||||||
enc_pass.version[1] = '7';
|
enc_pass.version[1] = '7';
|
||||||
enc_pass.version[2] = '2';
|
enc_pass.version[2] = '3';
|
||||||
enc_pass.memory_usage = 0;
|
enc_pass.memory_usage = 0;
|
||||||
enc_pass.password_count = 0;
|
enc_pass.password_count = 0;
|
||||||
enc_pass.storage_size = INIT_STORAGE_SIZE;
|
enc_pass.storage_size = INIT_STORAGE_SIZE;
|
||||||
@@ -61,11 +61,12 @@ uint8_t *encrypt_pass_kuzn(const uint8_t *new_pass, const uint8_t new_pass_lengt
|
|||||||
w128_t x;
|
w128_t x;
|
||||||
new_pass_enc = red_init_array(enc_pass.storage_pass_len, 0x00); // assign zeros to encrypted new password var
|
new_pass_enc = red_init_array(enc_pass.storage_pass_len, 0x00); // assign zeros to encrypted new password var
|
||||||
// copy new password in decrypted_passwords
|
// copy new password in decrypted_passwords
|
||||||
if (password_index == -1) {
|
if (password_index == 255) {
|
||||||
for (uint8_t byte_index = 0; byte_index < new_pass_length; byte_index++) {
|
for (uint8_t byte_index = 0; byte_index < new_pass_length; byte_index++) {
|
||||||
decrypted_passwords[enc_pass.password_count][byte_index] = new_pass[byte_index];
|
decrypted_passwords[enc_pass.password_count][byte_index] = new_pass[byte_index];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
decrypted_passwords[password_index] = red_init_array(enc_pass.storage_pass_len, 0x00);
|
||||||
for (uint8_t byte_index = 0; byte_index < new_pass_length; byte_index++) {
|
for (uint8_t byte_index = 0; byte_index < new_pass_length; byte_index++) {
|
||||||
decrypted_passwords[password_index][byte_index] = new_pass[byte_index];
|
decrypted_passwords[password_index][byte_index] = new_pass[byte_index];
|
||||||
}
|
}
|
||||||
|
|||||||
+61
-35
@@ -12,14 +12,15 @@ enum menu_options {
|
|||||||
SAVE_NEW_PASS,
|
SAVE_NEW_PASS,
|
||||||
READING_PASS,
|
READING_PASS,
|
||||||
READ_USER_CHOICE,
|
READ_USER_CHOICE,
|
||||||
SHOW_THIS_MENU
|
SHOW_MAIN_MENU,
|
||||||
|
WAIT_PASS_INDEX
|
||||||
};
|
};
|
||||||
|
|
||||||
// clang-format on
|
// clang-format on
|
||||||
uint8_t readed_option[1] = {255};
|
uint8_t readed_option[1] = {SHOW_MAIN_MENU};
|
||||||
uint8_t count_readed = 0;
|
uint8_t count_readed = 0;
|
||||||
uint8_t return_key = 0;
|
uint8_t return_key = 0;
|
||||||
uint8_t password_index = -1;
|
uint8_t password_index = 255;
|
||||||
uint8_t *enc_pass_new;
|
uint8_t *enc_pass_new;
|
||||||
|
|
||||||
uint8_t *readed_key_new;
|
uint8_t *readed_key_new;
|
||||||
@@ -30,7 +31,7 @@ uint8_t read_new_key(uint16_t keycode, keyrecord_t *record) {
|
|||||||
switch (keycode) {
|
switch (keycode) {
|
||||||
case KC_ENTER:
|
case KC_ENTER:
|
||||||
readed_option[0] = SAVE_NEW_PASS;
|
readed_option[0] = SAVE_NEW_PASS;
|
||||||
return 1;
|
return RED_KEY_READ;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (count_char_key_new + 1 == enc_pass.storage_pass_len) {
|
if (count_char_key_new + 1 == enc_pass.storage_pass_len) {
|
||||||
@@ -41,7 +42,7 @@ uint8_t read_new_key(uint16_t keycode, keyrecord_t *record) {
|
|||||||
return kc_to_ascii(keycode, record, readed_key_new, &count_char_key_new);
|
return kc_to_ascii(keycode, record, readed_key_new, &count_char_key_new);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return RED_IDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// clang-format on
|
// clang-format on
|
||||||
@@ -52,8 +53,8 @@ uint8_t read_new_key(uint16_t keycode, keyrecord_t *record) {
|
|||||||
uint8_t draw_red_menu(uint16_t keycode, keyrecord_t *record) {
|
uint8_t draw_red_menu(uint16_t keycode, keyrecord_t *record) {
|
||||||
switch (readed_option[0]) {
|
switch (readed_option[0]) {
|
||||||
case EXIT:
|
case EXIT:
|
||||||
readed_option[0] = 255;
|
readed_option[0] = SHOW_MAIN_MENU;
|
||||||
return 2;
|
return RED_MENU_EXIT;
|
||||||
break;
|
break;
|
||||||
case READ_USER_CHOICE: {
|
case READ_USER_CHOICE: {
|
||||||
return_key = kc_to_ascii(keycode, record, readed_option, &count_readed);
|
return_key = kc_to_ascii(keycode, record, readed_option, &count_readed);
|
||||||
@@ -79,52 +80,76 @@ uint8_t draw_red_menu(uint16_t keycode, keyrecord_t *record) {
|
|||||||
if (readed_option[0] == ASCII_LOW_6) {
|
if (readed_option[0] == ASCII_LOW_6) {
|
||||||
readed_option[0] = ADD_NEW_PASS;
|
readed_option[0] = ADD_NEW_PASS;
|
||||||
}
|
}
|
||||||
if (return_key == 1) {
|
if (return_key == RED_KEY_READ) {
|
||||||
send_string(SS_DOWN(X_LCTL) SS_DOWN(X_A) SS_UP(X_LCTL) SS_UP(X_A) SS_TAP(X_BACKSPACE));
|
readed_key_new = red_init_array(MAX_KEY_LEN, 0x00); // init or reinit readed keys
|
||||||
return 1;
|
count_char_key_new = 0; // init or reinit counted keys
|
||||||
|
CLEAR_MENU_MACROS;
|
||||||
|
return RED_KEY_READ;
|
||||||
}
|
}
|
||||||
readed_key_new = red_init_array(MAX_KEY_LEN, 0x00); // init or reinit readed keys
|
|
||||||
count_char_key_new = 0; // init or reinit counted keys
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SHOW_PASS_NAMES:
|
case SHOW_PASS_NAMES: // TODO
|
||||||
case SHOW_MEMORY_USAGE:
|
case SHOW_MEMORY_USAGE: // TODO
|
||||||
case CHANGE_MASTER_KEY:
|
case CHANGE_MASTER_KEY: // TODO
|
||||||
case CHANGE_PASS_IN_STORAGE:
|
case CHANGE_PASS_IN_STORAGE:
|
||||||
send_string("Which one? [0-");
|
send_string("Which one? Write index in hex [0-9a-f]: "); // now you can change first 16 passwords on the fly
|
||||||
send_byte(enc_pass.password_count);
|
// to read more, I need read keys as integers, or bytes
|
||||||
send_string("]: ");
|
readed_option[0] = WAIT_PASS_INDEX;
|
||||||
password_index = kc_to_ascii(keycode, record, readed_option, &count_readed);
|
// send_string("Which one? [1-");
|
||||||
count_readed = 0;
|
// send_byte(enc_pass.password_count);
|
||||||
readed_option[0] = READING_PASS;
|
// send_string("]: ");
|
||||||
send_string("\nWrite new password. Tap `Enter` for confirm\n");
|
|
||||||
break;
|
break;
|
||||||
case CHANGE_PASS_NAME:
|
case WAIT_PASS_INDEX:
|
||||||
|
return_key = kc_to_ascii(keycode, record, readed_option, &count_readed);
|
||||||
|
count_readed = 0;
|
||||||
|
uint8_t pass_ind_upd = 0; // for checking right translation from keycode to num
|
||||||
|
if (return_key == RED_KEY_READ) {
|
||||||
|
if (readed_option[0] >= ASCII_LOW_0 && readed_option[0] <= ASCII_LOW_9) {
|
||||||
|
password_index = readed_option[0] - 0x30;
|
||||||
|
pass_ind_upd++;
|
||||||
|
} else if (readed_option[0] >= ASCII_LOW_A && readed_option[0] <= ASCII_LOW_F) {
|
||||||
|
password_index = readed_option[0] - 0x61 + 10;
|
||||||
|
pass_ind_upd++;
|
||||||
|
}
|
||||||
|
if (pass_ind_upd == 0 || password_index >= enc_pass.password_count) {
|
||||||
|
send_string("\nWrong index! Try again!\n");
|
||||||
|
readed_option[0] = CHANGE_PASS_IN_STORAGE;
|
||||||
|
} else {
|
||||||
|
readed_option[0] = READING_PASS;
|
||||||
|
send_string("\nWrite new password. Tap `Enter` for confirm\n");
|
||||||
|
}
|
||||||
|
return RED_KEY_READ;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CHANGE_PASS_NAME: // TODO
|
||||||
case SAVE_NEW_PASS:
|
case SAVE_NEW_PASS:
|
||||||
enc_pass_new = (uint8_t *)malloc(sizeof(uint8_t) * enc_pass.storage_pass_len);
|
enc_pass_new = (uint8_t *)malloc(sizeof(uint8_t) * enc_pass.storage_pass_len);
|
||||||
enc_pass_new = encrypt_pass_kuzn(readed_key_new, count_char_key_new, password_index);
|
enc_pass_new = encrypt_pass_kuzn(readed_key_new, count_char_key_new, password_index);
|
||||||
if (password_index == -1) {
|
count_char_key_new = 0;
|
||||||
|
if (password_index == 255) {
|
||||||
for (uint8_t new_pass_index = 0; new_pass_index < enc_pass.storage_pass_len; new_pass_index++) {
|
for (uint8_t new_pass_index = 0; new_pass_index < enc_pass.storage_pass_len; new_pass_index++) {
|
||||||
enc_pass.passwords[enc_pass.password_count * enc_pass.storage_pass_len + new_pass_index] = enc_pass_new[new_pass_index];
|
enc_pass.passwords[enc_pass.password_count * enc_pass.storage_pass_len + new_pass_index] = enc_pass_new[new_pass_index];
|
||||||
}
|
}
|
||||||
enc_pass.password_count++;
|
enc_pass.password_count++;
|
||||||
} else {
|
} else {
|
||||||
for (uint8_t new_pass_index = password_index; new_pass_index < enc_pass.storage_pass_len; new_pass_index++) {
|
for (uint8_t new_pass_index = 0; new_pass_index < enc_pass.storage_pass_len; new_pass_index++) {
|
||||||
enc_pass.passwords[enc_pass.password_count * enc_pass.storage_pass_len + new_pass_index] = enc_pass_new[new_pass_index];
|
enc_pass.passwords[password_index * enc_pass.storage_pass_len + new_pass_index] = enc_pass_new[new_pass_index];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// eeconfig_update_user_datablock(enc_pass.raw);
|
// eeconfig_update_user_datablock(enc_pass.raw);
|
||||||
red_write_to_storage();
|
red_write_to_storage();
|
||||||
send_string("Successful adding new key on keycode RED_PASS");
|
send_string("Successful adding new key on keycode RED_PASS");
|
||||||
if (password_index == -1) {
|
if (password_index == 255) {
|
||||||
send_byte(enc_pass.password_count);
|
send_byte(enc_pass.password_count);
|
||||||
} else {
|
} else {
|
||||||
send_byte(password_index);
|
send_byte(password_index);
|
||||||
|
password_index = 255;
|
||||||
}
|
}
|
||||||
send_string("\n");
|
send_string("\n");
|
||||||
send_string(SS_DELAY(300));
|
send_string(SS_DELAY(1000));
|
||||||
password_index = -1;
|
CLEAR_MENU_MACROS;
|
||||||
readed_option[0] = 255;
|
send_string("Press `Enter` ");
|
||||||
|
readed_option[0] = SHOW_MAIN_MENU;
|
||||||
break;
|
break;
|
||||||
case READING_PASS:
|
case READING_PASS:
|
||||||
return read_new_key(keycode, record);
|
return read_new_key(keycode, record);
|
||||||
@@ -132,17 +157,18 @@ uint8_t draw_red_menu(uint16_t keycode, keyrecord_t *record) {
|
|||||||
case ADD_NEW_PASS:
|
case ADD_NEW_PASS:
|
||||||
if (enc_pass.password_count == enc_pass.storage_size) {
|
if (enc_pass.password_count == enc_pass.storage_size) {
|
||||||
send_string("Limit error\n");
|
send_string("Limit error\n");
|
||||||
readed_option[0] = 255;
|
readed_option[0] = SHOW_MAIN_MENU;
|
||||||
} else {
|
} else {
|
||||||
send_string("Write new password. Tap `Enter` for confirm\n");
|
send_string("Write new password. Tap `Enter` for confirm\n");
|
||||||
readed_option[0] = READING_PASS;
|
readed_option[0] = READING_PASS;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: // SHOW_THIS_MENU
|
default: // SHOW_MAIN_MENU
|
||||||
|
CLEAR_MENU_MACROS;
|
||||||
send_string("RED_CRYPTO MENU:\n0-EXIT\n1-Show password's names\n2-Show memory usage\n3-Change master key\n4-Change password in storage\n5-Change password's name\n6-Add new password\n");
|
send_string("RED_CRYPTO MENU:\n0-EXIT\n1-Show password's names\n2-Show memory usage\n3-Change master key\n4-Change password in storage\n5-Change password's name\n6-Add new password\n");
|
||||||
send_string("Choose option(0-6): ");
|
send_string("Choose option(0-6): ");
|
||||||
readed_option[0] = READ_USER_CHOICE;
|
readed_option[0] = READ_USER_CHOICE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return RED_IDLE;
|
||||||
}
|
}
|
||||||
@@ -7,6 +7,8 @@
|
|||||||
# include "kc_to_ascii.h"
|
# include "kc_to_ascii.h"
|
||||||
# include "red_crypto.h"
|
# include "red_crypto.h"
|
||||||
|
|
||||||
|
#define CLEAR_MENU_MACROS send_string(SS_DOWN(X_LCTL) SS_DOWN(X_A) SS_UP(X_LCTL) SS_UP(X_A) SS_TAP(X_BACKSPACE))
|
||||||
|
|
||||||
uint8_t draw_red_menu(uint16_t keycode, keyrecord_t *record);
|
uint8_t draw_red_menu(uint16_t keycode, keyrecord_t *record);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Reference in new issue
Block a user