All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe REYNES <philippe.reynes@softathome.com>
To: u-boot@lists.denx.de
Subject: [PATCH] mkimage: fit: include image cipher in configuration signature
Date: Thu, 30 Jul 2020 16:59:40 +0200 (CEST)	[thread overview]
Message-ID: <3477309.587596.1596121180682.JavaMail.zimbra@softathome.com> (raw)
In-Reply-To: <20200730043047.409762-1-patrick.oppenlander@gmail.com>

Hi Patrick,


> From: Patrick Oppenlander <patrick.oppenlander@gmail.com>
> 
> This patch addresses issue #2 for signed configurations.
> 
> -----8<-----

This "line" will be included in the commit message ;)

> Including the image cipher properties in the configuration signature
> prevents an attacker from modifying cipher, key or iv properties.
> 
> Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com>


Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>


Regards,
Philippe

> ---
> tools/image-host.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
> 
> diff --git a/tools/image-host.c b/tools/image-host.c
> index e5417beee5..3d52593e36 100644
> --- a/tools/image-host.c
> +++ b/tools/image-host.c
> @@ -744,6 +744,23 @@ static int fit_config_get_hash_list(void *fit, int
> conf_noffset,
> return -ENOMSG;
> }
> 
> + /* Add this image's cipher node if present */
> + noffset = fdt_subnode_offset(fit, image_noffset,
> + FIT_CIPHER_NODENAME);
> + if (noffset != -FDT_ERR_NOTFOUND) {
> + if (noffset < 0) {
> + printf("Failed to get cipher node in configuration '%s/%s' image '%s': %s\n",
> + conf_name, sig_name, iname,
> + fdt_strerror(noffset));
> + return -EIO;
> + }
> + ret = fdt_get_path(fit, noffset, path, sizeof(path));
> + if (ret < 0)
> + goto err_path;
> + if (strlist_add(node_inc, path))
> + goto err_mem;
> + }
> +
> image_count++;
> }
> 
> --
> 2.27.0

  reply	other threads:[~2020-07-30 14:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-24  2:06 Improvements to FIT ciphering Patrick Oppenlander
2020-07-27 22:49 ` Patrick Oppenlander
2020-07-28 15:28   ` Simon Glass
2020-07-29 13:49     ` Philippe REYNES
2020-07-30  4:30 ` [PATCH] mkimage: fit: include image cipher in configuration signature patrick.oppenlander at gmail.com
2020-07-30 14:59   ` Philippe REYNES [this message]
2020-07-30 22:22     ` Patrick Oppenlander
2020-08-08 12:29   ` Tom Rini
2020-07-30 22:51 ` Improvements to FIT ciphering Patrick Oppenlander
2020-08-07 17:03   ` Philippe REYNES
2020-08-07 23:55     ` Patrick Oppenlander
2020-08-24 15:57       ` Philippe REYNES
2020-08-24 22:37         ` Patrick Oppenlander
2020-09-10 16:08           ` Philippe REYNES
2020-09-10 22:43             ` Patrick Oppenlander

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3477309.587596.1596121180682.JavaMail.zimbra@softathome.com \
    --to=philippe.reynes@softathome.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.