There is a way to verify files related to specific package against original RPM content:
# Verify `vsftpd` package.
rpm -V vsftpd
How to complete the chain and verify that rpm
command itself hasn't been changed?
If I replace rpm
by a script which always succeeds, this type of verification will never fail.