File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9168,12 +9168,19 @@ WOLFSSL_EC_KEY *wolfSSL_EC_KEY_new_by_curve_name(int nid)
91689168
91699169 if (eccEnum != -1 ) {
91709170 /* search and set the corresponding internal curve idx */
9171- for (x = 0 ; ecc_sets [x ].size != 0 ; x ++ )
9171+ for (x = 0 ; ecc_sets [x ].size != 0 ; x ++ ) {
91729172 if (ecc_sets [x ].id == eccEnum ) {
91739173 key -> group -> curve_idx = x ;
91749174 key -> group -> curve_oid = ecc_sets [x ].oidSum ;
91759175 break ;
91769176 }
9177+ }
9178+
9179+ /* if not found, we don't support this curve. */
9180+ if (ecc_sets [x ].size == 0 ) {
9181+ wolfSSL_EC_KEY_free (key );
9182+ key = NULL ;
9183+ }
91779184 }
91789185
91799186 return key ;
Original file line number Diff line number Diff line change @@ -46165,7 +46165,7 @@ static int test_wolfSSL_EC_KEY_print_fp(void)
4616546165{
4616646166 int res = TEST_SKIPPED;
4616746167#if defined(HAVE_ECC) && ((defined(HAVE_ECC224) && defined(HAVE_ECC256)) || \
46168- defined(HAVE_ALL_CURVES)) && ECC_MIN_KEY_SZ <= 256 && \
46168+ defined(HAVE_ALL_CURVES)) && ECC_MIN_KEY_SZ <= 224 && \
4616946169 defined(OPENSSL_EXTRA) && defined(XFPRINTF) && !defined(NO_FILESYSTEM) && \
4617046170 !defined(NO_STDIO_FILESYSTEM)
4617146171 EC_KEY* key = NULL;
You can’t perform that action at this time.
0 commit comments