summaryrefslogtreecommitdiff
path: root/tools/image-host.c
diff options
context:
space:
mode:
authormario.six@gdsys.cc <mario.six@gdsys.cc>2016-07-22 08:58:40 +0200
committerTom Rini <trini@konsulko.com>2016-07-25 12:01:36 -0400
commit713fb2dcb24537073171fc84528044a3ba081817 (patch)
tree31d0e681b64656c3e60777284757d63610b2f21f /tools/image-host.c
parent335b4e53c9c5310c36f5178d2f66a13c4b1c8592 (diff)
tools, rsa: Further minor cleanups on top of c236ebd and 2b9ec7
[NOTE: I took v1 of these patches in, and then v2 came out, this commit is squashing the minor deltas from v1 -> v2 of updates to c236ebd and 2b9ec76 into this commit - trini] - Added an additional NULL check, as suggested by Simon Glass to fit_image_process_sig - Re-formatted the comment blocks Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Simon Glass <sjg@chromium.org> [For merging the chnages from v2 back onto v1] Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'tools/image-host.c')
-rw-r--r--tools/image-host.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/image-host.c b/tools/image-host.c
index 399ec94f8b..11046952fc 100644
--- a/tools/image-host.c
+++ b/tools/image-host.c
@@ -238,11 +238,16 @@ 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);
- ret = info.algo->add_verify_data(&info, keydest);
+ 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
+ /*
+ * Write the public key into the supplied FDT file; this might fail
* several times, since we try signing with successively increasing
- * size values */
+ * size values
+ */
if (keydest && ret)
return ret;