Remove carriage return \r for better debug.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2024-04-17 11:46:34 +02:00
parent ac781c1db6
commit a674410826
No known key found for this signature in database
GPG key ID: C0095B7870A4CCD3
2 changed files with 12 additions and 12 deletions

View file

@ -47,7 +47,7 @@ int cmd_keypair_gen() {
if (asn1_find_tag(&ctxo, 0x2, &ks) && asn1_len(&ks) > 0) {
key_size = asn1_get_uint(&ks);
}
printf("KEYPAIR RSA %lu (%lx)\r\n",
printf("KEYPAIR RSA %lu (%lx)\n",
(unsigned long) key_size,
(unsigned long) exponent);
mbedtls_rsa_context rsa;
@ -75,7 +75,7 @@ int cmd_keypair_gen() {
return SW_WRONG_DATA();
}
mbedtls_ecp_group_id ec_id = ec_get_curve_from_prime(prime.data, prime.len);
printf("KEYPAIR ECC %d\r\n", ec_id);
printf("KEYPAIR ECC %d\n", ec_id);
if (ec_id == MBEDTLS_ECP_DP_NONE) {
return SW_FUNC_NOT_SUPPORTED();
}

View file

@ -97,24 +97,24 @@ void scan_files() {
file_pin1 = search_by_fid(0x1081, NULL, SPECIFY_EF);
if (file_pin1) {
if (!file_pin1->data) {
printf("PIN1 is empty. Initializing with default password\r\n");
printf("PIN1 is empty. Initializing with default password\n");
const uint8_t empty[33] = { 0 };
flash_write_data_to_file(file_pin1, empty, sizeof(empty));
}
}
else {
printf("FATAL ERROR: PIN1 not found in memory!\r\n");
printf("FATAL ERROR: PIN1 not found in memory!\n");
}
file_sopin = search_by_fid(0x1088, NULL, SPECIFY_EF);
if (file_sopin) {
if (!file_sopin->data) {
printf("SOPIN is empty. Initializing with default password\r\n");
printf("SOPIN is empty. Initializing with default password\n");
const uint8_t empty[33] = { 0 };
flash_write_data_to_file(file_sopin, empty, sizeof(empty));
}
}
else {
printf("FATAL ERROR: SOPIN not found in memory!\r\n");
printf("FATAL ERROR: SOPIN not found in memory!\n");
}
file_retries_pin1 = search_by_fid(0x1083, NULL, SPECIFY_EF);
if (file_retries_pin1) {
@ -125,18 +125,18 @@ void scan_files() {
}
}
else {
printf("FATAL ERROR: Retries PIN1 not found in memory!\r\n");
printf("FATAL ERROR: Retries PIN1 not found in memory!\n");
}
file_retries_sopin = search_by_fid(0x108A, NULL, SPECIFY_EF);
if (file_retries_sopin) {
if (!file_retries_sopin->data) {
printf("Retries SOPIN is empty. Initializing with default retries\r\n");
printf("Retries SOPIN is empty. Initializing with default retries\n");
const uint8_t retries = 15;
flash_write_data_to_file(file_retries_sopin, &retries, sizeof(uint8_t));
}
}
else {
printf("FATAL ERROR: Retries SOPIN not found in memory!\r\n");
printf("FATAL ERROR: Retries SOPIN not found in memory!\n");
}
file_t *tf = NULL;
@ -149,18 +149,18 @@ void scan_files() {
}
}
else {
printf("FATAL ERROR: Max Retries PIN1 not found in memory!\r\n");
printf("FATAL ERROR: Max Retries PIN1 not found in memory!\n");
}
tf = search_by_fid(0x1089, NULL, SPECIFY_EF);
if (tf) {
if (!tf->data) {
printf("Max Retries SOPIN is empty. Initializing with default max retries\r\n");
printf("Max Retries SOPIN is empty. Initializing with default max retries\n");
const uint8_t retries = 15;
flash_write_data_to_file(tf, &retries, sizeof(uint8_t));
}
}
else {
printf("FATAL ERROR: Retries SOPIN not found in memory!\r\n");
printf("FATAL ERROR: Retries SOPIN not found in memory!\n");
}
low_flash_available();
}