Commit graph

184 commits

Author SHA1 Message Date
Simon Yorkston
8de7ce3899 Adding support for UL Gen 2 Badges 2016-04-09 01:32:14 +10:00
Romuald Conty
42d455c4e7 Merge pull request #325 from quantum-x/master
Extends nfc-mfultralight functionality (Magic cards, unattended mode)
2015-11-19 00:02:04 +01:00
Simon Yorkston
619b476028 Cleaned non-magic exit 2015-11-18 23:11:59 +01:00
Simon Yorkston
0cece94778 Adds --check-magic flag to nfc-mfultralight 2015-11-18 23:03:36 +01:00
Simon Yorkston
3aa2d46588 Added automatic mode to nfc-mfultralight 2015-11-18 08:56:48 +01:00
quantum-x
758cb0cc05 Update nfc-mfclassic.c 2015-11-03 18:52:39 +01:00
quantum-x
c71d7267ac Update nfc-mfclassic.c
Tweaking back the unlocked_read / write_block_zero after magic2 card discovered
2015-11-03 18:48:22 +01:00
quantum-x
20f22b97e7 Updating nesting typo 2015-11-03 18:39:03 +01:00
quantum-x
b5684c1755 Removing typo
Removing typo
2015-11-03 18:33:53 +01:00
quantum-x
87c6053d6f Updating nfc-mfclassic.c
Modifying behavior relating to magic cards.
If a user has a 'magic2' card (IE, direct-write, not a 'fully magic' card) - we'll warn them that they don't need to use the W / R modes, and then proceed with the unlock operation, instead of exiting.
2015-11-03 18:11:51 +01:00
Romuald Conty
33ce39ff71 nfc-relay-picc: fix wrong open mode for file descriptor
Fixes #280
2015-04-30 14:33:59 +02:00
Romuald Conty
8fbedb87f5 Update links from googlecode to github. 2015-04-30 14:19:03 +02:00
Marcos Vives Del Sol
5a08fcf2bc Fix "undefined reference"s 2015-02-22 13:27:13 +01:00
Adam Laurie
b978c45a11 tolerate errors when writing as well as reading 2014-05-25 16:39:47 +01:00
Philippe Teuwen
bb9babbeda Fix out-of-bounds access in nfc-mfultralight unveiled by coverity scan:
*** CID 1090333:  Out-of-bounds access  (OVERRUN)
2014-04-14 23:29:18 +02:00
Philippe Teuwen
db4fae9c2c Remove unreachable statements
As seen with clang -Wunreachable-code
2014-03-04 01:39:12 +01:00
Philippe Teuwen
a7649da2b0 nfc-read-forum-tag3: add -q and document -o - 2014-02-18 00:22:24 +01:00
Philippe Teuwen
2aa4b99b7b nfc-read-forum-tag3: full parsing of NDEF Attribute Block 2014-02-17 23:57:59 +01:00
Pim 't Hart
73c84c214d nfc-read-forum-tag3: fix incomplete NDEF retrieval and size of output file 2014-02-17 23:09:15 +01:00
Philippe Teuwen
491db20d54 nfc-jewel: remove extraneous parentheses to silence warning 2014-02-11 23:23:42 +01:00
Philippe Teuwen
766ed55c79 nfc-jewel: fix out-of-bounds array access
Defect(s) Reported-by: Coverity Scan
** CID 1169884:  Out-of-bounds read  (OVERRUN)
/utils/nfc-jewel.c: 186 in write_card()
2014-02-07 23:09:40 +01:00
Pim 't Hart
ef81f06344 Adding nfc-jewel util 2014-02-03 00:04:08 +01:00
Philippe Teuwen
7a30e35496 nfc-mfclassic: update help & man page 2014-01-28 00:22:33 +01:00
Philippe Teuwen
4817a6e5c9 make style 2013-12-02 22:55:10 +01:00
Philippe Teuwen
b8e0eec91d nfc-mfclassic: initialize always bFormatCard 2013-11-12 00:43:25 +01:00
Adam Laurie
250068462b add format/wipe command to nfc-mfclassic 2013-11-11 22:03:09 +00:00
Philippe Teuwen
117b58f501 nfc-read-forum-tag3: avoid passing large struct as parameter
Problem reported by Coverity:
CID 1090334 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
  pass_by_value: Passing parameter nt of type nfc_target const (size 291 bytes) by value.
2013-09-22 18:32:47 +02:00
Philippe Teuwen
cedbefb880 nfc-relay-picc: sleep() expects unsigned int
This avoids Coverity being unhappy that only lower bound was defined, well I hope

lower_bounds: Checking lower bounds of signed scalar "waiting_time" by "waiting_time > 0".
CID 1090343 (#1 of 1): Untrusted value as argument (TAINTED_SCALAR)
  tainted_data: Passing tainted variable "waiting_time" to a tainted sink.
  sleep(waiting_time);
2013-09-22 03:00:58 +02:00
Philippe Teuwen
61884967ea nfc-mfclassic: verify return of nfc_initiator_select_passive_target()
Problem reported by Coverity:
CID 1090323 (#1 of 1): Unchecked return value (CHECKED_RETURN)
  unchecked_value: No check of the return value of "nfc_initiator_select_passive_target(pnd, nmMifare, nt.nti.nai.abtUid, nt.nti.nai.szUidLen, NULL)".
2013-09-22 02:45:23 +02:00
Philippe Teuwen
a4f466df06 Verify return of nfc_device_set_property_bool()
Problem reported by Coverity:
CID 1090325 (#1 of 1): Unchecked return value (CHECKED_RETURN)
  unchecked_value: No check of the return value of "nfc_device_set_property_bool(pnd, NP_AUTO_ISO14443_4, false)".
2013-09-22 02:41:11 +02:00
Philippe Teuwen
679897d0a1 nfc-emulate-forum-tag4: fix TOCTOU
Hopefully fix TOCTOU by calling fopen() before stat()

At least this should prevent Coverity to complain about it:
CID 1090346 (#1 of 1): Time of check time of use (TOCTOU)
  fs_check_call: Calling function "stat(char const *, struct stat *)" to perform check on "filename".
  toctou: Calling function "fopen(char const * restrict, char const * restrict)" that uses "filename" after a check function. This can cause a time-of-check, time-of-use race condition.

Note that it seems pretty hard to avoid completely:
https://en.wikipedia.org/wiki/Time_of_check_to_time_of_use#Preventing_TOCTTOU
2013-09-22 02:29:07 +02:00
Philippe Teuwen
feb5f37aa3 nfc-read-forum-tag3: remove redundant error
switch case was redundant as getopt was already telling the issue:

  nfc-read-forum-tag3: option requires an argument -- 'o'
  Option -o requires an argument.

This fixes also a problem reported by Coverity about missing break:

CID 1090330 (#1 of 1): Missing break in switch (MISSING_BREAK)
  unterminated_case: This case (value 63) is not terminated by a 'break' statement.
2013-09-22 02:14:08 +02:00
Philippe Teuwen
d9b531f50f Verify return of nfc_device_set_property_bool()
Problem reported by Coverity
CID 1090319 (#1 of 1): Unchecked return value (CHECKED_RETURN)
  unchecked_value: No check of the return value of "nfc_device_set_property_bool(pnd, NP_EASY_FRAMING, nt.nti.nai.btSak & 0x20)".
CID 1090320 (#1 of 1): Unchecked return value (CHECKED_RETURN)
  unchecked_value: No check of the return value of "nfc_device_set_property_bool(dev, NP_HANDLE_CRC, false)".
CID 1090324 (#1 of 2): Unchecked return value (CHECKED_RETURN)
  unchecked_value: No check of the return value of "nfc_device_set_property_bool(pnd, NP_ACTIVATE_FIELD, true)".
CID 1090325 (#1 of 1): Unchecked return value (CHECKED_RETURN)
  unchecked_value: No check of the return value of "nfc_device_set_property_bool(pnd, NP_AUTO_ISO14443_4, false)".
2013-09-22 01:31:45 +02:00
Ludovic Rousseau
107b4ece8b Fix use after free bug
nfc_exit(context); was called 2 times

CID 1090348 (#1 of 1): Use after free (USE_AFTER_FREE)53. deref_arg:
Calling "nfc_exit(nfc_context *)" dereferences freed pointer "context".
(The dereference is assumed on the basis of the 'nonnull' parameter
attribute.)
2013-09-19 20:38:56 +02:00
Philippe Teuwen
ad9694cf00 nfc-list: New option to choose which technologies to poll for
This is useful especially against chips emulating several types
at once (e.g. PN53x, PN544 etc)
2013-09-09 15:58:07 +02:00
Peter Meerwald
34bf7b3089 nfs-list: drop outdated examples superseeded by connection string
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-09-03 16:30:43 +02:00
Philippe Teuwen
a2a335e3d4 make style 2013-08-31 17:35:41 +02:00
Adam Laurie
07c54cd91b allow setting of UID for special 'chinese' ultralight cards 2013-08-31 16:15:27 +01:00
Philippe Teuwen
bb5b712a74 Adding link to AUTHORS in the copyright headers 2013-07-17 13:57:56 +02:00
Philippe Teuwen
2db4a0e7e4 make style
new version of astyle, better separation of XOR
2013-07-03 00:16:15 +02:00
Philippe Teuwen
7638e9ea87 mifare_classic_block_manufacturer: clearer struct members
Fixes issue 250
2013-06-13 20:14:22 +02:00
Philippe Teuwen
0841a94c65 nfc-mfclassic: allow option f for read operation too 2013-04-09 23:42:55 +02:00
Romuald Conty
e6ab66037d Better support for some special chinese cards
Fixes issue 190
2013-04-05 11:29:31 +02:00
Philippe Teuwen
e70a3314bf Update ChangeLog & make style 2013-03-12 17:07:09 +01:00
Philippe Teuwen
20e51e9752 nfc-mfclassic: add option to allow using keyfile from another card 2013-03-12 15:39:57 +01:00
Philippe Teuwen
16161e1a68 nfc-mfclassic: detect 2K MFP via RATS 2013-03-12 14:15:04 +01:00
Philippe Teuwen
56ea2e65dc nfc-mfclassic: use smaller files for cards < 4k 2013-03-12 10:56:57 +01:00
Philippe Teuwen
94617366a7 nfc-mfclassic: abort if expected UID is not matching real card 2013-03-12 10:56:20 +01:00
Philippe Teuwen
bb7b05681e nfc-mfclassic: fix reporting of processed blocks number 2013-03-12 10:55:45 +01:00
Philippe Teuwen
bf164220ee Unify copyright notices & update authors lists 2013-03-10 16:15:23 +01:00