Vitaly Chikunov c7381b0128 crypto: akcipher - new verify API for public key algorithms
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>
Reviewed-by: Denis Kenzior <denkenz@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2019-04-18 22:15:02 +08:00
..
2018-06-18 20:17:38 +05:30
2019-01-25 18:41:51 +08:00
2018-09-04 11:35:03 +08:00
2018-05-26 09:16:44 +02:00
2019-02-15 13:21:55 +08:00
2018-04-21 00:58:34 +08:00
2018-07-20 13:51:21 +08:00
2019-01-11 14:16:58 +08:00
2019-03-07 18:32:03 -08:00
2019-03-07 18:32:03 -08:00
2018-05-16 07:23:35 +02:00
2019-03-07 18:32:03 -08:00
2018-09-04 11:35:03 +08:00
2018-04-21 00:58:30 +08:00