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

Kaspar Schleiser notifications at github.com
Wed Jul 10 12:24:53 CEST 2019


kaspar030 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);

yup. Maybe ```("RIOT", 4)``` is clear enough for now?

-- 
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_r301992820
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190710/74ff9e35/attachment.html>


More information about the notifications mailing list