fix key length to 16 bytes, cleaning

This commit is contained in:
Nunu 2024-01-25 18:09:37 +01:00
parent b1cbcccbd5
commit 5b02ce3e90
3 changed files with 3 additions and 2 deletions

View File

@ -487,7 +487,9 @@ void MENU_AcceptSetting(void)
#ifdef ENABLE_ENCRYPTION
case MENU_ENC_KEY:
memset(gEeprom.ENC_KEY, 0, sizeof(gEeprom.ENC_KEY));
memmove(gEeprom.ENC_KEY, edit, sizeof(edit));
memset(edit, 0, sizeof(edit));
gUpdateStatus = true;
break;
#endif

View File

@ -271,7 +271,6 @@ void SETTINGS_SaveChannelName(uint8_t channel, const char * name)
#ifdef ENABLE_ENCRYPTION
void SETTINGS_SaveEncryptionKey()
{
// TODO: this should probably autoadjust to sizeof(gEeprom.ENC_KEY)
EEPROM_WriteBuffer(0x0F30, gEeprom.ENC_KEY, true);
EEPROM_WriteBuffer(0x0F38, gEeprom.ENC_KEY + 8, true);
}

View File

@ -247,7 +247,7 @@ typedef struct {
uint8_t PASSWORD_WRONG_ATTEMPTS;
#endif
#ifdef ENABLE_ENCRYPTION
char ENC_KEY[32];
char ENC_KEY[16];
#endif
uint16_t VOX1_THRESHOLD;
uint16_t VOX0_THRESHOLD;