From: Stephan Bosch Date: Sun, 5 Mar 2023 19:41:27 +0000 (+0100) Subject: auth: sasl-server - Rename enum mech_passdb_need to sasl_mech_passdb_need X-Git-Tag: 2.4.2~266 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=576cf87c5482c553914a17972bebfe7e777acd8b;p=thirdparty%2Fdovecot%2Fcore.git auth: sasl-server - Rename enum mech_passdb_need to sasl_mech_passdb_need --- diff --git a/src/auth/auth-sasl-mech-apop.c b/src/auth/auth-sasl-mech-apop.c index 894a18463f..fe4ae9a97a 100644 --- a/src/auth/auth-sasl-mech-apop.c +++ b/src/auth/auth-sasl-mech-apop.c @@ -163,7 +163,7 @@ const struct mech_module mech_apop = { .flags = SASL_MECH_SEC_PRIVATE | SASL_MECH_SEC_DICTIONARY | SASL_MECH_SEC_ACTIVE | SASL_MECH_SEC_ALLOW_NULS, - .passdb_need = MECH_PASSDB_NEED_VERIFY_RESPONSE, + .passdb_need = SASL_MECH_PASSDB_NEED_VERIFY_RESPONSE, .auth_new = mech_apop_auth_new, .auth_initial = mech_apop_auth_initial, diff --git a/src/auth/auth-sasl-mech-dovecot-token.c b/src/auth/auth-sasl-mech-dovecot-token.c index 9b189e64c1..ead0feb044 100644 --- a/src/auth/auth-sasl-mech-dovecot-token.c +++ b/src/auth/auth-sasl-mech-dovecot-token.c @@ -83,7 +83,7 @@ const struct mech_module mech_dovecot_token = { .mech_name = "DOVECOT-TOKEN", .flags = SASL_MECH_SEC_PRIVATE | SASL_MECH_SEC_ALLOW_NULS, - .passdb_need = MECH_PASSDB_NEED_NOTHING, + .passdb_need = SASL_MECH_PASSDB_NEED_NOTHING, .auth_new = mech_dovecot_token_auth_new, .auth_initial = sasl_server_mech_generic_auth_initial, diff --git a/src/auth/auth.c b/src/auth/auth.c index 738d07cc20..5a81fd771f 100644 --- a/src/auth/auth.c +++ b/src/auth/auth.c @@ -244,18 +244,18 @@ static bool auth_mech_verify_passdb(const struct auth *auth, const struct mech_module_list *list) { switch (list->module.passdb_need) { - case MECH_PASSDB_NEED_NOTHING: + case SASL_MECH_PASSDB_NEED_NOTHING: break; - case MECH_PASSDB_NEED_VERIFY_PLAIN: + case SASL_MECH_PASSDB_NEED_VERIFY_PLAIN: if (!auth_passdb_list_have_verify_plain(auth)) return FALSE; break; - case MECH_PASSDB_NEED_VERIFY_RESPONSE: - case MECH_PASSDB_NEED_LOOKUP_CREDENTIALS: + case SASL_MECH_PASSDB_NEED_VERIFY_RESPONSE: + case SASL_MECH_PASSDB_NEED_LOOKUP_CREDENTIALS: if (!auth_passdb_list_have_lookup_credentials(auth)) return FALSE; break; - case MECH_PASSDB_NEED_SET_CREDENTIALS: + case SASL_MECH_PASSDB_NEED_SET_CREDENTIALS: if (!auth_passdb_list_have_lookup_credentials(auth)) return FALSE; if (!auth_passdb_list_have_set_credentials(auth)) diff --git a/src/auth/sasl-server-mech-anonymous.c b/src/auth/sasl-server-mech-anonymous.c index c83823242e..82a3e93be7 100644 --- a/src/auth/sasl-server-mech-anonymous.c +++ b/src/auth/sasl-server-mech-anonymous.c @@ -36,7 +36,7 @@ const struct mech_module mech_anonymous = { .mech_name = "ANONYMOUS", .flags = SASL_MECH_SEC_ANONYMOUS | SASL_MECH_SEC_ALLOW_NULS, - .passdb_need = MECH_PASSDB_NEED_NOTHING, + .passdb_need = SASL_MECH_PASSDB_NEED_NOTHING, .auth_new = mech_anonymous_auth_new, .auth_initial = sasl_server_mech_generic_auth_initial, diff --git a/src/auth/sasl-server-mech-cram-md5.c b/src/auth/sasl-server-mech-cram-md5.c index 4059e690d3..c57b5bdee8 100644 --- a/src/auth/sasl-server-mech-cram-md5.c +++ b/src/auth/sasl-server-mech-cram-md5.c @@ -181,7 +181,7 @@ const struct mech_module mech_cram_md5 = { .mech_name = "CRAM-MD5", .flags = SASL_MECH_SEC_DICTIONARY | SASL_MECH_SEC_ACTIVE, - .passdb_need = MECH_PASSDB_NEED_VERIFY_RESPONSE, + .passdb_need = SASL_MECH_PASSDB_NEED_VERIFY_RESPONSE, .auth_new = mech_cram_md5_auth_new, .auth_initial = mech_cram_md5_auth_initial, diff --git a/src/auth/sasl-server-mech-digest-md5.c b/src/auth/sasl-server-mech-digest-md5.c index 18230157b8..082d0d562f 100644 --- a/src/auth/sasl-server-mech-digest-md5.c +++ b/src/auth/sasl-server-mech-digest-md5.c @@ -622,7 +622,7 @@ const struct mech_module mech_digest_md5 = { .flags = SASL_MECH_SEC_DICTIONARY | SASL_MECH_SEC_ACTIVE | SASL_MECH_SEC_MUTUAL_AUTH, - .passdb_need = MECH_PASSDB_NEED_LOOKUP_CREDENTIALS, + .passdb_need = SASL_MECH_PASSDB_NEED_LOOKUP_CREDENTIALS, .auth_new = mech_digest_md5_auth_new, .auth_initial = mech_digest_md5_auth_initial, diff --git a/src/auth/sasl-server-mech-external.c b/src/auth/sasl-server-mech-external.c index 1d481a83bf..25cd47aad7 100644 --- a/src/auth/sasl-server-mech-external.c +++ b/src/auth/sasl-server-mech-external.c @@ -55,7 +55,7 @@ const struct mech_module mech_external = { .mech_name = "EXTERNAL", .flags = 0, - .passdb_need = MECH_PASSDB_NEED_VERIFY_PLAIN, + .passdb_need = SASL_MECH_PASSDB_NEED_VERIFY_PLAIN, .auth_new = mech_external_auth_new, .auth_initial = sasl_server_mech_generic_auth_initial, diff --git a/src/auth/sasl-server-mech-gssapi.c b/src/auth/sasl-server-mech-gssapi.c index d02b943638..55e05109d1 100644 --- a/src/auth/sasl-server-mech-gssapi.c +++ b/src/auth/sasl-server-mech-gssapi.c @@ -693,7 +693,7 @@ const struct mech_module mech_gssapi = { .mech_name = "GSSAPI", .flags = SASL_MECH_SEC_ALLOW_NULS, - .passdb_need = MECH_PASSDB_NEED_NOTHING, + .passdb_need = SASL_MECH_PASSDB_NEED_NOTHING, .auth_new = mech_gssapi_auth_new, .auth_initial = mech_gssapi_auth_initial, @@ -708,7 +708,7 @@ const struct mech_module mech_gssapi_spnego = { .mech_name = "GSS-SPNEGO", .flags = SASL_MECH_SEC_ALLOW_NULS, - .passdb_need = MECH_PASSDB_NEED_NOTHING, + .passdb_need = SASL_MECH_PASSDB_NEED_NOTHING, .auth_new = mech_gssapi_auth_new, .auth_initial = mech_gssapi_auth_initial, diff --git a/src/auth/sasl-server-mech-login.c b/src/auth/sasl-server-mech-login.c index 140a5e47f3..7b8cb980a0 100644 --- a/src/auth/sasl-server-mech-login.c +++ b/src/auth/sasl-server-mech-login.c @@ -65,7 +65,7 @@ const struct mech_module mech_login = { .mech_name = "LOGIN", .flags = SASL_MECH_SEC_PLAINTEXT, - .passdb_need = MECH_PASSDB_NEED_VERIFY_PLAIN, + .passdb_need = SASL_MECH_PASSDB_NEED_VERIFY_PLAIN, .auth_new = mech_login_auth_new, .auth_initial = mech_login_auth_initial, diff --git a/src/auth/sasl-server-mech-otp.c b/src/auth/sasl-server-mech-otp.c index 92214d408c..330a0cf586 100644 --- a/src/auth/sasl-server-mech-otp.c +++ b/src/auth/sasl-server-mech-otp.c @@ -321,7 +321,7 @@ const struct mech_module mech_otp = { .flags = SASL_MECH_SEC_DICTIONARY | SASL_MECH_SEC_ACTIVE | SASL_MECH_SEC_ALLOW_NULS, - .passdb_need = MECH_PASSDB_NEED_SET_CREDENTIALS, + .passdb_need = SASL_MECH_PASSDB_NEED_SET_CREDENTIALS, .auth_new = mech_otp_auth_new, .auth_initial = sasl_server_mech_generic_auth_initial, diff --git a/src/auth/sasl-server-mech-plain.c b/src/auth/sasl-server-mech-plain.c index 9b5740b3fc..098fc1d7e7 100644 --- a/src/auth/sasl-server-mech-plain.c +++ b/src/auth/sasl-server-mech-plain.c @@ -79,7 +79,7 @@ const struct mech_module mech_plain = { .mech_name = "PLAIN", .flags = SASL_MECH_SEC_PLAINTEXT | SASL_MECH_SEC_ALLOW_NULS, - .passdb_need = MECH_PASSDB_NEED_VERIFY_PLAIN, + .passdb_need = SASL_MECH_PASSDB_NEED_VERIFY_PLAIN, .auth_new = mech_plain_auth_new, .auth_initial = sasl_server_mech_generic_auth_initial, diff --git a/src/auth/sasl-server-mech-scram.c b/src/auth/sasl-server-mech-scram.c index 3c71f4d839..4f00e2b7b5 100644 --- a/src/auth/sasl-server-mech-scram.c +++ b/src/auth/sasl-server-mech-scram.c @@ -228,7 +228,7 @@ const struct mech_module mech_scram_sha1 = { .mech_name = "SCRAM-SHA-1", .flags = SASL_MECH_SEC_MUTUAL_AUTH, - .passdb_need = MECH_PASSDB_NEED_LOOKUP_CREDENTIALS, + .passdb_need = SASL_MECH_PASSDB_NEED_LOOKUP_CREDENTIALS, .auth_new = mech_scram_sha1_auth_new, .auth_initial = sasl_server_mech_generic_auth_initial, @@ -240,7 +240,7 @@ const struct mech_module mech_scram_sha1_plus = { .mech_name = "SCRAM-SHA-1-PLUS", .flags = SASL_MECH_SEC_MUTUAL_AUTH | SASL_MECH_SEC_CHANNEL_BINDING, - .passdb_need = MECH_PASSDB_NEED_LOOKUP_CREDENTIALS, + .passdb_need = SASL_MECH_PASSDB_NEED_LOOKUP_CREDENTIALS, .auth_new = mech_scram_sha1_auth_new, .auth_initial = sasl_server_mech_generic_auth_initial, @@ -252,7 +252,7 @@ const struct mech_module mech_scram_sha256 = { .mech_name = "SCRAM-SHA-256", .flags = SASL_MECH_SEC_MUTUAL_AUTH, - .passdb_need = MECH_PASSDB_NEED_LOOKUP_CREDENTIALS, + .passdb_need = SASL_MECH_PASSDB_NEED_LOOKUP_CREDENTIALS, .auth_new = mech_scram_sha256_auth_new, .auth_initial = sasl_server_mech_generic_auth_initial, @@ -264,7 +264,7 @@ const struct mech_module mech_scram_sha256_plus = { .mech_name = "SCRAM-SHA-256-PLUS", .flags = SASL_MECH_SEC_MUTUAL_AUTH | SASL_MECH_SEC_CHANNEL_BINDING, - .passdb_need = MECH_PASSDB_NEED_LOOKUP_CREDENTIALS, + .passdb_need = SASL_MECH_PASSDB_NEED_LOOKUP_CREDENTIALS, .auth_new = mech_scram_sha256_auth_new, .auth_initial = sasl_server_mech_generic_auth_initial, diff --git a/src/auth/sasl-server-mech-winbind.c b/src/auth/sasl-server-mech-winbind.c index 86e96c101d..11da7abcc6 100644 --- a/src/auth/sasl-server-mech-winbind.c +++ b/src/auth/sasl-server-mech-winbind.c @@ -343,7 +343,7 @@ const struct mech_module mech_winbind_ntlm = { .flags = SASL_MECH_SEC_DICTIONARY | SASL_MECH_SEC_ACTIVE | SASL_MECH_SEC_ALLOW_NULS, - .passdb_need = MECH_PASSDB_NEED_NOTHING, + .passdb_need = SASL_MECH_PASSDB_NEED_NOTHING, .auth_new = mech_winbind_ntlm_auth_new, .auth_initial = mech_winbind_auth_initial, @@ -355,7 +355,7 @@ const struct mech_module mech_winbind_spnego = { .mech_name = "GSS-SPNEGO", .flags = SASL_MECH_SEC_ALLOW_NULS, - .passdb_need = MECH_PASSDB_NEED_NOTHING, + .passdb_need = SASL_MECH_PASSDB_NEED_NOTHING, .auth_new = mech_winbind_spnego_auth_new, .auth_initial = mech_winbind_auth_initial, diff --git a/src/auth/sasl-server-protected.h b/src/auth/sasl-server-protected.h index b7d8f74105..c8dd77b8e6 100644 --- a/src/auth/sasl-server-protected.h +++ b/src/auth/sasl-server-protected.h @@ -12,7 +12,7 @@ struct mech_module { const char *mech_name; enum sasl_mech_security_flags flags; - enum mech_passdb_need passdb_need; + enum sasl_mech_passdb_need passdb_need; struct auth_request *(*auth_new)(void); void (*auth_initial)(struct auth_request *request, diff --git a/src/auth/sasl-server.h b/src/auth/sasl-server.h index 3ace2c29a0..839d707791 100644 --- a/src/auth/sasl-server.h +++ b/src/auth/sasl-server.h @@ -17,19 +17,19 @@ enum sasl_passdb_result_status { SASL_PASSDB_RESULT_OK = PASSDB_RESULT_OK, }; -enum mech_passdb_need { +enum sasl_mech_passdb_need { /* Mechanism doesn't need a passdb at all */ - MECH_PASSDB_NEED_NOTHING = 0, + SASL_MECH_PASSDB_NEED_NOTHING = 0, /* Mechanism just needs to verify a given plaintext password */ - MECH_PASSDB_NEED_VERIFY_PLAIN, + SASL_MECH_PASSDB_NEED_VERIFY_PLAIN, /* Mechanism needs to verify a given challenge+response combination, i.e. there is only a single response from client. (Currently implemented the same as _LOOKUP_CREDENTIALS) */ - MECH_PASSDB_NEED_VERIFY_RESPONSE, + SASL_MECH_PASSDB_NEED_VERIFY_RESPONSE, /* Mechanism needs to look up credentials with appropriate scheme */ - MECH_PASSDB_NEED_LOOKUP_CREDENTIALS, + SASL_MECH_PASSDB_NEED_LOOKUP_CREDENTIALS, /* Mechanism needs to look up credentials and also modify them */ - MECH_PASSDB_NEED_SET_CREDENTIALS + SASL_MECH_PASSDB_NEED_SET_CREDENTIALS, }; enum sasl_server_output_status {