version 1.21, 2004/06/01 14:20:45 |
version 1.21.2.2, 2005/09/02 03:44:59 |
|
|
kbdintctxt->devices = t[len] ? xstrdup(t+len+1) : NULL; |
kbdintctxt->devices = t[len] ? xstrdup(t+len+1) : NULL; |
xfree(t); |
xfree(t); |
debug2("kbdint_next_device: devices %s", kbdintctxt->devices ? |
debug2("kbdint_next_device: devices %s", kbdintctxt->devices ? |
kbdintctxt->devices : "<empty>"); |
kbdintctxt->devices : "<empty>"); |
} while (kbdintctxt->devices && !kbdintctxt->device); |
} while (kbdintctxt->devices && !kbdintctxt->device); |
|
|
return kbdintctxt->device ? 1 : 0; |
return kbdintctxt->device ? 1 : 0; |
|
|
{ |
{ |
KbdintAuthctxt *kbdintctxt; |
KbdintAuthctxt *kbdintctxt; |
char *name, *instr, **prompts; |
char *name, *instr, **prompts; |
int i; |
u_int i, *echo_on; |
u_int *echo_on; |
|
|
|
kbdintctxt = authctxt->kbdintctxt; |
kbdintctxt = authctxt->kbdintctxt; |
if (kbdintctxt->device->query(kbdintctxt->ctxt, |
if (kbdintctxt->device->query(kbdintctxt->ctxt, |
|
|
{ |
{ |
Authctxt *authctxt = ctxt; |
Authctxt *authctxt = ctxt; |
KbdintAuthctxt *kbdintctxt; |
KbdintAuthctxt *kbdintctxt; |
int i, authenticated = 0, res, len; |
int authenticated = 0, res, len; |
u_int nresp; |
u_int i, nresp; |
char **response = NULL, *method; |
char **response = NULL, *method; |
|
|
if (authctxt == NULL) |
if (authctxt == NULL) |
|
|
} |
} |
packet_check_eom(); |
packet_check_eom(); |
|
|
if (authctxt->valid) { |
res = kbdintctxt->device->respond(kbdintctxt->ctxt, nresp, response); |
res = kbdintctxt->device->respond(kbdintctxt->ctxt, |
|
nresp, response); |
|
} else { |
|
res = -1; |
|
} |
|
|
|
for (i = 0; i < nresp; i++) { |
for (i = 0; i < nresp; i++) { |
memset(response[i], 'r', strlen(response[i])); |
memset(response[i], 'r', strlen(response[i])); |
|
|
switch (res) { |
switch (res) { |
case 0: |
case 0: |
/* Success! */ |
/* Success! */ |
authenticated = 1; |
authenticated = authctxt->valid ? 1 : 0; |
break; |
break; |
case 1: |
case 1: |
/* Authentication needs further interaction */ |
/* Authentication needs further interaction */ |