version 1.120, 2012/12/11 22:16:21 |
version 1.121, 2013/03/07 00:19:59 |
|
|
monitor_valid_userblob(u_char *data, u_int datalen) |
monitor_valid_userblob(u_char *data, u_int datalen) |
{ |
{ |
Buffer b; |
Buffer b; |
char *p; |
char *p, *userstyle; |
u_int len; |
u_int len; |
int fail = 0; |
int fail = 0; |
|
|
|
|
} |
} |
if (buffer_get_char(&b) != SSH2_MSG_USERAUTH_REQUEST) |
if (buffer_get_char(&b) != SSH2_MSG_USERAUTH_REQUEST) |
fail++; |
fail++; |
p = buffer_get_string(&b, NULL); |
p = buffer_get_cstring(&b, NULL); |
if (strcmp(authctxt->user, p) != 0) { |
xasprintf(&userstyle, "%s%s%s", authctxt->user, |
|
authctxt->style ? ":" : "", |
|
authctxt->style ? authctxt->style : ""); |
|
if (strcmp(userstyle, p) != 0) { |
logit("wrong user name passed to monitor: expected %s != %.100s", |
logit("wrong user name passed to monitor: expected %s != %.100s", |
authctxt->user, p); |
userstyle, p); |
fail++; |
fail++; |
} |
} |
|
xfree(userstyle); |
xfree(p); |
xfree(p); |
buffer_skip_string(&b); |
buffer_skip_string(&b); |
if (datafellows & SSH_BUG_PKAUTH) { |
if (datafellows & SSH_BUG_PKAUTH) { |
if (!buffer_get_char(&b)) |
if (!buffer_get_char(&b)) |
fail++; |
fail++; |
} else { |
} else { |
p = buffer_get_string(&b, NULL); |
p = buffer_get_cstring(&b, NULL); |
if (strcmp("publickey", p) != 0) |
if (strcmp("publickey", p) != 0) |
fail++; |
fail++; |
xfree(p); |
xfree(p); |
|
|
char *chost) |
char *chost) |
{ |
{ |
Buffer b; |
Buffer b; |
char *p; |
char *p, *userstyle; |
u_int len; |
u_int len; |
int fail = 0; |
int fail = 0; |
|
|
|
|
|
|
if (buffer_get_char(&b) != SSH2_MSG_USERAUTH_REQUEST) |
if (buffer_get_char(&b) != SSH2_MSG_USERAUTH_REQUEST) |
fail++; |
fail++; |
p = buffer_get_string(&b, NULL); |
p = buffer_get_cstring(&b, NULL); |
if (strcmp(authctxt->user, p) != 0) { |
xasprintf(&userstyle, "%s%s%s", authctxt->user, |
|
authctxt->style ? ":" : "", |
|
authctxt->style ? authctxt->style : ""); |
|
if (strcmp(userstyle, p) != 0) { |
logit("wrong user name passed to monitor: expected %s != %.100s", |
logit("wrong user name passed to monitor: expected %s != %.100s", |
authctxt->user, p); |
userstyle, p); |
fail++; |
fail++; |
} |
} |
|
free(userstyle); |
xfree(p); |
xfree(p); |
buffer_skip_string(&b); /* service */ |
buffer_skip_string(&b); /* service */ |
p = buffer_get_string(&b, NULL); |
p = buffer_get_cstring(&b, NULL); |
if (strcmp(p, "hostbased") != 0) |
if (strcmp(p, "hostbased") != 0) |
fail++; |
fail++; |
xfree(p); |
xfree(p); |