21823 Commits

Author SHA1 Message Date
Iceman 537f844ce4 Merge pull request #3301 from suut/desfire-ev3c-support__create-mapping
Desfire EV3C Support: create MFC mapping
2026-05-14 18:50:53 +02:00
suut 5c376032ed hf mfdes createmfcmapping: review comments 2026-05-14 18:39:12 +02:00
Iceman 476289ade0 Merge pull request #3307 from kormax/aidlist-extra-calypso-lid
Calypso AID handling improvements
2026-05-14 11:56:51 +02:00
kormax 551b3bae28 Introduce protocol-scoped 'Extras' field to 'aidlist.json' 2026-05-14 09:10:22 +03:00
kormax 462592f713 Attempt shorter Calypso AID values first for 'info' and 'dump' 2026-05-14 08:30:05 +03:00
kormax 7ff2d017a4 Update AID name matching priority for Calypso 2026-05-14 08:23:36 +03:00
Iceman e95b1060a4 Merge pull request #3306 from kormax/calypso-aid-values
Add more Calypso-related AID entries to 'aidlist.json'
2026-05-13 20:28:36 +02:00
kormax 8eacb30ed2 Add more Calypso-related AID entries to 'aidlist.json' 2026-05-13 21:21:45 +03:00
Iceman 8415ab8b71 Merge pull request #3304 from Sanduuz/fix/client_lib_missing_symbol
Add prime.c to experimental client lib CMakeLists.txt
2026-05-13 15:24:47 +02:00
Sanduuz 2d1fbc12c0 Add prime.c containing mifare_prime_get_version_str symbol to experimental client lib CMakeLists.txt 2026-05-13 15:43:52 +03:00
Iceman d9ed0b310f Merge pull request #3302 from kormax/calypso-improvements
Calypso improvements
2026-05-12 21:53:17 +02:00
Iceman fce7441dc6 Merge pull request #3303 from kormax/calypso-list-more-commands
Recognize more command codes in 'hf calypso list'
2026-05-12 21:51:46 +02:00
kormax d0d562528d Recognize more command codes in 'hf calypso list' 2026-05-12 19:04:02 +03:00
kormax bd5cb11ee7 Add color codes to ansi.h 2026-05-12 18:22:15 +03:00
Philippe Teuwen 620e8b4744 Client Makefile: add FORCE* options to mirror the SKIP* options, mostly for maintainers 2026-05-11 21:43:57 +02:00
kormax 954cf2e392 Improve output formatting for 'hf calypso dump' 2026-05-11 21:03:17 +03:00
kormax 5621bd7340 Add Calypso data objects related to PKI 2026-05-11 20:50:33 +03:00
iceman1001 cbb572afad style 2026-05-11 14:36:17 +02:00
suut ac9db3314f Add missing argument to PrintAndLogEx 2026-05-11 14:02:15 +02:00
suut ce2e59c440 Add support for the special block list values 'data' and 'trailer' when making a MFC mapping 2026-05-11 11:08:14 +02:00
suut 91eb6345a9 Uniformize code style 2026-05-11 11:01:09 +02:00
suut 2e3425d537 Correct typo 2026-05-11 10:54:22 +02:00
suut 1c258381ef add support for hf mfdes createmfcmapping 2026-05-11 10:54:22 +02:00
Iceman 9fe6f12859 Merge pull request #3300 from Antiklesys/master
Added SC Operations
2026-05-11 10:49:50 +02:00
Antiklesys 7c1fa4de4b Update cmdhficlass.c
Signed-off-by: Antiklesys <syselkitna@gmail.com>
2026-05-11 14:07:05 +08:00
Antiklesys f73ec7275c Fix formatting in command help text
Signed-off-by: Antiklesys <syselkitna@gmail.com>
2026-05-11 14:05:57 +08:00
Antiklesys 3a293cb98c Update CHANGELOG.md 2026-05-11 13:58:16 +08:00
Antiklesys abe54994d2 Implemented SC operations 2026-05-11 13:54:49 +08:00
Antiklesys b269b83a83 Merge branch 'RfidResearchGroup:master' into master 2026-05-11 13:09:34 +08:00
Iceman 70516ce41d Merge pull request #3288 from suut/desfire-ev3c-support
DESFire EV3C support
2026-05-11 05:19:20 +02:00
suut 6661653316 Remove extra spaces 2026-05-10 23:34:41 +02:00
suut 6d458a9f49 Remove the --force argument from hf mfdes auth 2026-05-10 23:33:37 +02:00
suut b018054bce Fix linter error 2026-05-10 23:28:27 +02:00
suut cfb32e6951 Remove superfluous typing of defines 2026-05-10 23:27:27 +02:00
Iceman a11275a2f7 Merge pull request #3299 from kormax/calypso-list
Add `hf calypso list` command
2026-05-10 20:59:57 +02:00
kormax 3da7e52c1a Implement 'hf calypso list' command 2026-05-10 21:18:04 +03:00
kormax 9399dfc16e Fix ISO7816 trace CRC status handling 2026-05-10 21:18:04 +03:00
kormax 80751a88c0 Add ISODEP trace annotation helpers 2026-05-10 21:17:56 +03:00
Antiklesys d5d00bce0a smartcard-i2c-fixes
## armsrc: smartcard / I2C correctness + SAM compatibility fixes

A focused pass over `armsrc/i2c.{c,h}` and `armsrc/i2c_direct.c` addressing correctness bugs (NULL deref on alloc failure, unbounded recursion, write-failure silently falling through to read), and removing two long-standing SAM-compatibility blockers (`SmartCardSetBaud` was a stub; float in firmware hot path).

### Fixed

- **`SmartCardRaw`: BigBuf_calloc result was unchecked.** NULL deref on memory pressure crashed the firmware. Now bails with `PM3_EMALLOC` before touching `resp[]`.
- **`SmartCardRaw`: `I2C_BufferWrite` failure was only acted on at `dbglevel > 3`.** Lower debug levels silently fell through to `sc_rx_bytes()` reading from a card we never wrote to. The `reply_ng` / `goto OUT` path now runs on any write failure; the `Dbprintf` is the only thing gated on dbglevel.
- **`SmartCardRaw`: replaced float division** `(p->wait_delay * 1000) / 3.07` with integer math via `uint64_t`. Avoids pulling `__aeabi_fdiv` into the ARM image and removes overflow at large `wait_delay` values: `wait = (ms * 100000 + 153) / 307`.
- **`SmartCardUpgrade`: BigBuf_calloc result was unchecked.** Now bails with `PM3_EMALLOC`. Renamed local `verfiydata` typo to `verifydata`. Failure messages now include the offset where the upgrade aborted (`Writing failed at offset 0x%04X` instead of `Writing failed`).
- **`I2C_BufferRead`: rejected `len == 0` but accepted `len == 1`**, which cannot represent the SIM module's 2-byte BE length header (returned -1 cast through int16_t). Tightened to `len < 2`.
- **`WaitSCL_L_timeout`: `return (delay == 0)` was dead code** — post-decrement underflows `delay` to `UINT32_MAX` after the loop, so the expression was always false. Replaced with explicit `return false` and corrected the comment that claimed an 1800 ms cap (actual cap is 1200 ms).
- **`i2c.h`: SIM_WAIT_DELAY comment was wrong** — `150000 * 3.07us = 460 ms`, not 270 ms. Updated comment to match the actual value; constant unchanged.
- **`SmartCardDirectSend`: BigBuf_calloc result for `resp[]` was unchecked.** The next `resp[0] = prepend` would NULL-deref on alloc failure. Now bails.
- **`SmartCardDirectSend`: GET RESPONSE (61xx) chain recursed without bound**, allocating a fresh `smart_card_raw_t` from BigBuf each round. A misbehaving card returning 61xx every time would wedge the device. Added `depth` parameter capped at `SC_DIRECT_MAX_DEPTH` (8); both call sites updated. The GET RESPONSE inner allocation is also now NULL-checked.
- **`SmartCardDirectSend`: same write-failure-silent fix** as `SmartCardRaw`.
- **`SmartCardDirectSend`: same float → integer-math conversion** as `SmartCardRaw`.

### Added

- **`SmartCardSetBaud` is now functional.** Was an empty stub (wired through `pm3_cmd.h` / `appmain.c` dispatch but did nothing). Now sends `I2C_DEVICE_CMD_SETBAUD` (0x04) to the SIM module's main address.

### Notes for follow-up

- `SmartCardSetBaud` is now functional on the firmware side, but no client command exposes it — `client/src/cmdsmartcard.c` has no `setbaud` subcommand. A separate change can wire `CMD_SMART_SETBAUD` into the client if needed; leaving it out of this patch keeps it firmware-only and safe to backport.
- The proxmark3 SIM module's stock asm firmware (`sim013`) silently drops `CMD_SETBAUD`. gentilkiwi's `sim_c` v4.50+ also currently dispatches it to a no-op. Full PPS follow-through requires a SIM-firmware-side patch in addition to this commit.
- Mid-byte SCL stretch timeouts in `I2C_SendByte` / `I2C_ReadByte` are still swallowed (return void / -1, both ignored at most callers). Fixing this requires changing those signatures and verifying every caller — out of scope here, merits its own PR.
2026-05-10 14:35:16 +08:00
Iceman b2689aad92 Merge pull request #3298 from kormax/trace-14b-improvements
Trace 14b improvements
2026-05-09 18:56:53 +02:00
kormax 2529b16662 Annotate ECP in HF 14B traces 2026-05-09 18:33:45 +03:00
kormax eef3721357 Clear trace before HF 14B info 2026-05-09 18:33:45 +03:00
Iceman d198304579 Merge pull request #3296 from kormax/calypso-maintenance
Calypso maintenance
2026-05-08 21:23:59 +02:00
kormax 7ee697aa02 Add new hex print helper 2026-05-08 21:43:54 +03:00
kormax e96b6931e6 Skip attempting GET DATA if reported as unsupported 2026-05-08 19:46:21 +03:00
kormax b2f5ae43c6 Format big GET DATA object entries 2026-05-08 19:45:58 +03:00
kormax a1077d9f7d Retrieve GET DATA objects in 'hf calypso info' 2026-05-08 19:45:27 +03:00
Iceman 486f9f1b00 Merge pull request #3295 from kormax/calypso-implicit-select
Handle implicitly selected DF in 'hf calypso info'
2026-05-08 10:10:02 +02:00
kormax 3a0fdf1ddf Handle implicitly selected DF in 'hf calypso info' 2026-05-07 17:22:03 +03:00
Iceman d3e9638474 Merge pull request #3292 from YoungJules/legic_improvements
Some improvements to a couple lua scripts for Legic.
2026-05-07 12:09:16 +02:00