Commit 0e7491f6 authored by Tetsuo Handa's avatar Tetsuo Handa Committed by James Morris

trusted-keys: check for NULL before using it

TSS_rawhmac() checks for data != NULL before using it.
We should do the same thing for TSS_authhmac().
Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reviewed-by: default avatarJesper Juhl <jj@chaosbits.net>
Acked-by: default avatarMimi Zohar <zohar@us.ibm.com>
Acked-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent 35576eab
...@@ -148,6 +148,11 @@ static int TSS_authhmac(unsigned char *digest, const unsigned char *key, ...@@ -148,6 +148,11 @@ static int TSS_authhmac(unsigned char *digest, const unsigned char *key,
if (dlen == 0) if (dlen == 0)
break; break;
data = va_arg(argp, unsigned char *); data = va_arg(argp, unsigned char *);
if (!data) {
ret = -EINVAL;
va_end(argp);
goto out;
}
ret = crypto_shash_update(&sdesc->shash, data, dlen); ret = crypto_shash_update(&sdesc->shash, data, dlen);
if (ret < 0) { if (ret < 0) {
va_end(argp); va_end(argp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment