From: Stephan Bosch Date: Fri, 3 Mar 2023 22:45:43 +0000 (+0100) Subject: auth: Use designated initializers in mech-* X-Git-Tag: 2.4.2~302 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d02d6a8a366017803f4661ad125bb418fa202b32;p=thirdparty%2Fdovecot%2Fcore.git auth: Use designated initializers in mech-* --- diff --git a/src/auth/mech-anonymous.c b/src/auth/mech-anonymous.c index 2a311a10f6..6503bf13fd 100644 --- a/src/auth/mech-anonymous.c +++ b/src/auth/mech-anonymous.c @@ -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, }; diff --git a/src/auth/mech-apop.c b/src/auth/mech-apop.c index d5431f3a11..a3d3c5bdf3 100644 --- a/src/auth/mech-apop.c +++ b/src/auth/mech-apop.c @@ -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 }; diff --git a/src/auth/mech-cram-md5.c b/src/auth/mech-cram-md5.c index 74872a1dd6..9536d065e7 100644 --- a/src/auth/mech-cram-md5.c +++ b/src/auth/mech-cram-md5.c @@ -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, }; diff --git a/src/auth/mech-digest-md5.c b/src/auth/mech-digest-md5.c index 0035bb0a57..cf65a993fd 100644 --- a/src/auth/mech-digest-md5.c +++ b/src/auth/mech-digest-md5.c @@ -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, diff --git a/src/auth/mech-dovecot-token.c b/src/auth/mech-dovecot-token.c index 02bcfc365d..7282269cf2 100644 --- a/src/auth/mech-dovecot-token.c +++ b/src/auth/mech-dovecot-token.c @@ -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 }; diff --git a/src/auth/mech-external.c b/src/auth/mech-external.c index 42faef309f..dcabb4099d 100644 --- a/src/auth/mech-external.c +++ b/src/auth/mech-external.c @@ -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, }; diff --git a/src/auth/mech-gssapi.c b/src/auth/mech-gssapi.c index 3c949039b7..0ce1c06034 100644 --- a/src/auth/mech-gssapi.c +++ b/src/auth/mech-gssapi.c @@ -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) diff --git a/src/auth/mech-login.c b/src/auth/mech-login.c index 6f27433a7f..5083573fcc 100644 --- a/src/auth/mech-login.c +++ b/src/auth/mech-login.c @@ -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, }; diff --git a/src/auth/mech-oauth2.c b/src/auth/mech-oauth2.c index af23ee2d16..5650532db9 100644 --- a/src/auth/mech-oauth2.c +++ b/src/auth/mech-oauth2.c @@ -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) diff --git a/src/auth/mech-otp.c b/src/auth/mech-otp.c index d118d17dcb..9f1272df93 100644 --- a/src/auth/mech-otp.c +++ b/src/auth/mech-otp.c @@ -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) diff --git a/src/auth/mech-plain.c b/src/auth/mech-plain.c index 3a2b2f4f14..1878daa82d 100644 --- a/src/auth/mech-plain.c +++ b/src/auth/mech-plain.c @@ -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, }; diff --git a/src/auth/mech-scram.c b/src/auth/mech-scram.c index b98d8c81d8..a5e948f036 100644 --- a/src/auth/mech-scram.c +++ b/src/auth/mech-scram.c @@ -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, }; diff --git a/src/auth/mech-winbind.c b/src/auth/mech-winbind.c index d988e25fa0..d8022d8be1 100644 --- a/src/auth/mech-winbind.c +++ b/src/auth/mech-winbind.c @@ -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, };