the device class is likely at https://github.com/amonet-kamakiri/kamakiri/blob/master/modules/common.py . it's okay to paste it in I believe.

a cursory glance and I notice the code is downgrading the firmware. this would work since older versions have the same signature. an interesting problem present in all instances of signed bootware, probably resolvable by protocol improvements, like tiers of fuses or something.