KEYS: do not kmemdup digest in {public,tpm}_key_verify_signature
authorVitaly Chikunov <vt@altlinux.org>
Thu, 11 Apr 2019 15:51:16 +0000 (18:51 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 18 Apr 2019 14:15:02 +0000 (22:15 +0800)
commit83bc0299960477a4b99d9ad11b766d63c0dfaf60
tree4f444c5f25cdbe1137d2e95508ccefd27233facc
parentc7381b01287240abe942a081729203e26782d981
KEYS: do not kmemdup digest in {public,tpm}_key_verify_signature

Treat (struct public_key_signature)'s digest same as its signature (s).
Since digest should be already in the kmalloc'd memory do not kmemdup
digest value before calling {public,tpm}_key_verify_signature.

Patch is split from the previous as suggested by Herbert Xu.

Suggested-by: David Howells <dhowells@redhat.com>
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>
crypto/asymmetric_keys/asym_tpm.c
crypto/asymmetric_keys/public_key.c