diff options
| author | MarcoFalke <[email protected]> | 2020-06-25 08:07:29 -0400 |
|---|---|---|
| committer | MarcoFalke <[email protected]> | 2020-06-25 08:07:36 -0400 |
| commit | c9d1040d254eedac98ec4a2038742d7b3d45f9ab (patch) | |
| tree | b1260d8583bcbdb83b2ef19be46d51c7c5a3611e /src/httpserver.cpp | |
| parent | Merge #19272: net, test: invalid p2p messages and test framework improvements (diff) | |
| parent | Add tests for CPubKey serialization/unserialization (diff) | |
| download | discoin-c9d1040d254eedac98ec4a2038742d7b3d45f9ab.tar.xz discoin-c9d1040d254eedac98ec4a2038742d7b3d45f9ab.zip | |
Merge #19237: wallet: Check size after unserializing a pubkey
37ae687f95c82f2d64ed880533d158060d4fc3de Add tests for CPubKey serialization/unserialization (Elichai Turkel)
9b8907faded8e4ec312c0dd4b4b15e1793876acd Check size after Unserializing CPubKey (Elichai Turkel)
Pull request description:
Found by practicalswift, closes #19235
Currently all the public API(except the pointer-like API) in CPubKey that sets/constructs a pubkey goes through `CPubKey::Set` which checks if that the length and size match and if not invalidates the key.
This adds the same check to `CPubKey::Unserialize`, sadly I don't see an easy way to just push this to the existing checks in `CPubKey::Set` but it's only a simple condition.
The problem with not invalidating is that if you write a pubkey like: `{0x02,0x00}` it will think the actual length is 33(because of `size()`) and will access uninitialized memory if you call any of the functions on CPubKey.
ACKs for top commit:
practicalswift:
re-ACK 37ae687f95c82f2d64ed880533d158060d4fc3de
jonatack:
Code review re-ACK 37ae687 per `git diff eab8ee3 37ae687` only change since last review at eab8ee3 is passing the `pubkey` param by reference to const instead of by value in `src/test/key_tests.cpp::CmpSerializationPubkey`
MarcoFalke:
ACK 37ae687f95c82f2d64ed880533d158060d4fc3de
Tree-SHA512: 30173755555dfc76d6263fb6a59f41be36049ffae7b4e1b92b922d668f5e5e2331f7374d5fa10d5d59fc53020d2966156905ffcfa8b8129c1f6d0ca062174ff1
Diffstat (limited to 'src/httpserver.cpp')
0 files changed, 0 insertions, 0 deletions