From: Denis Kenzior <denkenz@gmail.com>
To: Vitaly Chikunov <vt@altlinux.org>,
Herbert Xu <herbert@gondor.apana.org.au>,
David Howells <dhowells@redhat.com>,
Mimi Zohar <zohar@linux.ibm.com>,
Dmitry Kasatkin <dmitry.kasatkin@gmail.com>,
linux-integrity@vger.kernel.org, keyrings@vger.kernel.org,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 03/10] crypto: akcipher - new verify API for public key algorithms
Date: Tue, 26 Mar 2019 11:00:40 -0500 [thread overview]
Message-ID: <ed78154e-2491-8e3e-3362-e45df4fda011@gmail.com> (raw)
In-Reply-To: <20190326125842.24110-4-vt@altlinux.org>
Hi Vitaly,
On 03/26/2019 07:58 AM, Vitaly Chikunov wrote:
> Previous akcipher .verify() just `decrypts' (using RSA encrypt which is
> using public key) signature to uncover message hash, which was then
> compared in upper level public_key_verify_signature() with the expected
> hash value, which itself was never passed into verify().
>
> This approach was incompatible with EC-DSA family of algorithms,
> because, to verify a signature EC-DSA algorithm also needs a hash value
> as input; then it's used (together with a signature divided into halves
> `r||s') to produce a witness value, which is then compared with `r' to
> determine if the signature is correct. Thus, for EC-DSA, nor
> requirements of .verify() itself, nor its output expectations in
> public_key_verify_signature() wasn't sufficient.
>
> Make improved .verify() call which gets hash value as input and produce
> complete signature check without any output besides status.
>
> Now for the top level verification only crypto_akcipher_verify() needs
> to be called and its return value inspected.
>
> Make sure that `digest' is in kmalloc'd memory (in place of `output`) in
> {public,tpm}_key_verify_signature() as insisted by Herbert Xu, and will
> be changed in the following commit.
>
> Cc: David Howells <dhowells@redhat.com>
> Cc: keyrings@vger.kernel.org
> Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
> ---
> crypto/asymmetric_keys/asym_tpm.c | 34 ++++++++-----------------
> crypto/asymmetric_keys/public_key.c | 34 ++++++++-----------------
> crypto/rsa-pkcs1pad.c | 29 +++++++++++++--------
> crypto/testmgr.c | 50 ++++++++++++++++++++++---------------
> include/crypto/akcipher.h | 36 ++++++++++++++++----------
> 5 files changed, 92 insertions(+), 91 deletions(-)
The TPM bits, public_key and akcipher changes look good to me. Didn't
look into testmgr.
Feel free to add
Reviewed-by: Denis Kenzior <denkenz@gmail.com>
to this and patch 4.
Regards,
-Denis
next prev parent reply other threads:[~2019-03-26 16:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-26 12:58 [PATCH v8 00/10] crypto: add EC-RDSA (GOST 34.10) algorithm Vitaly Chikunov
2019-03-26 12:58 ` [PATCH v8 01/10] crypto: akcipher - default implementations for request callbacks Vitaly Chikunov
2019-03-26 12:58 ` [PATCH v8 02/10] crypto: rsa - unimplement sign/verify for raw RSA backends Vitaly Chikunov
2019-03-26 12:58 ` [PATCH v8 03/10] crypto: akcipher - new verify API for public key algorithms Vitaly Chikunov
2019-03-26 16:00 ` Denis Kenzior [this message]
2019-03-26 12:58 ` [PATCH v8 04/10] KEYS: do not kmemdup digest in {public,tpm}_key_verify_signature Vitaly Chikunov
2019-03-26 12:58 ` [PATCH v8 05/10] X.509: parse public key parameters from x509 for akcipher Vitaly Chikunov
2019-03-26 16:14 ` Denis Kenzior
2019-03-26 12:58 ` [PATCH v8 06/10] crypto: Kconfig - create Public-key cryptography section Vitaly Chikunov
2019-03-26 12:58 ` [PATCH v8 07/10] crypto: ecc - make ecc into separate module Vitaly Chikunov
2019-03-26 12:58 ` [PATCH v8 08/10] crypto: ecrdsa - add EC-RDSA (GOST 34.10) algorithm Vitaly Chikunov
2019-03-26 12:58 ` [PATCH v8 09/10] crypto: ecrdsa - add EC-RDSA test vectors to testmgr Vitaly Chikunov
2019-03-26 12:58 ` [PATCH v8 10/10] integrity: support EC-RDSA signatures for asymmetric_verify Vitaly Chikunov
2019-03-27 18:10 ` Mimi Zohar
2019-03-27 20:14 ` Vitaly Chikunov
2019-03-27 20:21 ` Mimi Zohar
2019-03-28 6:16 ` 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=ed78154e-2491-8e3e-3362-e45df4fda011@gmail.com \
--to=denkenz@gmail.com \
--cc=dhowells@redhat.com \
--cc=dmitry.kasatkin@gmail.com \
--cc=herbert@gondor.apana.org.au \
--cc=keyrings@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vt@altlinux.org \
--cc=zohar@linux.ibm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).