return 1; /* we have all the prompts */
}
+static inline int sasl_is_plus_mech(const char *mech)
+{
+ size_t len = strlen(mech);
+ const char *p;
+
+ if (len < 5)
+ return 0;
+
+ p = &mech[len - 5];
+
+ return (strcmp(p, "-PLUS") == 0);
+}
+
/* select a mechanism for a connection
* mechlist -- mechanisms server has available (punctuation ignored)
* secret -- optional secret from previous session
!(m->m.plug->features & SASL_FEAT_ALLOWS_PROXY)) {
break;
}
+
+ /* If client requires channel binding, prefer -PLUS mech */
+ if (c_conn->cparams->chanbindingscrit &&
+ !sasl_is_plus_mech(name)) {
+ break;
+ }
#ifdef PREFER_MECH
if (strcasecmp(m->m.plug->mech_name, PREFER_MECH) &&