aboutsummaryrefslogtreecommitdiff
path: root/src/blockencodings.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-06-25 08:07:29 -0400
committerMarcoFalke <falke.marco@gmail.com>2020-06-25 08:07:36 -0400
commitc9d1040d254eedac98ec4a2038742d7b3d45f9ab (patch)
treeb1260d8583bcbdb83b2ef19be46d51c7c5a3611e /src/blockencodings.h
parent67881de0e3b1cef1d0f978582765a8aeeb09c21a (diff)
parent37ae687f95c82f2d64ed880533d158060d4fc3de (diff)
downloadbitcoin-c9d1040d254eedac98ec4a2038742d7b3d45f9ab.tar.xz
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/blockencodings.h')
0 files changed, 0 insertions, 0 deletions