Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DESFire emulation support: Bug, stability and reliability fixes and PM3 compatible ISO authentication #319

Merged
merged 71 commits into from
Jul 8, 2022

Conversation

maxieds
Copy link
Contributor

@maxieds maxieds commented Mar 30, 2022

This pull request (PR) brings in many small code patches to the current DESFire support on the RevG devices. The discussion in issue #313 was helpful in fixing unresolved bugs. If this PR gets merged quickly, I can see it making many users looking for improvements to the DESFire support on the Chameleon very happy.

A request in the issue thread by @david-oswald was for me to verify basic ISO authentication functionality with the PM3 devices that so many NFC hardware engineers use day to day:

[usb] pm3 --> script run debug.cmd
[+] executing Cmd debug.cmd
[+] args ''
[usb|script] pm3 --> hw dbg -4
[usb|script] pm3 --> prefs set clientdebug --full
[=]     client debug........... full
[usb|script] pm3 --> data setdebugmode -2
[=] client debug level... 2 ( verbose debug messages )

[#]   Debug log level......... 4 ( extended )
[usb] pm3 --> hf mfdes auth -n 0 -t 3tdea -k 000000000000000000000000000000000000000000000000 -v -c native -a
[=] Key num: 0 Key algo: 3tdea Key[24]: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
[=] Secure channel: n/a Command set: native Communication mode: plain
[+] Setting ISODEP -> inactive
[+] Setting ISODEP -> NFC-A
[=] AID 000000 is selected
[=] Auth: cmd: 0x1a keynum: 0x00
[+] raw>> 1A 00 
[+] raw<< AF EE 91 30 1E E8 F5 84 D6 C7 85 1D 05 65 13 90 A6 C6 D5 
[#] encRndB: EE 91 30 1E E8 F5 84 D6 
[#] RndB: CA FE BA BE 00 11 22 33 
[#] rotRndB: FE BA BE 00 11 22 33 CA FE BA BE 00 11 22 33 CA 
[#] Both   : 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 FE BA BE 00 11 22 33 CA FE BA BE 00 11 22 33 CA 
[+] raw>> AF 30 EB 55 F3 29 39 04 96 77 88 CE EF 33 A3 C8 7B 18 66 1A F1 62 78 A0 28 53 84 67 98 7C BB DB 03 
[+] raw<< 00 9B 71 57 8F FB DF 80 A8 F6 EF 33 4A C6 CD F9 7A 7D BE 
[=] Session key : 01 02 03 04 CA FE BA BE 07 08 09 10 22 33 CA FE 13 14 15 16 00 11 22 33 
[=] Desfire  authenticated
[+] PICC selected and authenticated succesfully
[+] Context: 
[=] Key num: 0 Key algo: 3tdea Key[24]: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
[=] Secure channel: ev1 Command set: native Communication mode: plain
[=] Session key [24]: 01 02 03 04 CA FE BA BE 07 08 09 10 22 33 CA FE 13 14 15 16 00 11 22 33  
[=]     IV [8]: 00 00 00 00 00 00 00 00 
[+] Setting ISODEP -> inactive

Builds of the firmware binaries for testing: DESFire-AuthISO-Patch-FirmwareBinariesBuild.zip

Otherwise, the firmware can be built by running make desfire or make desfire-dev (for extra verbose debugging logs) in the Firmware/Chameleon-Mini/ directory.


Support for @maxieds to work on this software project is provided via university COVID relief funding at Georgia Tech. Special thanks to Professor Josephine Yu for funding the PM3 hardware and accessories to get all these code patches working. 😃

…ionality (will revisit when get to this subproject)
… terminal buffers stored on the stack -- adding buffer full messages for INFO)
…checksum functions DO NOT fit into text/data (yet)
…LIMITED_TESTING define set in the Makefile :)
@fptrs
Copy link
Collaborator

fptrs commented Jun 29, 2022

@fptrs The ISO14443A_READER configuration is now enabled for every build target. I do not know what happened resetting the functions for ISO15693_SNIFF. They are now restored to the defaults in the current HEAD of the main branch.

I think you misunderstood. You need to enable the MFU config every time the reader config is enabled.

@maxieds
Copy link
Contributor Author

maxieds commented Jun 29, 2022

Yes, the READER/MFU dependency should be fixed in the latest commit. Please triple check me. It's my first month off of caffeine in a long time.

mifare-classic: CONFIG_SETTINGS:=$(SUPPORTED_TAGS_BUILD) -DDEFAULT_CONFIGURATION=CONFIG_NONE $(EXTRA_CONFIG_SETTINGS)
mifare-classic: custom-build

desfire: FLASH_DATA_SIZE:=0x0E000
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maxieds The lower part of the flash will be used for the firmware and FLASH_DATA_ADDR marks the start where the slots/settings are stored. So if you want to change the number of settings in order to gain space for the firmware you have to change both variables:

  • FLASH_DATA_SIZE=#settings*0x2000
  • FLASH_DATA_ADDR=0x20000-FLASH_DATA_SIZE

@maxieds
Copy link
Contributor Author

maxieds commented Jun 29, 2022

I usually test with the binaries built with make desfire-dev. I noticed testing today that the Chameleon is substantially more responsive to the PM3 when running with make desfire (turns off a lot of extra logging messages and settings).

change DESFire Generic Error decoder
@fptrs
Copy link
Collaborator

fptrs commented Jun 29, 2022

@maxieds I repeated your test with a proxmark3 and I can verify that the build works most of the times. If I repeatedly run hf mfdes info I sometimes get this output:

[usb] pm3 --> hf mfdes info
[#] Halt error

[=] ---------------------------------- Tag Information ----------------------------------
[+]               UID: 08 96 3E A0 C1 1B 3C 
[+]      Batch number: 1B 3C 59 04 33 
[+]   Production date: week 52 / 20d7

[=] --- Hardware Information
[=]    raw: 04010100011805
[=]      Vendor Id: NXP Semiconductors Germany
[=]           Type: 0x01
[=]        Subtype: 0x01
[=]        Version: 0.1 ( DESFire MF3ICD40 )
[=]   Storage size: 0x18 ( 4096 bytes )
[=]       Protocol: 0x05 ( ISO 14443-2, 14443-3 )

[=] --- Software Information
[=]    raw: 90AF0401010001
[=]      Vendor Id: no tag-info available
[=]           Type: 0xAF
[=]        Subtype: 0x04
[=]        Version: 1.1
[=]   Storage size: 0x00 ( 1 bytes )
[=]       Protocol: 0x01 ( Unknown )

[=] --------------------------------- Card capabilities ---------------------------------
[!!] 🚨 APDU: No APDU response
[+] ------------------------------------ PICC level -------------------------------------
[+] Applications count: 0 free memory n/a
[+] PICC level auth commands: auth: NO auth iso: NO auth aes: NO auth ev2: NO auth iso native: NO auth lrp: NO

[=] --- Free memory
[+]    Card doesn't support 'free mem' cmd

If I get this output the Chameleon is stuck and needs a reboot. So far I got no clue what triggers this behavior. Have you experienced this before?

@maxieds
Copy link
Contributor Author

maxieds commented Jun 30, 2022

@fptrs
I will try to look into this tonight. I am going to need more debugging information to figure out what is going on.

@maxieds
Copy link
Contributor Author

maxieds commented Jul 1, 2022

@fptrs
I am no longer able to crash the Chameleon by repeatedly running hf mfdes info. The responsiveness seems to be subject to how close the PM3 is to the Chameleon when running the command. I find that positioning the Chameleon about 1.25in from the PM3 works the best. When it is too close, it returns an error on the PM3. Moving it way back then repositioning gets the command to work again.

Can you confirm it's now working this way with your setup?

@fptrs
Copy link
Collaborator

fptrs commented Jul 5, 2022

@maxieds Thank you for the fixes.
I hadn't had time to test the changes yet, but I will do it this week

@maxieds
Copy link
Contributor Author

maxieds commented Jul 7, 2022

Thanks. I successfully defended my thesis yesterday. I should have a couple of free weeks to do stuff if there are more problems starting at the end of next week.

The issues I spotted using make desfire-dev and live logging to my phone with the CMLD app suggest that there were some jumbled messages getting interspersed from logging the codec TX/RX to other messages. I added the sei/cli statements to the live logger header and things seemed to get better. If problems persist, I think we should look at that first: Something like a codec interrupt getting triggered while writing logs (to FRAM, or LIVE over USB) could have caused problems. There are some race condition though.

@fptrs
Copy link
Collaborator

fptrs commented Jul 8, 2022

@maxieds I can confirm that the setup works without any crashes of the chameleon. Good work 👍

[usb] pm3 --> hf mfdes info
[#] pcb_blocknum 0 == 2 
[#] [WCMD <--: : 08/08] 02 90 60 00 00 00 14 98 
[#] pcb_blocknum 1 == 3 
[#] [WCMD <--: : 08/08] 03 90 af 00 00 00 1f 15 
[#] pcb_blocknum 0 == 2 
[#] [WCMD <--: : 08/08] 02 90 af 00 00 00 34 11 

[=] ---------------------------------- Tag Information ----------------------------------
[+]               UID: D7 90 A7 54 96 E0 51 
[+]      Batch number: 96 E0 BA 9A A5 
[+]   Production date: week eb / 2050

[=] --- Hardware Information
[=]    raw: 04010100011805
[=]      Vendor Id: NXP Semiconductors Germany
[=]           Type: 0x01
[=]        Subtype: 0x01
[=]        Version: 0.1 ( DESFire MF3ICD40 )
[=]   Storage size: 0x18 ( 4096 bytes )
[=]       Protocol: 0x05 ( ISO 14443-2, 14443-3 )

[=] --- Software Information
[=]    raw: 90AF0401010001
[=]      Vendor Id: no tag-info available
[=]           Type: 0xAF
[=]        Subtype: 0x04
[=]        Version: 1.1
[=]   Storage size: 0x00 ( 1 bytes )
[=]       Protocol: 0x01 ( Unknown )

[=] --------------------------------- Card capabilities ---------------------------------
[#] switch_off
[+] ------------------------------------ PICC level -------------------------------------
[+] Applications count: 0 free memory n/a
[+] PICC level auth commands: auth: YES auth iso: YES auth aes: NO auth ev2: NO auth iso native: NO auth lrp: NO

[=] --- Free memory
[+]    Card doesn't support 'free mem' cmd

[usb] pm3 --> hf mfdes auth -n 0 -t 3tdea -k 000000000000000000000000000000000000000000000000 -v -c native -a
[=] Key num: 0 Key algo: 3tdea Key[24]: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
[=] Secure channel: n/a Command set: native Communication mode: plain
[+] Setting ISODEP -> inactive
[+] Setting ISODEP -> NFC-A
[=] AID 000000 is selected
[=] Auth: cmd: 0x1a keynum: 0x00
[+] raw>> 1A 00 
[+] raw<< AF DE 0B 42 FC D6 D5 DB 3A 74 E6 32 CA 6C 17 FD 14 33 3F 
[+] raw>> AF 47 27 A0 CA 25 D0 A5 61 42 90 7B B6 4D 29 15 EB 7A E2 3D C8 26 D3 20 6D CF D7 5B C5 4A 5D B0 B9 
[+] raw<< 00 8B 6C 67 32 E8 DB 1B 8E 5D CC 70 FC CC DD 63 34 D5 76 
[=] Session key : 01 02 03 04 98 2E DB 6A 07 08 09 10 FB 6A 51 3F 13 14 15 16 32 FF E5 9C 
[=] Desfire  authenticated
[+] PICC selected and authenticated succesfully
[+] Context: 
[=] Key num: 0 Key algo: 3tdea Key[24]: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
[=] Secure channel: ev1 Command set: native Communication mode: plain
[=] Session key [24]: 01 02 03 04 98 2E DB 6A 07 08 09 10 FB 6A 51 3F 13 14 15 16 32 FF E5 9C  
[=]     IV [8]: 00 00 00 00 00 00 00 00 
[+] Setting ISODEP -> inactive

@fptrs fptrs merged commit bc333f9 into emsec:master Jul 8, 2022
@maxieds
Copy link
Contributor Author

maxieds commented Jul 15, 2022

@fptrs @linuxgemini
Are either of you still the maintainer of the nightly firmware builds? The PR just merged has several new custom build targets that are compiled by running any of the following commands:

make mifare|mifare-classic|desfire|desfire-dev|iso-modes|ntag215|vicinity|sl2s2002|tagatit|em4233

Each target generates firmware binaries with names reflective of the contents that can be copied into the latest builds directory. These file names are set by the TARGET_CUSTOM_BUILD_NAME variable in this new make build script. For example, running make desfire-dev yields the outputs:

Chameleon-Mini-CustomBuild_DESFire_DEV.(HEX|EEP|ELF|BIN)

It would be nice to see this get integrated on the main repo. I guess I can try asking about this topic on discord later if no one notices the comment on the closed PR.

@fptrs
Copy link
Collaborator

fptrs commented Jul 15, 2022

@maxieds I will look into it

@david-oswald
Copy link
Collaborator

@maxieds @fptrs and I had talked about this, and we concluded that auto-building all targets will be too confusing for most users. We basically now want to have three: all "normal" ISO14443 cards, ISO15693, and DESFire. The remaining ones are probably best left to expert users who clone the repo and build locally.

@maxieds
Copy link
Contributor Author

maxieds commented Jul 15, 2022

@david-oswald
Okay. That sounds reasonable. Do you think we should add something to the documentation to tell users that these make targets can build standard tag configurations without having to fiddle too much with hand editing the Makefile? Scanning the Makefile does not give users a clue. All this magic is hidden in a build script that is included midfile.

Also, testing with the USB readers as I mentioned in #313 earlier, there is a build error running make desire|desfire-dev on Arch Linux. The bc command used to calculate the flash address bounds on the fly is not installed by default. It may be a problem on other Linux distros. I will push a commit into a new branch on my fork in a short while. Hope to file another small PR to fix up some of the DESFire code and build scripts soon (maybe today or this weekend).

@maxieds
Copy link
Contributor Author

maxieds commented Jul 17, 2022

@david-oswald
Recent commits to the working development branch of my fork will have documentation for these new extra make targets (see this new docs page). I am trying to get this submitted as a PR this weekend. Bear with me...

gcammisa added a commit to gcammisa/ChameleonMini that referenced this pull request Oct 14, 2022
commit 9fbb7fb
Author: Fabian <[email protected]>
Date:   Wed Sep 21 11:06:58 2022 +0200

    fix emsec#325

    * remove MemoryClear from ConfigurationSetById

commit 62e2f71
Merge: f5c1347 d5d36fe
Author: fptrs <[email protected]>
Date:   Mon Aug 15 10:45:10 2022 +0200

    Merge pull request emsec#323 from maxieds/ExternalUSBReadersCompat

    DESfire emulation support: Updated support for PM3 and better compatibility with external USB readers

commit d5d36fe
Author: Maxie D. Schmidt <[email protected]>
Date:   Wed Aug 3 18:03:28 2022 -0500

    Update BuilingFirmwareBinariesFromSource.md

commit 46a3cc8
Author: Maxie Dion Schmidt <[email protected]>
Date:   Tue Jul 26 01:40:27 2022 -0400

    Small changes to the NAK/ACK return size (4 bits versus 1 byte)

commit eb0d5fd
Author: Maxie D. Schmidt <[email protected]>
Date:   Tue Jul 26 00:02:15 2022 -0400

    Update DESFireSupportReadme.md

commit 3a91394
Author: Maxie Dion Schmidt <[email protected]>
Date:   Mon Jul 25 20:39:50 2022 -0400

    One more small change to resetting the ATQA value automatically depending on whether the UID is known to be randomly generated

commit 2257c42
Author: Maxie Dion Schmidt <[email protected]>
Date:   Mon Jul 25 20:31:29 2022 -0400

    Cleaning up modifications used to test the development code

commit cddb9bd
Author: Maxie D. Schmidt <[email protected]>
Date:   Mon Jul 25 19:41:50 2022 -0400

    Update DESFireSupportReadme.md

commit 63e74f9
Author: Maxie Dion Schmidt <[email protected]>
Date:   Mon Jul 25 19:42:29 2022 -0400

    Changes to ISO14443A-4 handlers confirmed to work with the ACS ACR-122U external USB reader ; Updated docs and source code

commit 32277f0
Author: Maxie D. Schmidt <[email protected]>
Date:   Mon Jul 25 19:15:46 2022 -0400

    Update DESFireSupportReadme.md

commit f9e9018
Author: Maxie D. Schmidt <[email protected]>
Date:   Mon Jul 25 18:42:50 2022 -0400

    Update DESFireSupportReadme.md

commit 8fe0e66
Author: Maxie D. Schmidt <[email protected]>
Date:   Mon Jul 25 18:40:06 2022 -0400

    Update DESFireSupportReadme.md

commit 15be871
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sat Jul 23 00:16:22 2022 -0400

    Restore point for changes to the CL1/CL2 exchanges in the anticollision for DF ISO14443A-4 support

commit 2a42b31
Author: Maxie D. Schmidt <[email protected]>
Date:   Sat Jul 23 00:12:24 2022 -0400

    Update DESFireSupportReadme.md

commit f5c1347
Author: Fabian <[email protected]>
Date:   Wed Jul 20 13:42:28 2022 +0200

    fix github action name

commit 78a108b
Author: Fabian <[email protected]>
Date:   Wed Jul 20 13:32:06 2022 +0200

    change automated builds

    * make all builds all ISO14443A configs
    * all ISO15693 configs are automatically build with make iso15693

commit 66c2e8b
Merge: 3c01a6c aa20be6
Author: fptrs <[email protected]>
Date:   Wed Jul 20 13:08:23 2022 +0200

    Merge pull request emsec#322 from maxieds/DESFireNFCExternalUSBReaderPatches-LibNFCTestCode

    DESFire emulation support: Bug fixes, improvements and updated LibNFC test code

commit aa20be6
Author: Maxie Dion Schmidt <[email protected]>
Date:   Wed Jul 20 06:14:27 2022 -0400

    Current firmware builds tested with PM3 and LibNFC test code ; Still takes too long to verify the file mgmt and data manip programs

commit ffb6683
Author: Maxie D. Schmidt <[email protected]>
Date:   Wed Jul 20 05:59:02 2022 -0400

    Update DESFireSupportReadme.md

commit b79d964
Author: Maxie D. Schmidt <[email protected]>
Date:   Wed Jul 20 03:25:21 2022 -0400

    Update DESFireSupportReadme.md

commit 5cd6773
Author: Maxie Dion Schmidt <[email protected]>
Date:   Wed Jul 20 03:00:17 2022 -0400

    Restore point for many incremental updates, bug fixes and documentation changes

commit 126189a
Author: Maxie Dion Schmidt <[email protected]>
Date:   Tue Jul 19 22:00:24 2022 -0400

    Verified ISODES and legacy DES auth schemes work ; AES-128 auth support is verified with the PM3

commit a050d04
Author: Maxie Dion Schmidt <[email protected]>
Date:   Tue Jul 19 20:54:09 2022 -0400

    Multiple code cleanup changes to TransferState -- Enc of transfers is handled by the APDU pre/post process functions -- Restore point for previous functionality

commit 871451a
Author: Maxie D. Schmidt <[email protected]>
Date:   Tue Jul 19 19:14:45 2022 -0400

    Update DESFireSupportReadme.md

commit 512eff3
Author: Maxie Dion Schmidt <[email protected]>
Date:   Tue Jul 19 18:53:18 2022 -0400

    Fixing PM3 AES-128 authentication bug

commit 3d86fe4
Author: Maxie Dion Schmidt <[email protected]>
Date:   Tue Jul 19 17:46:08 2022 -0400

    Updating TDEA (x3) crypto code to handle uneven buffer sizes ; Changes to DESFire auth instructions reinit / (in)validate state logic

commit 5c894b8
Author: Maxie Dion Schmidt <[email protected]>
Date:   Tue Jul 19 15:24:27 2022 -0400

    Updating the AES128 enc/dec code to support ECB mode (default) and handle uneven buffer sizes that are not a multiple of 16

commit ccdc36e
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sun Jul 17 16:54:43 2022 -0400

    Removed old AES128 support with AVR libs in place of openssl/EVP ; Bug fix for ISODES auth in the firmware to keep session IV state with multiple auths

commit 3078e7f
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sun Jul 17 14:23:02 2022 -0400

    Stashing working LibNFC test code -- ISO auth is working

commit e7790dc
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sun Jul 17 06:56:28 2022 -0400

    Updates to LibNFC test code (ISO auth works) ; Untested changes to fw source to support recall of header data from EEPROM on power cycle (need to test) ; Other misc minor modifications to stash as a restore point

commit 1c2cf3a
Author: Maxie D. Schmidt <[email protected]>
Date:   Sun Jul 17 02:09:53 2022 -0400

    Update DESFireSupportReadme.md

commit 306865e
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sun Jul 17 01:55:21 2022 -0400

    New DF_ENCMODE command to set ECB/CBC crypto modes ; Incremental changes to LibNFC test code ; Incomplete docs to edit elsewhere

commit 3a89c4b
Author: Maxie D. Schmidt <[email protected]>
Date:   Sat Jul 16 20:57:25 2022 -0400

    Update BuilingFirmwareBinariesFromSource.md

commit 197b958
Author: Maxie D. Schmidt <[email protected]>
Date:   Sat Jul 16 20:55:20 2022 -0400

    Update and rename BuilingFromSource.md to BuilingFirmwareBinariesFromSource.md

commit 5de0aae
Author: Maxie D. Schmidt <[email protected]>
Date:   Sat Jul 16 20:54:59 2022 -0400

    New misc-tags target to BuildScripts/custom_build_targets.mk

commit e07823e
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sat Jul 16 20:39:06 2022 -0400

    Stashing in progress changes to the DESFire LibNFC test code ; Adding incomplete documentation for custom build targets

commit 3d19776
Author: Maxie D. Schmidt <[email protected]>
Date:   Sat Jul 16 20:27:39 2022 -0400

    Update DESFireSupportReadme.md

commit 4cfea3d
Author: Maxie Dion Schmidt <[email protected]>
Date:   Fri Jul 15 19:10:30 2022 -0400

    Saving work on the LibNFC testing code for DESFire builds

commit d297a0e
Author: Maxie Dion Schmidt <[email protected]>
Date:   Fri Jul 15 11:04:24 2022 -0400

    Restoring full log buffer space to the default (non dev) desfire target

commit bfac980
Author: Maxie Dion Schmidt <[email protected]>
Date:   Fri Jul 15 10:20:39 2022 -0400

    Testing code updates with the PM3 -- a few small changes

commit 53de26e
Author: Maxie Dion Schmidt <[email protected]>
Date:   Fri Jul 15 08:50:10 2022 -0400

    Tidying up code, build script fixes for no bc command, preliminary attempts to get CONFIG=MF_DESFIRE compatibility with extrernal USB readers using 'pcsc_spy -v'

commit 3c01a6c
Author: fptrs <[email protected]>
Date:   Fri Jul 8 13:09:53 2022 +0200

    Update firmware-desfire-push.yml

commit bc333f9
Merge: 99dceff 37be68d
Author: fptrs <[email protected]>
Date:   Fri Jul 8 12:24:22 2022 +0200

    Merge pull request emsec#319 from maxieds/DESFire-AuthISO-Patch

    DESFire emulation support: Bug, stability and reliability fixes and PM3 compatible ISO authentication

commit 37be68d
Merge: bc8057b 05eeda6
Author: Maxie Dion Schmidt <[email protected]>
Date:   Fri Jul 1 08:44:33 2022 -0400

    Merge branch 'DESFire-AuthISO-Patch' of https://github.com/maxieds/ChameleonMini into DESFire-AuthISO-Patch

commit bc8057b
Author: Maxie Dion Schmidt <[email protected]>
Date:   Fri Jul 1 08:44:21 2022 -0400

    Several fixes to responsiveness and frozen behavior noted in PR emsec#319

commit 93e77a2
Author: Maxie Dion Schmidt <[email protected]>
Date:   Thu Jun 30 22:42:22 2022 -0400

    Stashing changes to DESFire code -- No PSTR wrappers on command names as this doesn't change the ELF application size

commit 807d4ac
Author: Maxie Dion Schmidt <[email protected]>
Date:   Thu Jun 30 22:24:07 2022 -0400

    Stashing DESFire updates before tinkering with saving space with PSTR wrappers around the terminal command names

commit 05eeda6
Author: fptrs <[email protected]>
Date:   Wed Jun 29 13:12:55 2022 +0200

    Update Log.py

    change DESFire Generic Error decoder

commit 99dceff
Author: fptrs <[email protected]>
Date:   Wed Jun 29 11:50:28 2022 +0200

    Update ISO15693-A.c

    add missing VICINITY support statement

commit cda26ee
Merge: c3e1dab b6f4094
Author: Maxie Dion Schmidt <[email protected]>
Date:   Wed Jun 29 05:44:30 2022 -0400

    Merge branch 'DESFire-AuthISO-Patch' of https://github.com/maxieds/ChameleonMini into DESFire-AuthISO-Patch

commit c3e1dab
Author: Maxie Dion Schmidt <[email protected]>
Date:   Wed Jun 29 05:44:22 2022 -0400

    Updating the FLASH_DATA_ADDR value to the correct value for 6 slots (versus standard 8)

commit b6f4094
Author: fptrs <[email protected]>
Date:   Wed Jun 29 11:36:35 2022 +0200

    add missing sources for ISO15693_SNIFF

commit 3d2a8a6
Author: fptrs <[email protected]>
Date:   Wed Jun 29 11:24:39 2022 +0200

    add missing EM4233 statement

commit 40da00a
Author: fptrs <[email protected]>
Date:   Wed Jun 29 11:12:29 2022 +0200

    fix typos

commit 688b494
Author: Maxie Dion Schmidt <[email protected]>
Date:   Wed Jun 29 04:50:39 2022 -0400

    More typ corrections and build script bug fixes annotated in emsec#319

commit 7f37bfb
Author: Maxie Dion Schmidt <[email protected]>
Date:   Tue Jun 28 11:59:03 2022 -0400

    Updating source after the feedback from @fptrs in PR emsec#319

commit b378b4e
Author: Maxie D. Schmidt <[email protected]>
Date:   Wed Jun 22 21:00:18 2022 -0400

    Delete DESFire_example.contents

    This image is out of date -- Created using much older firmware sources. It eventually would be nice to replace it with a better dump using PR emsec#319 sources (or more recent).

commit 3806bcf
Author: Maxie D. Schmidt <[email protected]>
Date:   Wed Jun 22 21:00:08 2022 -0400

    Delete DESFire_example.dmp

    This image is out of date -- Created using much older firmware sources. It eventually would be nice to replace it with a better dump using PR emsec#319 sources (or more recent).

commit d29f087
Merge: 149599e 0291b9b
Author: Maxie D. Schmidt <[email protected]>
Date:   Thu Jun 16 20:17:00 2022 -0400

    Merge branch 'master' into DESFire-AuthISO-Patch

commit 149599e
Author: Maxie D. Schmidt <[email protected]>
Date:   Thu Jun 16 02:32:57 2022 -0400

    Cleaning up some old commented out macro definitions

commit bbc489e
Author: Maxie D. Schmidt <[email protected]>
Date:   Thu Jun 16 02:31:32 2022 -0400

    Typo corrected

commit 39de8cc
Author: Maxie Dion Schmidt <[email protected]>
Date:   Wed Jun 15 18:54:58 2022 -0400

    ACR122U USB/PCSC reader stopped being responsive after all of the PM3 compat changes: Attempt to fix this problem (PM3 command support verified as still working) -- Cf. emsec#313

commit 1ce7b55
Author: Maxie Dion Schmidt <[email protected]>
Date:   Wed Jun 15 12:20:25 2022 -0400

    Fixing the terminal (echo) printing on MacOS following the last commit for Linux users

commit 68a12e6
Author: Maxie Dion Schmidt <[email protected]>
Date:   Wed Jun 15 11:42:43 2022 -0400

    Fixing Linux build errors noticed by @colinoflynn in \emsec#313

commit 7b4cdd8
Author: Maxie Dion Schmidt <[email protected]>
Date:   Tue Jun 7 21:56:24 2022 -0400

    Fixing some make build script bugs

commit 024c699
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sat Jun 4 16:13:01 2022 -0400

    Finalizing the fixes to emsec#313 to verify PM3 support

commit f9c1dab
Author: Maxie Dion Schmidt <[email protected]>
Date:   Thu Jun 2 00:40:53 2022 -0400

    Updates to make/build scripts ; Partial fixes to @colinoflynn\'s notes in emsec#313 (success with \'hf mfdes info -- Still debugging auth exchanges)

commit 8e77d78
Author: Maxie Dion Schmidt <[email protected]>
Date:   Wed Jun 1 09:04:53 2022 -0400

    More refinements and efforts to make build output cleaner to read

commit 8a823c8
Author: Maxie Dion Schmidt <[email protected]>
Date:   Wed Jun 1 00:39:24 2022 -0400

    A few improvements to Makefile and build scripts (cf. previous issue emsec#283)

commit 8e25538
Author: Maxie Dion Schmidt <[email protected]>
Date:   Fri May 13 08:27:42 2022 -0400

    Attempt to fix bug with `pm3 --> hf mfdes info` reported in emsec#313

commit 83ce182
Author: Maxie Dion Schmidt <[email protected]>
Date:   Wed May 11 00:43:28 2022 -0400

    Fix Makefile bugs noticed in emsec#313

commit 4536789
Author: Maxie Dion Schmidt <[email protected]>
Date:   Fri Apr 22 13:43:40 2022 -0400

    Incorporating bug fixes by @colinoflynn at https://github.com/colinoflynn/ChameleonMini/commits/desfire-fixes (see message in emsec#313)

commit 19e0d1c
Author: Maxie Dion Schmidt <[email protected]>
Date:   Wed Mar 30 12:46:06 2022 -0400

    Stashing LibNFC external USB reader test code online to test on Linux (builds on MacOS)

commit f4faaa7
Author: Maxie Dion Schmidt <[email protected]>
Date:   Wed Mar 30 10:00:26 2022 -0400

    Working ISO authentication on the PM3 : cf. emsec#313

commit 45a6c3f
Author: Maxie Dion Schmidt <[email protected]>
Date:   Tue Mar 29 23:30:46 2022 -0400

    Stashing more working code to test PM3 compatibility (ISO/EV1 auth)

commit 7ecf3cb
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sat Mar 26 18:25:54 2022 -0400

    Stuck on debugging issue with PM3 -- Posted to discord -- awaiting fix before this can get fixed

commit fecf5cb
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sat Mar 26 10:44:07 2022 -0400

    More progress towards PM3 compatible auth II

commit b873261
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sat Mar 26 10:23:55 2022 -0400

    More progress towards PM3 compatible auth

commit bccf579
Author: Maxie Dion Schmidt <[email protected]>
Date:   Tue Mar 22 06:36:24 2022 -0400

    Proposed PM3 ISO auth compliant fwmod -- pending testing

commit 1be7688
Author: Maxie Dion Schmidt <[email protected]>
Date:   Mon Mar 21 21:05:16 2022 -0400

    Adding more complete support for PM3 ISO auth (stashing incremental changes as reference point -- II)

commit bb7d46f
Author: Maxie Dion Schmidt <[email protected]>
Date:   Mon Mar 21 18:34:11 2022 -0400

    Adding more complete support for PM3 ISO auth (stashing incremental changes as reference point)

commit 0291b9b
Author: Fabian <[email protected]>
Date:   Thu Mar 17 12:04:40 2022 +0100

    update Doxygen

commit aafc5ab
Author: Maxie Dion Schmidt <[email protected]>
Date:   Wed Mar 16 03:03:03 2022 -0400

    Stashing more incremental updates to the code to get/verify PM3 compatibility

commit 64d1fff
Author: Maxie Dion Schmidt <[email protected]>
Date:   Tue Mar 15 17:48:29 2022 -0400

    Stashing incremental changes from Arch for compilation on Mac

commit 371eaca
Merge: 94aeb3c 14537ac
Author: fptrs <[email protected]>
Date:   Tue Mar 1 15:31:32 2022 +0100

    Merge pull request emsec#318 from cacke-r/master

    AUTOCALIBRATE command for Sniff-ISO15693 application

commit 14537ac
Merge: a212bbb c47974e
Author: cacke-r <[email protected]>
Date:   Thu Feb 24 15:40:22 2022 +0100

    Merge pull request #2 from cacke-r/fix_autothreshold

    Sniff15693: Autocalibrate: Detect error case

commit c47974e
Author: cacke-r <[email protected]>
Date:   Wed Feb 23 21:03:17 2022 +0100

    Sniff15693: Autocalibrate: Detect error case

    Detect the case, that we never receive a valid card frame.
    Restore original/recent threshold in this case.

    Signed-off-by: cacke-r <[email protected]>

commit a212bbb
Author: cacke-r <[email protected]>
Date:   Tue Feb 15 20:56:36 2022 +0100

    Chamtool: Add Autothreshold command

    Signed-off-by: cacke-r <[email protected]>

commit c686040
Author: cacke-r <[email protected]>
Date:   Tue Feb 15 20:15:15 2022 +0100

    Commands: Autocalibrate: Dont execute if ISO15693 codec uses autothreshold

    Signed-off-by: cacke-r <[email protected]>

commit b8fec22
Author: cacke-r <[email protected]>
Date:   Mon Feb 14 21:01:46 2022 +0100

    Terminal: Add commands to control Sniff15693 autothreshold feature

    Signed-off-by: cacke-r <[email protected]>

commit b04351b
Author: cacke-r <[email protected]>
Date:   Wed Feb 9 21:46:30 2022 +0100

    Sniff15693: Add CRC Check on received data

    Signed-off-by: cacke-r <[email protected]>

commit ad16434
Author: cacke-r <[email protected]>
Date:   Tue Feb 15 20:07:25 2022 +0100

    Sniff15693: Implementation of Autocalibration command

    Signed-off-by: cacke-r <[email protected]>

commit 821de78
Author: cacke-r <[email protected]>
Date:   Tue Feb 15 20:00:22 2022 +0100

    SniffISO15693: Add functions to codec to enable autocalibration

    Signed-off-by: cacke-r <[email protected]>

commit 97d7ad8
Author: cacke-r <[email protected]>
Date:   Sun Jan 30 21:21:39 2022 +0100

    Hook Sniff15693 App to the AutoCalibration command

    Signed-off-by: cacke-r <[email protected]>

commit 5f8d0ec
Author: cacke-r <[email protected]>
Date:   Sun Jan 30 21:20:38 2022 +0100

    Add Autocalibrate command to chamtool

    Signed-off-by: cacke-r <[email protected]>

commit 8f5053f
Author: Maxie Dion Schmidt <[email protected]>
Date:   Mon Feb 14 12:54:05 2022 -0500

    *Should* finally be working now -- Problem was that the SETTINGS memory remapped the FLASH memory space used by avr-gcc\'s __flash to a custom .flashdata section after the LUFA build by a second call to avr-objcopy -- Clever way to maximize slot space, but the previous code was not aware of that causing apparently quasi-non-deterministic behavior with some readers -- Cf. emsec#313 and emsec#315

commit 2d54740
Author: Maxie Dion Schmidt <[email protected]>
Date:   Mon Feb 14 12:32:10 2022 -0500

    Separate section to store in flash not working -- Beginning new approach to put reduced size massive structure into plain old data mem

commit 138a174
Author: Maxie Dion Schmidt <[email protected]>
Date:   Mon Feb 14 08:19:23 2022 -0500

    Swapping out previous __flash settings for commands lookup table into last half of LOG_FRAM (code and Makefile defines -- may still need to extract this new section using avr-objcopy -- pending testing)

commit ac265b4
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sun Feb 13 03:54:01 2022 -0500

    Out of hell ... Everything seems to be working again with the MEMORY_LIMITED_TESTING define set in the Makefile :)

commit 65766e1
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sun Feb 13 02:41:53 2022 -0500

    Incremental backup -- Auth schemes should be working -- New CommMode checksum functions DO NOT fit into text/data (yet)

commit bf1eadc
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sun Feb 13 00:29:24 2022 -0500

    Making a sane backup point while prfusely debugging

commit a24fbe8
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sat Feb 12 21:47:54 2022 -0500

    Preliminary (partial) support for more CommModes -- This is going to need substantial testing -- III

commit 74f216f
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sat Feb 12 19:15:57 2022 -0500

    Preliminary (partial) support for more CommModes -- This is going to need substantial testing -- II

commit e9437a6
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sat Feb 12 18:52:10 2022 -0500

    Preliminary (partial) support for more CommModes -- This is going to need substantial testing

commit e9ce4ac
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sat Feb 12 14:43:01 2022 -0500

    Untested CMAC implementation for CommMode=FULL exchanges (Enciphered+CMAC'ed data)

commit de798fb
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sat Feb 12 10:59:20 2022 -0500

    Adding in preliminary AES transfer functions -- Trying to save space for more where it can be pruned -- III -- cf. emsec#313

commit a0cb74c
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sat Feb 12 10:20:10 2022 -0500

    Adding in preliminary AES transfer functions -- Trying to save space for more where it can be pruned -- II

commit 583bb93
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sat Feb 12 10:07:37 2022 -0500

    Adding in preliminary AES transfer functions -- Trying to save space for more where it can be pruned

commit 3974786
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sat Feb 12 08:47:04 2022 -0500

    Finding other places to squeeze space for the DESFire config (Log and terminal buffers stored on the stack -- adding buffer full messages for INFO)

commit a4672ff
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sat Feb 12 08:34:27 2022 -0500

    Finding other places to squeeze space for the DESFire config (Log and terminal buffers stored on the stack)

commit 9ee3236
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sat Feb 12 08:02:54 2022 -0500

    Addressing the ACK/NAK keep-alive exchanges from some NXP readers noted by \@lvandenb in emsec#313

commit b6be1b8
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sat Feb 12 05:32:37 2022 -0500

    Space saving defines to remove currently unused crypto exchange functionality (will revisit when get to this subproject)

commit 20a6960
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sat Feb 12 04:41:40 2022 -0500

    Fixing legacy auth algorithm from 3K3DES -> 2K3DES (cf. emsec#313)

commit 1644a9e
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sat Feb 12 00:40:13 2022 -0500

    Making sure the auth AES and auth ISO handlers keep the chain of prior legacy auths intact

commit bcf68d0
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sat Feb 12 00:27:24 2022 -0500

    Last minute modifications to DES/3DES enc/dec routines for data that is not a multiple of the resp. block size

commit e15f8c7
Author: Maxie Dion Schmidt <[email protected]>
Date:   Fri Feb 11 22:51:37 2022 -0500

    Fixing bug where we must first auth with the legacy command mentioned in emsec#313

commit e22b286
Author: Maxie Dion Schmidt <[email protected]>
Date:   Fri Feb 11 17:43:41 2022 -0500

    Removing default testing nonce B from auth commands ; Running make style

commit ba3c736
Author: Maxie Dion Schmidt <[email protected]>
Date:   Fri Feb 11 17:42:20 2022 -0500

    Bug fixes to observations in emsec#313

commit a02f214
Author: Maxie Dion Schmidt <[email protected]>
Date:   Fri Feb 4 22:17:00 2022 -0500

    Working AES128 auth and ISO auth ; Still need to debug the legacy auth

commit b451e12
Author: Maxie Dion Schmidt <[email protected]>
Date:   Thu Feb 3 06:52:33 2022 -0500

    Working AES128 auth ; Nearly working ISO auth (still debugging) -- Stashing copy for reference

commit 7176259
Author: Maxie Dion Schmidt <[email protected]>
Date:   Mon Jan 31 12:54:23 2022 -0500

    Stashing incremental testing release code

commit ca0afad
Author: Maxie Dion Schmidt <[email protected]>
Date:   Mon Jan 31 10:54:37 2022 -0500

    Adding support for non-wrapped native commands (I believe)

commit 281d3c7
Author: Maxie Dion Schmidt <[email protected]>
Date:   Mon Jan 31 01:23:50 2022 -0500

    AuthLegacy(0x0A) works using 3DES enc/dec modes -- Makefile no testing -- For emsec#313

commit 195e600
Author: Maxie Dion Schmidt <[email protected]>
Date:   Mon Jan 31 01:22:07 2022 -0500

    AuthLegacy(0x0A) works using 3DES enc/dec modes

commit 6ee1958
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sun Jan 30 23:03:07 2022 -0500

    AuthISO(0x1A) works tentatively (a little slowly) with the LibNFC test code

commit d20cac4
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sun Jan 30 15:45:27 2022 -0500

    More testing (still doesn't make it through round2 on the Chameleon)

commit 1e542ec
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sun Jan 30 14:53:16 2022 -0500

    Re-implementing the 3DES crypto with CBC

commit fba0ee3
Author: Maxie Dion Schmidt <[email protected]>
Date:   Sun Jan 30 12:34:25 2022 -0500

    Debugging ISO authenticate command (0x1a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants