mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
crypto: sig - Fix verify call
The dst SG list needs to be set to NULL for verify calls. Do
this as otherwise the underlying algorithm may fail.
Furthermore the digest needs to be copied just like the source.
Fixes: 6cb8815f41
("crypto: sig - Add interface for sign/verify")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -128,9 +128,7 @@ int crypto_sig_verify(struct crypto_sig *tfm,
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
sg_init_table(data.sg, 2);
|
||||
sg_set_buf(&data.sg[0], src, slen);
|
||||
sg_set_buf(&data.sg[1], digest, dlen);
|
||||
memcpy(data.buf + slen, digest, dlen);
|
||||
|
||||
return crypto_akcipher_sync_post(&data,
|
||||
crypto_akcipher_verify(data.req));
|
||||
|
Reference in New Issue
Block a user