-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CBOR: Reject malformed and invalid indefinite-length strings (#405)
* Test UTF-8 validation of indefinite-length CBOR text string chunks. Per the CBOR spec, each chunk of an indefinite-length text string must be valid, or the entire indefinite-length string is invalid. * Test indefinite-length CBOR string chunks match parent type. An indefinite-length text or byte string is not well-formed unless all of its chunks are of the same major type as the indefinite-length string. * CBOR: Reject malformed/invalid indefinite strings. This addresses two conformance issues: 1. All chunks of an indefinite-length text string must be valid, so if UTF-8 validation is enabled for text strings in DecodeOptions, it should be applied to each chunk. 2. All of the chunks of an indefinite-length text or byte string must have the same major type as the indefinite-length string itself. Indefinitely-length text strings can't contain byte strings and vice versa.
- Loading branch information
Showing
2 changed files
with
47 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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