Hi Bin Wu,
Thanks for coming up with this question. As per the below signature verification code, you raised a valid point that signature gets verified before ROTPK hash verification.
1. Get ROTPK hash from the platform (Using platform implemented method e.g., HW register). 2. Extract ROTPK from the image itself. 3. Use ROTPK to verify the image signature. 4. Calculate the hash of ROTPK and compare it against the hash received in step.
But we can't see any concern as the system fails to boot anyways at step  if the ROTPK gets corrupted.
Regards Manish Badarkhe From: TF-A firstname.lastname@example.org on behalf of 吴斌(郅隆) via TF-A email@example.com Date: Friday, 29 January 2021 at 07:55 To: firstname.lastname@example.org email@example.com Subject: [TF-A] PK hash verify after signature virified
I am studying tbbr module in ATF recenlty. I have a little confusion about the ROTPK hash verify flow.
In ATF current implementation, we will verify the signature first, then verify the ROTPK hash. But in my understanding, we should verify ROTPK first then verify signature.
So, what is the consideration that we use current flow in ATF?
Thanks for you patience
BRs， Bin Wu