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

[WIP][Build] Libsodium upgrade & sanity checks #2358

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Commits on Jul 7, 2021

  1. Add test vectors for small-order Ed25519 pubkeys

    Not adding test vectors for non-canonical pubkeys, as that would
    require grinding to find a private key corresponding to one of the 19
    pubkeys that can be non-canonical.
    
    Adapted for PIVX unit test framework.
    str4d authored and furszy committed Jul 7, 2021
    Configuration menu
    Copy the full SHA
    9635c73 View commit details
    Browse the repository at this point in the history
  2. Upgrade libsodium to v1.0.17

    furszy committed Jul 7, 2021
    Configuration menu
    Copy the full SHA
    01b9aae View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d49aece View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d39e0f0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    cd2e210 View commit details
    Browse the repository at this point in the history
  6. libsodium sanity check connected to app init.

    Abort at node startup if it is running a non-patched version of the libsodium library.
    
    libsodium <= 1.0.15 accepts valid signatures for a non-zero pubkey with small order; this is currently part of our consensus rules.
    libsodium >= 1.0.16 rejects all pubkeys with small order.
    furszy committed Jul 7, 2021
    Configuration menu
    Copy the full SHA
    21d221b View commit details
    Browse the repository at this point in the history
  7. Use libsodium's s < L check, instead checking that libsodium checks t…

    …hat.
    
    Adaptation coming from zcash@2902ac7ce8e754d09a5137cba82d8af10c172977
    furszy committed Jul 7, 2021
    Configuration menu
    Copy the full SHA
    69cd9f8 View commit details
    Browse the repository at this point in the history
  8. build: new script for building own libsodium version.

    Plus connected to GA.
    furszy committed Jul 7, 2021
    Configuration menu
    Copy the full SHA
    a1818df View commit details
    Browse the repository at this point in the history
  9. Pass DO_NOT_UPDATE_CONFIG_SCRIPTS=1 to autogen.sh in libsodium depend…

    …ency, to avoid updating config scripts over the network.
    ebfull authored and furszy committed Jul 7, 2021
    Configuration menu
    Copy the full SHA
    3f09b2c View commit details
    Browse the repository at this point in the history
  10. Depends: Hard set sodium library minor version

    This allows us to do some compile time checking to see if we are using a
    compatible version
    Fuzzbawls authored and furszy committed Jul 7, 2021
    Configuration menu
    Copy the full SHA
    e20e216 View commit details
    Browse the repository at this point in the history
  11. GA: Only build/install patched sodium for no_depends jobs

    Otherwise it is already supplied by the previous depends stage
    Fuzzbawls authored and furszy committed Jul 7, 2021
    Configuration menu
    Copy the full SHA
    809ad8c View commit details
    Browse the repository at this point in the history
  12. GA: Remove syslib installed sodium

    GA builds that intend to use syslibs instead of depends (CMake and
    no_depends jobs) end up installing libsodium syslib, so remove that
    prior to installing our patched version.
    
    This also moves the installation of the patched version of sodium to the
     environment setup stage.
    Fuzzbawls authored and furszy committed Jul 7, 2021
    Configuration menu
    Copy the full SHA
    b132f68 View commit details
    Browse the repository at this point in the history
  13. Build: Detect and error for unsupported Sodium versions

    We require the use of libsodium <= 1.0.15, or a patched version of
    1.0.17, which is supplied by depends or the `install_sodium.sh` shell
    script.
    
    This change will look at the libsodium version header's
    `SODIUM_LIBRARY_VERSION_MAJOR` and `SODIUM_LIBRARY_VERSION_MINOR` values
    to determine if it is a valid version. For reference, Sodium 1.0.15
    used `10` and `0`, respectively. Earlier versions used a different major
    value, and later versions used a different minor value, so this
    combination of values is unique to v1.0.15 (and our patched version of
    v1.0.17)
    Fuzzbawls authored and furszy committed Jul 7, 2021
    Configuration menu
    Copy the full SHA
    faa5450 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    625e7ac View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    89aa2a7 View commit details
    Browse the repository at this point in the history
  16. fixup

    furszy committed Jul 7, 2021
    Configuration menu
    Copy the full SHA
    ff19755 View commit details
    Browse the repository at this point in the history
  17. fixup2

    furszy committed Jul 7, 2021
    Configuration menu
    Copy the full SHA
    80e8493 View commit details
    Browse the repository at this point in the history