Remove carriage return \r for better debug.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -47,7 +47,7 @@ int cmd_keypair_gen() {
|
|||||||
if (asn1_find_tag(&ctxo, 0x2, &ks) && asn1_len(&ks) > 0) {
|
if (asn1_find_tag(&ctxo, 0x2, &ks) && asn1_len(&ks) > 0) {
|
||||||
key_size = asn1_get_uint(&ks);
|
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) key_size,
|
||||||
(unsigned long) exponent);
|
(unsigned long) exponent);
|
||||||
mbedtls_rsa_context rsa;
|
mbedtls_rsa_context rsa;
|
||||||
@@ -75,7 +75,7 @@ int cmd_keypair_gen() {
|
|||||||
return SW_WRONG_DATA();
|
return SW_WRONG_DATA();
|
||||||
}
|
}
|
||||||
mbedtls_ecp_group_id ec_id = ec_get_curve_from_prime(prime.data, prime.len);
|
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) {
|
if (ec_id == MBEDTLS_ECP_DP_NONE) {
|
||||||
return SW_FUNC_NOT_SUPPORTED();
|
return SW_FUNC_NOT_SUPPORTED();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,24 +97,24 @@ void scan_files() {
|
|||||||
file_pin1 = search_by_fid(0x1081, NULL, SPECIFY_EF);
|
file_pin1 = search_by_fid(0x1081, NULL, SPECIFY_EF);
|
||||||
if (file_pin1) {
|
if (file_pin1) {
|
||||||
if (!file_pin1->data) {
|
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 };
|
const uint8_t empty[33] = { 0 };
|
||||||
flash_write_data_to_file(file_pin1, empty, sizeof(empty));
|
flash_write_data_to_file(file_pin1, empty, sizeof(empty));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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);
|
file_sopin = search_by_fid(0x1088, NULL, SPECIFY_EF);
|
||||||
if (file_sopin) {
|
if (file_sopin) {
|
||||||
if (!file_sopin->data) {
|
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 };
|
const uint8_t empty[33] = { 0 };
|
||||||
flash_write_data_to_file(file_sopin, empty, sizeof(empty));
|
flash_write_data_to_file(file_sopin, empty, sizeof(empty));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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);
|
file_retries_pin1 = search_by_fid(0x1083, NULL, SPECIFY_EF);
|
||||||
if (file_retries_pin1) {
|
if (file_retries_pin1) {
|
||||||
@@ -125,18 +125,18 @@ void scan_files() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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);
|
file_retries_sopin = search_by_fid(0x108A, NULL, SPECIFY_EF);
|
||||||
if (file_retries_sopin) {
|
if (file_retries_sopin) {
|
||||||
if (!file_retries_sopin->data) {
|
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;
|
const uint8_t retries = 15;
|
||||||
flash_write_data_to_file(file_retries_sopin, &retries, sizeof(uint8_t));
|
flash_write_data_to_file(file_retries_sopin, &retries, sizeof(uint8_t));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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;
|
file_t *tf = NULL;
|
||||||
|
|
||||||
@@ -149,18 +149,18 @@ void scan_files() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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);
|
tf = search_by_fid(0x1089, NULL, SPECIFY_EF);
|
||||||
if (tf) {
|
if (tf) {
|
||||||
if (!tf->data) {
|
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;
|
const uint8_t retries = 15;
|
||||||
flash_write_data_to_file(tf, &retries, sizeof(uint8_t));
|
flash_write_data_to_file(tf, &retries, sizeof(uint8_t));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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();
|
low_flash_available();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user