cbor: allow user to control nesting#329
Merged
kaczmarczyck merged 3 commits intogoogle:developfrom Jun 18, 2021
Merged
Conversation
- Make the default read/write entrypoints allow infinite nesting.
- Add {read,write}_nested() entrypoints that allow the crate user to
control the depth of nesting that's allowed.
- Along the way, convert the write[_nested] variants to return a
`Result<(), EncoderError>` rather than a bool. This exposes
more failure information (and forces the caller to take notice
of those tailures), and allows use of the ? operator.
43ba35e to
add4ca4
Compare
daviddrysdale
commented
Jun 18, 2021
Collaborator
kaczmarczyck
left a comment
There was a problem hiding this comment.
I'd propose a change in cbor_read and cbor_write that works specifically for CTAP. I marked the lines that would need changes for convenience.
8f64018 to
c295121
Compare
kaczmarczyck
approved these changes
Jun 18, 2021
Collaborator
kaczmarczyck
left a comment
There was a problem hiding this comment.
Perfect! The code is cleaner now. Binary size also didn't change much (my current quest :).
Contributor
Author
|
Should I squash into a single commit or do you normally squash-and-merge? |
Collaborator
|
I'll just squash-and-merge. |
ia0
added a commit
to ia0/OpenSK
that referenced
this pull request
Aug 11, 2021
This fixes a left-over from google#329.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
control the depth of nesting that's allowed.
Result<(), EncoderError>rather than a bool. This exposesmore failure information (and forces the caller to take notice
of those tailures), and allows use of the ? operator.