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

Fix ED25519 signature validation #1127

Merged
merged 2 commits into from May 15, 2019
Merged

Fix ED25519 signature validation #1127

merged 2 commits into from May 15, 2019

Conversation

appaquet
Copy link
Contributor

The ED25519 verify method wasn't checking if the actual verification was successful, but was only checking if the signature decoding was successful.

The RSA and Secp256k1 keys logic looks valid.

@tomaka
Copy link
Member

tomaka commented May 15, 2019

Hmm, probably worth notifying the cargo audit people.

cc @kirushik

@ghost ghost assigned tomaka May 15, 2019
@ghost ghost added the in progress label May 15, 2019
@tomaka tomaka merged commit 4c20d31 into libp2p:master May 15, 2019
@ghost ghost removed the in progress label May 15, 2019
tomaka pushed a commit to tomaka/libp2p-rs that referenced this pull request May 15, 2019
tomaka added a commit that referenced this pull request May 15, 2019
* Fix ED25519 signature validation (#1127)

* Publish 0.7.1
@@ -100,7 +100,7 @@ pub struct PublicKey(ed25519::PublicKey);
impl PublicKey {
/// Verify the Ed25519 signature on a message using the public key.
pub fn verify(&self, msg: &[u8], sig: &[u8]) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

You might want to consider changing this method to return a Result<(), ()> so as to strategically avoid this bugclass in the future

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.

None yet

4 participants