Skip to content

Commit 9f1e391

Browse files
committed
code: declare enum members as int
so they can be initialized to OIDC_CONFIG_POS_INT_UNSET without warning Signed-off-by: Hans Zandbelt <[email protected]>
1 parent 38878d4 commit 9f1e391

File tree

4 files changed

+18
-15
lines changed

4 files changed

+18
-15
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
12/16/2024
22
- http: report errors when curl_easy_setopt fails and improve macro usage
3+
- code: declare enum members as int so they can be set to OIDC_CONFIG_POS_INT_UNSET without warning
34

45
12/15/2024
56
- add Coverity Github action

src/cfg/cfg_int.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,12 @@ struct oidc_cfg_t {
150150
int session_cookie_chunk_size;
151151
char *cookie_domain;
152152
int cookie_http_only;
153-
oidc_samesite_cookie_t cookie_same_site;
153+
int cookie_same_site;
154154

155155
int state_timeout;
156156
int max_number_of_state_cookies;
157157
int delete_oldest_state_cookies;
158-
oidc_state_input_hdrs_t state_input_headers;
158+
int state_input_headers;
159159

160160
int session_inactivity_timeout;
161161
int provider_metadata_refresh_interval;
@@ -181,9 +181,9 @@ struct oidc_cfg_t {
181181
apr_hash_t *redirect_urls_allowed;
182182
char *ca_bundle_path;
183183
char *logout_x_frame_options;
184-
oidc_hdr_x_forwarded_t x_forwarded_headers;
185-
oidc_on_error_action_t action_on_userinfo_error;
186-
oidc_trace_parent_t trace_parent;
184+
int x_forwarded_headers;
185+
int action_on_userinfo_error;
186+
int trace_parent;
187187

188188
apr_hash_t *metrics_hook_data;
189189
char *metrics_path;

src/cfg/dir.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ struct oidc_dir_cfg_t {
5353
char *cookie_path;
5454
char *cookie;
5555
char *authn_header;
56-
oidc_unauth_action_t unauth_action;
57-
oidc_unautz_action_t unautz_action;
56+
int unauth_action;
57+
int unautz_action;
5858
char *unauthz_arg;
5959
apr_array_header_t *pass_cookies;
6060
apr_array_header_t *strip_cookies;
61-
oidc_appinfo_pass_in_t pass_info_in;
62-
oidc_appinfo_encoding_t pass_info_encoding;
63-
oidc_oauth_accept_token_in_t oauth_accept_token_in;
61+
int pass_info_in;
62+
int pass_info_encoding;
63+
int oauth_accept_token_in;
6464
apr_hash_t *oauth_accept_token_options;
6565
int oauth_token_introspect_interval;
6666
int preserve_post;
@@ -71,11 +71,11 @@ struct oidc_dir_cfg_t {
7171
oidc_apr_expr_t *unauth_expression;
7272
oidc_apr_expr_t *userinfo_claims_expr;
7373
int refresh_access_token_before_expiry;
74-
oidc_on_error_action_t action_on_error_refresh;
75-
oidc_on_error_action_t action_on_userinfo_refresh;
74+
int action_on_error_refresh;
75+
int action_on_userinfo_refresh;
7676
char *state_cookie_prefix;
7777
apr_array_header_t *pass_userinfo_as;
78-
oidc_pass_idtoken_as_t pass_idtoken_as;
78+
int pass_idtoken_as;
7979
};
8080

8181
#define OIDC_PASS_ID_TOKEN_AS_CLAIMS_STR "claims"
@@ -422,7 +422,8 @@ const char *oidc_cmd_dir_refresh_access_token_before_expiry_set(cmd_parms *cmd,
422422
goto end;
423423

424424
if (arg2)
425-
rv = oidc_cfg_parse_action_on_error_refresh_as(cmd->pool, arg2, &dir_cfg->action_on_error_refresh);
425+
rv = oidc_cfg_parse_action_on_error_refresh_as(
426+
cmd->pool, arg2, (oidc_on_error_action_t *)&dir_cfg->action_on_error_refresh);
426427

427428
end:
428429

src/cfg/provider.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,8 @@ const char *oidc_cmd_provider_userinfo_refresh_interval_set(cmd_parms *cmd, void
632632
if (rv == NULL)
633633
rv = oidc_cfg_provider_userinfo_refresh_interval_set(cmd->pool, cfg->provider, v);
634634
if ((rv == NULL) && (arg2))
635-
rv = oidc_cfg_parse_action_on_error_refresh_as(cmd->pool, arg2, &cfg->action_on_userinfo_error);
635+
rv = oidc_cfg_parse_action_on_error_refresh_as(
636+
cmd->pool, arg2, (oidc_on_error_action_t *)&cfg->action_on_userinfo_error);
636637
return OIDC_CONFIG_DIR_RV(cmd, rv);
637638
}
638639

0 commit comments

Comments
 (0)