chiark
/
gitweb
/
~mdw
/
disorder
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
60432d3
)
protocol gen 2 support for eclient.c
author
Richard Kettlewell
<rjk@greenend.org.uk>
Fri, 21 Dec 2007 16:02:28 +0000
(16:02 +0000)
committer
Richard Kettlewell
<rjk@greenend.org.uk>
Fri, 21 Dec 2007 16:02:28 +0000
(16:02 +0000)
lib/eclient.c
patch
|
blob
|
blame
|
history
diff --git
a/lib/eclient.c
b/lib/eclient.c
index 2d85fb92233696dcb3122f72e9d169670b3a9c3e..012db987d9a1599b97de73100c88925667b65fda 100644
(file)
--- a/
lib/eclient.c
+++ b/
lib/eclient.c
@@
-536,7
+536,7
@@
static void authbanner_opcallback(disorder_eclient *c,
const char *res;
char **rvec;
int nrvec;
const char *res;
char **rvec;
int nrvec;
- const char *
algo = "SHA1"
;
+ const char *
protocol, *algorithm, *challenge
;
D(("authbanner_opcallback"));
if(c->rc / 100 != 2
D(("authbanner_opcallback"));
if(c->rc / 100 != 2
@@
-547,15
+547,22
@@
static void authbanner_opcallback(disorder_eclient *c,
disorder_eclient_close(c);
return;
}
disorder_eclient_close(c);
return;
}
- if(nrvec > 1) {
- algo = *rvec++;
- --nrvec;
+ if(nrvec != 3) {
+ protocol_error(c, op, c->rc, "%s: %s", c->ident, c->line);
+ disorder_eclient_close(c);
+ }
+ protocol = *rvec++;
+ algorithm = *rvec++;
+ challenge = *rvec++;
+ if(strcmp(protocol, "2")) {
+ protocol_error(c, op, c->rc, "%s: %s", c->ident, c->line);
+ disorder_eclient_close(c);
}
}
- nonce = unhex(
rvec[0]
, &nonce_len);
- res = authhash(nonce, nonce_len, config->password, algo);
+ nonce = unhex(
challenge
, &nonce_len);
+ res = authhash(nonce, nonce_len, config->password, algo
rithm
);
if(!res) {
protocol_error(c, op, c->rc, "%s: unknown authentication algorithm '%s'",
if(!res) {
protocol_error(c, op, c->rc, "%s: unknown authentication algorithm '%s'",
- c->ident, algo);
+ c->ident, algo
rithm
);
disorder_eclient_close(c);
return;
}
disorder_eclient_close(c);
return;
}