Fixed several coverity issues and a small issue in configuration files (accidental #can_define) statements.
This commit is contained in:
@@ -816,7 +816,7 @@ int32 psAesTestGCM(void)
|
||||
}
|
||||
memcpy(iv, tests[i].iv, 12);
|
||||
psAesInitGCM(&eCtx, tests[i].key, tests[i].keylen);
|
||||
res = psAesReadyGCMRandomIV(&eCtx, iv, tests[i].aad, tests[i].aadlen,
|
||||
res |= psAesReadyGCMRandomIV(&eCtx, iv, tests[i].aad, tests[i].aadlen,
|
||||
NULL);
|
||||
if (res != PS_SUCCESS) {
|
||||
memset(ciphertext_rand, 0, sizeof ciphertext_rand);
|
||||
@@ -3487,8 +3487,13 @@ static int test_hmac_vector(int32 size,
|
||||
din, din_len,
|
||||
md_res,
|
||||
key_out, &key_length);
|
||||
} else {
|
||||
_psTraceInt("FAILED: HMAC vector unsupported size: %d\n",
|
||||
(int) size);
|
||||
return PS_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
equals = (rv == PS_SUCCESS && memcmp(dout, md_res, size) == 0);
|
||||
if (equals != should_succeed)
|
||||
{
|
||||
|
||||
@@ -173,6 +173,11 @@ int main(int argc, char **argv)
|
||||
|
||||
#ifdef DO_GEN_SECRET
|
||||
psDhExportParameters(misc, &dhParams, &p, &pLen, &g, &gLen);
|
||||
if (p == NULL || g == NULL) {
|
||||
_psTrace(" DH parameters could not be used\n");
|
||||
fprintf(stderr, "FAIL: DH parameters did not work.\n");
|
||||
exit(1);
|
||||
}
|
||||
if (psDhGenKeyInts(misc, dhParams.size, &dhParams.p, &dhParams.g,
|
||||
&dhKeyPriv, NULL) < 0) {
|
||||
_psTrace(" FAILED OPERATION\n");
|
||||
@@ -198,8 +203,8 @@ int main(int argc, char **argv)
|
||||
_psTraceInt(TIME_UNITS " genSecret\n", psDiffMsecs(start, end, NULL));
|
||||
#endif /* DO_GEN_SECRET */
|
||||
|
||||
psFree(p, misc);
|
||||
psFree(g, misc);
|
||||
psFreeAndClear(&p, misc);
|
||||
psFreeAndClear(&g, misc);
|
||||
pkcs3ClearDhParams(&dhParams);
|
||||
i++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user