Secure software and firmware update