style
This commit is contained in:
@@ -59,7 +59,7 @@ void SendCommand(UsbCommand *c) {
|
||||
#endif
|
||||
|
||||
if (offline) {
|
||||
PrintAndLogEx(WARNING, "Sending bytes to Proxmark3 failed." _YELLOW_("offline") );
|
||||
PrintAndLogEx(WARNING, "Sending bytes to Proxmark3 failed." _YELLOW_("offline"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ __attribute__((force_align_arg_pointer))
|
||||
if (txBuffer_pending) {
|
||||
if (!uart_send(sp, (uint8_t *) &txBuffer, sizeof(UsbCommand))) {
|
||||
//counter_to_offline++;
|
||||
PrintAndLogEx(WARNING, "sending bytes to Proxmark3 device" _RED_("failed") );
|
||||
PrintAndLogEx(WARNING, "sending bytes to Proxmark3 device" _RED_("failed"));
|
||||
}
|
||||
txBuffer_pending = false;
|
||||
|
||||
|
||||
@@ -287,8 +287,8 @@ static int CmdEMVGPO(const char *Cmd) {
|
||||
PrintAndLogEx(ERR, "Can't create PDOL data.");
|
||||
tlvdb_free(tmp_ext);
|
||||
tlvdb_free(tlvRoot);
|
||||
if ( pdol_data_tlv != &data_tlv);
|
||||
free(pdol_data_tlv);
|
||||
if (pdol_data_tlv != &data_tlv);
|
||||
free(pdol_data_tlv);
|
||||
return 4;
|
||||
}
|
||||
PrintAndLogEx(INFO, "PDOL data[%d]: %s", pdol_data_tlv_data_len, sprint_hex(pdol_data_tlv_data, pdol_data_tlv_data_len));
|
||||
@@ -1278,9 +1278,9 @@ static int CmdEMVExec(const char *Cmd) {
|
||||
// authorization response code from acquirer
|
||||
const char HostResponse[] = "00"; // 0x3030
|
||||
size_t HostResponseLen = sizeof(HostResponse) - 1;
|
||||
|
||||
|
||||
PrintAndLogEx(NORMAL, "Host Response: `%s`", HostResponse);
|
||||
|
||||
|
||||
tlvdb_change_or_add_node(tlvRoot, 0x8a, HostResponseLen, (const unsigned char *)HostResponse);
|
||||
|
||||
if (CryptoVersion == 10) {
|
||||
|
||||
@@ -253,7 +253,7 @@ static size_t crypto_pk_polarssl_get_nbits(const struct crypto_pk *_cp) {
|
||||
static unsigned char *crypto_pk_polarssl_get_parameter(const struct crypto_pk *_cp, unsigned param, size_t *plen) {
|
||||
struct crypto_pk_polarssl *cp = (struct crypto_pk_polarssl *)_cp;
|
||||
unsigned char *result = NULL;
|
||||
int res;
|
||||
int res;
|
||||
switch (param) {
|
||||
// mod
|
||||
case 0:
|
||||
@@ -261,10 +261,10 @@ static unsigned char *crypto_pk_polarssl_get_parameter(const struct crypto_pk *_
|
||||
result = malloc(*plen);
|
||||
memset(result, 0x00, *plen);
|
||||
res = mbedtls_mpi_write_binary(&cp->ctx.N, result, *plen);
|
||||
if ( res == 0 ) {
|
||||
if (res == 0) {
|
||||
printf("Error write_binary.");
|
||||
result = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
// exp
|
||||
case 1:
|
||||
@@ -272,9 +272,9 @@ static unsigned char *crypto_pk_polarssl_get_parameter(const struct crypto_pk *_
|
||||
result = malloc(*plen);
|
||||
memset(result, 0x00, *plen);
|
||||
res = mbedtls_mpi_write_binary(&cp->ctx.E, result, *plen);
|
||||
if ( res == 0 ) {
|
||||
if (res == 0) {
|
||||
printf("Error write_binary.");
|
||||
result = 0;
|
||||
result = 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -65,15 +65,15 @@ static RetType write_to_buffer(void *cookie, const char *data, LenType len) {
|
||||
if (newsize >= b->alloc) { // NB! one extra byte is needed to avoid buffer overflow at close_buffer
|
||||
// make room
|
||||
size_t newalloc = newsize + newsize / 2 + 1; // give 50% more room
|
||||
|
||||
|
||||
char *tmp = realloc(ptr, newalloc);
|
||||
if ( tmp == NULL ) {
|
||||
if (tmp == NULL) {
|
||||
free(ptr);
|
||||
return -1;
|
||||
} else {
|
||||
ptr = tmp;
|
||||
}
|
||||
|
||||
|
||||
b->alloc = newalloc;
|
||||
*b->ptr = ptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user