Double hashing on terra

Change-Id: Ie3d65030d221585245d94d7650694fc545e72174
This commit is contained in:
Hendrik Hofstadt 2021-07-20 09:54:11 +02:00
parent aa417344c1
commit 1fc6842917
1 changed files with 5 additions and 0 deletions

View File

@ -114,6 +114,11 @@ impl ParsedVAA {
hasher.update(body);
let hash = hasher.finalize().to_vec();
// Rehash the hash
let mut hasher = Keccak256::new();
hasher.update(hash);
let hash = hasher.finalize().to_vec();
// Signatures valid, apply VAA
if body_offset + Self::VAA_PAYLOAD_POS > data.len() {
return ContractError::InvalidVAA.std_err();