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

Print hash algo.

parent cdb7ee7e
No related branches found
No related tags found
No related merge requests found
......@@ -149,7 +149,8 @@ static int get_hash(char *buf, char *name)
{
char path[MAX_PATH_LEN];
int noffset, i;
uint8_t *val;
uint8_t *val = NULL;
const char *algo;
snprintf(path, MAX_PATH_LEN, "/images/%s/hash-1", name);
noffset = fdt_path_offset(buf, path);
......@@ -158,15 +159,17 @@ static int get_hash(char *buf, char *name)
return -1;
}
val = (uint8_t *)fdt_getprop(buf, noffset, "algo", NULL);
if (strcmp((const char *)val, "sha256")) {
algo = fdt_getprop(buf, noffset, "algo", NULL);
if (strcmp(algo, "sha256")) {
printf("Error: unknown hash algorithm %s\n", val);
return -1;
}
val = (uint8_t *)fdt_getprop(buf, noffset, "value", NULL);
printf("%s ", algo);
for (i=0; i<SHA_256_LEN; i++)
printf("%x", val[i]);
printf("\n");
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment