Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit d6a72eb

Browse files
Add pubkey consistency check on account and proof data (#3767)
1 parent 7a27029 commit d6a72eb

File tree

1 file changed

+4
-0
lines changed
  • token/program-2022/src/extension/confidential_transfer

1 file changed

+4
-0
lines changed

token/program-2022/src/extension/confidential_transfer/processor.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,10 @@ fn process_empty_account(
252252
return Err(ProgramError::InvalidInstructionData);
253253
}
254254

255+
if confidential_transfer_account.encryption_pubkey != proof_data.pubkey {
256+
return Err(TokenError::ConfidentialTransferElGamalPubkeyMismatch.into());
257+
}
258+
255259
confidential_transfer_account.available_balance = EncryptedBalance::zeroed();
256260
confidential_transfer_account.closable()?;
257261

0 commit comments

Comments
 (0)