Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
0652-fixup-some-warnings-and-refactor-to-facili...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0652-fixup-some-warnings-and-refactor-to-facilitate-it.patch of Package erlang
From b65f560c0e18a4b9c3538f0baa51200ddcd3dee2 Mon Sep 17 00:00:00 2001 From: Hans Nilsson <hans@erlang.org> Date: Wed, 8 Sep 2021 08:08:23 +0200 Subject: [PATCH 2/2] fixup some warnings and refactor to facilitate it --- lib/crypto/c_src/algorithms.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/lib/crypto/c_src/algorithms.c b/lib/crypto/c_src/algorithms.c index 51c5901929..aaad836869 100644 --- a/lib/crypto/c_src/algorithms.c +++ b/lib/crypto/c_src/algorithms.c @@ -53,6 +53,8 @@ void init_algorithms_types(ErlNifEnv* env) /* ciphers and macs are initiated statically */ } +void cleanup_algorithms_types(ErlNifEnv* env); + void cleanup_algorithms_types(ErlNifEnv* env) { enif_mutex_destroy(mtx_init_curve_types); @@ -250,21 +252,22 @@ int get_curve_cnt(ErlNifEnv* env, int fips) { } void init_curve_types(ErlNifEnv* env) { +#if defined(DEBUG) int curve_cnt = 0; +#endif + #if defined(HAVE_EC) + int fips_mode = 0; + +# ifdef FIPS_SUPPORT + if (FIPS_mode()) fips_mode = 1; +# endif + +# ifdef DEBUG + curve_cnt = +# endif + get_curve_cnt(env, fips_mode); -#ifdef FIPS_SUPPORT - if (FIPS_mode()) { - // enabled - curve_cnt = get_curve_cnt(env, 1); - } else { - // disabled - curve_cnt = get_curve_cnt(env, 0); - } -#else - // No fips support - curve_cnt = get_curve_cnt(env, 0); -#endif #endif /* defined(HAVE_EC) */ ASSERT(curve_cnt <= sizeof(algo_curve)/sizeof(ERL_NIF_TERM)); @@ -726,4 +729,3 @@ void init_rsa_opts_types(ErlNifEnv* env) { ASSERT(algo_rsa_opts_cnt <= sizeof(algo_rsa_opts)/sizeof(ERL_NIF_TERM)); } - -- 2.31.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor