File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27902,6 +27902,31 @@ static wc_test_ret_t hpke_test_single(Hpke* hpke)
2790227902 ret = WC_TEST_RET_ENC_NC;
2790327903 }
2790427904
27905+ /* Negative test case with NULL argument */
27906+ if (ret == 0) {
27907+ ret = wc_HpkeGenerateKeyPair(NULL, &receiverKey, rng);
27908+ if (ret != BAD_FUNC_ARG)
27909+ ret = WC_TEST_RET_ENC_EC(ret);
27910+ else
27911+ ret = 0;
27912+ }
27913+
27914+ if (ret == 0) {
27915+ ret = wc_HpkeGenerateKeyPair(hpke, NULL, rng);
27916+ if (ret != BAD_FUNC_ARG)
27917+ ret = WC_TEST_RET_ENC_EC(ret);
27918+ else
27919+ ret = 0;
27920+ }
27921+
27922+ if (ret == 0) {
27923+ ret = wc_HpkeGenerateKeyPair(hpke, &receiverKey, NULL);
27924+ if (ret != BAD_FUNC_ARG)
27925+ ret = WC_TEST_RET_ENC_EC(ret);
27926+ else
27927+ ret = 0;
27928+ }
27929+
2790527930 if (ephemeralKey != NULL)
2790627931 wc_HpkeFreeKey(hpke, hpke->kem, ephemeralKey, hpke->heap);
2790727932
You can’t perform that action at this time.
0 commit comments