Add pubkey consistency check on account and proof data (#3767)

This commit is contained in:
samkim-crypto 2022-10-27 12:40:26 +09:00 committed by GitHub
parent 7a2702936d
commit d6a72ebfe4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -252,6 +252,10 @@ fn process_empty_account(
return Err(ProgramError::InvalidInstructionData);
}
if confidential_transfer_account.encryption_pubkey != proof_data.pubkey {
return Err(TokenError::ConfidentialTransferElGamalPubkeyMismatch.into());
}
confidential_transfer_account.available_balance = EncryptedBalance::zeroed();
confidential_transfer_account.closable()?;