diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2004-01-07 11:10:17 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2004-01-07 11:10:17 +0000 |
commit | d95e11bf7e5a59b5c3f81bd8dfc2918ee7d3bada (patch) | |
tree | d7e09b6d73cb37aa875779151439b14df7273b87 /crypto/openssh/auth-chall.c | |
parent | dcf5581978ae9708715473af978f587c1ad7caf7 (diff) | |
download | src-d95e11bf7e5a59b5c3f81bd8dfc2918ee7d3bada.tar.gz src-d95e11bf7e5a59b5c3f81bd8dfc2918ee7d3bada.zip |
Vendor import of OpenSSH 3.7.1p2.
Notes
Notes:
svn path=/vendor-crypto/openssh/dist/; revision=124208
Diffstat (limited to 'crypto/openssh/auth-chall.c')
-rw-r--r-- | crypto/openssh/auth-chall.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/crypto/openssh/auth-chall.c b/crypto/openssh/auth-chall.c index 45e0c34522b1..00d6e0ec5a76 100644 --- a/crypto/openssh/auth-chall.c +++ b/crypto/openssh/auth-chall.c @@ -76,7 +76,33 @@ verify_response(Authctxt *authctxt, const char *response) return 0; resp[0] = (char *)response; res = device->respond(authctxt->kbdintctxt, 1, resp); + if (res == 1) { + /* postponed - send a null query just in case */ + char *name, *info, **prompts; + u_int i, numprompts, *echo_on; + + res = device->query(authctxt->kbdintctxt, &name, &info, + &numprompts, &prompts, &echo_on); + if (res == 0) { + for (i = 0; i < numprompts; i++) + xfree(prompts[i]); + xfree(prompts); + xfree(name); + xfree(echo_on); + xfree(info); + } + /* if we received more prompts, we're screwed */ + res = (res == 0 && numprompts == 0) ? 0 : -1; + } device->free_ctx(authctxt->kbdintctxt); authctxt->kbdintctxt = NULL; return res ? 0 : 1; } +void +abandon_challenge_response(Authctxt *authctxt) +{ + if (authctxt->kbdintctxt != NULL) { + device->free_ctx(authctxt->kbdintctxt); + authctxt->kbdintctxt = NULL; + } +} |