style
This commit is contained in:
1 parent
0442e04e05
commit
026cd7d53d
7 files changed
+40
-41
No files matched your search
@@ -3289,7 +3289,7 @@ static int CmdNumCon(const char *Cmd) {
|
||||
|
||||
for (uint8_t i = 0; i < ARRAYLEN(radix); i++) {
|
||||
MBEDTLS_MPI_CHK(mbedtls_mpi_write_string(&N, radix[i].radix, s, sizeof(s), &slen));
|
||||
if (slen > 0) {
|
||||
if (slen > 0) {
|
||||
PrintAndLogEx(SUCCESS, "%s%s", radix[i].desc, s);
|
||||
}
|
||||
}
|
||||
|
||||
+10
-10
@@ -365,7 +365,7 @@ static int generate_config_card(const iclass_config_card_item_t *o, uint8_t *ke
|
||||
// KEYROLL need to encrypt
|
||||
uint8_t key_en[16] = {0};
|
||||
uint8_t *keyptr_en = NULL;
|
||||
if (IsCardHelperPresent(false) == false){
|
||||
if (IsCardHelperPresent(false) == false) {
|
||||
size_t keylen = 0;
|
||||
int res_key = loadFile_safe(ICLASS_DECRYPTION_BIN, "", (void **)&keyptr_en, &keylen);
|
||||
if (res_key != PM3_SUCCESS) {
|
||||
@@ -384,13 +384,13 @@ static int generate_config_card(const iclass_config_card_item_t *o, uint8_t *ke
|
||||
|
||||
PrintAndLogEx(INFO, "Setting up encryption... " NOLF);
|
||||
uint8_t ffs[8] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
||||
if (IsCardHelperPresent(false) != false){
|
||||
if (IsCardHelperPresent(false) != false) {
|
||||
if (Encrypt(ffs, ffs) == false) {
|
||||
PrintAndLogEx(WARNING, "failed to encrypt FF");
|
||||
} else {
|
||||
PrintAndLogEx(NORMAL, "( " _GREEN_("ok") " )");
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
iclass_encrypt_block_data(ffs, key_en);
|
||||
PrintAndLogEx(NORMAL, "( " _GREEN_("ok") " )");
|
||||
}
|
||||
@@ -400,13 +400,13 @@ static int generate_config_card(const iclass_config_card_item_t *o, uint8_t *ke
|
||||
uint8_t lkey[8];
|
||||
memcpy(lkey, key, sizeof(lkey));
|
||||
uint8_t enckey1[8];
|
||||
if (IsCardHelperPresent(false) != false){
|
||||
if (IsCardHelperPresent(false) != false) {
|
||||
if (Encrypt(lkey, enckey1) == false) {
|
||||
PrintAndLogEx(WARNING, "failed to encrypt key1");
|
||||
} else {
|
||||
PrintAndLogEx(NORMAL, "( " _GREEN_("ok") " )");
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
iclass_encrypt_block_data(lkey, key_en);
|
||||
PrintAndLogEx(NORMAL, "( " _GREEN_("ok") " )");
|
||||
}
|
||||
@@ -416,7 +416,7 @@ static int generate_config_card(const iclass_config_card_item_t *o, uint8_t *ke
|
||||
memcpy(data + (6 * 8), o->data, sizeof(o->data));
|
||||
|
||||
// encrypted keyroll key 0D
|
||||
if (IsCardHelperPresent(false) != false){
|
||||
if (IsCardHelperPresent(false) != false) {
|
||||
memcpy(data + (0x0D * 8), enckey1, sizeof(enckey1));
|
||||
} else {
|
||||
memcpy(data + (0x0D * 8), lkey, sizeof(enckey1));
|
||||
@@ -432,14 +432,14 @@ static int generate_config_card(const iclass_config_card_item_t *o, uint8_t *ke
|
||||
uint8_t foo[8] = {0x15};
|
||||
memcpy(foo + 1, key, 7);
|
||||
uint8_t enckey2[8];
|
||||
if (IsCardHelperPresent(false) != false){
|
||||
if (IsCardHelperPresent(false) != false) {
|
||||
if (Encrypt(foo, enckey2) == false) {
|
||||
PrintAndLogEx(WARNING, "failed to encrypt partial 1");
|
||||
} else {
|
||||
PrintAndLogEx(NORMAL, "( " _GREEN_("ok") " )");
|
||||
memcpy(data + (0x14 * 8), enckey2, sizeof(enckey2));
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
iclass_encrypt_block_data(foo, key_en);
|
||||
PrintAndLogEx(NORMAL, "( " _GREEN_("ok") " )");
|
||||
memcpy(data + (0x14 * 8), foo, sizeof(enckey2));
|
||||
@@ -449,14 +449,14 @@ static int generate_config_card(const iclass_config_card_item_t *o, uint8_t *ke
|
||||
PrintAndLogEx(INFO, "Setting encrypted partial key15... " NOLF);
|
||||
memset(foo, 0xFF, sizeof(foo));
|
||||
foo[0] = lkey[7];
|
||||
if (IsCardHelperPresent(false) != false){
|
||||
if (IsCardHelperPresent(false) != false) {
|
||||
if (Encrypt(foo, enckey2) == false) {
|
||||
PrintAndLogEx(WARNING, "failed to encrypt partial 2");
|
||||
} else {
|
||||
PrintAndLogEx(NORMAL, "( " _GREEN_("ok") " )");
|
||||
memcpy(data + (0x15 * 8), enckey2, sizeof(enckey2));
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
iclass_encrypt_block_data(foo, key_en);
|
||||
PrintAndLogEx(NORMAL, "( " _GREEN_("ok") " )");
|
||||
memcpy(data + (0x15 * 8), foo, sizeof(enckey2));
|
||||
|
||||
+1
-1
@@ -682,7 +682,7 @@ int TestProxmark(pm3_device_t *dev) {
|
||||
int res;
|
||||
if (is_tcp_conn || is_udp_conn) {
|
||||
if ((strstr(g_conn.serial_port_name, "localhost") != NULL) ||
|
||||
(strstr(g_conn.serial_port_name, "127.0.0.1") != NULL)) {
|
||||
(strstr(g_conn.serial_port_name, "127.0.0.1") != NULL)) {
|
||||
res = uart_reconfigure_timeouts(UART_TCP_CLIENT_LOCAL_RX_TIMEOUT_MS);
|
||||
} else {
|
||||
res = uart_reconfigure_timeouts(UART_TCP_CLIENT_RX_TIMEOUT_MS);
|
||||
|
||||
Reference in new issue
Block a user