#include "str-sanitize.h"
#include "randgen.h"
#include "master-service.h"
-#include "sasl-server-protected.h" // FIXME: remove
#include "auth-sasl.h"
#include "auth-request-handler.h"
#include "auth-client-interface.h"
return;
if (conn->token_auth) {
- mechanisms = t_strconcat("MECH\t",
- mech_dovecot_token.name, "\tprivate\n", NULL);
+ mechanisms = "MECH\t"
+ AUTH_SASL_MECH_NAME_DOVECOT_TOKEN "\tprivate\n";
} else {
mechanisms = auth_sasl_mechs_get_handshake();
if (conn->conn.minor_version >= AUTH_CLIENT_MINOR_VERSION_CHANNEL_BINDING)
#include "auth-common.h"
#include "safe-memset.h"
#include "sasl-server-protected.h"
+#include "auth-sasl.h"
#include "auth-token.h"
static void
};
const struct sasl_server_mech_def mech_dovecot_token = {
- .name = "DOVECOT-TOKEN",
+ .name = AUTH_SASL_MECH_NAME_DOVECOT_TOKEN,
.flags = SASL_MECH_SEC_PRIVATE | SASL_MECH_SEC_ALLOW_NULS,
.passdb_need = SASL_MECH_PASSDB_NEED_NOTHING,
struct auth *auth = auth_default_protocol();
const struct sasl_server_mech *mech;
- if (strcmp(mech_name, "DOVECOT-TOKEN") == 0)
+ if (strcmp(mech_name, AUTH_SASL_MECH_NAME_DOVECOT_TOKEN) == 0)
mech = auth->sasl_mech_dovecot_token;
else
mech = sasl_server_mech_find(auth->sasl_inst, mech_name);
base64_encode(str_data(auth_data),
str_len(auth_data), init_resp);
- (void)client_auth_begin_private(client, "DOVECOT-TOKEN",
- str_c(init_resp));
+ (void)client_auth_begin_private(client,
+ AUTH_SASL_MECH_NAME_DOVECOT_TOKEN, str_c(init_resp));
} T_END;
}
#include "sasl-common.h"
#define AUTH_SASL_MECH_NAME_APOP "APOP"
+#define AUTH_SASL_MECH_NAME_DOVECOT_TOKEN "DOVECOT-TOKEN"
#endif