HomePhabricator

Switch memory_cleanse implementation to BoringSSL's

Description

Switch memory_cleanse implementation to BoringSSL's

Summary:
...to ensure memory clearing even with link-time optimization.

The implementation we currently use from OpenSSL prevents the compiler
from optimizing away clensing operations on blocks of memory that are
about to be released, but this protection is not extended to link-time
optimization. This commit copies the solution cooked up by Google
compiler engineers which uses inline assembly directives to instruct the
compiler not to optimize out the call under any circumstances. As the
code is in-lined, this has the added advantage of removing one more
OpenSSL dependency.

Regarding license compatibility, Google's contributions to BoringSSL
library, including this code, is made available under the ISC license,
which is MIT compatible.

BoringSSL git commit: ad1907fe73334d6c696c8539646c21b11178f20f

Backport of core PR11196.

Test Plan:

ninja all check

Run the windows Gitian build.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D6135

Details

Provenance
Adam Langley <agl@google.com>Authored on Aug 30 2017, 05:26
FabienCommitted on May 19 2020, 13:02
FabienPushed on May 19 2020, 13:02
Reviewer
Restricted Project
Differential Revision
D6135: Switch memory_cleanse implementation to BoringSSL's
Parents
rABC1ff305f83c9c: [testonly] [wallet] use P2WPKH change output if any destination is P2WPKH or…
Branches
Unknown
Tags
Unknown