Further improve the "wc_EccPrivateKeyDecode" to use the CheckCurve return code, which is the curve_id in the success case. Fixes scan-build warning.

This commit is contained in:
David Garske
2016-11-14 10:06:20 -08:00
parent 07efd88e4d
commit a2d29e4c71

View File

@ -8940,11 +8940,10 @@ int wc_EccPrivateKeyDecode(const byte* input, word32* inOutIdx, ecc_key* key,
oidSum += input[*inOutIdx]; oidSum += input[*inOutIdx];
*inOutIdx += 1; *inOutIdx += 1;
} }
if (CheckCurve(oidSum) < 0) if ((ret = CheckCurve(oidSum)) < 0) {
ret = ECC_CURVE_OID_E; ret = ECC_CURVE_OID_E;
}
ret = wc_ecc_get_oid(oidSum, NULL, NULL); else {
if (ret >= 0) {
curve_id = ret; curve_id = ret;
ret = 0; ret = 0;
} }