X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=tools%2Fimage-host.c;h=11046952fcf0d4b65cdd85bd1362d5bc43c25c23;hb=6f5f92c60b7cc86bcfbd4acd310c5efbb6b68a8f;hp=3e14fdc1eb3c95d1b1372692a8a8da3a2945e025;hpb=45031f1a1e575bf2e5ceb3e6e9f5b8b09f4945a1;p=u-boot diff --git a/tools/image-host.c b/tools/image-host.c index 3e14fdc1eb..11046952fc 100644 --- a/tools/image-host.c +++ b/tools/image-host.c @@ -238,12 +238,18 @@ static int fit_image_process_sig(const char *keydir, void *keydest, /* Get keyname again, as FDT has changed and invalidated our pointer */ info.keyname = fdt_getprop(fit, noffset, "key-name-hint", NULL); - /* Write the public key into the supplied FDT file */ - if (keydest && info.algo->add_verify_data(&info, keydest)) { - printf("Failed to add verification data for '%s' signature node in '%s' image node\n", - node_name, image_name); + if (keydest) + ret = info.algo->add_verify_data(&info, keydest); + else return -1; - } + + /* + * Write the public key into the supplied FDT file; this might fail + * several times, since we try signing with successively increasing + * size values + */ + if (keydest && ret) + return ret; return 0; }