Skip to content

Commit

Permalink
Removed returns & check next case for ret
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Tjaden committed May 22, 2024
1 parent 1a000ef commit 14068fb
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions wolfcrypt/test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -27625,24 +27625,24 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hpke_test(void)
#endif
#endif

/* added this code to hit code coverage on lines 219-225 on hpke.c*/
/* Test coverage for wc_HpkeInit with Curve448, even though it is not supported */
#if defined(HAVE_CURVE448) && \
(defined(WOLFSSL_SHA384) || defined(WOLFSSL_SHA512))
/* test with_curve448 */
ret = wc_HpkeInit(hpke, DHKEM_X448_HKDF_SHA512, HKDF_SHA512,
HPKE_AES_128_GCM, NULL);
HPKE_AES_256_GCM, NULL);

if (ret != BAD_FUNC_ARG) /* Curve448 is not supported yet */
return WC_TEST_RET_ENC_EC(ret);

if (ret == 0)
return ret;
ret = WC_TEST_RET_ENC_EC(ret);
else
ret = 0;
#endif

#if defined(HAVE_CURVE25519)
/* test with curve25519 and aes256 */
ret = wc_HpkeInit(hpke, DHKEM_X25519_HKDF_SHA256, HKDF_SHA256,
HPKE_AES_256_GCM, NULL);
if (ret == 0)
ret = wc_HpkeInit(hpke, DHKEM_X25519_HKDF_SHA256, HKDF_SHA256,
HPKE_AES_256_GCM, NULL);

if (ret != 0)
return WC_TEST_RET_ENC_EC(ret);
Expand Down

0 comments on commit 14068fb

Please sign in to comment.