Commit 713fb2dcb24537073171fc84528044a3ba081817
Committed by
Tom Rini
1 parent
335b4e53c9
Exists in
v2017.01-smarct4x
and in
25 other branches
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>
Showing 2 changed files with 12 additions and 5 deletions Side-by-side Diff
lib/rsa/rsa-sign.c
... | ... | @@ -420,8 +420,10 @@ |
420 | 420 | BN_rshift(num, num, 32); /* N = N/B */ |
421 | 421 | } |
422 | 422 | |
423 | - /* We try signing with successively increasing size values, so this | |
424 | - * might fail several times */ | |
423 | + /* | |
424 | + * We try signing with successively increasing size values, so this | |
425 | + * might fail several times | |
426 | + */ | |
425 | 427 | ret = fdt_setprop(blob, noffset, prop_name, buf, size); |
426 | 428 | if (ret) |
427 | 429 | return -FDT_ERR_NOSPACE; |
tools/image-host.c
... | ... | @@ -238,11 +238,16 @@ |
238 | 238 | /* Get keyname again, as FDT has changed and invalidated our pointer */ |
239 | 239 | info.keyname = fdt_getprop(fit, noffset, "key-name-hint", NULL); |
240 | 240 | |
241 | - ret = info.algo->add_verify_data(&info, keydest); | |
241 | + if (keydest) | |
242 | + ret = info.algo->add_verify_data(&info, keydest); | |
243 | + else | |
244 | + return -1; | |
242 | 245 | |
243 | - /* Write the public key into the supplied FDT file; this might fail | |
246 | + /* | |
247 | + * Write the public key into the supplied FDT file; this might fail | |
244 | 248 | * several times, since we try signing with successively increasing |
245 | - * size values */ | |
249 | + * size values | |
250 | + */ | |
246 | 251 | if (keydest && ret) |
247 | 252 | return ret; |
248 | 253 |