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

Remove OpenSSL #17265

Draft
wants to merge 8 commits into
base: master
from

Conversation

@fanquake
Copy link
Member

fanquake commented Oct 26, 2019

Now that #17165 has been merged, removing our remaining OpenSSL usage is possible.

That remaining usage was a call to RAND_bytes during the ::SLOW path of ProcRand. As well as feeding output from our RNG back into OpenSSL via RAND_add during the ::SLOW and ::SLEEP paths.

Optimistically tagged for 0.20.0. Needs discussion, potentially in an upcoming weekly meeting?

TODO:

  • Someone one Windows probably needs to regenerate some of the build_msvc files, as well as update the flags passed to Qt here. Done in #17309.

Please don't add a "Needs gitian build" tag to this yet.

@fanquake fanquake added this to the 0.20.0 milestone Oct 26, 2019
@fanquake fanquake requested a review from sipa Oct 26, 2019
@jnewbery

This comment has been minimized.

Copy link
Member

jnewbery commented Oct 26, 2019

Concept ACK!

src/random.cpp Outdated Show resolved Hide resolved
@DrahtBot

This comment has been minimized.

Copy link
Contributor

DrahtBot commented Oct 26, 2019

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #17270 (Feed environment data into RNG initializers by sipa)
  • #16834 (Fetch Headers over DNS by TheBlueMatt)
  • #16762 (Rust-based Backup over-REST block downloader by TheBlueMatt)
  • #16110 (depends: Add Android NDK support by icota)
  • #15382 (util: add runCommandParseJSON by Sjors)
  • #12557 ([WIP] 64 bit iOS device support by Sjors)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@sipa

This comment has been minimized.

Copy link
Member

sipa commented Oct 26, 2019

I think we wanted to include some of the environmental entropy sources (statistics, pid, ...) that OpenSSL uses in our own RNG state first. See #10299. I'll PR something soon.

@promag

This comment has been minimized.

Copy link
Member

promag commented Oct 26, 2019

Concept ACK.

@BlockMechanic

This comment has been minimized.

Copy link
Contributor

BlockMechanic commented Oct 27, 2019

Concept ACK.

I recently ran into openssl issues here #17123, this is awesome !

@laanwj

This comment has been minimized.

Copy link
Member

laanwj commented Oct 27, 2019

Concept and code review ACK, agree that we should ideally get #17270 in first.

@practicalswift

This comment has been minimized.

Copy link
Member

practicalswift commented Oct 27, 2019

Concept ACK

Very pleased to see OpenSSL go :)

@fanquake fanquake force-pushed the fanquake:remove_openssl branch from f56a128 to 1ee67af Oct 28, 2019
@fanquake fanquake changed the title [WIP] Remove OpenSSL Remove OpenSSL Oct 28, 2019
@fanquake

This comment has been minimized.

Copy link
Member Author

fanquake commented Oct 28, 2019

Fixed doc nit above and squashed some commits together. This is waiting on #17270.

@Sjors

This comment has been minimized.

Copy link
Member

Sjors commented Oct 29, 2019

Concept ACK after #17270. This fixes #12530.

@jamesob

This comment has been minimized.

Copy link
Member

jamesob commented Oct 29, 2019

big Concept ACK

fanquake added 8 commits Oct 26, 2019
This should have been part of #17151.
On the ::SLOW or ::SLEEP paths, we would feed our RNG output back into
OpenSSL using RAND_add. This commit removes that functionality.

RAND_add(): https://www.openssl.org/docs/manmaster/man3/RAND_add.html

RAND_add() mixes the num bytes at buf into the internal state of the
random generator. This function will not normally be needed, as
mentioned above. The randomness argument is an estimate of how much
randomness is contained in buf, in bytes, and should be a number
between zero and num.
On the ::SLOW path we would use OpenSSL as an additional source of
random bytes. This commit removes that functionality. Note that this was
always only an additional source, and that we never checked the return
value

RAND_bytes(): https://www.openssl.org/docs/manmaster/man3/RAND_bytes.html

RAND_bytes() puts num cryptographically strong pseudo-random bytes into buf.
@fanquake fanquake force-pushed the fanquake:remove_openssl branch from 1ee67af to 24ac38d Nov 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
10 participants
You can’t perform that action at this time.