conorpp/u2f-zero

Highlight "lazy check" for rewrite

rampageservices opened this issue · 1 comments

Hi,
I just wanted to highlight this line of code for someone to rewrite or to remind myself to submit a PR for a better check for the test_key_signing() method. I understand code-space is limited which may be the reasoning behind a simple check but if the result can be verified that seems to be the better route.

// lazy/bad check but eh
	return res.len > 8 ? 0 : -1;

https://github.com/conorpp/u2f-zero/blob/master/firmware/tests/tests.c#L226

Thanks. It isn't so much of a space constraint of me being lazy a a while ago when I wrote that test. Tests shouldn't be compiled into production and don't need all functionality present so relatively speaking there aren't any constraints.