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

Replace Crypt::NaCl::Sodium with Crypt::Ed25519 #1182

Merged
merged 7 commits into from
Jan 5, 2022
Merged

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Dec 23, 2021

First we vendor in Protocol::Matrix. Then we patch it to use Crypt::Ed25519 instead of Crypt::NaCl::Sodium. Then we switch the rest of sytest to use Crypt::Ed25519.

Hopefully fixes #1114, and generally makes sytest a whole lot easier to install.

I want to update Protocol::Matrix to drop the dependency on
`Crypt::NaCl::Sodium`, so this is a first step.
This essentially applies my patch at
https://rt.cpan.org/Public/Bug/Display.html?id=140079 to our vendored copy of
`Protocol::Matrix`, as a first step for dropping the dep on
`Crypt::NaCl::Sodium`.
This requires two classes of changes:

 * `Crypt::Ed25519::eddsa_verify($msg, $pub_key, $sig)` is pretty
    much a drop-in replacement for
    `Crypt::NaCl::Sodium->sign->verify($sig, $msg, $pub_key)`, modulo the order
    of the arguments.

 * We need a shim to recreate `Crypt::NaCl::Sodium->sign->keypair`.
@richvdh richvdh requested a review from a team as a code owner December 23, 2021 12:51
Copy link
Member

@clokep clokep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK overall, but I had a few questions!

lib/Protocol/Matrix.pm Outdated Show resolved Hide resolved
lib/Protocol/Matrix.pm Show resolved Hide resolved
lib/SyTest/Crypto.pm Show resolved Hide resolved
tests/50federation/01keys.pl Show resolved Hide resolved
@richvdh richvdh requested a review from clokep January 5, 2022 13:43
Copy link
Member

@clokep clokep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@richvdh richvdh merged commit 13f436b into develop Jan 5, 2022
@richvdh richvdh deleted the rav/sodium_must_die branch January 5, 2022 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

install-deps.pl fails to build libsodium with gcc 11.2.1
2 participants