Nitrokey / nitrokey-pro-firmware

Firmware for the Nitrokey Pro device
GNU General Public License v3.0
118 stars 21 forks source link

Fix warnings #10

Closed FlorianUekermann closed 7 years ago

FlorianUekermann commented 8 years ago

This includes a missing return, which seems to fix #9

I am still not sure about the correctness of testScAesKey, so don't apply this yet. The switch statement looks very fishy. What exactly is the meaning of nRet and what do the callers of testScAesKey expect as return value?

All other changes should at least not introduce regressions (but also no fixes).

FlorianUekermann commented 8 years ago

I found only two users of testScAesKey. Both only check if the return value is false, so I decided to return FALSE unless APDU_ANSWER_COMMAND_CORRECT == CcidAesDec (...) in which case TRUE is returned.

This does not fix issue #9 anymore. This should be applied after review, since the behavior with the old switch in testScAesKey statement is undefined in some cases.

szszszsz commented 8 years ago

You might want to check https://github.com/Nitrokey/nitrokey-storage-firmware for comparison. Some bugs might have been fixed independently there.

szszszsz commented 7 years ago

Made obsolete with #31 Closing.