Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make randomization of a non-signing context a noop #587

Merged

Conversation

real-or-random
Copy link
Contributor

Before this commit secp256k1_context_randomize called illegal_callback
when called on a context not initialized for signing. This is not
documented. Moreover, it is not desirable because non-signing contexts
may use randomization in the future.

This commit makes secp256k1_context_randomize a noop in this case. This
is safe because the context cannot be used for signing anyway.

This fixes #573 and it fixes rust-bitcoin/rust-secp256k1#82.

Before this commit secp256k1_context_randomize called illegal_callback
when called on a context not initialized for signing. This is not
documented. Moreover, it is not desirable because non-signing contexts
may use randomization in the future.

This commit makes secp256k1_context_randomize a noop in this case. This
is safe because the context cannot be used for signing anyway.

This fixes bitcoin-core#573 and it fixes rust-bitcoin/rust-secp256k1#82.
@gmaxwell
Copy link
Contributor

gmaxwell commented Feb 2, 2019

I guess this seems reasonable to me. The only concern I have is minor: if someone has a signing and verifying context, this makes it easier to randomize the wrong one.

@sipa
Copy link
Contributor

sipa commented Feb 4, 2019

utACK 6198375

@jonasnick
Copy link
Contributor

Was about to NACK this PR because being explicit is better in general. However, if verification contexts can be randomized in the future, it's better to start allow to randomizing everything always.

ACK 6198375

@gmaxwell
Copy link
Contributor

ACK

@gmaxwell gmaxwell merged commit 6198375 into bitcoin-core:master Feb 21, 2019
gmaxwell added a commit that referenced this pull request Feb 21, 2019
6198375 Make randomization of a non-signing context a noop (Tim Ruffing)

Pull request description:

  Before this commit secp256k1_context_randomize called illegal_callback
  when called on a context not initialized for signing. This is not
  documented. Moreover, it is not desirable because non-signing contexts
  may use randomization in the future.

  This commit makes secp256k1_context_randomize a noop in this case. This
  is safe because the context cannot be used for signing anyway.

  This fixes #573 and it fixes rust-bitcoin/rust-secp256k1#82.

Tree-SHA512: 34ddfeb004d9da8f4a77c739fa2110544c28939378e779226da52f410a0e36b3aacb3ebd2e3f3918832a9027684c161789cfdc27a133f2f0e0f1c47e8363029c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants