[riot-notifications] [RIOT-OS/RIOT] sys/riotboot: add initial image digest verification (#11805)

Francisco notifications at github.com
Wed Jul 10 12:04:55 CEST 2019


fjmolinas commented on this pull request.



> +{
+    char digest[SHA256_DIGEST_LENGTH];
+
+    sha256_context_t sha256;
+
+    if (img_len < 4) {
+        LOG_INFO("riotboot: verify_sha256(): image too small\n");
+        return -1;
+    }
+
+    uint8_t *img_start = (uint8_t *)riotboot_slot_get_hdr(target_slot);
+
+    LOG_INFO("riotboot: verifying digest at %p (img at: %p size: %u)\n", sha256_digest, img_start, img_len);
+
+    sha256_init(&sha256);
+    sha256_update(&sha256, "RIOT", 4);

hmm this can't be done since RIOTBOOT_MAGIC is a numerical value

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11805#discussion_r301985170
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190710/4a0c11f2/attachment.html>


More information about the notifications mailing list