!client->set->auth_allow_cleartext &&
(mech->flags & MECH_SEC_PLAINTEXT) != 0)
return FALSE;
+ /* Disable mechanisms that require channel binding when there is no TLS
+ layer (yet). */
+ if (client->ssl_iostream == NULL &&
+ (mech->flags & MECH_SEC_CHANNEL_BINDING) != 0)
+ return FALSE;
return TRUE;
}
return TRUE;
}
+static int
+sasl_server_channel_binding(const char *type, void *context,
+ const buffer_t **data_r, const char **error_r)
+{
+ struct client *client = context;
+
+ return ssl_iostream_get_channel_binding(client->ssl_iostream,
+ type, data_r, error_r);
+}
+
static void
sasl_server_auth_success_finish(struct client *client, bool nologin,
const char *data, const char *const *args)
client->auth_request =
auth_client_request_new(auth_client, &info,
authenticate_callback, client);
+ auth_client_request_enable_channel_binding(client->auth_request,
+ sasl_server_channel_binding,
+ client);
}
static void ATTR_NULL(2, 3)