Skip to content

Commit

Permalink
A0-0000: Use hash as msg in signature (#1899)
Browse files Browse the repository at this point in the history
Co-authored-by: Michal Swietek <mike1729@users.noreply.github.com>
  • Loading branch information
mike1729 and mike1729 authored Dec 20, 2024
1 parent 0ab00a7 commit 7b31cbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pallets/aleph/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub mod pallet {
};
use pallet_session::SessionManager;
use primitives::{Score, ScoreNonce, SessionInfoProvider, TotalIssuanceProvider};
use sp_runtime::traits::ValidateUnsigned;
use sp_runtime::traits::{Hash, ValidateUnsigned};
use sp_std::collections::btree_map::BTreeMap;
#[cfg(feature = "std")]
use sp_std::marker::PhantomData;
Expand Down Expand Up @@ -344,7 +344,7 @@ pub mod pallet {
score: &Score,
signature: &SignatureSet<Signature<T>>,
) -> Result<(), TransactionValidityError> {
let msg = score.encode();
let msg = T::Hashing::hash_of(&score.encode()).encode();
let authority_verifier = AuthorityVerifier::new(Self::authorities());
if !AuthorityVerifier::is_complete(&authority_verifier, &msg, signature) {
return Err(InvalidTransaction::BadProof.into());
Expand Down

0 comments on commit 7b31cbb

Please sign in to comment.