Skip to content
Snippets Groups Projects
Commit 22515123 authored by Young Xiao's avatar Young Xiao Committed by Stefan Roese
Browse files

kwbimage: fixing the issue with proper return code checking


EVP_VerifyFinal would return one of three values:
1 if the data is verified to be correct;
0 if it is incorrect;
-1 if there is any failure in the verification process.

The varification in unpatched version is wrong, since it ignored
the return value of -1.

The bug allows a malformed signature to be treated as a good
signature rather than as an error. This issue affects the
signature checks on DSA ans ECDSA keys used with SSL/TLS.

This issue is similar to CVE-2008-5077, CVE-2009-0021,
CVE-2009-0025, CVE-2009-0046 ~ CVE-2009-0049.

Signed-off-by: default avatarYoung Xiao <92siuyang@gmail.com>
Signed-off-by: default avatarStefan Roese <sr@denx.de>
parent b4ee6daa
No related branches found
No related tags found
No related merge requests found
...@@ -701,7 +701,7 @@ int kwb_verify(RSA *key, void *data, int datasz, struct sig_v1 *sig, ...@@ -701,7 +701,7 @@ int kwb_verify(RSA *key, void *data, int datasz, struct sig_v1 *sig,
goto err_ctx; goto err_ctx;
} }
if (!EVP_VerifyFinal(ctx, sig->sig, sizeof(sig->sig), evp_key)) { if (EVP_VerifyFinal(ctx, sig->sig, sizeof(sig->sig), evp_key) != 1) {
ret = openssl_err("Could not verify signature"); ret = openssl_err("Could not verify signature");
goto err_ctx; goto err_ctx;
} }
......
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