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: wrong public keys signing #1027

Merged
merged 4 commits into from
May 4, 2023
Merged

Conversation

QuantumExplorer
Copy link
Member

@QuantumExplorer QuantumExplorer commented May 4, 2023

Issue being fixed or feature implemented

There was an issue with signing public keys that has now been resolved. Previously keys were signing only the key which is not secure. Now they are signing the whole state transition.

What was done?

How Has This Been Tested?

Breaking Changes

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@strophy
Copy link
Collaborator

strophy commented May 4, 2023

What was the issue?

@shumkov shumkov changed the title fix: signing public keys fix: wrong public keys signing May 4, 2023
@shumkov
Copy link
Member

shumkov commented May 4, 2023

Yeah, good question.

// Own ST fields
pub public_keys: Vec<IdentityPublicKeyInCreationWithWitness>,
// The signable
#[platform_signable(into = "Vec<IdentityPublicKeyInCreationSignable>")]
Copy link
Member

Choose a reason for hiding this comment

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

proc macros are cool!

@QuantumExplorer QuantumExplorer merged commit c411645 into v0.25-dev May 4, 2023
@QuantumExplorer QuantumExplorer deleted the fix/SigningPublicKeys branch May 4, 2023 15:06
@@ -1,4 +1,7 @@
use crate::ProtocolError;
use crate::identity::KeyType;
Copy link
Member

Choose a reason for hiding this comment

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

Shall we put it encoding module?

use dashcore::signer;

impl PlatformMessageSignable for &[u8] {
fn verify_signature(
Copy link
Member

Choose a reason for hiding this comment

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

Since this function can be used outside of validation functions it should return own errors which should be transformed to consensus errors in validation function.

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.

4 participants