]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Use designated initializers in mech-*
authorStephan Bosch <stephan.bosch@open-xchange.com>
Fri, 3 Mar 2023 22:45:43 +0000 (23:45 +0100)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Thu, 9 Oct 2025 08:41:22 +0000 (08:41 +0000)
13 files changed:
src/auth/mech-anonymous.c
src/auth/mech-apop.c
src/auth/mech-cram-md5.c
src/auth/mech-digest-md5.c
src/auth/mech-dovecot-token.c
src/auth/mech-external.c
src/auth/mech-gssapi.c
src/auth/mech-login.c
src/auth/mech-oauth2.c
src/auth/mech-otp.c
src/auth/mech-plain.c
src/auth/mech-scram.c
src/auth/mech-winbind.c

index 2a311a10f6b1c6a002819fe3c73ab1257421aa76..6503bf13fd2fde181b7076632308ac15d77d6264 100644 (file)
@@ -32,13 +32,13 @@ static struct auth_request *mech_anonymous_auth_new(void)
 }
 
 const struct mech_module mech_anonymous = {
-       "ANONYMOUS",
+       .mech_name = "ANONYMOUS",
 
        .flags = MECH_SEC_ANONYMOUS | MECH_SEC_ALLOW_NULS,
        .passdb_need = MECH_PASSDB_NEED_NOTHING,
 
-       mech_anonymous_auth_new,
-       mech_generic_auth_initial,
-       mech_anonymous_auth_continue,
-       mech_generic_auth_free
+       .auth_new = mech_anonymous_auth_new,
+       .auth_initial = mech_generic_auth_initial,
+       .auth_continue = mech_anonymous_auth_continue,
+       .auth_free = mech_generic_auth_free,
 };
index d5431f3a11c00f00e9e921a0ed9af9634a29fc0b..a3d3c5bdf351e45adc74a2253d2170c8c7dc295d 100644 (file)
@@ -159,14 +159,13 @@ static struct auth_request *mech_apop_auth_new(void)
 }
 
 const struct mech_module mech_apop = {
-       "APOP",
+       .mech_name = "APOP",
 
        .flags = MECH_SEC_PRIVATE | MECH_SEC_DICTIONARY | MECH_SEC_ACTIVE |
                 MECH_SEC_ALLOW_NULS,
        .passdb_need = MECH_PASSDB_NEED_VERIFY_RESPONSE,
 
-       mech_apop_auth_new,
-       mech_apop_auth_initial,
-       NULL,
-        mech_generic_auth_free
+       .auth_new = mech_apop_auth_new,
+       .auth_initial = mech_apop_auth_initial,
+       .auth_free = mech_generic_auth_free
 };
index 74872a1dd6635643553b7d69527c73abc5f63100..9536d065e72d36313ae23db9aab98e830de748ad 100644 (file)
@@ -178,13 +178,13 @@ static struct auth_request *mech_cram_md5_auth_new(void)
 }
 
 const struct mech_module mech_cram_md5 = {
-       "CRAM-MD5",
+       .mech_name = "CRAM-MD5",
 
        .flags = MECH_SEC_DICTIONARY | MECH_SEC_ACTIVE,
        .passdb_need = MECH_PASSDB_NEED_VERIFY_RESPONSE,
 
-       mech_cram_md5_auth_new,
-       mech_cram_md5_auth_initial,
-       mech_cram_md5_auth_continue,
-        mech_generic_auth_free
+       .auth_new = mech_cram_md5_auth_new,
+       .auth_initial = mech_cram_md5_auth_initial,
+       .auth_continue = mech_cram_md5_auth_continue,
+       .auth_free = mech_generic_auth_free,
 };
index 0035bb0a5738324c155267edbccfaa5612e5d636..cf65a993fdbbc12c6647537885fc7dfea68d64e6 100644 (file)
@@ -618,16 +618,16 @@ static struct auth_request *mech_digest_md5_auth_new(void)
 }
 
 const struct mech_module mech_digest_md5 = {
-       "DIGEST-MD5",
+       .mech_name = "DIGEST-MD5",
 
        .flags = MECH_SEC_DICTIONARY | MECH_SEC_ACTIVE |
                MECH_SEC_MUTUAL_AUTH,
        .passdb_need = MECH_PASSDB_NEED_LOOKUP_CREDENTIALS,
 
-       mech_digest_md5_auth_new,
-       mech_digest_md5_auth_initial,
-       mech_digest_md5_auth_continue,
-       mech_generic_auth_free
+       .auth_new = mech_digest_md5_auth_new,
+       .auth_initial = mech_digest_md5_auth_initial,
+       .auth_continue = mech_digest_md5_auth_continue,
+       .auth_free = mech_generic_auth_free,
 };
 
 void mech_digest_test_set_nonce(struct auth_request *auth_request,
index 02bcfc365d079e53227e0013d8a45bfcd0ae4907..7282269cf247647183b4ce713b0ad424bce9800c 100644 (file)
@@ -80,13 +80,13 @@ static struct auth_request *mech_dovecot_token_auth_new(void)
 }
 
 const struct mech_module mech_dovecot_token = {
-       "DOVECOT-TOKEN",
+       .mech_name = "DOVECOT-TOKEN",
 
        .flags = MECH_SEC_PRIVATE | MECH_SEC_ALLOW_NULS,
        .passdb_need = MECH_PASSDB_NEED_NOTHING,
 
-       mech_dovecot_token_auth_new,
-       mech_generic_auth_initial,
-       mech_dovecot_token_auth_continue,
-       mech_generic_auth_free
+       .auth_new = mech_dovecot_token_auth_new,
+       .auth_initial = mech_generic_auth_initial,
+       .auth_continue = mech_dovecot_token_auth_continue,
+       .auth_free = mech_generic_auth_free
 };
index 42faef309f32f1429c3ba95ed88c8ad343dd6e2a..dcabb4099d1f7f62ef6a97f93b6a0318e31f2343 100644 (file)
@@ -52,13 +52,13 @@ static struct auth_request *mech_external_auth_new(void)
 }
 
 const struct mech_module mech_external = {
-       "EXTERNAL",
+       .mech_name = "EXTERNAL",
 
        .flags = 0,
        .passdb_need = MECH_PASSDB_NEED_VERIFY_PLAIN,
 
-       mech_external_auth_new,
-       mech_generic_auth_initial,
-       mech_external_auth_continue,
-       mech_generic_auth_free
+       .auth_new = mech_external_auth_new,
+       .auth_initial = mech_generic_auth_initial,
+       .auth_continue = mech_external_auth_continue,
+       .auth_free = mech_generic_auth_free,
 };
index 3c949039b75bfe06e64fa9692165d7b8da5d5097..0ce1c0603408fd365dbb66200540b6740f6e2994 100644 (file)
@@ -692,30 +692,30 @@ mech_gssapi_auth_free(struct auth_request *auth_request)
 }
 
 const struct mech_module mech_gssapi = {
-       "GSSAPI",
+       .mech_name = "GSSAPI",
 
        .flags = MECH_SEC_ALLOW_NULS,
        .passdb_need = MECH_PASSDB_NEED_NOTHING,
 
-       mech_gssapi_auth_new,
-       mech_gssapi_auth_initial,
-       mech_gssapi_auth_continue,
-       mech_gssapi_auth_free
+       .auth_new = mech_gssapi_auth_new,
+       .auth_initial = mech_gssapi_auth_initial,
+       .auth_continue = mech_gssapi_auth_continue,
+       .auth_free = mech_gssapi_auth_free,
 };
 
 /* MIT Kerberos v1.5+ and Heimdal v0.7+ support SPNEGO for Kerberos tickets
    internally. Nothing else needs to be done here. Note, however, that this does
    not support SPNEGO when the only available credential is NTLM. */
 const struct mech_module mech_gssapi_spnego = {
-       "GSS-SPNEGO",
+       .mech_name = "GSS-SPNEGO",
 
        .flags = MECH_SEC_ALLOW_NULS,
        .passdb_need = MECH_PASSDB_NEED_NOTHING,
 
-       mech_gssapi_auth_new,
-        mech_gssapi_auth_initial,
-        mech_gssapi_auth_continue,
-        mech_gssapi_auth_free
+       .auth_new = mech_gssapi_auth_new,
+        .auth_initial = mech_gssapi_auth_initial,
+        .auth_continue = mech_gssapi_auth_continue,
+        .auth_free = mech_gssapi_auth_free,
 };
 
 static void mech_gssapi_initialize(const struct auth_settings *set)
index 6f27433a7f9d8383a1aa830703c5c841c145c7e0..5083573fccfde0fa417154283d919122c593b78d 100644 (file)
@@ -64,13 +64,13 @@ static struct auth_request *mech_login_auth_new(void)
 }
 
 const struct mech_module mech_login = {
-       "LOGIN",
+       .mech_name = "LOGIN",
 
        .flags = MECH_SEC_PLAINTEXT,
        .passdb_need = MECH_PASSDB_NEED_VERIFY_PLAIN,
 
-       mech_login_auth_new,
-       mech_login_auth_initial,
-       mech_login_auth_continue,
-       mech_generic_auth_free
+       .auth_new = mech_login_auth_new,
+       .auth_initial = mech_login_auth_initial,
+       .auth_continue = mech_login_auth_continue,
+       .auth_free = mech_generic_auth_free,
 };
index af23ee2d1609d962205b0bb01d2409650c17d39d..5650532db9eab776600fc4140244102fa0cbea33 100644 (file)
@@ -392,29 +392,29 @@ static struct auth_request *mech_oauth2_auth_new(void)
 }
 
 const struct mech_module mech_oauthbearer = {
-       "OAUTHBEARER",
+       .mech_name = "OAUTHBEARER",
 
        /* while this does not transfer plaintext password,
           the token is still considered as password */
        .flags = MECH_SEC_PLAINTEXT,
        .passdb_need = 0,
 
-       mech_oauth2_auth_new,
-       mech_generic_auth_initial,
-       mech_oauthbearer_auth_continue,
-       mech_generic_auth_free
+       .auth_new = mech_oauth2_auth_new,
+       .auth_initial = mech_generic_auth_initial,
+       .auth_continue = mech_oauthbearer_auth_continue,
+       .auth_free = mech_generic_auth_free,
 };
 
 const struct mech_module mech_xoauth2 = {
-       "XOAUTH2",
+       .mech_name = "XOAUTH2",
 
        .flags = MECH_SEC_PLAINTEXT,
        .passdb_need = 0,
 
-       mech_oauth2_auth_new,
-       mech_generic_auth_initial,
-       mech_xoauth2_auth_continue,
-       mech_generic_auth_free
+       .auth_new = mech_oauth2_auth_new,
+       .auth_initial = mech_generic_auth_initial,
+       .auth_continue = mech_xoauth2_auth_continue,
+       .auth_free = mech_generic_auth_free,
 };
 
 void mech_oauth2_initialize(void)
index d118d17dcb5ab2585b7ed785c52fc7b953d9a4eb..9f1272df9388b63299da6ac33280bdfd121bb72e 100644 (file)
@@ -319,15 +319,15 @@ static void mech_otp_auth_free(struct auth_request *auth_request)
  */
 
 const struct mech_module mech_otp = {
-       "OTP",
+       .mech_name = "OTP",
 
        .flags = MECH_SEC_DICTIONARY | MECH_SEC_ACTIVE | MECH_SEC_ALLOW_NULS,
        .passdb_need = MECH_PASSDB_NEED_SET_CREDENTIALS,
 
-       mech_otp_auth_new,
-       mech_generic_auth_initial,
-       mech_otp_auth_continue,
-       mech_otp_auth_free
+       .auth_new = mech_otp_auth_new,
+       .auth_initial = mech_generic_auth_initial,
+       .auth_continue = mech_otp_auth_continue,
+       .auth_free = mech_otp_auth_free,
 };
 
 void mech_otp_deinit(void)
index 3a2b2f4f14febb4b11a5225c9961ade503075430..1878daa82d4ee9c24f0ac856c5535e9edf47ec5b 100644 (file)
@@ -76,13 +76,13 @@ static struct auth_request *mech_plain_auth_new(void)
 }
 
 const struct mech_module mech_plain = {
-       "PLAIN",
+       .mech_name = "PLAIN",
 
        .flags = MECH_SEC_PLAINTEXT | MECH_SEC_ALLOW_NULS,
        .passdb_need = MECH_PASSDB_NEED_VERIFY_PLAIN,
 
-       mech_plain_auth_new,
-       mech_generic_auth_initial,
-       mech_plain_auth_continue,
-       mech_generic_auth_free
+       .auth_new = mech_plain_auth_new,
+       .auth_initial = mech_generic_auth_initial,
+       .auth_continue = mech_plain_auth_continue,
+       .auth_free = mech_generic_auth_free,
 };
index b98d8c81d8010d47f1ce73148cb80d243d3f61f6..a5e948f036c65a78dcdcb281d5c792d35dce02b0 100644 (file)
@@ -225,49 +225,49 @@ static void mech_scram_auth_free(struct auth_request *auth_request)
 }
 
 const struct mech_module mech_scram_sha1 = {
-       "SCRAM-SHA-1",
+       .mech_name = "SCRAM-SHA-1",
 
        .flags = MECH_SEC_MUTUAL_AUTH,
        .passdb_need = MECH_PASSDB_NEED_LOOKUP_CREDENTIALS,
 
-       mech_scram_sha1_auth_new,
-       mech_generic_auth_initial,
-       mech_scram_auth_continue,
-       mech_scram_auth_free,
+       .auth_new = mech_scram_sha1_auth_new,
+       .auth_initial = mech_generic_auth_initial,
+       .auth_continue = mech_scram_auth_continue,
+       .auth_free = mech_scram_auth_free,
 };
 
 const struct mech_module mech_scram_sha1_plus = {
-       "SCRAM-SHA-1-PLUS",
+       .mech_name = "SCRAM-SHA-1-PLUS",
 
        .flags = MECH_SEC_MUTUAL_AUTH | MECH_SEC_CHANNEL_BINDING,
        .passdb_need = MECH_PASSDB_NEED_LOOKUP_CREDENTIALS,
 
-       mech_scram_sha1_auth_new,
-       mech_generic_auth_initial,
-       mech_scram_auth_continue,
-       mech_scram_auth_free
+       .auth_new = mech_scram_sha1_auth_new,
+       .auth_initial = mech_generic_auth_initial,
+       .auth_continue = mech_scram_auth_continue,
+       .auth_free = mech_scram_auth_free,
 };
 
 const struct mech_module mech_scram_sha256 = {
-       "SCRAM-SHA-256",
+       .mech_name = "SCRAM-SHA-256",
 
        .flags = MECH_SEC_MUTUAL_AUTH,
        .passdb_need = MECH_PASSDB_NEED_LOOKUP_CREDENTIALS,
 
-       mech_scram_sha256_auth_new,
-       mech_generic_auth_initial,
-       mech_scram_auth_continue,
-       mech_scram_auth_free,
+       .auth_new = mech_scram_sha256_auth_new,
+       .auth_initial = mech_generic_auth_initial,
+       .auth_continue = mech_scram_auth_continue,
+       .auth_free = mech_scram_auth_free,
 };
 
 const struct mech_module mech_scram_sha256_plus = {
-       "SCRAM-SHA-256-PLUS",
+       .mech_name = "SCRAM-SHA-256-PLUS",
 
        .flags = MECH_SEC_MUTUAL_AUTH | MECH_SEC_CHANNEL_BINDING,
        .passdb_need = MECH_PASSDB_NEED_LOOKUP_CREDENTIALS,
 
-       mech_scram_sha256_auth_new,
-       mech_generic_auth_initial,
-       mech_scram_auth_continue,
-       mech_scram_auth_free
+       .auth_new = mech_scram_sha256_auth_new,
+       .auth_initial = mech_generic_auth_initial,
+       .auth_continue = mech_scram_auth_continue,
+       .auth_free = mech_scram_auth_free,
 };
index d988e25fa0e7025a26dd3327bd93279884a63823..d8022d8be161bc47020150edd60514942a81ae60 100644 (file)
@@ -338,26 +338,26 @@ static struct auth_request *mech_winbind_spnego_auth_new(void)
 }
 
 const struct mech_module mech_winbind_ntlm = {
-       "NTLM",
+       .mech_name = "NTLM",
 
        .flags = MECH_SEC_DICTIONARY | MECH_SEC_ACTIVE |
                 MECH_SEC_ALLOW_NULS,
        .passdb_need = MECH_PASSDB_NEED_NOTHING,
 
-       mech_winbind_ntlm_auth_new,
-       mech_winbind_auth_initial,
-       mech_winbind_auth_continue,
-       mech_generic_auth_free
+       .auth_new = mech_winbind_ntlm_auth_new,
+       .auth_initial = mech_winbind_auth_initial,
+       .auth_continue = mech_winbind_auth_continue,
+       .auth_free = mech_generic_auth_free,
 };
 
 const struct mech_module mech_winbind_spnego = {
-       "GSS-SPNEGO",
+       .mech_name = "GSS-SPNEGO",
 
        .flags = MECH_SEC_ALLOW_NULS,
        .passdb_need = MECH_PASSDB_NEED_NOTHING,
 
-       mech_winbind_spnego_auth_new,
-       mech_winbind_auth_initial,
-       mech_winbind_auth_continue,
-       mech_generic_auth_free
+       .auth_new = mech_winbind_spnego_auth_new,
+       .auth_initial = mech_winbind_auth_initial,
+       .auth_continue = mech_winbind_auth_continue,
+       .auth_free = mech_generic_auth_free,
 };