Skip to content

Commit

Permalink
Merge 'sverker/crypto/supports-curves-race-deadlock/erlangGH-8971/OTP…
Browse files Browse the repository at this point in the history
…-19316' into maint
  • Loading branch information
sverker committed Oct 24, 2024
2 parents f39ea45 + fdb53c9 commit 471b366
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/crypto/c_src/algorithms.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,16 +250,14 @@ int get_curve_cnt(ErlNifEnv* env, int fips) {

enif_mutex_lock(mtx_init_curve_types);
if (1 == fips) {
if (algo_curve_fips_cnt >= 0) {
return algo_curve_fips_cnt;
if (algo_curve_fips_cnt < 0) {
algo_curve_fips_cnt = init_curves(env, 1);
}
algo_curve_fips_cnt = init_curves(env, 1);
cnt = algo_curve_fips_cnt;
} else {
if (algo_curve_cnt >= 0) {
return algo_curve_cnt;
if (algo_curve_cnt < 0) {
algo_curve_cnt = init_curves(env, 0);
}
algo_curve_cnt = init_curves(env, 0);
cnt = algo_curve_cnt;
}
enif_mutex_unlock(mtx_init_curve_types);
Expand Down

0 comments on commit 471b366

Please sign in to comment.