rgb-cln/bitcoin
Jon Griffiths 4b38696613 pull_length: Take structure size into account when checking max
When a serialized length refers to an array of structures, the trivial
DOS prevention can be out by a factor of sizeof(serialized struct). Use
the size of the serialized structure as a multiplier to prevent this.

Transaction inputs are the motivating example, where the check is out by
a factor of ~40.
2018-02-07 00:45:26 +00:00
..
test bitcoin: add test programs to ALL_TEST_PROGRAMS 2018-01-24 17:42:32 +01:00
Makefile bitcoin: add test programs to ALL_TEST_PROGRAMS 2018-01-24 17:42:32 +01:00
README Fix typo. 2015-06-25 13:48:05 +09:30
address.h Makefile: generalize whitespace check. 2017-01-04 14:09:20 +10:30
base58.c external: new subdirectory for all external libraries and submodules. 2017-08-29 17:54:14 +02:00
base58.h headers: fix up header idempotent lines. 2017-08-29 17:54:14 +02:00
block.c bitcoin: add formatting hook for printing bitcoin blockids 2017-12-25 12:33:22 +01:00
block.h bitcoin: create new wrapper type bitcoin_blkid, log backward endianness. 2017-12-21 11:05:38 +00:00
chainparams.c chainparams: fix regtest bip173_name 2018-02-06 01:37:58 +00:00
chainparams.h bitcoin: create new wrapper type bitcoin_blkid, log backward endianness. 2017-12-21 11:05:38 +00:00
locktime.c common: new directory for any shared objects. 2017-08-29 17:54:14 +02:00
locktime.h header cleanup: sort include lines into alpha order, after config.h 2016-01-22 06:38:08 +10:30
preimage.h bitcoin/preimage: struct preimage. 2017-02-02 14:48:00 +10:30
privkey.h struct secret: use everywhere. 2017-05-09 11:43:35 +09:30
pubkey.c common: new directory for any shared objects. 2017-08-29 17:54:14 +02:00
pubkey.h headers: fix up header idempotent lines. 2017-08-29 17:54:14 +02:00
pullpush.c struct bitcoin_tx: remove explicit lengths, use tal_len()/tal_count() 2017-01-25 11:03:55 +10:30
pullpush.h struct bitcoin_tx: remove explicit lengths, use tal_len()/tal_count() 2017-01-25 11:03:55 +10:30
script.c bitcoin/script: define standard scriptpubkey lengths. 2017-12-20 12:56:15 +01:00
script.h bitcoin/script: define standard scriptpubkey lengths. 2017-12-20 12:56:15 +01:00
shadouble.c bitcoin: create new wrapper type bitcoin_blkid, log backward endianness. 2017-12-21 11:05:38 +00:00
shadouble.h header cleanup: sort include lines into alpha order, after config.h 2016-01-22 06:38:08 +10:30
short_channel_id.c gossip: Added short_channel_id_to_uint for uintmap index 2018-02-05 18:28:39 +00:00
short_channel_id.h gossip: Added short_channel_id_to_uint for uintmap index 2018-02-05 18:28:39 +00:00
signature.c common: new directory for any shared objects. 2017-08-29 17:54:14 +02:00
signature.h struct bitcoin_tx: remove explicit lengths, use tal_len()/tal_count() 2017-01-25 11:03:55 +10:30
tx.c pull_length: Take structure size into account when checking max 2018-02-07 00:45:26 +00:00
tx.h Fix weight calculation, rename cost->weight. 2018-02-03 21:00:55 +01:00
varint.c bitcoin/varint: fix varint reading for multibyte varints. 2016-07-07 11:55:32 +09:30
varint.h varint: new file. 2016-04-12 13:07:03 +09:30

README

These are standard bitcoin manipulation routines which should be
provided by any normal bitcoin library in whatever language you choose.

The ones here are standalone ones taken from bitcoin core and some I
wrote, many taken from bitcoin-iterate and pasted in here.