From ccc83cda812cc37b4b82cb935de34730f72e773c Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 20 Oct 1998 07:17:52 +0000 Subject: Cosmetic fix. svn path=/trunk/; revision=2123 --- imap.c | 86 +++++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) (limited to 'imap.c') diff --git a/imap.c b/imap.c index 9441854f..8dbe59a7 100644 --- a/imap.c +++ b/imap.c @@ -123,63 +123,63 @@ int imap_ok(int sock, char *argbuf) #if OPIE static int do_otp(int sock, struct query *ctl) { - int i, rval; - char buffer[128]; - char challenge[OPIE_CHALLENGE_MAX+1]; - char response[OPIE_RESPONSE_MAX+1]; + int i, rval; + char buffer[128]; + char challenge[OPIE_CHALLENGE_MAX+1]; + char response[OPIE_RESPONSE_MAX+1]; - gen_send(sock, "AUTHENTICATE X-OTP"); + gen_send(sock, "AUTHENTICATE X-OTP"); - if (rval = gen_recv(sock, buffer, sizeof(buffer))) - return rval; + if (rval = gen_recv(sock, buffer, sizeof(buffer))) + return rval; - if ((i = from64tobits(challenge, buffer)) < 0) { - error(0, -1, "Could not decode initial BASE64 challenge"); - return PS_AUTHFAIL; - }; + if ((i = from64tobits(challenge, buffer)) < 0) { + error(0, -1, "Could not decode initial BASE64 challenge"); + return PS_AUTHFAIL; + }; - to64frombits(buffer, ctl->remotename, strlen(ctl->remotename)); + to64frombits(buffer, ctl->remotename, strlen(ctl->remotename)); - if (outlevel >= O_MONITOR) - error(0, 0, "IMAP> %s", buffer); - SockWrite(sock, buffer, strlen(buffer)); - SockWrite(sock, "\r\n", 2); + if (outlevel >= O_MONITOR) + error(0, 0, "IMAP> %s", buffer); + SockWrite(sock, buffer, strlen(buffer)); + SockWrite(sock, "\r\n", 2); - if (rval = gen_recv(sock, buffer, sizeof(buffer))) - return rval; + if (rval = gen_recv(sock, buffer, sizeof(buffer))) + return rval; - if ((i = from64tobits(challenge, buffer)) < 0) { - error(0, -1, "Could not decode OTP challenge"); - return PS_AUTHFAIL; - }; + if ((i = from64tobits(challenge, buffer)) < 0) { + error(0, -1, "Could not decode OTP challenge"); + return PS_AUTHFAIL; + }; - rval = opiegenerator(challenge, !strcmp(ctl->password, "opie") ? "" : ctl->password, response); - if ((rval == -2) && !run.poll_interval) { - char secret[OPIE_SECRET_MAX+1]; - fprintf(stderr, "Secret pass phrase: "); - if (opiereadpass(secret, sizeof(secret), 0)) - rval = opiegenerator(challenge, secret, response); - memset(secret, 0, sizeof(secret)); - }; + rval = opiegenerator(challenge, !strcmp(ctl->password, "opie") ? "" : ctl->password, response); + if ((rval == -2) && !run.poll_interval) { + char secret[OPIE_SECRET_MAX+1]; + fprintf(stderr, "Secret pass phrase: "); + if (opiereadpass(secret, sizeof(secret), 0)) + rval = opiegenerator(challenge, secret, response); + memset(secret, 0, sizeof(secret)); + }; - if (rval) - return PS_AUTHFAIL; + if (rval) + return PS_AUTHFAIL; - to64frombits(buffer, response, strlen(response)); + to64frombits(buffer, response, strlen(response)); - if (outlevel >= O_MONITOR) - error(0, 0, "IMAP> %s", buffer); - SockWrite(sock, buffer, strlen(buffer)); - SockWrite(sock, "\r\n", 2); + if (outlevel >= O_MONITOR) + error(0, 0, "IMAP> %s", buffer); + SockWrite(sock, buffer, strlen(buffer)); + SockWrite(sock, "\r\n", 2); - if (rval = gen_recv(sock, buffer, sizeof(buffer))) - return rval; + if (rval = gen_recv(sock, buffer, sizeof(buffer))) + return rval; - if (strstr(buffer, "OK")) - return PS_SUCCESS; - else - return PS_AUTHFAIL; + if (strstr(buffer, "OK")) + return PS_SUCCESS; + else + return PS_AUTHFAIL; }; #endif /* OPIE */ -- cgit v1.2.3