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

refact(der-to-jose) add additional param length checks #13

Merged
merged 1 commit into from
Jan 19, 2016

Conversation

omsmith
Copy link
Contributor

@omsmith omsmith commented Jan 18, 2016

No description provided.

@omsmith
Copy link
Contributor Author

omsmith commented Jan 18, 2016

@j3parker When you have a minute, no real rush as its not particularly important. Suggested reading with ?w=1

Just adds an additional sanity/correctness check when reading in a DER signature.

The DER representation, a minimally represented signed integer, should be at most paramLength + 1, given they could be the full length with a leading zero when necessary to disambiguate positivity. Using the "happy path fuzzing", this is usually the case.

@j3parker
Copy link
Member

Whoops! Will look tomorrow

@j3parker
Copy link
Member

Haha I forgot about the leading zero for positivity thing. Sigh.

:shipit: but you're the expert :)

Is the sanity check just for helping lawful-good devs or is it also a perf thing?

@omsmith
Copy link
Contributor Author

omsmith commented Jan 19, 2016

Eh, would just be to avoid following through the whole process, allocating buffers and copying and whatnot if it couldn't possibly be valid

@j3parker
Copy link
Member

Sounds reasonable. Better to reject crap data early.

omsmith added a commit that referenced this pull request Jan 19, 2016
refact(der-to-jose) add additional param length checks
@omsmith omsmith merged commit 7b330e9 into Brightspace:master Jan 19, 2016
@omsmith omsmith deleted the decode-additional-length-checks branch January 19, 2016 15:18
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

2 participants