All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.ibm.com>
To: Vitaly Chikunov <vt@altlinux.org>
Cc: Dmitry Kasatkin <dmitry.kasatkin@gmail.com>,
	linux-integrity@vger.kernel.org
Subject: Re: [PATCH v4 4/5] ima-evm-utils: Convert sign v2 from RSA to EVP_PKEY API
Date: Mon, 17 Jun 2019 11:10:37 -0400	[thread overview]
Message-ID: <1560784237.4072.94.camel@linux.ibm.com> (raw)
In-Reply-To: <20190617144232.qp2gnjrowgu7soot@altlinux.org>

On Mon, 2019-06-17 at 17:42 +0300, Vitaly Chikunov wrote:

> > I like simple stories, where everything is laid out.  Think of a patch
> > set as a simple story, not a mystery, explaining how you go from point
> > A to point B.  Each patch in the series explains the next step.
> > 
> > The changes in cmd_import() are nice, straight forward, and easy to
> > read.  Other than the "calc_keyid_v2()" change from passing an RSA key
> > to pkey key" dependency, this could be a separate patch.
> > Please see if you could further break this patch up to simplify review.
> 
> I thought about splitting as much as possible, but didn't not find what
> to split more.
> 
> - If we add read_pub_pkey into cmd_import then we can not use old
> calc_keyid_v2 (which wants RSA).
> - If we add new calc_keyid_v2 into cmd_import it would require calling
> read_pub_pkey (and have sign_hash_v2 updated too).
> - We can not put cmd_import change before 'rsa to pkey' change, because
> calc_keyid_v2 is also used in new sign_hash_v2.
> - We can not put cmd_import change after 'rsa to pkey' change, because
> cmd_import will fail for v2 signatures (which should use PKEY).
> 
> So I don't see how this is splittable.

Perhaps it causes more patch churn, but there always is a way.  In
this case, there are a couple of ways.  Instead of replacing "key"
with "pkey":

- define pkey as an additional argument to calc_keyid_v2().
- define a new function named, for example, calc_keyid_v2_pkey().

Mimi


  reply	other threads:[~2019-06-17 15:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14  1:54 [PATCH v4 0/5] ima-avm-utils: Convert sign v2 from RSA to EVP_PKEY API Vitaly Chikunov
2019-06-14  1:54 ` [PATCH v4 1/5] ima-avm-utils: Make sure sig buffer is always MAX_SIGNATURE_SIZE Vitaly Chikunov
2019-06-17 13:32   ` Mimi Zohar
2019-06-14  1:54 ` [PATCH v4 2/5] ima-avm-utils: Change read_pub_key to use EVP_PKEY API Vitaly Chikunov
2019-06-14  1:54 ` [PATCH v4 3/5] ima-avm-utils: Change read_priv_key " Vitaly Chikunov
2019-06-17 13:33   ` Mimi Zohar
2019-06-14  1:54 ` [PATCH v4 4/5] ima-evm-utils: Convert sign v2 from RSA to " Vitaly Chikunov
2019-06-17 13:34   ` Mimi Zohar
2019-06-17 14:42     ` Vitaly Chikunov
2019-06-17 15:10       ` Mimi Zohar [this message]
2019-06-14  1:54 ` [PATCH v4 5/5] ima-avm-utils: Remove RSA_ASN1_templates Vitaly Chikunov
2019-06-14  1:59 ` [PATCH v4 0/5] ima-avm-utils: Convert sign v2 from RSA to EVP_PKEY API Vitaly Chikunov

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=1560784237.4072.94.camel@linux.ibm.com \
    --to=zohar@linux.ibm.com \
    --cc=dmitry.kasatkin@gmail.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=vt@altlinux.org \
    /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.