1. 01 May, 2018 1 commit
    • Alessandro Sorniotti's avatar
      [FAB-6381] Secure defaults for txsFilter · 53de0781
      Alessandro Sorniotti authored
      The aim of this change set is to apply the well-established "Secure by
      default" security principle to the way the validator validates transactions
      in a block.
      The current code behaves as follows: create an array of validation codes, set
      by default to "all transactions are valid"; then perform validation which may
      mark transactions as invalid. Furthermore, in other parts of the code, if no
      array of validation codes is yet persent in the block, a new one is
      indiscriminately created (again, marking all transactions as valid). This
      approach is a security anti-pattern because it opens up to attacks where an
      adversary may force the code through a path where the default "tx is valid"
      validation code is maintained even for invalid txes.
      This change set ensures that validation code arrays are created and set to a
      new value (TxValidationCode_NOT_VALIDATED) which ensures that a transaction
      that hasn't been validated cannot be mistaken for a valid one.
      Change-Id: I5dbb18dd77af3cd14b168042ae660e4e27bf29dd
      Signed-off-by: default avatarAlessandro Sorniotti <ale.linux@sopit.net>
  2. 18 Jan, 2018 1 commit
    • Robert Zaremba's avatar
      [FAB-7802] Automatic format fix using gofmt · e14f2080
      Robert Zaremba authored
      gofmt -w -s
      Many developers have integrated `gofmt`  auto-formatting. S
      Some code changes can automatically cause other changes caused through
      `gofmt` integration, not related to the intent of the task.
      For clarity in future pull-requests, the gofmt issues should be solved
      once and for all.
      This change doesn't break the code, because it uses official `gofmt` to do
      the auto code formatting.
      Change-Id: Ife1c2e112dc4f188fb6a90916587af453a133099
      Signed-off-by: default avatarRobert Zaremba <robert.zaremba@scale-it.pl>
  3. 06 Dec, 2017 1 commit
    • manish's avatar
      [FAB-7224] Enhance custom tx processor · adf74750
      manish authored
      This CR enhances custom transaction processor in ledger such that
      the processor is able to distinguish whether it is being invoked
      during ledger initialization or for on-line tx processing.
      In the former situation, the processor needs to just rely on the
      states stored previously in the ledger and in the latter it can assume that
      the peer is up and running and hence other peer structures can be used.
      Other than this, in the initialization situation only valid transactions are
      passed to the processor which makes the custom validation in the processor
      Change-Id: Idff54ab124dd588dfa5172a5b882e521217ca62a
      Signed-off-by: default avatarmanish <manish.sethi@gmail.com>
  4. 25 Nov, 2017 1 commit