Skip to content

Commit

Permalink
Sync nfc-utils.[hc] with devel libnfc files
Browse files Browse the repository at this point in the history
  • Loading branch information
neomilium committed Apr 4, 2013
1 parent ba7e75c commit e502460
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
4 changes: 1 addition & 3 deletions src/mfoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ int main(int argc, char *const argv[])
// Array with default Mifare Classic keys
uint8_t defaultKeys[][6] = {
{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, // Default key (first key used by program if no user defined key)
{0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5}, // NFCForum MAD key
{0xd3, 0xf7, 0xd3, 0xf7, 0xd3, 0xf7}, // NFCForum content key
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // Blank key
{0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5},
{0x4d, 0x3a, 0x99, 0xc3, 0x51, 0xdd},
Expand Down Expand Up @@ -251,7 +249,7 @@ int main(int argc, char *const argv[])
t.sectors[s].foundKeyA = t.sectors[s].foundKeyB = false;
}

print_nfc_target(t.nt, true);
print_nfc_target(&t.nt, true);

fprintf(stdout, "\nTry to authenticate to all sectors with default keys...\n");
fprintf(stdout, "Symbols: '.' no key found, '/' A key found, '\\' B key found, 'x' both keys found\n");
Expand Down
18 changes: 11 additions & 7 deletions src/nfc-utils.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
/*-
* Public platform independent Near Field Communication (NFC) library examples
* Free/Libre Near Field Communication (NFC) library
*
* Copyright (C) 2009 Roel Verdult
* Copyright (C) 2010, 2011 Romain Tartière
* Copyright (C) 2009, 2010, 2011, 2012 Romuald Conty
* Libnfc historical contributors:
* Copyright (C) 2009 Roel Verdult
* Copyright (C) 2009-2013 Romuald Conty
* Copyright (C) 2010-2012 Romain Tartière
* Copyright (C) 2010-2013 Philippe Teuwen
* Copyright (C) 2012-2013 Ludovic Rousseau
* Additional contributors of this file:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
Expand Down Expand Up @@ -115,10 +119,10 @@ print_hex_par(const uint8_t *pbtData, const size_t szBits, const uint8_t *pbtDat
}

void
print_nfc_target(const nfc_target nt, bool verbose)
print_nfc_target(const nfc_target *pnt, bool verbose)
{
char *s;
str_nfc_target(&s, nt, verbose);
str_nfc_target(&s, pnt, verbose);
printf("%s", s);
free(s);
nfc_free(s);
}
14 changes: 9 additions & 5 deletions src/nfc-utils.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
/*-
* Public platform independent Near Field Communication (NFC) library examples
* Free/Libre Near Field Communication (NFC) library
*
* Copyright (C) 2009 Roel Verdult
* Copyright (C) 2010 Romain Tartière
* Copyright (C) 2010, 2011, 2012 Romuald Conty
* Libnfc historical contributors:
* Copyright (C) 2009 Roel Verdult
* Copyright (C) 2009-2013 Romuald Conty
* Copyright (C) 2010-2012 Romain Tartière
* Copyright (C) 2010-2013 Philippe Teuwen
* Copyright (C) 2012-2013 Ludovic Rousseau
* Additional contributors of this file:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
Expand Down Expand Up @@ -94,6 +98,6 @@ void print_hex(const uint8_t *pbtData, const size_t szLen);
void print_hex_bits(const uint8_t *pbtData, const size_t szBits);
void print_hex_par(const uint8_t *pbtData, const size_t szBits, const uint8_t *pbtDataPar);

void print_nfc_target(const nfc_target nt, bool verbose);
void print_nfc_target(const nfc_target *pnt, bool verbose);

#endif

0 comments on commit e502460

Please sign in to comment.