updated unit test

This commit is contained in:
MJSPollard
2018-05-21 12:44:59 -06:00
parent f447fe22b0
commit 2b49f69f1b
2 changed files with 4 additions and 1 deletions

View File

@ -7671,6 +7671,9 @@ static int test_wc_Poly1305SetKey(void)
/* Test bad args. */
if (ret == 0) {
ret = wc_Poly1305SetKey(NULL, key, (word32)(sizeof(key)/sizeof(byte)));
if(ret == BAD_FUNC_ARG) {
ret = wc_Poly1305SetKey(&ctx, NULL, (word32)(sizeof(key)/sizeof(byte)));
}
if (ret == BAD_FUNC_ARG) {
ret = wc_Poly1305SetKey(&ctx, key, 18);
}

View File

@ -1222,7 +1222,7 @@ int wc_Poly1305SetKey(Poly1305* ctx, const byte* key, word32 keySz)
printf("\n");
#endif
if (keySz != 32 || ctx == NULL)
if (keySz != 32 || ctx == NULL || key == NULL)
return BAD_FUNC_ARG;
#ifdef USE_INTEL_SPEEDUP