X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/5abe307a2878e3e523cfd76fa3343cf904c9297f..c00fce3ab1dc8b810a439e81e419d7b8ae1d97b9:/server/server.c diff --git a/server/server.c b/server/server.c index 1d3e682..6ee11c9 100644 --- a/server/server.c +++ b/server/server.c @@ -391,7 +391,8 @@ static int c_user(struct conn *c, 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]); + 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 */ @@ -762,6 +763,9 @@ static int c_log(struct conn *c, if(playing) sink_printf(ev_writer_sink(c->w), "%"PRIxMAX" state playing\n", (uintmax_t)now); + /* Initial volume */ + sink_printf(ev_writer_sink(c->w), "%"PRIxMAX" volume %d %d\n", + (uintmax_t)now, volume_left, volume_right); c->lo = xmalloc(sizeof *c->lo); c->lo->fn = logclient; c->lo->user = c; @@ -1081,7 +1085,15 @@ static int listen_callback(ev_source *ev, c->reader = reader_callback; c->l = l; gcry_randomize(c->nonce, sizeof c->nonce, GCRY_STRONG_RANDOM); - sink_printf(ev_writer_sink(c->w), "231 %s\n", hex(c->nonce, sizeof c->nonce)); + if(!strcmp(config->authorization_algorithm, "sha1") + || !strcmp(config->authorization_algorithm, "SHA1")) { + sink_printf(ev_writer_sink(c->w), "231 %s\n", + hex(c->nonce, sizeof c->nonce)); + } else { + sink_printf(ev_writer_sink(c->w), "231 %s %s\n", + config->authorization_algorithm, + hex(c->nonce, sizeof c->nonce)); + } return 0; }