~ari-tczew/ubuntu/dapper/fetchmail/fix-CVE-2008-2711

« back to all changes in this revision

Viewing changes to opie.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2006-02-07 12:12:13 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060207121213-onurwfrzdlzlzxnt
Tags: 6.3.2-2ubuntu1
* Resynchronise with Debian. This brings the new upstream version to dapper
  since upstream support for 6.2 was dropped.
* Drop debian/patches/CVE-2005-4348.dpatch, upstream now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#include  "i18n.h"
18
18
#include "md5.h"
19
19
 
20
 
#if OPIE_ENABLE
 
20
#ifdef OPIE_ENABLE
21
21
#include <opie.h>
22
22
 
23
23
int do_otp(int sock, char *command, struct query *ctl)
24
24
{
25
25
    int i, rval;
26
 
    int result;
27
26
    char buffer[128];
28
27
    char challenge[OPIE_CHALLENGE_MAX+1+8];
29
28
    char response[OPIE_RESPONSE_MAX+1];
30
29
 
31
30
    gen_send(sock, "%s X-OTP", command);
32
31
 
33
 
    if (rval = gen_recv(sock, buffer, sizeof(buffer)))
 
32
    if ((rval = gen_recv(sock, buffer, sizeof(buffer))))
34
33
        return rval;
35
34
 
36
35
        if (strncmp(buffer, "+", 1)) {
43
42
    gen_send(sock, buffer, sizeof(buffer));
44
43
        suppress_tags = FALSE;
45
44
 
46
 
    if (rval = gen_recv(sock, buffer, sizeof(buffer)))
 
45
    if ((rval = gen_recv(sock, buffer, sizeof(buffer))))
47
46
        return rval;
48
47
 
49
48
        memset(challenge, '\0', sizeof(challenge));
70
69
    gen_send(sock, buffer, strlen(buffer));
71
70
    suppress_tags = FALSE;
72
71
 
73
 
    if (rval = gen_recv(sock, buffer, sizeof(buffer)))
 
72
    if ((rval = gen_recv(sock, buffer, sizeof(buffer))))
74
73
        return rval;
75
74
 
76
 
    if (result)
77
 
        return PS_SUCCESS;
78
 
    else
79
 
        return PS_AUTHFAIL;
 
75
    return PS_SUCCESS;
80
76
};
81
77
#endif /* OPIE_ENABLE */
82
78