- if(n < config->allow.n) {
- res = authhash(c->nonce, sizeof c->nonce, config->allow.s[n].s[1]);
- if(res && !strcmp(res, vec[1])) {
- c->who = vec[0];
- /* currently we only bother logging remote connections */
- if(c->l->pf != PF_UNIX)
- info("S%x %s connected from %s", c->tag, vec[0], host);
- sink_writes(ev_writer_sink(c->w), "230 OK\n");
- return 1;
- }
+ if(n >= config->allow.n) {
+ info("S%x unknown user '%s' from %s", c->tag, vec[0], host);
+ sink_writes(ev_writer_sink(c->w), "530 authentication failed\n");
+ return 1;
+ }
+ res = authhash(c->nonce, sizeof c->nonce, config->allow.s[n].s[1],
+ config->authorization_algorithm);
+ if(wideopen || (res && !strcmp(res, vec[1]))) {
+ c->who = vec[0];
+ /* currently we only bother logging remote connections */
+ if(c->l->pf != PF_UNIX)
+ info("S%x %s connected from %s", c->tag, vec[0], host);
+ sink_writes(ev_writer_sink(c->w), "230 OK\n");
+ return 1;