rboot: Add cryptographic digest support for OTA images & SHA256 example

This commit is contained in:
Angus Gratton 2016-03-23 19:44:27 +11:00
parent 03559de5cb
commit 53b2b50241
5 changed files with 88 additions and 6 deletions

View file

@ -369,7 +369,9 @@ static err_t tftp_receive_data(struct netconn *nc, size_t write_offs, size_t lim
it so the client gets an indication if things were successful.
*/
const char *err = "Unknown validation error";
if(!rboot_verify_image(start_offs, *received_len, &err)) {
uint32_t image_length;
if(!rboot_verify_image(start_offs, &image_length, &err)
|| image_length != *received_len) {
tftp_send_error(nc, TFTP_ERR_ILLEGAL, err);
return ERR_VAL;
}