*
* @info: Specifies key and FIT information
* @keydest: Destination FDT blob for public key data
- * @return: 0, on success, -ve on error
+ * @return: node offset within the FDT blob where the data was written,
+ * or -ve on error
*/
int (*add_verify_data)(struct image_sign_info *info, void *keydest);
*
* @info: Specifies key and FIT information
* @keydest: Destination FDT blob for public key data
- * @return: 0, on success, -ENOSPC if the keydest FDT blob ran out of space,
- * other -ve value on error
+ * @return: node offset within the FDT blob where the data was written on
+ * success, -ENOSPC if the keydest FDT blob ran out of space, other -ve
+ * value on other error
*/
int ecdsa_add_verify_data(struct image_sign_info *info, void *keydest);
*
* @info: Specifies key and FIT information
* @keydest: Destination FDT blob for public key data
- * @return: 0, on success, -ENOSPC if the keydest FDT blob ran out of space,
- other -ve value on error
+ * @return: node offset within the FDT blob where the data was written on
+ * success, -ENOSPC if the keydest FDT blob ran out of space, other -ve
+ * value on other error
*/
int rsa_add_verify_data(struct image_sign_info *info, void *keydest);
if (ret < 0)
return ret;
- return 0;
+ return key_node;
}
int ecdsa_add_verify_data(struct image_sign_info *info, void *fdt)
fdt_key_name = info->keyname ? info->keyname : "default-key";
ret = prepare_ctx(&ctx, info);
if (ret >= 0)
- do_add(&ctx, fdt, fdt_key_name);
+ ret = do_add(&ctx, fdt, fdt_key_name);
free_ctx(&ctx);
return ret;
if (info->engine_id)
rsa_engine_remove(e);
- return ret;
+ if (ret)
+ return ret;
+
+ return node;
}
*/
if (keydest) {
ret = info.crypto->add_verify_data(&info, keydest);
- if (ret) {
+ if (ret < 0) {
printf("Failed to add verification data for '%s' signature node in '%s' image node\n",
node_name, image_name);
return ret;
/* Write the public key into the supplied FDT file */
if (keydest) {
ret = info.crypto->add_verify_data(&info, keydest);
- if (ret) {
+ if (ret < 0) {
printf("Failed to add verification data for '%s' signature node in '%s' configuration node\n",
node_name, conf_name);
}
- return ret;
}
return 0;