Details
Description
If a device loses its power during generating the client key, the next it gets powered up, while being executed with mender -daemon, it will crash at bootstrap stage. To solve this, a user has added a feature to mender client for making sure it generates the key successfully. There’s a side effect, which is now every time when a device is booted first time after an OTA, the client key will be re-generated.
Acceptance criteria
- Before using the key, the validity of the keypair (both private and public part) is checked
- If the key is invalid, any old ones are moved to a backup (e.g. key.previous) and a new one is generated
- Appropriate (error) log message about this occurrence
- Once a valid key has been generated, subsequent updates will not need to regenerate.