1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2013, Google Inc.
5 * (C) Copyright 2008 Semihalf
7 * (C) Copyright 2000-2006
8 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
17 * fit_set_hash_value - set hash value in requested has node
18 * @fit: pointer to the FIT format image header
19 * @noffset: hash node offset
20 * @value: hash value to be set
21 * @value_len: hash value length
23 * fit_set_hash_value() attempts to set hash value in a node at offset
24 * given and returns operation status to the caller.
30 static int fit_set_hash_value(void *fit, int noffset, uint8_t *value,
35 ret = fdt_setprop(fit, noffset, FIT_VALUE_PROP, value, value_len);
37 printf("Can't set hash '%s' property for '%s' node(%s)\n",
38 FIT_VALUE_PROP, fit_get_name(fit, noffset, NULL),
40 return ret == -FDT_ERR_NOSPACE ? -ENOSPC : -EIO;
47 * fit_image_process_hash - Process a single subnode of the images/ node
49 * Check each subnode and process accordingly. For hash nodes we generate
50 * a hash of the supplised data and store it in the node.
52 * @fit: pointer to the FIT format image header
53 * @image_name: name of image being processes (used to display errors)
54 * @noffset: subnode offset
55 * @data: data to process
56 * @size: size of data in bytes
57 * @return 0 if ok, -1 on error
59 static int fit_image_process_hash(void *fit, const char *image_name,
60 int noffset, const void *data, size_t size)
62 uint8_t value[FIT_MAX_HASH_LEN];
63 const char *node_name;
68 node_name = fit_get_name(fit, noffset, NULL);
70 if (fit_image_hash_get_algo(fit, noffset, &algo)) {
71 printf("Can't get hash algo property for '%s' hash node in '%s' image node\n",
72 node_name, image_name);
76 if (calculate_hash(data, size, algo, value, &value_len)) {
77 printf("Unsupported hash algorithm (%s) for '%s' hash node in '%s' image node\n",
78 algo, node_name, image_name);
79 return -EPROTONOSUPPORT;
82 ret = fit_set_hash_value(fit, noffset, value, value_len);
84 printf("Can't set hash value for '%s' hash node in '%s' image node\n",
85 node_name, image_name);
93 * fit_image_write_sig() - write the signature to a FIT
95 * This writes the signature and signer data to the FIT.
97 * @fit: pointer to the FIT format image header
98 * @noffset: hash node offset
99 * @value: signature value to be set
100 * @value_len: signature value length
101 * @comment: Text comment to write (NULL for none)
105 * -FDT_ERR_..., on failure
107 static int fit_image_write_sig(void *fit, int noffset, uint8_t *value,
108 int value_len, const char *comment, const char *region_prop,
109 int region_proplen, const char *cmdname)
115 * Get the current string size, before we update the FIT and add
118 string_size = fdt_size_dt_strings(fit);
120 ret = fdt_setprop(fit, noffset, FIT_VALUE_PROP, value, value_len);
122 ret = fdt_setprop_string(fit, noffset, "signer-name",
126 ret = fdt_setprop_string(fit, noffset, "signer-version",
130 ret = fdt_setprop_string(fit, noffset, "comment", comment);
132 time_t timestamp = imagetool_get_source_date(cmdname,
135 ret = fit_set_timestamp(fit, noffset, timestamp);
137 if (region_prop && !ret) {
140 ret = fdt_setprop(fit, noffset, "hashed-nodes",
141 region_prop, region_proplen);
142 /* This is a legacy offset, it is unused, and must remain 0. */
144 strdata[1] = cpu_to_fdt32(string_size);
146 ret = fdt_setprop(fit, noffset, "hashed-strings",
147 strdata, sizeof(strdata));
154 static int fit_image_setup_sig(struct image_sign_info *info,
155 const char *keydir, void *fit, const char *image_name,
156 int noffset, const char *require_keys, const char *engine_id)
158 const char *node_name;
160 const char *padding_name;
162 node_name = fit_get_name(fit, noffset, NULL);
163 if (fit_image_hash_get_algo(fit, noffset, &algo_name)) {
164 printf("Can't get algo property for '%s' signature node in '%s' image node\n",
165 node_name, image_name);
169 padding_name = fdt_getprop(fit, noffset, "padding", NULL);
171 memset(info, '\0', sizeof(*info));
172 info->keydir = keydir;
173 info->keyname = fdt_getprop(fit, noffset, "key-name-hint", NULL);
175 info->node_offset = noffset;
176 info->name = strdup(algo_name);
177 info->checksum = image_get_checksum_algo(algo_name);
178 info->crypto = image_get_crypto_algo(algo_name);
179 info->padding = image_get_padding_algo(padding_name);
180 info->require_keys = require_keys;
181 info->engine_id = engine_id;
182 if (!info->checksum || !info->crypto) {
183 printf("Unsupported signature algorithm (%s) for '%s' signature node in '%s' image node\n",
184 algo_name, node_name, image_name);
192 * fit_image_process_sig- Process a single subnode of the images/ node
194 * Check each subnode and process accordingly. For signature nodes we
195 * generate a signed hash of the supplised data and store it in the node.
197 * @keydir: Directory containing keys to use for signing
198 * @keydest: Destination FDT blob to write public keys into
199 * @fit: pointer to the FIT format image header
200 * @image_name: name of image being processes (used to display errors)
201 * @noffset: subnode offset
202 * @data: data to process
203 * @size: size of data in bytes
204 * @comment: Comment to add to signature nodes
205 * @require_keys: Mark all keys as 'required'
206 * @engine_id: Engine to use for signing
207 * @return 0 if ok, -1 on error
209 static int fit_image_process_sig(const char *keydir, void *keydest,
210 void *fit, const char *image_name,
211 int noffset, const void *data, size_t size,
212 const char *comment, int require_keys, const char *engine_id,
215 struct image_sign_info info;
216 struct image_region region;
217 const char *node_name;
222 if (fit_image_setup_sig(&info, keydir, fit, image_name, noffset,
223 require_keys ? "image" : NULL, engine_id))
226 node_name = fit_get_name(fit, noffset, NULL);
229 ret = info.crypto->sign(&info, ®ion, 1, &value, &value_len);
231 printf("Failed to sign '%s' signature node in '%s' image node: %d\n",
232 node_name, image_name, ret);
234 /* We allow keys to be missing */
240 ret = fit_image_write_sig(fit, noffset, value, value_len, comment,
243 if (ret == -FDT_ERR_NOSPACE)
245 printf("Can't write signature for '%s' signature node in '%s' conf node: %s\n",
246 node_name, image_name, fdt_strerror(ret));
251 /* Get keyname again, as FDT has changed and invalidated our pointer */
252 info.keyname = fdt_getprop(fit, noffset, "key-name-hint", NULL);
255 * Write the public key into the supplied FDT file; this might fail
256 * several times, since we try signing with successively increasing
260 ret = info.crypto->add_verify_data(&info, keydest);
262 printf("Failed to add verification data for '%s' signature node in '%s' image node\n",
263 node_name, image_name);
271 static int fit_image_read_data(char *filename, unsigned char *data,
279 fd = open(filename, O_RDONLY | O_BINARY);
281 printf("Can't open file %s (err=%d => %s)\n",
282 filename, errno, strerror(errno));
286 /* Compute file size */
287 if (fstat(fd, &sbuf) < 0) {
288 printf("Can't fstat file %s (err=%d => %s)\n",
289 filename, errno, strerror(errno));
293 /* Check file size */
294 if (sbuf.st_size != expected_size) {
295 printf("File %s don't have the expected size (size=%ld, expected=%d)\n",
296 filename, sbuf.st_size, expected_size);
301 n = read(fd, data, sbuf.st_size);
303 printf("Can't read file %s (err=%d => %s)\n",
304 filename, errno, strerror(errno));
308 /* Check that we have read all the file */
309 if (n != sbuf.st_size) {
310 printf("Can't read all file %s (read %ld bytes, expexted %ld)\n",
311 filename, n, sbuf.st_size);
322 static int fit_image_setup_cipher(struct image_cipher_info *info,
323 const char *keydir, void *fit,
324 const char *image_name, int image_noffset,
325 const char *node_name, int noffset)
331 if (fit_image_cipher_get_algo(fit, noffset, &algo_name)) {
332 printf("Can't get algo name for cipher '%s' in image '%s'\n",
333 node_name, image_name);
337 info->keydir = keydir;
339 /* Read the key name */
340 info->keyname = fdt_getprop(fit, noffset, "key-name-hint", NULL);
341 if (!info->keyname) {
342 printf("Can't get key name for cipher '%s' in image '%s'\n",
343 node_name, image_name);
347 /* Read the IV name */
348 info->ivname = fdt_getprop(fit, noffset, "iv-name-hint", NULL);
350 printf("Can't get iv name for cipher '%s' in image '%s'\n",
351 node_name, image_name);
356 info->node_noffset = noffset;
357 info->name = algo_name;
359 info->cipher = image_get_cipher_algo(algo_name);
361 printf("Can't get algo for cipher '%s'\n", image_name);
365 /* Read the key in the file */
366 snprintf(filename, sizeof(filename), "%s/%s%s",
367 info->keydir, info->keyname, ".bin");
368 info->key = malloc(info->cipher->key_len);
370 printf("Can't allocate memory for key\n");
374 ret = fit_image_read_data(filename, (unsigned char *)info->key,
375 info->cipher->key_len);
379 /* Read the IV in the file */
380 snprintf(filename, sizeof(filename), "%s/%s%s",
381 info->keydir, info->ivname, ".bin");
382 info->iv = malloc(info->cipher->iv_len);
384 printf("Can't allocate memory for iv\n");
388 ret = fit_image_read_data(filename, (unsigned char *)info->iv,
389 info->cipher->iv_len);
395 int fit_image_write_cipher(void *fit, int image_noffset, int noffset,
396 const void *data, size_t size,
397 unsigned char *data_ciphered, int data_ciphered_len)
401 /* Remove unciphered data */
402 ret = fdt_delprop(fit, image_noffset, FIT_DATA_PROP);
404 printf("Can't remove data (err = %d)\n", ret);
408 /* Add ciphered data */
409 ret = fdt_setprop(fit, image_noffset, FIT_DATA_PROP,
410 data_ciphered, data_ciphered_len);
412 printf("Can't add ciphered data (err = %d)\n", ret);
416 /* add non ciphered data size */
417 ret = fdt_setprop_u32(fit, image_noffset, "data-size-unciphered", size);
419 printf("Can't add unciphered data size (err = %d)\n", ret);
428 fit_image_process_cipher(const char *keydir, void *keydest, void *fit,
429 const char *image_name, int image_noffset,
430 const char *node_name, int node_noffset,
431 const void *data, size_t size,
434 struct image_cipher_info info;
435 unsigned char *data_ciphered = NULL;
436 int data_ciphered_len;
439 memset(&info, 0, sizeof(info));
441 ret = fit_image_setup_cipher(&info, keydir, fit, image_name,
442 image_noffset, node_name, node_noffset);
446 ret = info.cipher->encrypt(&info, data, size,
447 &data_ciphered, &data_ciphered_len);
452 * Write the public key into the supplied FDT file; this might fail
453 * several times, since we try signing with successively increasing
457 ret = info.cipher->add_cipher_data(&info, keydest);
459 printf("Failed to add verification data for cipher '%s' in image '%s'\n",
460 info.keyname, image_name);
465 ret = fit_image_write_cipher(fit, image_noffset, node_noffset,
467 data_ciphered, data_ciphered_len);
471 free((void *)info.key);
472 free((void *)info.iv);
476 int fit_image_cipher_data(const char *keydir, void *keydest,
477 void *fit, int image_noffset, const char *comment,
478 int require_keys, const char *engine_id,
481 const char *image_name;
487 image_name = fit_get_name(fit, image_noffset, NULL);
489 printf("Can't get image name\n");
493 /* Get image data and data length */
494 if (fit_image_get_data(fit, image_noffset, &data, &size)) {
495 printf("Can't get image data/size\n");
499 /* Process all hash subnodes of the component image node */
500 for (node_noffset = fdt_first_subnode(fit, image_noffset);
502 node_noffset = fdt_next_subnode(fit, node_noffset)) {
503 const char *node_name;
506 node_name = fit_get_name(fit, node_noffset, NULL);
508 printf("Can't get node name\n");
512 if (IMAGE_ENABLE_ENCRYPT && keydir &&
513 !strncmp(node_name, FIT_CIPHER_NODENAME,
514 strlen(FIT_CIPHER_NODENAME)))
515 ret = fit_image_process_cipher(keydir, keydest,
518 node_name, node_noffset,
519 data, size, cmdname);
528 * fit_image_add_verification_data() - calculate/set verig. data for image node
530 * This adds hash and signature values for an component image node.
532 * All existing hash subnodes are checked, if algorithm property is set to
533 * one of the supported hash algorithms, hash value is computed and
534 * corresponding hash node property is set, for example:
536 * Input component image node structure:
538 * o image-1 (at image_noffset)
539 * | - data = [binary data]
543 * Output component image node structure:
545 * o image-1 (at image_noffset)
546 * | - data = [binary data]
549 * |- value = sha1(data)
551 * For signature details, please see doc/uImage.FIT/signature.txt
553 * @keydir Directory containing *.key and *.crt files (or NULL)
554 * @keydest FDT Blob to write public keys into (NULL if none)
555 * @fit: Pointer to the FIT format image header
556 * @image_noffset: Requested component image node
557 * @comment: Comment to add to signature nodes
558 * @require_keys: Mark all keys as 'required'
559 * @engine_id: Engine to use for signing
560 * @return: 0 on success, <0 on failure
562 int fit_image_add_verification_data(const char *keydir, void *keydest,
563 void *fit, int image_noffset, const char *comment,
564 int require_keys, const char *engine_id, const char *cmdname)
566 const char *image_name;
571 /* Get image data and data length */
572 if (fit_image_get_data(fit, image_noffset, &data, &size)) {
573 printf("Can't get image data/size\n");
577 image_name = fit_get_name(fit, image_noffset, NULL);
579 /* Process all hash subnodes of the component image node */
580 for (noffset = fdt_first_subnode(fit, image_noffset);
582 noffset = fdt_next_subnode(fit, noffset)) {
583 const char *node_name;
587 * Check subnode name, must be equal to "hash" or "signature".
588 * Multiple hash nodes require unique unit node
589 * names, e.g. hash-1, hash-2, signature-1, etc.
591 node_name = fit_get_name(fit, noffset, NULL);
592 if (!strncmp(node_name, FIT_HASH_NODENAME,
593 strlen(FIT_HASH_NODENAME))) {
594 ret = fit_image_process_hash(fit, image_name, noffset,
596 } else if (IMAGE_ENABLE_SIGN && keydir &&
597 !strncmp(node_name, FIT_SIG_NODENAME,
598 strlen(FIT_SIG_NODENAME))) {
599 ret = fit_image_process_sig(keydir, keydest,
600 fit, image_name, noffset, data, size,
601 comment, require_keys, engine_id, cmdname);
615 static void strlist_init(struct strlist *list)
617 memset(list, '\0', sizeof(*list));
620 static void strlist_free(struct strlist *list)
624 for (i = 0; i < list->count; i++)
625 free(list->strings[i]);
629 static int strlist_add(struct strlist *list, const char *str)
634 list->strings = realloc(list->strings,
635 (list->count + 1) * sizeof(char *));
638 list->strings[list->count++] = dup;
643 static const char *fit_config_get_image_list(void *fit, int noffset,
644 int *lenp, int *allow_missingp)
646 static const char default_list[] = FIT_KERNEL_PROP "\0"
650 /* If there is an "image" property, use that */
651 prop = fdt_getprop(fit, noffset, "sign-images", lenp);
654 return *lenp ? prop : NULL;
657 /* Default image list */
659 *lenp = sizeof(default_list);
664 static int fit_config_get_hash_list(void *fit, int conf_noffset,
665 int sig_offset, struct strlist *node_inc)
668 const char *prop, *iname, *end;
669 const char *conf_name, *sig_name;
670 char name[200], path[200];
674 conf_name = fit_get_name(fit, conf_noffset, NULL);
675 sig_name = fit_get_name(fit, sig_offset, NULL);
678 * Build a list of nodes we need to hash. We always need the root
679 * node and the configuration.
681 strlist_init(node_inc);
682 snprintf(name, sizeof(name), "%s/%s", FIT_CONFS_PATH, conf_name);
683 if (strlist_add(node_inc, "/") ||
684 strlist_add(node_inc, name))
687 /* Get a list of images that we intend to sign */
688 prop = fit_config_get_image_list(fit, sig_offset, &len,
693 /* Locate the images */
696 for (iname = prop; iname < end; iname += strlen(iname) + 1) {
701 image_noffset = fit_conf_get_prop_node(fit, conf_noffset,
703 if (image_noffset < 0) {
704 printf("Failed to find image '%s' in configuration '%s/%s'\n",
705 iname, conf_name, sig_name);
712 ret = fdt_get_path(fit, image_noffset, path, sizeof(path));
715 if (strlist_add(node_inc, path))
718 snprintf(name, sizeof(name), "%s/%s", FIT_CONFS_PATH,
721 /* Add all this image's hashes */
723 for (noffset = fdt_first_subnode(fit, image_noffset);
725 noffset = fdt_next_subnode(fit, noffset)) {
726 const char *name = fit_get_name(fit, noffset, NULL);
728 if (strncmp(name, FIT_HASH_NODENAME,
729 strlen(FIT_HASH_NODENAME)))
731 ret = fdt_get_path(fit, noffset, path, sizeof(path));
734 if (strlist_add(node_inc, path))
740 printf("Failed to find any hash nodes in configuration '%s/%s' image '%s' - without these it is not possible to verify this image\n",
741 conf_name, sig_name, iname);
749 printf("Failed to find any images for configuration '%s/%s'\n",
750 conf_name, sig_name);
757 printf("Out of memory processing configuration '%s/%s'\n", conf_name,
762 printf("Failed to get path for image '%s' in configuration '%s/%s': %s\n",
763 iname, conf_name, sig_name, fdt_strerror(ret));
767 static int fit_config_get_data(void *fit, int conf_noffset, int noffset,
768 struct image_region **regionp, int *region_countp,
769 char **region_propp, int *region_proplen)
771 char * const exc_prop[] = {"data"};
772 struct strlist node_inc;
773 struct image_region *region;
774 struct fdt_region fdt_regions[100];
775 const char *conf_name, *sig_name;
781 conf_name = fit_get_name(fit, conf_noffset, NULL);
782 sig_name = fit_get_name(fit, noffset, NULL);
783 debug("%s: conf='%s', sig='%s'\n", __func__, conf_name, sig_name);
785 /* Get a list of nodes we want to hash */
786 ret = fit_config_get_hash_list(fit, conf_noffset, noffset, &node_inc);
790 /* Get a list of regions to hash */
791 count = fdt_find_regions(fit, node_inc.strings, node_inc.count,
792 exc_prop, ARRAY_SIZE(exc_prop),
793 fdt_regions, ARRAY_SIZE(fdt_regions),
794 path, sizeof(path), 1);
796 printf("Failed to hash configuration '%s/%s': %s\n", conf_name,
797 sig_name, fdt_strerror(ret));
801 printf("No data to hash for configuration '%s/%s': %s\n",
802 conf_name, sig_name, fdt_strerror(ret));
806 /* Build our list of data blocks */
807 region = fit_region_make_list(fit, fdt_regions, count, NULL);
809 printf("Out of memory hashing configuration '%s/%s'\n",
810 conf_name, sig_name);
814 /* Create a list of all hashed properties */
815 debug("Hash nodes:\n");
816 for (i = len = 0; i < node_inc.count; i++) {
817 debug(" %s\n", node_inc.strings[i]);
818 len += strlen(node_inc.strings[i]) + 1;
820 region_prop = malloc(len);
822 printf("Out of memory setting up regions for configuration '%s/%s'\n",
823 conf_name, sig_name);
826 for (i = len = 0; i < node_inc.count;
827 len += strlen(node_inc.strings[i]) + 1, i++)
828 strcpy(region_prop + len, node_inc.strings[i]);
829 strlist_free(&node_inc);
831 *region_countp = count;
833 *region_propp = region_prop;
834 *region_proplen = len;
839 static int fit_config_process_sig(const char *keydir, void *keydest,
840 void *fit, const char *conf_name, int conf_noffset,
841 int noffset, const char *comment, int require_keys,
842 const char *engine_id, const char *cmdname)
844 struct image_sign_info info;
845 const char *node_name;
846 struct image_region *region;
854 node_name = fit_get_name(fit, noffset, NULL);
855 if (fit_config_get_data(fit, conf_noffset, noffset, ®ion,
856 ®ion_count, ®ion_prop, ®ion_proplen))
859 if (fit_image_setup_sig(&info, keydir, fit, conf_name, noffset,
860 require_keys ? "conf" : NULL, engine_id))
863 ret = info.crypto->sign(&info, region, region_count, &value,
867 printf("Failed to sign '%s' signature node in '%s' conf node\n",
868 node_name, conf_name);
870 /* We allow keys to be missing */
876 ret = fit_image_write_sig(fit, noffset, value, value_len, comment,
877 region_prop, region_proplen, cmdname);
879 if (ret == -FDT_ERR_NOSPACE)
881 printf("Can't write signature for '%s' signature node in '%s' conf node: %s\n",
882 node_name, conf_name, fdt_strerror(ret));
888 /* Get keyname again, as FDT has changed and invalidated our pointer */
889 info.keyname = fdt_getprop(fit, noffset, "key-name-hint", NULL);
891 /* Write the public key into the supplied FDT file */
893 ret = info.crypto->add_verify_data(&info, keydest);
895 printf("Failed to add verification data for '%s' signature node in '%s' configuration node\n",
896 node_name, conf_name);
904 static int fit_config_add_verification_data(const char *keydir, void *keydest,
905 void *fit, int conf_noffset, const char *comment,
906 int require_keys, const char *engine_id, const char *cmdname)
908 const char *conf_name;
911 conf_name = fit_get_name(fit, conf_noffset, NULL);
913 /* Process all hash subnodes of the configuration node */
914 for (noffset = fdt_first_subnode(fit, conf_noffset);
916 noffset = fdt_next_subnode(fit, noffset)) {
917 const char *node_name;
920 node_name = fit_get_name(fit, noffset, NULL);
921 if (!strncmp(node_name, FIT_SIG_NODENAME,
922 strlen(FIT_SIG_NODENAME))) {
923 ret = fit_config_process_sig(keydir, keydest,
924 fit, conf_name, conf_noffset, noffset, comment,
925 require_keys, engine_id, cmdname);
934 int fit_cipher_data(const char *keydir, void *keydest, void *fit,
935 const char *comment, int require_keys,
936 const char *engine_id, const char *cmdname)
942 /* Find images parent node offset */
943 images_noffset = fdt_path_offset(fit, FIT_IMAGES_PATH);
944 if (images_noffset < 0) {
945 printf("Can't find images parent node '%s' (%s)\n",
946 FIT_IMAGES_PATH, fdt_strerror(images_noffset));
947 return images_noffset;
950 /* Process its subnodes, print out component images details */
951 for (noffset = fdt_first_subnode(fit, images_noffset);
953 noffset = fdt_next_subnode(fit, noffset)) {
955 * Direct child node of the images parent node,
956 * i.e. component image node.
958 ret = fit_image_cipher_data(keydir, keydest,
959 fit, noffset, comment,
960 require_keys, engine_id,
969 int fit_add_verification_data(const char *keydir, void *keydest, void *fit,
970 const char *comment, int require_keys,
971 const char *engine_id, const char *cmdname)
973 int images_noffset, confs_noffset;
977 /* Find images parent node offset */
978 images_noffset = fdt_path_offset(fit, FIT_IMAGES_PATH);
979 if (images_noffset < 0) {
980 printf("Can't find images parent node '%s' (%s)\n",
981 FIT_IMAGES_PATH, fdt_strerror(images_noffset));
982 return images_noffset;
985 /* Process its subnodes, print out component images details */
986 for (noffset = fdt_first_subnode(fit, images_noffset);
988 noffset = fdt_next_subnode(fit, noffset)) {
990 * Direct child node of the images parent node,
991 * i.e. component image node.
993 ret = fit_image_add_verification_data(keydir, keydest,
994 fit, noffset, comment, require_keys, engine_id,
1000 /* If there are no keys, we can't sign configurations */
1001 if (!IMAGE_ENABLE_SIGN || !keydir)
1004 /* Find configurations parent node offset */
1005 confs_noffset = fdt_path_offset(fit, FIT_CONFS_PATH);
1006 if (confs_noffset < 0) {
1007 printf("Can't find images parent node '%s' (%s)\n",
1008 FIT_CONFS_PATH, fdt_strerror(confs_noffset));
1012 /* Process its subnodes, print out component images details */
1013 for (noffset = fdt_first_subnode(fit, confs_noffset);
1015 noffset = fdt_next_subnode(fit, noffset)) {
1016 ret = fit_config_add_verification_data(keydir, keydest,
1017 fit, noffset, comment,
1019 engine_id, cmdname);
1027 #ifdef CONFIG_FIT_SIGNATURE
1028 int fit_check_sign(const void *fit, const void *key)
1033 cfg_noffset = fit_conf_get_node(fit, NULL);
1037 printf("Verifying Hash Integrity for node '%s'... ",
1038 fdt_get_name(fit, cfg_noffset, NULL));
1039 ret = fit_config_verify(fit, cfg_noffset);
1042 ret = bootm_host_load_images(fit, cfg_noffset);