Skip to content
Snippets Groups Projects
Commit cdb7ee7e authored by Jonas Höglund's avatar Jonas Höglund
Browse files

Check hash algo.

parent 30d1aedc
Branches
No related tags found
No related merge requests found
...@@ -158,10 +158,17 @@ static int get_hash(char *buf, char *name) ...@@ -158,10 +158,17 @@ static int get_hash(char *buf, char *name)
return -1; return -1;
} }
val = (uint8_t *)fdt_getprop(buf, noffset, "algo", NULL);
if (strcmp((const char *)val, "sha256")) {
printf("Error: unknown hash algorithm %s\n", val);
return -1;
}
val = (uint8_t *)fdt_getprop(buf, noffset, "value", NULL); val = (uint8_t *)fdt_getprop(buf, noffset, "value", NULL);
for (i=0; i<SHA_256_LEN; i++) for (i=0; i<SHA_256_LEN; i++)
printf("%x", val[i]); printf("%x", val[i]);
printf("\n");
return 0;
} }
int main(int argc, char *argv[]) int main(int argc, char *argv[])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment