Commit Graph

80 Commits

Author SHA1 Message Date
WillyJL
9e1baf715e Merge remote-tracking branch 'fork-ofw/feat/nfc-type-4-final' into mntm-dev --nobuild 2025-06-29 03:43:52 +01:00
Willy-JL
77debdc3f1 Update TODOs that are out of scope for the project 2025-04-22 02:40:26 +01:00
Willy-JL
04415bf7dc Merge remote-tracking branch 'ofw/dev' into feat/nfc-type-4 2025-04-10 03:42:55 +01:00
WillyJL
0eb3fc33dd NFC: Fix NDEF parser for MIFARE Classic (#4153)
* Add div() to API

* Revert "Add div() to API"

This reverts commit e03b5c4244.

* Use / and %

* NFC: More MFC NDEF fixes

* Simplify duplicated code in MFC data generator

* NFC: Print NDEF hex data with pretty format

* NFC: Consider NDEF strings with last \0 byte as text

* Pretty Format: Add padding to last line to keep table width

---------

Co-authored-by: hedger <hedger@users.noreply.github.com>
2025-04-01 00:34:54 +04:00
Willy-JL
9887be24ac Merge branch 'fix/mfc-ndef' into mntm-dev --nobuild 2025-03-26 11:44:55 +00:00
Willy-JL
a7409edd62 Simplify duplicated code in MFC data generator 2025-03-26 07:31:18 +00:00
Willy-JL
118e745368 NFC: Refactor common NXP Native command handling 2025-03-22 11:36:34 +00:00
Willy-JL
e0b5aa8070 For now send NACK to all R blocks 2025-03-15 05:44:31 +00:00
Willy-JL
7689efa129 Use flags for ISO14443-4 layer decode result 2025-03-15 05:42:57 +00:00
Willy-JL
e64292d478 NFC: Initial ISO14443-4 PCB listener handling 2025-03-11 08:58:57 +00:00
Nathan N
8427ec0098 MIFARE Classic Key Recovery Improvements (#3822)
* Initial structure for nonce collection
* Nonce logging
* Dictionary attack structure
* Fix compilation
* Identified method to reduce candidate states
* Use EXT_PATH instead of ANY_PATH
* Use median calibrated distance, collect parity bits
* Modify parity collection
* Fixed parity bit collection
* Add note to fix nonce logging
* Fix nonce logging
* Clean redundant code
* Fix valid_nonce
* First attempt disambiguous nonce implementation
* FM11RF08S backdoor detection
* Initial accelerated dictionary attack for weak PRNGs
* Refactor to nested dictionary attack
* Renaming some variables
* Hard PRNG support for accelerated dictionary attack
* Update found keys, initial attempt
* Update found keys, second attempt
* Code cleanup
* Misc bugfixes
* Only use dicts in search_dicts_for_nonce_key if we have them
* Collect nonces again
* Should be detecting both backdoors now
* Relocate backdoor detection
* Hardnested support
* Fix regression for regular nested attack
* Backdoor read
* Backdoor working up to calibration
* Backdoor nested calibration
* Don't recalibrate hard PRNG tags
* Static encrypted nonce collection
* Update TODO
* NFC app UI updates, MVP
* Bump f18 API version (all functions are NFC related)
* Add new backdoor key, fix UI status update carrying over from previous read
* Clear TODO line
* Fix v1/v2 backdoor nonce collection
* Speed up backdoor detection, alert on new backdoor
* Add additional condition to backdoor check
* I'll try freeing memory, that's a good trick!
* Do not enter nested attack if card is already finished
* Do not reset the poller between collected nonces
* Clean up various issues
* Fix Hardnested sector/key type logging
* Add nested_target_key 64 to TODO
* Implement progress bar for upgraded attacks in NFC app
* Typo
* Zero nested_target_key and msb_count on exit
* Note TODO (malloc)
* Dismiss duplicate nonces
* Fix calibration (ensure values are within 3 standard deviations)
* Log static
* No nested dictionary attack re-entry
* Note minor inefficiency
* Uniformly use crypto1_ prefix for symbols in Crypto1 API
* Fix include paths
* Fix include paths cont
* Support CUID dictionary
* Fix log levels
* Avoid storage errors, clean up temporary files
* Handle invalid key candidates
* Fix memory leak in static encrypted attack
* Fix memory leak, use COUNT_OF macro
* Use single call to free FuriString
* Refactor enums to avoid redefinition
* Fix multiple crashes and state machine logic
* Fix inconsistent assignment of known key and known key type/sector
* Backdoor known key logic still needs the current key
* Larger data type for 4K support
* Fix typo
* Fix issue with resume logic
* Mark TODOs for next PR
* Remove redundant assignment
* Fix size_t format specifier
* Simplify auth_passed condition

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
Co-authored-by: gornekich <n.gorbadey@gmail.com>
2024-10-31 09:53:58 +09:00
Willy-JL
88dfe97a89 Merge remote-tracking branch 'ofw/dev' into mntm-dev 2024-10-15 23:43:33 +01:00
hedger
57c438d91a heap: increased size (#3924)
* reduced reserved memory size for system stack; added temporary markup to monitor usage
* fbt: relink elf file on linker script change; removed debug memory fill
* Make PVS Happy
* Make doxygen happy

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2024-10-14 19:26:17 +01:00
RebornedBrain
0902fd49e1 NFC: iso14443_4a improvements. Canvas: extended icon draw. (#3918)
* Now 4a listener invokes upper level callback on Halt and FieldOff
* Added new method for drawing mirrored XBM bitmaps
* iso14443_4a poller logic enhanced
* Function renamed accroding to review suggestions
* Rename #2
* Api adjustements
* Correct API bump

Co-authored-by: あく <alleteam@gmail.com>
2024-10-14 18:22:47 +01:00
Willy-JL
ba605e1c03 Merge remote-tracking branch 'ul/dev' into mntm-dev
Only partially merged 1ceb1eb256 and 09d6e4ee30
Changes to login in cc1101_ext.c and adding setting are ignored
2024-10-07 04:00:01 +01:00
MX
0d8d71ff1c Merge remote-tracking branch 'RebornedBrain/reborned/some_api_adjustments' into dev [ci skip] 2024-10-05 10:19:32 +03:00
MX
9bb3853c80 Merge remote-tracking branch 'noproto/nestednonces' into dev 2024-10-05 05:02:08 +03:00
RebornedBrain
180d1f0471 iso14443_4a poller logic enhanced 2024-09-28 22:19:18 +03:00
Willy-JL
ae3b2d40e4 Merge branch 'nestednonces' into ofw-3822-nestednonces 2024-09-24 05:56:21 +01:00
noproto
61e24fcb13 Fix include paths 2024-09-23 21:55:39 -04:00
noproto
0ba8ac4ed0 Uniformly use crypto1_ prefix for symbols in Crypto1 API 2024-09-23 19:44:08 -04:00
Willy-JL
7f1c048978 Merge branch 'nestednonces' into ofw-3822-nestednonces 2024-09-04 01:30:16 +02:00
noproto
01b19483c5 First attempt disambiguous nonce implementation 2024-08-14 02:25:57 -04:00
noproto
6332ec7478 Fix valid_nonce 2024-08-11 14:30:26 -04:00
noproto
8dd3daf625 Fixed parity bit collection 2024-08-09 20:22:19 -04:00
MX
57f3bce8e3 merge manually formatted stuff too 2024-07-16 01:01:17 +03:00
Willy-JL
2eaf1ffc95 New formatting 2024-07-15 22:32:17 +01:00
Willy-JL
02f7207d28 Merge remote-tracking branch 'ofw/dev' into mntm-dev 2024-07-15 22:18:35 +01:00
MX
726cb770d0 formatting 2024-07-15 20:02:45 +03:00
hedger
ffa3996a5e [FL-3867] Code formatting update (#3765)
* clang-format: AllowShortEnumsOnASingleLine: false
* clang-format: InsertNewlineAtEOF: true
* clang-format: Standard:        c++20
* clang-format: AlignConsecutiveBitFields
* clang-format: AlignConsecutiveMacros
* clang-format: RemoveParentheses: ReturnStatement
* clang-format: RemoveSemicolon: true
* Restored RemoveParentheses: Leave, retained general changes for it
* formatting: fixed logging TAGs
* Formatting update for dev

Co-authored-by: あく <alleteam@gmail.com>
2024-07-15 13:38:49 +09:00
MX
a7ca56cf4e Merge remote-tracking branch 'OFW/dev' into dev 2024-07-07 02:22:08 +03:00
Willy-JL
4830ef94c6 Merge remote-tracking branch 'ofw/dev' into mntm-dev 2024-07-05 20:01:29 +02:00
hedger
7879876ba1 [FL-3863] toolchain: v37 (#3746)
* toolchain: v36
* toolchain: fixed cert path; lib: nanopb: updated to 0.4.8
* fbtenv: rolled back cert path for 3.11
* clang-format: updated config for v18
* linter fixes
* clang-format: properly regenerated config (`clang-format -style=file:.clang-format -dump-config > .clang-format-new; mv .clang-format-new .clang-format`)
* clang-format: AllowShortLoopsOnASingleLine: false
* toolchain: v37
* fbt: compilation_db.py: fixes for Windows
2024-07-05 18:27:21 +01:00
MX
990d80e5b9 Merge remote-tracking branch 'OFW/dev' into dev [ci skip] 2024-06-17 23:59:15 +03:00
Willy-JL
ea63af1863 Merge branch 'dev' of https://github.com/flipperdevices/flipperzero-firmware into mntm-dev 2024-06-17 21:47:13 +02:00
gornekich
729db7fa98 [FL-3857] NFC Ultralight Original write support (#3718)
* mf ultralight: rename ultralight unknown to origin
* nfc app: add write to origin support for origin ultralights
* mf ultralight: add orig write support on lib level
* targets: bump major API version
2024-06-17 15:20:35 +01:00
MX
7f05a224be Merge remote-tracking branch 'OFW/dev' into dev 2024-06-09 16:05:06 +03:00
Willy-JL
468f870729 Merge branch 'dev' of https://github.com/flipperdevices/flipperzero-firmware into mntm-dev 2024-06-08 19:09:37 +02:00
RebornedBrain
467e973da2 [FL-3810] Felica emulation (#3673)
* Moved some structs and defs from poller to generic felica
* Buffer size increased for transferring more data
* Felica HAL Tx function implemented
* Some structs and fields for listener
* Raw listener implementation
* Added new event for felica activation
* Proper config fot listener added
* Moved some structs from poller in order to use them in listener too
* New function for calculating MAC
* Listener data structures and function definitions
* Private listener functions implementation added
* Raw felica listener logic implementation added
* Fix total sector count both for poller and listener
* Defined type for write handlers
* New logic for write operations added
* Removed old commented code
* Splitted read logic into several separate functions
* New type added and some fields to instance
* New logic of read command implemented
* Defines added for response codes
* Functions moved to private namespace
* Function visibility changed and some cleanups
* Update felica_listener.c, felica_listener_i.c, and felica_listener_i.h
* Some type adjustments
* Moved frame_exchange function to private namespace
* Error handling added
* Function to get data_ptr for write request added
* Missing declaration added
* Add processing of nfc errors
* write_with_mac is a local variable now
* Adjustments to MAC calculation logic
* Values replaced with defines
* Update nfc_transport.c with felica logic
* Sync felica poller added for unit tests
* Felica unit_tests and data dump added
* Fixed proper reading of MAC_A block when it is 1st
* Macro definitions for MC added
* Function simplified
* More defines
* CRC check for incomming packets added
* Readonly logic adjusted
* Block write validation adjusted
* New logic for ID block writing
* Some cleanups
* New logic of moving across the block list with different element length
* Some cleanups
* Adjusted requires_mac logic to cover all blocks needed
* Cleanups and renaming
* New block list validation logic
* Block list logic iteration simplified
* Some asserts and checks added
* Replaced MC[2] checks with macros
* Marked def values as unsigned
* Removed old code
* Removed commented function declarations
* Changed protected block in felica test card dump and adjusted tests
* Fixes after merge
* Moved defines to header
* Now we allocate memory for max possible response pack in any case
* Some renaming and documentation
* Bump api symbols
* Set feature to emulate full for felica
* Removed 'More' button and added MoreInfo feature which adds this button back
* Types renamed
* Removed unnecessary code
* Reformat comments
* Fixing missing signatures
* Replaced crash with error log and return value
* Format doxygen comments

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2024-06-08 15:24:51 +01:00
MX
1db05ed2c6 Revert "add temp fix since no proper fix exist at the moment"
This reverts commit 75ece9b697.
2024-06-05 22:18:09 +03:00
Willy-JL
4931b5b2f7 NFC: Fix Mifare DESFire reading 2024-05-28 05:51:07 +01:00
MX
75ece9b697 add temp fix since no proper fix exist at the moment 2024-05-01 19:07:57 +03:00
MX
c3b59a9dba add todo 2024-04-23 14:54:56 +03:00
MX
c9909467f9 Merge remote-tracking branch 'OFW/dev' into dev 2024-04-09 03:24:16 +03:00
Astra
27e61eb808 Move crypto1 to helpers, add it to the public API (#3567)
* Move crypto1 to helpers, add it to the public API
* F18 API version bump

Co-authored-by: あく <alleteam@gmail.com>
2024-04-07 23:47:48 +09:00
MX
585b7f963d Api Symbols: replace asserts with checks
merge ofw commit
2024-03-25 13:53:32 +03:00
あく
acc39a4bc0 Api Symbols: replace asserts with checks (#3507)
* Api Symbols: replace asserts with checks
* Api Symbols: replace asserts with checks part 2
* Update no args function signatures with void, to help compiler to track incorrect usage
* More unavoidable void
* Update PVS config and code to make it happy
* Format sources
* nfc: fix checks
* dead code cleanup & include fixes

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: hedger <hedger@nanode.su>
2024-03-19 23:43:52 +09:00
MX
6d15c23231 Merge branch 'ofw_dev' into dev 2024-02-14 12:12:54 +03:00
Leptopt1los
dd988ba449 bit_lib and nfc_util refactor (#3383)
* nfc_util functions for processing bytes moved into bit_lib
* bitlib test update
* bit_lib moved from lfrfid to standalone lib
* Added bit functions for any supported data types
* Error fix and api add
* Added test for 64
* Added doc
* Testcase for 64 rewrited
* Realization error fix
* API version bump
* sync api version, fix after-merge old libs usage
* fix build errors
* build fix
* fbt format

Co-authored-by: assasinfil <nfa57643@gmail.com>
Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2024-02-14 11:41:42 +07:00
MX
5b97ddc842 Merge branch 'ofw_dev' into dev [ci skip] 2024-02-10 02:38:42 +03:00