-
Notifications
You must be signed in to change notification settings - Fork 719
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
[Refactor] Remove OpenSSL #2352
Conversation
e327846
to
c316548
Compare
Gitian at c316548
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Also the hanging declaration of DecodeBase64Secure
also cleanup some stray comments
c316548
to
5563331
Compare
Rebased now that #2314 was merged and removed the redundant hasher object in |
Gitian [Merge 5563331 into 44ddf8a]
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gitian here:
Linux:
945643f6a19fe942ddad9176fb2d618b00176835e26d5b24c2e87151eeca63a7 pivx-5.1.99-aarch64-linux-gnu-debug.tar.gz
9cb8733096290c73e5ff63ed321d68497e9f8e883e273c3a0d8139912ddccebb pivx-5.1.99-aarch64-linux-gnu.tar.gz
16de180100dbe1d96e21c677921037ca7c6334a9ad2c58ae3d47d7209f4627ea pivx-5.1.99-arm-linux-gnueabihf-debug.tar.gz
44ec7d4e506bfe2a74ec6f632462463313b5ace5b29b9740440a0f0d11667178 pivx-5.1.99-arm-linux-gnueabihf.tar.gz
f2a6711658c982281539b6cdb11b369b3f9e8d29f5da291a2871aa2600b47e35 pivx-5.1.99-i686-pc-linux-gnu-debug.tar.gz
08fdb40f785b2ec49968a96ad58f9427d16ed1be617046c78cb2ac91702c998a pivx-5.1.99-i686-pc-linux-gnu.tar.gz
cb40140db46d73c07b9ab69d44595ebc8e0489db41c78a2c442eb01204d16845 pivx-5.1.99-x86_64-linux-gnu-debug.tar.gz
6ccfae0c11590ffa41e622794dc8ce3392096f6a9709034eaa84acac11be6c3d pivx-5.1.99-x86_64-linux-gnu.tar.gz
b14f25d8519712de954f741075df482caae513083fbdd8a8c4ed55ff040df19a src/pivx-5.1.99.tar.gz
501f92949acda149b01350d75f401ea5baa833a2576f7cbf821af1452e86e062 pivx-linux-6.0-res.yml
Windows:
7ab71bf03357bbe3a7d6a186fb675e71cb246bd8d756440c92ed795997e4ef39 pivx-5.1.99-win-unsigned.tar.gz
f18575bbcd1280b06af96526c35e22cfe276315ec023de7d799244a1e3d428b4 pivx-5.1.99-win64-debug.zip
0b1df2a8c7d7b50a066cf9a0f1adbfcecaafaec212b3c7ae2668e6df00b544bf pivx-5.1.99-win64-setup-unsigned.exe
c767d07858190d4ad02f3b316570d2bc14400a3b74d275413adb50658b1c04e7 pivx-5.1.99-win64.zip
b14f25d8519712de954f741075df482caae513083fbdd8a8c4ed55ff040df19a src/pivx-5.1.99.tar.gz
730d7980b5020b032682e918826fce7a3d3ad8bfa4fda4053174616e4a459d41 pivx-win-6.0-res.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 5563331
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
k, ACK 5563331 and merging..
The natural follow-up to #2278, #2286, and #2288. With these three PRs merged, there are only a few minor pieces of code that still rely on OpenSSL:
RAND_bytes
during the ::SLOW path of ProcRandRAND_add
during the ::SLOW and ::SLEEP paths.utilstrencodings.cpp
(DecodeBase64Secure()
, now removed)crypto/scrypt.cpp
, now switched to using our native HMAC_SHA256 headerhash.h
(std::string Hash(std::string input)
), now removedUpstream PRs backported: bitcoin#17265, bitcoin#17515, and bitcoin#18825
The changes to bip38 were tested by doing two-way encryption/decryption between
master
and this PR