diff options
author | Mykola Salomatin <mykola.salomatin@globallogic.com> | 2022-05-13 18:40:43 +0300 |
---|---|---|
committer | Mykola Salomatin <mykola.salomatin@globallogic.com> | 2022-05-13 18:40:43 +0300 |
commit | e0f209ee7cd8ea28a2f436d363fdfd5470312b3f (patch) | |
tree | 2439b8b3d5db95c583ed3e1ff43514637f007313 | |
parent | 6975928ce6253a3e4a0d257804ca456a03cc325b (diff) | |
download | mts-id-eeprom-e0f209ee7cd8ea28a2f436d363fdfd5470312b3f.tar.gz mts-id-eeprom-e0f209ee7cd8ea28a2f436d363fdfd5470312b3f.tar.bz2 mts-id-eeprom-e0f209ee7cd8ea28a2f436d363fdfd5470312b3f.zip |
[MTX-4480] mPower R.6.0.X: MTCAP3 - Filesystem Encryption capability GP-1586
Added user data encryption capability for encryption purposes in MTCAP3 devices.
-rw-r--r-- | src/eeprom_main.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/eeprom_main.c b/src/eeprom_main.c index 66c948b..ed7d674 100644 --- a/src/eeprom_main.c +++ b/src/eeprom_main.c @@ -173,6 +173,7 @@ static int id_yaml_out(const char *name, struct mts_id_eeprom_layout *id_eeprom) fprintf(file, "capa-battery: %s\n", DEVICE_CAPA(id_eeprom->capa, CAPA_BATTERY) ? "true" : "false"); fprintf(file, "capa-supercap: %s\n", DEVICE_CAPA(id_eeprom->capa, CAPA_SUPERCAP) ? "true" : "false"); fprintf(file, "capa-cellular: %s\n", DEVICE_CAPA(id_eeprom->capa, CAPA_CELLULAR) ? "true" : "false"); + fprintf(file, "capa-user-data-encryption: %s\n", DEVICE_CAPA(id_eeprom->capa, CAPA_USER_DATA_ENCRYPTION) ? "true" : "false"); fprintf(file, "capa: \""); for (i = 0; i < sizeof(id_eeprom->capa); i++) { @@ -397,6 +398,7 @@ static void mts_id_eeprom_inspect(struct mts_id_eeprom_layout *id_eeprom) log_info("capa-lora-lbt: %s", DEVICE_CAPA(id_eeprom->capa, CAPA_LORA_LBT) ? "yes" : "no"); log_info("capa-supercap: %s", DEVICE_CAPA(id_eeprom->capa, CAPA_SUPERCAP) ? "yes" : "no"); log_info("capa-cellular: %s", DEVICE_CAPA(id_eeprom->capa, CAPA_CELLULAR) ? "yes" : "no"); + log_info("capa-user-data-encryption: %s", DEVICE_CAPA(id_eeprom->capa, CAPA_USER_DATA_ENCRYPTION) ? "yes" : "no"); log_info("mac-bluetooth: %02X:%02X:%02X:%02X:%02X:%02X", id_eeprom->mac_bluetooth[0], @@ -558,6 +560,7 @@ static void usage(FILE *out) { fprintf(out, " --capa-battery |\n"); fprintf(out, " --capa-supercap |\n"); fprintf(out, " --capa-cellular |\n"); + fprintf(out, " --capa-user-data-encryption |\n"); fprintf(out, " --capa-clear (clears all flags) |\n"); fprintf(out, " --hex-to-bin | \n"); fprintf(out, " --out-format { bin | yaml (default) } |\n"); @@ -600,6 +603,7 @@ enum { CMD_OPT_CAPA_BATTERY, CMD_OPT_CAPA_SUPERCAP, CMD_OPT_CAPA_CELLULAR, + CMD_OPT_CAPA_USER_DATA_ENCRYPTION, CMD_OPT_CAPA_CLEAR, CMD_OPT_OUT_FORMAT, CMD_OPT_UPDATE, @@ -651,6 +655,7 @@ static struct option long_options[] = { {"capa-battery", 0, NULL, CMD_OPT_CAPA_BATTERY}, {"capa-supercap", 0, NULL, CMD_OPT_CAPA_SUPERCAP}, {"capa-cellular", 0, NULL, CMD_OPT_CAPA_CELLULAR}, + {"capa-user-data-encryption", 0, NULL, CMD_OPT_CAPA_USER_DATA_ENCRYPTION}, {"capa-clear", 0, NULL, CMD_OPT_CAPA_CLEAR}, {"hex-to-bin", 0, NULL, CMD_OPT_HEX_TO_BIN}, {"out-format", 1, NULL, CMD_OPT_OUT_FORMAT}, @@ -972,9 +977,11 @@ int main(int argc, char *argv[]) { #endif DEVICE_CAPA_SET(id_eeprom.capa, CAPA_LORA); break; + case CMD_OPT_CAPA_LORA_LBT: DEVICE_CAPA_SET(id_eeprom.capa, CAPA_LORA_LBT); break; + case CMD_OPT_CAPA_BATTERY: DEVICE_CAPA_SET(id_eeprom.capa, CAPA_BATTERY); break; @@ -987,6 +994,10 @@ int main(int argc, char *argv[]) { DEVICE_CAPA_SET(id_eeprom.capa, CAPA_CELLULAR); break; + case CMD_OPT_CAPA_USER_DATA_ENCRYPTION: + DEVICE_CAPA_SET(id_eeprom.capa, CAPA_USER_DATA_ENCRYPTION); + break; + case CMD_OPT_CAPA_CLEAR: capa_clear = 1; break; |