All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH 2/4] mkimage: Add a 'keyfile' argument for image signing
Date: Sun, 7 Feb 2021 07:37:28 -0700	[thread overview]
Message-ID: <CAPnjgZ0m=7j+PjH8=3DeAi57h6MHUi=ZtWES-57naH+aNDHHcQ@mail.gmail.com> (raw)
In-Reply-To: <20210204195705.2057081-3-mr.nuke.me@gmail.com>

Hi Alexandru,

On Thu, 4 Feb 2021 at 12:57, Alexandru Gagniuc <mr.nuke.me@gmail.com> wrote:
>
> It's not always desirable to use 'keydir' and some ad-hoc heuristics
> to get the filename of the signing key. More often, just passing the
> filename is the simpler, easier, and logical thing to do.
>
> Since mkimage doesn't use long options, we're slowly running out of
> letters. I've chosen '-G' because it was available.
>
> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
> ---
>  include/image.h    |  8 ++++---
>  tools/fit_image.c  |  3 ++-
>  tools/image-host.c | 58 +++++++++++++++++++++++++---------------------
>  tools/imagetool.h  |  1 +
>  tools/mkimage.c    |  6 ++++-
>  5 files changed, 45 insertions(+), 31 deletions(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

See below.

> diff --git a/include/image.h b/include/image.h
> index 2447321023..9bc8b8d179 100644
> --- a/include/image.h
> +++ b/include/image.h
> @@ -1128,9 +1128,10 @@ int fit_cipher_data(const char *keydir, void *keydest, void *fit,
>   *     0, on success
>   *     libfdt error code, on failure
>   */
> -int fit_add_verification_data(const char *keydir, void *keydest, void *fit,
> -                             const char *comment, int require_keys,
> -                             const char *engine_id, const char *cmdname);
> +int fit_add_verification_data(const char *keydir, const char *keyfile,
> +                             void *keydest, void *fit, const char *comment,
> +                             int require_keys, const char *engine_id,
> +                             const char *cmdname);
>
>  int fit_image_verify_with_data(const void *fit, int image_noffset,
>                                const void *data, size_t size);
> @@ -1236,6 +1237,7 @@ void image_set_host_blob(void *host_blob);
>  struct image_sign_info {
>         const char *keydir;             /* Directory conaining keys */
>         const char *keyname;            /* Name of key to use */
> +       const char *keyfile;            /* Filename of private or public key */

Please also document the semantics of this...can it be NULL? I think
you intend that either keydir or keyfile is used but not both, right?

Regards,
Simon

  reply	other threads:[~2021-02-07 14:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04 19:57 [PATCH 0/4] mkimage: Add a 'keyfile' argument for image signing Alexandru Gagniuc
2021-02-04 19:57 ` [PATCH 1/4] doc: signature.txt: Document the keydir and keyfile arguments Alexandru Gagniuc
2021-02-07 14:37   ` Simon Glass
2021-02-04 19:57 ` [PATCH 2/4] mkimage: Add a 'keyfile' argument for image signing Alexandru Gagniuc
2021-02-07 14:37   ` Simon Glass [this message]
2021-02-04 19:57 ` [PATCH 3/4] lib/rsa: Use the 'keyfile' argument from mkimage Alexandru Gagniuc
2021-02-07 14:37   ` Simon Glass
2021-02-04 19:57 ` [PATCH 4/4] lib/ecdsa: Use the 'keydir' argument from mkimage if appropriate Alexandru Gagniuc
2021-02-07 14:37   ` Simon Glass

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='CAPnjgZ0m=7j+PjH8=3DeAi57h6MHUi=ZtWES-57naH+aNDHHcQ@mail.gmail.com' \
    --to=sjg@chromium.org \
    --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.