Commit Graph
21302 Commits
Author SHA1 Message Date
Henry Gabryjelski c5cec7ba51 Implement significant portions of saflok selftest 2025-11-17 03:02:37 -08:00
Henry Gabryjelski c98bf9ad3a Fix a few bugs
Discovered by github copilot.
Verified actual bugs by a human.
Fixed by a human.
2025-11-17 02:34:28 -08:00
Henry Gabryjelski 87a144c46a Comments, improved function names, use of common get_days_in_month() function. 2025-11-17 02:02:19 -08:00
Henry Gabryjelski 02056c9515 Saflok - creation year is limited to 7 bits 2025-11-17 01:27:32 -08:00
Henry Gabryjelski 3bf51b1fd4 Migrate more fields to type-safe getter / setter routines 2025-11-17 01:27:32 -08:00
Henry Gabryjelski 444e19212e more use of type-safe routines for getting properties. 2025-11-17 01:27:32 -08:00
Henry Gabryjelski 3d0fe23c17 improved messaging for cards w/o variable keys 2025-11-17 01:27:32 -08:00
Henry Gabryjelski 700a109a8e Saflok: remove redundant CLIParserFreE(ctx) 2025-11-17 01:27:32 -08:00
Henry Gabryjelski dcf7c2dd33 side-by-side check of new vs. old decoding
run `hf saflok decode` twice ... and it will run old decoder one time, and new decoder the other time.   Makes it easy to compare side-by-side in this interrim build.
2025-11-17 01:27:32 -08:00
Henry Gabryjelski 11eaa017d4 Saflok: Fix datetime math helpers 2025-11-17 01:27:32 -08:00
Henry Gabryjelski 1cfeb79003 automated from make style 2025-11-17 01:27:32 -08:00
Henry Gabryjelski a535bdb0e7 list of needed self-test 2025-11-17 01:27:32 -08:00
Henry Gabryjelski cb4ba660ab framework for saflok selftest 2025-11-17 01:27:32 -08:00
Henry Gabryjelski 319339b4cd UNTESTED: Add lots of helper functions to get data into / out of saflok formats
* Small, testable functions
* `set_` functions return boolean so they can indicate out-of-bounds values and similar failures.
* const-correctness for all helper functions

Note: The new functions are NOT used extensively yet ... they still need testing.   But they should make the code more self-documenting / readable (if somewhat verbose).
2025-11-17 01:27:32 -08:00
Henry Gabryjelski 4ce34c6c1e More type and bufferlen safety, and validation in bit manipulation routines.
Again, these should have zero impact on resulting
instructions.   At the same time, this will enable
static analysis to more accurately validate a buffer
(here `saflock_mfc_data_t`)  points to sufficiently
large allocated memory.

Additional validation for `extract_bits()` and
`insert_bits()` will prevent accidental corruptions
(and assert, if assertions are enabled).

These changes also makes the code easier to follow.
2025-11-17 01:27:32 -08:00
Henry Gabryjelski c60c15e184 self-document expr --> expiration 2025-11-17 01:27:32 -08:00
Henry Gabryjelski 5fc6f5275a More type safety for encrypt/decrypt 2025-11-17 01:27:32 -08:00
Henry Gabryjelski 72cf97c622 prevent buffer overrun ... assert with clear message instead. 2025-11-17 01:27:32 -08:00
Henry Gabryjelski 9579a2f4b9 change functions using UID and Key to use structs
This should have zero effect on an optimized build,
as there are effectively zero changes to the instructions.

Rather, this provides greater clarity as to the size of buffers
being passed to various functions, which improves the
long-term maintainability of code, especially when
maintained by someone other than the original author.
2025-11-17 01:27:32 -08:00
Iceman d29d912fff Merge pull request #3025 from aaronjamt/patch-3
[hf seos] Support variable length SIO
2025-11-15 09:50:13 +01:00
Iceman d436e8edc3 Merge pull request #3024 from aaronjamt/patch-2
[hf seos] Fix buffer overflow
2025-11-15 09:49:12 +01:00
Aaron Tulino (Aaronjamt) 25140d9c8b [hf seos] Support variable length SIO 2025-11-14 23:23:46 -07:00
Aaron Tulino (Aaronjamt) ff344e6473 [hf seos] Fix buffer overflow 2025-11-14 23:08:13 -07:00
Iceman ebe431b420 Merge pull request #3023 from aaronjamt/patch-1
Proper TLV parsing for Seos
2025-11-15 05:45:12 +01:00
Aaron Tulino (Aaronjamt) 9ee9b1a73f Proper TLV parsing for Seos 2025-11-14 21:10:46 -07:00
Philippe Teuwen 210b9a704c Add -- to proxmark3 client to pass args to scripts
Examples:
pm3 -y myscript.py -- -h
pm3 -y myscript.py -- --input foo --output bar

This enables usage in scripts shebang, e.g.
  #!/usr/bin/env -S uv run --with pycryptodome pm3 -y
2025-11-13 09:29:05 +01:00
Iceman e10e1135d2 Merge pull request #3022 from team-orangeBlue/14b-ndef-fix
Fix ISO14443-4 type B NDEF processing
2025-11-12 03:11:48 +01:00
team-orangeBlue 2a5cb01167 Update CHANGELOG.md
Signed-off-by: team-orangeBlue <63470411+team-orangeBlue@users.noreply.github.com>
2025-11-12 00:48:52 +03:00
team-orangeBlue fb7553cd8a Basic NDEF functionality
Fixed ndef. Now it reads much like the 14443A counterpart.

Untested except for one run on TCOS cards.

Signed-off-by: team-orangeBlue <63470411+team-orangeBlue@users.noreply.github.com>
2025-11-12 00:46:15 +03:00
Philippe Teuwen f20d8f3ef5 ulaes sim: add getversion support 2025-11-11 18:17:08 +01:00
Philippe Teuwen 716d5c639b add tearoff support to hf 14a apdu 2025-11-10 23:49:38 +01:00
Iceman 7b65dfb3b5 Merge pull request #3021 from Foxushka/hf-mf-keygen
Replaced hf mf bambukeys with hf mf keygen with multiple KDFs support + Snapmaker U1 filament spool KDF
2025-11-10 20:11:24 +01:00
Foxushka b380132cbb Replaced hf mf bambukeys with hf mf keygen with multiple KDFs support, use table for key output
Added Snapmaker U1 filament RFID KDF in `hf mf keygen`
2025-11-10 20:58:49 +03:00
Iceman 3d53e85743 Merge pull request #3020 from nvx/fix_seos_adf_and_diversifier
Fix hf seos adf/pacs handling of cards with different diversifier lengths and different ADF OIDs
2025-11-10 16:33:28 +01:00
iceman1001 49e80b5b02 step 1 in fiddling with mfu restore 2025-11-10 16:32:53 +01:00
Tiernan Messmer 781f235a85 Fix hf seos adf/pacs handling of cards with different diversifier lengths and different ADF OIDs 2025-11-11 01:25:04 +10:00
iceman1001 cac4e225e1 initial modification to hf mfu restore to support secure messaging 2025-11-10 16:22:22 +01:00
iceman1001 abb0427960 style 2025-11-10 16:20:50 +01:00
iceman1001 ed516550ca added "data qrcode" command to generate QR codes from inside the PM3 client 2025-11-10 16:20:00 +01:00
iceman1001 c4de141d03 style 2025-11-10 16:16:39 +01:00
iceman1001 0aac15cfd0 fix unicode issues with mingw/proxspace. Thanks to @nvx for the fix! 2025-11-10 16:09:17 +01:00
iceman1001 e39a7cdb57 added test for open printer tag 2025-11-10 14:09:03 +01:00
iceman1001 f1c97c0526 fix "hf felica raw" length of buffer calculations. Added some more comments to explain whats going on. Thanks to @dxl for the solutions! 2025-11-10 13:50:59 +01:00
iceman1001 fd06c38a89 add QR code generation in the pm3 client. It's a text based version using unicode to print the generated qr code. Might not work on all things but its a MIT license and a simple to use project 2025-11-09 16:54:21 +01:00
iceman1001 8df7a49a0e initial support for OpenPrint Tag NDEF records. See: https://github.com/prusa3d/Prusa-Firmware-Buddy/blob/openprinttag/src/module/nfc/openprinttag/openprinttag 2025-11-09 16:43:56 +01:00
Iceman d2c0b1744a Merge pull request #3017 from VarChar42/master
Fix invalid  country code len for lf fdxb reader command
2025-11-08 15:42:01 +01:00
Michael Wiesinger ead54bdf54 Fix invalid country code len for lf fdxb reader command 2025-11-07 22:12:06 +01:00
Iceman e59afadc45 Merge pull request #3016 from VarChar42/master
Fix help description for lf indala brute command
2025-11-07 21:54:03 +01:00
Michael Wiesinger 737a6dc3d7 Fix help description for lf indala brute 2025-11-07 21:02:14 +01:00
iceman1001 02dacdb22a update "hf mfu tamper" to use updated writeblock NG command 2025-11-07 16:03:06 +01:00