Skip to content
Snippets Groups Projects
Commit 5ecf1141 authored by Dr. Stephen Henson's avatar Dr. Stephen Henson
Browse files

Sanity check keylength in PVK files.

PR#2277
parent 75b76068
No related branches found
No related tags found
No related merge requests found
......@@ -759,6 +759,11 @@ static EVP_PKEY *do_PVK_body(const unsigned char **in,
/* Copy BLOBHEADER across, decrypt rest */
memcpy(enctmp, p, 8);
p += 8;
if (keylen < 8)
{
PEMerr(PEM_F_DO_PVK_BODY, PEM_R_PVK_TOO_SHORT);
return NULL;
}
inlen = keylen - 8;
q = enctmp + 8;
if (!EVP_DecryptInit_ex(&cctx, EVP_rc4(), NULL, keybuf, NULL))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment