From: Timo Sirainen Date: Fri, 4 Nov 2022 20:08:21 +0000 (+0200) Subject: auth: Rename "secured" variable/enum to "conn_secured" X-Git-Tag: 2.4.0~3422 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9fa8e1ae80e454c8ac536dea8bf6e95fd3ed6860;p=thirdparty%2Fdovecot%2Fcore.git auth: Rename "secured" variable/enum to "conn_secured" --- diff --git a/src/auth/auth-policy.c b/src/auth/auth-policy.c index 65e630a5c7..ace932a560 100644 --- a/src/auth/auth-policy.c +++ b/src/auth/auth-policy.c @@ -573,7 +573,7 @@ void auth_policy_create_json(struct policy_lookup_ctx *context, str_append(context->json, context->request->policy_refusal ? "true" : "false"); } str_append(context->json, ",\"tls\":"); - if (context->request->fields.secured == AUTH_REQUEST_SECURED_TLS) + if (context->request->fields.conn_secured == AUTH_REQUEST_CONN_SECURED_TLS) str_append(context->json, "true"); else str_append(context->json, "false"); diff --git a/src/auth/auth-request-fields.c b/src/auth/auth-request-fields.c index 6f94b81765..9ca5f22529 100644 --- a/src/auth/auth-request-fields.c +++ b/src/auth/auth-request-fields.c @@ -100,10 +100,10 @@ void auth_request_export(struct auth_request *request, string_t *dest) } if (event_want_debug(request->event)) str_append(dest, "\tdebug"); - switch (fields->secured) { - case AUTH_REQUEST_SECURED_NONE: break; - case AUTH_REQUEST_SECURED: str_append(dest, "\tsecured"); break; - case AUTH_REQUEST_SECURED_TLS: str_append(dest, "\tsecured=tls"); break; + switch (fields->conn_secured) { + case AUTH_REQUEST_CONN_SECURED_NONE: break; + case AUTH_REQUEST_CONN_SECURED: str_append(dest, "\tsecured"); break; + case AUTH_REQUEST_CONN_SECURED_TLS: str_append(dest, "\tsecured=tls"); break; default: break; } if (fields->skip_password_check) @@ -213,10 +213,10 @@ bool auth_request_import_auth(struct auth_request *request, /* auth client may set these */ if (strcmp(key, "secured") == 0) { if (strcmp(value, "tls") == 0) { - fields->secured = AUTH_REQUEST_SECURED_TLS; + fields->conn_secured = AUTH_REQUEST_CONN_SECURED_TLS; event_add_str(request->event, "transport", "TLS"); } else { - fields->secured = AUTH_REQUEST_SECURED; + fields->conn_secured = AUTH_REQUEST_CONN_SECURED; event_add_str(request->event, "transport", "trusted"); } } diff --git a/src/auth/auth-request-var-expand.c b/src/auth/auth-request-var-expand.c index 04d774e54e..aad851a254 100644 --- a/src/auth/auth-request-var-expand.c +++ b/src/auth/auth-request-var-expand.c @@ -135,10 +135,10 @@ auth_request_get_var_expand_table_full(const struct auth_request *auth_request, } tab[10].value = tab[43].value = fields->mech_name == NULL ? "" : escape_func(fields->mech_name, auth_request); - switch (fields->secured) { - case AUTH_REQUEST_SECURED_NONE: tab[11].value = ""; break; - case AUTH_REQUEST_SECURED: tab[11].value = "secured"; break; - case AUTH_REQUEST_SECURED_TLS: tab[11].value = "TLS"; break; + switch (fields->conn_secured) { + case AUTH_REQUEST_CONN_SECURED_NONE: tab[11].value = ""; break; + case AUTH_REQUEST_CONN_SECURED: tab[11].value = "secured"; break; + case AUTH_REQUEST_CONN_SECURED_TLS: tab[11].value = "TLS"; break; default: tab[11].value = ""; break; }; tab[12].value = tab[37].value = dec2str(fields->local_port); diff --git a/src/auth/auth-request.h b/src/auth/auth-request.h index 530c62dc4f..63cc0dfaa6 100644 --- a/src/auth/auth-request.h +++ b/src/auth/auth-request.h @@ -28,10 +28,10 @@ enum auth_request_state { AUTH_REQUEST_STATE_MAX }; -enum auth_request_secured { - AUTH_REQUEST_SECURED_NONE, - AUTH_REQUEST_SECURED, - AUTH_REQUEST_SECURED_TLS, +enum auth_request_conn_secured { + AUTH_REQUEST_CONN_SECURED_NONE, + AUTH_REQUEST_CONN_SECURED, + AUTH_REQUEST_CONN_SECURED_TLS, }; enum auth_request_cache_result { @@ -77,7 +77,7 @@ struct auth_request_fields { const unsigned char *delayed_credentials; size_t delayed_credentials_size; - enum auth_request_secured secured; + enum auth_request_conn_secured conn_secured; /* Authentication was successfully finished, including policy checks and such. There may still be some final delay or final SASL diff --git a/src/auth/test-auth-request-var-expand.c b/src/auth/test-auth-request-var-expand.c index e54e2ba9e0..e8035528e9 100644 --- a/src/auth/test-auth-request-var-expand.c +++ b/src/auth/test-auth-request-var-expand.c @@ -28,7 +28,7 @@ static struct auth_request default_test_request = { .local_ip = { .family = AF_INET }, .remote_ip = { .family = AF_INET }, .mech_name = "-mech", - .secured = AUTH_REQUEST_SECURED, + .conn_secured = AUTH_REQUEST_CONN_SECURED, .local_port = 21, .remote_port = 210, .valid_client_cert = TRUE, @@ -126,7 +126,7 @@ static void test_auth_request_var_expand_flags(void) test_begin("auth request var expand flags"); test_request.userdb_lookup = FALSE; - test_request.fields.secured = AUTH_REQUEST_SECURED_NONE; + test_request.fields.conn_secured = AUTH_REQUEST_CONN_SECURED_NONE; test_request.fields.valid_client_cert = FALSE; test_assert(var_expand(str, test_input, auth_request_get_var_expand_table(&test_request, test_escape), @@ -134,7 +134,7 @@ static void test_auth_request_var_expand_flags(void) test_assert(strcmp(str_c(str), "40\n\n\n") == 0); test_request.userdb_lookup = TRUE; - test_request.fields.secured = AUTH_REQUEST_SECURED; + test_request.fields.conn_secured = AUTH_REQUEST_CONN_SECURED; test_request.fields.valid_client_cert = TRUE; str_truncate(str, 0);