Commit graph

9316 commits

Author SHA1 Message Date
Matt Moran 82cd44e99f Reorder function definitions
Order is roughly:
- exported helpers
- helpers
- read -> create -> delete
- exported commands
2022-01-06 00:11:30 +13:00
Matt Moran 02e5fb6b1c Fix incorrect comments 2022-01-06 00:00:04 +13:00
Matt Moran de30ba90d1 Merge remote-tracking branch 'upstream/master' into feat/hf-gallagher 2022-01-05 23:56:33 +13:00
Matt Moran caebfdca62 Update license from LGPL to GPL 2022-01-05 23:54:18 +13:00
Matt Moran 8ecfc4af34 Make variables & function names snake_case 2022-01-05 23:53:03 +13:00
Matt Moran fad30294aa Format styles 2022-01-05 23:08:10 +13:00
Matt Moran 81da8a1317 Add hf gallagher delete command 2022-01-05 00:22:34 +13:00
Matt Moran 28437f018b Check if facility already exists in CAD
Disallow duplicate credentials for the same facility (because readers won't handle it properly - I assume they'll just use the first entry?)
2022-01-04 22:38:30 +13:00
Matt Moran d7989caad0 Automatically choose an new valid Gallagher AID 2022-01-04 22:15:00 +13:00
Matt Moran d3da798517 Move GallagherDiversifyKey to top of file 2022-01-04 21:14:18 +13:00
iceman1001 5ddfedbad0 cppcheck fix const 2022-01-04 07:32:58 +01:00
iceman1001 a7f3a42aff cppcheck fix const 2022-01-04 07:32:21 +01:00
iceman1001 ed10409bfd cppcheck fix uninitvar 2022-01-04 07:31:10 +01:00
iceman1001 cd825bfac8 cppcheck fixes 2022-01-04 07:28:20 +01:00
Matt Moran 28844756d9 Add default MIFARE Site Key 2022-01-04 18:19:42 +13:00
Matt Moran e129bee161 Fix print level should be ERR, was FAILED 2022-01-04 18:06:20 +13:00
Matt Moran f395b28643 Extract cadAidUintToByte and cadAidByteToUint 2022-01-04 18:06:02 +13:00
Matt Moran 21b080e49a Extract selectAid and authenticate commands 2022-01-04 17:42:05 +13:00
Matt Moran 1e3ed42f54 Extract CAD_AID to a constant 2022-01-04 17:04:05 +13:00
Matt Moran 863cf16015 Add comments and logging 2022-01-04 16:59:59 +13:00
Philippe Teuwen 0f9315391a Changed drastically Hitag S ARM code to remove state machines and ease way to build new commands, Fixed Hitag S crypto mode with key or NrAr, fixed lf hitag cc, fixed pwd dump in hitagS dump with LKP 2022-01-03 22:43:58 +01:00
iceman1001 3491157345 cppcheck fixes and other minor stuff 2022-01-03 22:17:40 +01:00
iceman1001 7b61c35948 textual change to trace list -h 2022-01-03 22:12:30 +01:00
iceman1001 0a4c9f83ac fixes to hf iclass configcard mem setup, textual output, MIX->NG convertion 2022-01-03 22:08:55 +01:00
Matt Moran aed687cb96 Add basic cloning support 2022-01-03 17:02:56 +13:00
Matt Moran 7b0a85a0af Fix incorrect types in encodeCardholderCredentials 2022-01-03 16:39:18 +13:00
Philippe Teuwen 89554501bb trace list: check protocol exists and allows to run without arg 2022-01-02 00:13:20 +01:00
iceman1001 0bad12fcac cppcheck 2022-01-01 17:45:43 +01:00
iceman1001 89becb8d9f cppcheck 2022-01-01 17:43:12 +01:00
iceman1001 4919d14c13 cppcheck fix 2022-01-01 16:29:51 +01:00
iceman1001 9a746db6f9 cppcheck fixes 2022-01-01 15:59:02 +01:00
iceman1001 a85fa6dfb7 mem leak fix 2022-01-01 15:46:41 +01:00
iceman1001 ea7f2e03d3 cppcheck fixes 2022-01-01 15:38:57 +01:00
Matt Moran 13ff8d50cf Add hf gallagher reader command 2022-01-01 22:22:57 +13:00
iceman1001 03282f0fd0 maur keys 2022-01-01 09:54:38 +01:00
iceman1001 77f49c8efc text - unified 2022-01-01 09:39:05 +01:00
iceman1001 debf2796cc text - unified 2022-01-01 09:25:53 +01:00
Matt Moran 491c93e715 Add CardholderCredentials struct 2022-01-01 17:34:53 +13:00
Philippe Teuwen 7a5786b9e4 fix a number of strx usages 2022-01-01 02:39:10 +01:00
iceman1001 cb5cd18ff2 make even more obvious 2021-12-31 16:14:11 +01:00
Philippe Teuwen f81b772577 gview: fix parsing and desc 2021-12-31 12:54:58 +01:00
Philippe Teuwen 23b4a47e94 make style 2021-12-31 12:45:21 +01:00
iceman1001 7265b2708b text 2021-12-31 11:11:56 +01:00
iceman1001 f9ac27c223 text 2021-12-31 09:27:26 +01:00
iceman1001 9c2b5118df hf mf gview now support user supplied password 2021-12-31 09:24:10 +01:00
iceman1001 0cb1cfee6b text 2021-12-30 22:06:43 +01:00
Philippe Teuwen eb3c48cd25 make style 2021-12-30 12:41:23 +01:00
Philippe Teuwen 02f2318326 option --force to hf mfu rdb/wrbl and document how to set version & sig on ultimate card 2021-12-30 12:11:22 +01:00
Philippe Teuwen 85def31a8d hitag1/S trace: add crc check
Example:

[usb] pm3 --> trace load -f traces/lf_HitagS256_dump.trace
[+] loaded 272 bytes from binary file traces/lf_HitagS256_dump.trace
[+] Recorded Activity (TraceLen = 272 bytes)
[?] try `trace list -1 -t ...` to view trace.  Remember the `-1` param
[usb] pm3 --> trace list -t hitags -c
[=] downloading tracelog data from device
[+] Recorded activity (trace len = 272 bytes)
[=] start = start of start frame end = end of frame. src = source of transfer
[=] Hitag1 / Hitag2 / HitagS - Timings in ETU (8us)

      Start |        End | Src | Data (! denotes parity error)                                           | CRC | Annotation
------------+------------+-----+-------------------------------------------------------------------------+-----+--------------------
          0 |          0 | Rdr |18(5)                                                                    |     |
        117 |        117 | Tag |21  a5  b4 [73]                                                          | !crc|
          0 |          0 | Rdr |00(5) 21  a5  b4  73 [8c]                                                |  ok |
        117 |        117 | Tag |c9  00  00  aa [75]                                                      |  ok |
          0 |          0 | Rdr |0c(4) 00 [ab]                                                            |  ok |
        117 |        117 | Tag |21  a5  b4  73 [53]                                                      |  ok |
          0 |          0 | Rdr |0c(4) 01 [b6]                                                            |  ok |
        117 |        117 | Tag |c9  00  00  aa [75]                                                      |  ok |
          0 |          0 | Rdr |0c(4) 02 [91]                                                            |  ok |
        117 |        117 | Tag |48  54  4f  4e [2c]                                                      |  ok |
          0 |          0 | Rdr |0c(4) 03 [8c]                                                            |  ok |
        117 |        117 | Tag |4d  49  4b  52 [1e]                                                      |  ok |
          0 |          0 | Rdr |0c(4) 04 [df]                                                            |  ok |
        117 |        117 | Tag |00  00  00  00 [a6]                                                      |  ok |
          0 |          0 | Rdr |0c(4) 05 [c2]                                                            |  ok |
        117 |        117 | Tag |00  00  00  00 [a6]                                                      |  ok |
          0 |          0 | Rdr |0c(4) 06 [e5]                                                            |  ok |
        118 |        118 | Tag |00  00  00  00 [a6]                                                      |  ok |
          0 |          0 | Rdr |0c(4) 07 [f8]                                                            |  ok |
        118 |        118 | Tag |57  5f  4f  4b [88]                                                      |  ok |
          0 |          0 | Rdr |0c(4) 08 [43]                                                            |  ok |
2021-12-30 01:46:41 +01:00
Philippe Teuwen 8a85702662 hitags: don't record SOF in trace and demodulate AC frame 2021-12-30 01:11:12 +01:00