Skip to content

Reuse BN_BLINDING multiple times in RSA signing #234

Closed

Description

@briansmith

Right now, we create a new temporary BN_BLINDING value before signing and then throw it away right after signing, never using it again. Instead, we should make use of the reuse facilities already built into BN_BLINDING by saving a pointer to the BN_BLINDING in the RSAKeyPair. It should be saved in a Mutex so that multiple threads can access the blinding safely.

Activity

  1. briansmith commented on Jul 2, 2016

    @briansmith
    OwnerAuthor

    Extra testing is needed:

    • export BN_BLINDING_COUNTER as an extern GFp_BN_BLINDING_COUNTER.
    • Create a test that uses the same BN_BLINDING at least GFp_BN_BLINDING_COUNTER +1 times, to exercise all the code paths in blinding.c. This should be complete the test coverage of bn_blinding_update.
    • Create a test that is similar to test_agreement_suite_b_ecdh_generate, where the RAND returns unusable values forever, to test the logic where the blinding gives up after a bunch of tries.
    • Look at the coveralls report to make sure that everything in BN_BLINDING is now covered.
  2. added this to the crates.io milestone on Jul 3, 2016
  3. ranweiler commented on Jul 14, 2016

    @ranweiler
    Contributor

    Hi there! I'd like to take on this work. I'm really excited to pitch in on this project!

    FYI, master currently doesn't build due to an unused variable warning introduced here, in 690ca69. Without that definition, everything builds, tests pass. I'm not sure if its inclusion was an accident, or if it will be used once your work in #247 lands, so I'll leave that to you (rather than fixing it), and just rebase once a fix lands in master.

  4. briansmith commented on Jul 14, 2016

    @briansmith
    OwnerAuthor

    Hi there! I'd like to take on this work. I'm really excited to pitch in on this project!

    Awesome!

    FYI, master currently doesn't build due to an unused variable warning introduced here, in 690ca69.

    Thanks! I'll fix that now!

  5. briansmith commented on Jul 14, 2016

    @briansmith
    OwnerAuthor

    FYI, master currently doesn't build due to an unused variable warning introduced here, in 690ca69.
    Thanks! I'll fix that now!

    Fixed. Thanks again!

  6. briansmith commented on Jul 29, 2016

    @briansmith
    OwnerAuthor

    Fixed with #258. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions