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

mifare_desfire_key: fix get/set_version for AES keys #70

Closed

Conversation

mtdcr
Copy link
Contributor

@mtdcr mtdcr commented Aug 30, 2017

mifare_desfire_key_set_version incorrectly modified AES key bytes, while mifare_desfire_key_get_version returned some bits of the AES key.

@smortex smortex self-requested a review August 30, 2017 21:11
Copy link
Contributor

@smortex smortex left a comment

Choose a reason for hiding this comment

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

The current behavior looks odd indeed.

May I ask you add some simple unit-test that breaks without this change (and prove the code is wrong) and pass with the proposed patch? Extra point if you push the tests, Travis-CI complains that the code is broken, and then push this commit on top and Travis-CI is happy again 😉

@mtdcr
Copy link
Contributor Author

mtdcr commented Sep 3, 2017

No, but feel free to take my contribution as is. The defect is obvious.

@darconeous
Copy link
Member

Is it really better to leave this bug in the code base than to take this simple fix for an obvious defect without a unit test?

@darconeous
Copy link
Member

If this isn't resolved by the time I get a pull request for #77 submitted, I could also throw in a test for this as a part of that pull request.

@smortex
Copy link
Contributor

smortex commented Jan 3, 2018

If this isn't resolved by the time I get a pull request for #77 submitted, I could also throw in a test for this as a part of that pull request.

@darconeous please don't mix fixes in a single Pull-Request 😨 . Feel free to open a new PR that fix this issue, and reference this issue in the new Pull-Request… that way we do not forget to close one PR when merging the other one, and have a more readable code history 👍 .

Thanks!

@darconeous
Copy link
Member

No problem.

darconeous added a commit to darconeous/libfreefare that referenced this pull request Jan 5, 2018
In addition to adding tests for the bugs addressed via nfc-tools#70,
this commit also addresses a key corruption bug that would
occur on 3DES keys when `mifare_desfire_key_set_version()`
was called.
@darconeous
Copy link
Member

#78 includes tests which validate this PR.

darconeous added a commit to darconeous/libfreefare that referenced this pull request Jan 6, 2018
In addition to adding tests for the bugs addressed via nfc-tools#70,
this commit also addresses a key corruption bug that would
occur on 3DES keys when `mifare_desfire_key_set_version()`
was called.
darconeous added a commit to darconeous/libfreefare that referenced this pull request Jan 6, 2018
In addition to adding tests for the bugs addressed via nfc-tools#70,
this commit also addresses a key corruption bug that would
occur on 3DES keys when `mifare_desfire_key_set_version()`
was called.
darconeous added a commit to darconeous/libfreefare that referenced this pull request Jan 6, 2018
In addition to adding tests for the bugs addressed via nfc-tools#70,
this commit also addresses a key corruption bug that would
occur on 3DES keys when `mifare_desfire_key_set_version()`
was called.
darconeous added a commit to darconeous/libfreefare that referenced this pull request Jan 6, 2018
In addition to adding tests for the bugs addressed via nfc-tools#70,
this commit also addresses a key corruption bug that would
occur on 3DES keys when `mifare_desfire_key_set_version()`
was called.
darconeous added a commit to darconeous/libfreefare that referenced this pull request Jan 6, 2018
In addition to adding tests for the bugs addressed via nfc-tools#70,
this commit also addresses a key corruption bug that would
occur on 3DES keys when `mifare_desfire_key_set_version()`
was called.
darconeous added a commit to darconeous/libfreefare that referenced this pull request Jan 7, 2018
In addition to adding tests for the bugs addressed via nfc-tools#70,
this commit also addresses a key corruption bug that would
occur on 3DES keys when `mifare_desfire_key_set_version()`
was called.
@smortex
Copy link
Contributor

smortex commented Jan 8, 2018

Closing since #78 will be merged soon-ish!

@smortex smortex closed this Jan 8, 2018
darconeous added a commit to darconeous/libfreefare that referenced this pull request Jan 8, 2018
In addition to adding tests for the bugs addressed via nfc-tools#70,
this commit also addresses a key corruption bug that would
occur on 3DES keys when `mifare_desfire_key_set_version()`
was called.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants