bitcoin-tx input verification (awemany, jnewbery) #10130

pull jnewbery wants to merge 3 commits into bitcoin:master from jnewbery:bitcoin_tx_input_sanitiser changing 3 files +54 −0
  1. jnewbery commented at 8:42 PM on March 30, 2017: member

    Check number of arguments passed to bitcoin-tx in outaddr and outpubkey.

    This PR also updates the bitcoin-tx tests to check bitcoin-tx stderr and verify that expected errors are raised.

    Adds test cases for calling bitcoin-tx with wrong number of separators in outaddr and outpubkey.

  2. bitcoin-tx: Fix missing range check
    The number of arguments is not checked MutateTxAddOutAddr(..), meaning
    that
    
    > ./bitcoin-tx -create outaddr=
    
    accessed the vStrInputParts vector beyond its bounds.
    
    This also includes work by jnewbery to check the inputs for
    MutateTxAddPubKey()
    eb66bf9bdd
  3. Check stderr when testing bitcoin-tx 21704f6334
  4. Add tests for bitcoin-tx input checking 19ecd1e2e1
  5. jnewbery commented at 8:46 PM on March 30, 2017: member
  6. fanquake added the label Needs backport on Mar 30, 2017
  7. fanquake added this to the milestone 0.14.1 on Mar 30, 2017
  8. jnewbery commented at 10:08 PM on March 30, 2017: member

    @theuni has suggested that checking the stderr for error text may cause problems due to unicode, eols, etc, and that we'd be better off defining our own exit codes in bitcoin-tx and testing on those. I think it's ok to test for text in stderr for now, but we a future PR should define exit codes and test them in bctest.py.

  9. fanquake added this to the "For backport" column in a project

  10. laanwj commented at 6:15 AM on March 31, 2017: member

    I don't disagree with @theuni on that in general, however checking for text in error messages is perfectly fine for tests that are supposed to test these errors. Especially for a user-facing tool. We do a similar thing for checking e.g. RPC errors where we check both the code and the message.

  11. laanwj commented at 6:30 AM on March 31, 2017: member

    utACK 19ecd1e

  12. gmaxwell commented at 6:39 AM on March 31, 2017: contributor

    @awemany Fix moved over here, your review/testing would be very welcome!

  13. gmaxwell approved
  14. gmaxwell commented at 6:41 AM on March 31, 2017: contributor

    ACK (did not test test, e.g. by introducing a bug).

  15. theuni commented at 7:00 AM on March 31, 2017: member

    As mentioned in the comments: for reference, I suggested using exit codes rather than comparing text because (here specifically), Wine piles nonsense about window creation into stderr when running without DISPLAY set. For that reason, we can't test that "stderr == expected", rather we have to test "expected in stderr". That's not great, but it's not a huge deal either.

    utACK 19ecd1e2e13514c8a92a2a4337c2568c3d5d13e5

  16. MarcoFalke renamed this:
    bitcoin-tx input verification
    bitcoin-tx input verification (awemany, jnewbery)
    on Mar 31, 2017
  17. laanwj merged this on Mar 31, 2017
  18. laanwj closed this on Mar 31, 2017

  19. laanwj referenced this in commit de301b0488 on Mar 31, 2017
  20. laanwj referenced this in commit 04c21afcdf on Mar 31, 2017
  21. laanwj referenced this in commit ecc523288c on Mar 31, 2017
  22. laanwj referenced this in commit f59e3dfc59 on Mar 31, 2017
  23. laanwj removed the label Needs backport on Mar 31, 2017
  24. laanwj removed this from the "For backport" column in a project

  25. codablock referenced this in commit a149129656 on Jan 26, 2018
  26. andvgal referenced this in commit 5f89df41e2 on Jan 6, 2019
  27. CryptoCentric referenced this in commit c5878f73dc on Feb 27, 2019
  28. PastaPastaPasta referenced this in commit a05f5ac881 on Mar 15, 2019
  29. PastaPastaPasta referenced this in commit 7aa47ee091 on May 20, 2019
  30. PastaPastaPasta referenced this in commit 2538f8334c on May 20, 2019
  31. PastaPastaPasta referenced this in commit e798b83cbc on May 21, 2019
  32. PastaPastaPasta referenced this in commit 3ce2d6fb93 on May 22, 2019
  33. PastaPastaPasta referenced this in commit f9c2cd915c on May 22, 2019
  34. PastaPastaPasta referenced this in commit 10d3311b22 on May 22, 2019
  35. PastaPastaPasta referenced this in commit 4dd3af6441 on May 22, 2019
  36. PastaPastaPasta referenced this in commit 61b0481944 on May 23, 2019
  37. MarcoFalke locked this on Sep 8, 2021

Milestone
0.14.1


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-29 03:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me