aboutsummaryrefslogtreecommitdiffstats
path: root/rlp/decode_test.go
Commit message (Collapse)AuthorAgeFilesLines
* rlp: fix list bounds check overflow (found by go-fuzz)Felix Lange2015-04-281-0/+11
| | | | | | The list size checking overflowed if the size information for a value was bigger than the list. This is resolved by always performing the check before reading.
* rlp: require declared number of input elements for array typesFelix Lange2015-04-171-15/+11
|
* rlp: stop accepting lists for byte slices and byte arraysFelix Lange2015-04-171-34/+7
|
* rlp: stricter rules for structs and pointersFelix Lange2015-04-171-12/+53
| | | | | | | | | | The rules have changed as follows: * When decoding into pointers, empty values no longer produce a nil pointer. This can be overriden for struct fields using the struct tag "nil". * When decoding into structs, the input list must contain an element for each field.
* rlp: reject non-minimal input stringsFelix Lange2015-04-171-8/+24
| | | | | Input strings of length 1 containing a byte < 56 are non-minimal and should be encoded as a single byte instead. Reject such strings.
* rlp: stricter validation of canonical integer formatFelix Lange2015-04-171-8/+30
| | | | | | | All integers (including size information in type tags) need to be encoded using the smallest possible encoding. This commit expands the stricter validation introduced for *big.Int in commit 59597d23a5ee268 to all integer types and size tags.
* rlp: fix handling of single byte zero when decoding into a pointerFelix Lange2015-04-171-1/+1
| | | | | | A single zero byte carries information and should not set the pointer to nil. This is arguably a corner case. While here, fix the comment to explain pointer reuse.
* rlp: fix integer overflow in list element size validationFelix Lange2015-04-171-0/+3
| | | | It is not safe to add anything to s.size.
* rlp: check top-level value sizes against input limitFelix Lange2015-04-171-38/+80
| | | | | | This is a preliminary fix for #420 (SEC-18 RLP decoder unsafe allocation). If a sane input limit is set on the rlp.Stream, it should no longer be possible to cause huge []byte allocations.
* Reject integers w/ appended zero'sobscuren2015-04-051-0/+1
|
* rlp: add Stream.RawFelix Lange2015-03-211-1/+15
|
* rlp: fix nil pointer decodingFelix Lange2015-03-211-1/+21
| | | | | | The generic pointer decoder did not advance the input position for empty values. This can lead to strange issues and even infinite loops.
* rlp: allow encoding non-empty interface valuesFelix Lange2015-01-161-0/+5
| | | | | | | | This needs to be supported because []someInterface does occur sometimes. Funny enough, the fix involves changes to the decoder. makeDecoder cannot return an error for non-empty interfaces anymore because the type cache builds both decoder and writer. Do the check at 'runtime' instead.
* rlp: fix Decode benchmarksFelix Lange2015-01-151-8/+10
|
* rlp: add functions for encodingFelix Lange2015-01-151-3/+3
| | | | | | | | I'm reasonably confident that the encoding matches the output of ethutil.Encode for values that it supports. Some of the tests have been adpated from the Ethereum testing repository. There are still TODOs in the code.
* Mergeobscuren2015-01-061-5/+33
|
* rlp: display decoder target type in more error messagesFelix Lange2014-12-101-9/+9
| | | | | Decode error messages now say "expected input list for foo.MyStruct" instead of just "expected List".
* rlp: remove support for signed integer typesFelix Lange2014-12-091-21/+21
| | | | | There is no agreement on how to encode negative integers across implementations. cpp-ethereum doesn't support them either.
* rlp: include target type in decoder error messagesFelix Lange2014-11-251-17/+16
|
* rlp: add NewListStream (for p2p)Felix Lange2014-11-251-0/+18
|
* rlp: add Stream.Reset and accept any reader (for p2p)Felix Lange2014-11-251-2/+36
|
* rlp: fix pointer reuseFelix Lange2014-11-171-2/+9
|
* rlp: new package for streaming RLP decoderFelix Lange2014-11-171-0/+469