return ret;
}
-static int do_add(struct signer *ctx, void *fdt, const char *key_node_name)
+static int do_add(struct signer *ctx, void *fdt, const char *key_node_name,
+ struct image_sign_info *info)
{
int signature_node, key_node, ret, key_bits;
const char *curve_name;
point = EC_KEY_get0_public_key(ctx->ecdsa_key);
EC_POINT_get_affine_coordinates(group, point, x, y, NULL);
+ ret = fdt_setprop_string(fdt, key_node, FIT_KEY_HINT,
+ info->keyname);
+ if (ret < 0)
+ return ret;
+
ret = fdt_setprop_string(fdt, key_node, "ecdsa,curve", curve_name);
if (ret < 0)
return ret;
if (ret < 0)
return ret;
+ ret = fdt_setprop_string(fdt, key_node, FIT_ALGO_PROP,
+ info->name);
+ if (ret < 0)
+ return ret;
+
+ ret = fdt_setprop_string(fdt, key_node, FIT_KEY_REQUIRED,
+ info->require_keys);
+ if (ret < 0)
+ return ret;
+
return key_node;
}
fdt_key_name = info->keyname ? info->keyname : "default-key";
ret = prepare_ctx(&ctx, info);
if (ret >= 0) {
- ret = do_add(&ctx, fdt, fdt_key_name);
+ ret = do_add(&ctx, fdt, fdt_key_name, info);
if (ret < 0)
ret = ret == -FDT_ERR_NOSPACE ? -ENOSPC : -EIO;
}