1. 21 Feb, 2019 1 commit
    • Nicola Tuveri's avatar
      Test for constant-time flag leakage in BN_CTX · c4e901db
      Nicola Tuveri authored
      This commit adds a simple unit test to make sure that the constant-time
      flag does not "leak" among BN_CTX frames:
      
      - test_ctx_consttime_flag() initializes (and later frees before
        returning) a BN_CTX object, then it calls in sequence
        test_ctx_set_ct_flag() and test_ctx_check_ct_flag() using the same
        BN_CTX object. The process is run twice, once with a "normal"
        BN_CTX_new() object, then with a BN_CTX_secure_new() one.
      - test_ctx_set_ct_flag() starts a frame in the given BN_CTX and sets the
        BN_FLG_CONSTTIME flag on some of the BIGNUMs obtained from the frame
        before ending it.
      - test_ctx_check_ct_flag() then starts a new frame and gets a number of
        BIGNUMs from it. In absence of leaks, none of the BIGNUMs in the new
        frame should have BN_FLG_CONSTTIME set.
      
      In actual BN_CTX usage inside libcrypto the leak could happen at any
      depth level in the BN_CTX stack, with varying results depending on the
      patterns of sibling trees of nested function calls sharing the same
      BN_CTX object, and the effect of unintended BN_FLG_CONSTTIME on the
      called BN_* functions.
      
      This simple unit test abstracts away this complexity and verifies that
      the leak does not happen between two sibling functions sharing the same
      BN_CTX object at the same level of nesting.
      
      (manually cherry picked from commit fe16ae5f
      
      )
      
      Reviewed-by: default avatarMatt Caswell <matt@openssl.org>
      (Merged from https://github.com/openssl/openssl/pull/8294)
      c4e901db
  2. 20 Feb, 2019 2 commits
  3. 18 Feb, 2019 1 commit
  4. 11 Feb, 2019 1 commit
  5. 31 Jan, 2019 1 commit
  6. 12 Dec, 2018 1 commit
  7. 08 Dec, 2018 6 commits
  8. 07 Dec, 2018 1 commit
  9. 24 Nov, 2018 5 commits
  10. 23 Nov, 2018 3 commits
  11. 20 Nov, 2018 4 commits
  12. 13 Nov, 2018 5 commits
  13. 10 Nov, 2018 1 commit
  14. 09 Nov, 2018 4 commits
  15. 01 Nov, 2018 1 commit
  16. 30 Oct, 2018 1 commit
  17. 28 Oct, 2018 2 commits