]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Rename "secured" variable/enum to "conn_secured"
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 4 Nov 2022 20:08:21 +0000 (22:08 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 16 Nov 2022 08:09:54 +0000 (08:09 +0000)
src/auth/auth-policy.c
src/auth/auth-request-fields.c
src/auth/auth-request-var-expand.c
src/auth/auth-request.h
src/auth/test-auth-request-var-expand.c

index 65e630a5c73ae374e13c0c62bc3bc20c2291279c..ace932a5601246ad911705380a3964d4d53bd094 100644 (file)
@@ -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");
index 6f94b8176529660583ad11d9ff90caf03920f894..9ca5f2252970d739235229e2771fa534e38957e9 100644 (file)
@@ -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");
                }
        }
index 04d774e54e035200966a38d8db9886502751a35c..aad851a2546358f86663b592223994148dccea5e 100644 (file)
@@ -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);
index 530c62dc4f5dfa87fc6a97c8f68a46c7335b3a32..63cc0dfaa6e9d2db9f4c6426b4eb3120b8a60b71 100644 (file)
@@ -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
index e54e2ba9e02cf63af7f5d5b7068066785b3a33c8..e8035528e91d7a07f934fe420263b46f18d630d3 100644 (file)
@@ -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);