> OTOH if the machine processed the current transaction correctly while sending all your codes to the bad guys, it could do so until the store noticed its bad firmware, which could take years
Banks already correlate fraud reports to where customers have used their cards to track down offending stores that skim cards. They don't have to find the bad firmware, they just have to see "well 10 customers had their cards skimmed, and the only store they had in common was that one"
So really it's just a matter of how sophisticated the hackers are. Add keylogger to get PINs. Add thug to get cards. Win.
There's no way around trusting the machine itself.
If a machine charged you too much, either it would say so on the receipt and you could protest immediately, or the receipt wouldn't match the charge so you could protest later. Sure, the first few customers might get fucked, but soon the bad machine would be caught. OTOH if the machine processed the current transaction correctly while sending all your codes to the bad guys, it could do so until the store noticed its bad firmware, which could take years.