Commit d128471a authored by Lans Zhang's avatar Lans Zhang Committed by James Morris

pefile: Fix the failure of calculation for digest

Commit e68503bd forgot to set digest_len and thus cause the following
error reported by kexec when launching a crash kernel:

	kexec_file_load failed: Bad message

Fixes: e68503bd (KEYS: Generalise system_verify_data() to provide access to internal content)
Signed-off-by: default avatarLans Zhang <jia.zhang@windriver.com>
Tested-by: default avatarDave Young <dyoung@redhat.com>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
cc: kexec@lists.infradead.org
cc: linux-crypto@vger.kernel.org
Signed-off-by: default avatarJames Morris <james.l.morris@oracle.com>
parent a46e6678
...@@ -124,5 +124,10 @@ int mscode_note_digest(void *context, size_t hdrlen, ...@@ -124,5 +124,10 @@ int mscode_note_digest(void *context, size_t hdrlen,
struct pefile_context *ctx = context; struct pefile_context *ctx = context;
ctx->digest = kmemdup(value, vlen, GFP_KERNEL); ctx->digest = kmemdup(value, vlen, GFP_KERNEL);
return ctx->digest ? 0 : -ENOMEM; if (!ctx->digest)
return -ENOMEM;
ctx->digest_len = vlen;
return 0;
} }
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