/[imapfilter]/imapfilter/auth.c
ViewVC logotype

Diff of /imapfilter/auth.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by lefcha, Sat Jul 26 19:40:16 2003 UTC revision 1.2 by lefcha, Sun Jul 27 17:39:45 2003 UTC
# Line 14  Line 14 
14   * "CRAM-MD5".   * "CRAM-MD5".
15   */   */
16  int  int
17  imf_cram_md5(int *sock, char *user, char *pass)  imf_cram_md5(conn_t * conn, char *user, char *pass)
18  {  {
19          int i, n;          int i, n;
20          unsigned int t;          unsigned int t;
# Line 23  imf_cram_md5(int *sock, char *user, char Line 23  imf_cram_md5(int *sock, char *user, char
23          unsigned int mdlen;          unsigned int mdlen;
24          HMAC_CTX hmac;          HMAC_CTX hmac;
25    
26          t = imap_authenticate(sock, "CRAM-MD5", 0);          t = imap_authenticate(conn, "CRAM-MD5", 0);
27    
28          if (authenticate_response(sock, t, &chal) == RESPONSE_NONE) {          if (authenticate_response(conn, t, &chal) == RESPONSE_NONE) {
29                  n = strlen(chal) * 3 / 4 + 1;                  n = strlen(chal) * 3 / 4 + 1;
30                  resp = (char *)xmalloc(n);                  resp = (char *)xmalloc(n);
31                  memset(resp, 0, n);                  memset(resp, 0, n);
# Line 57  imf_cram_md5(int *sock, char *user, char Line 57  imf_cram_md5(int *sock, char *user, char
57    
58                  EVP_EncodeBlock(out, buf, strlen(buf));                  EVP_EncodeBlock(out, buf, strlen(buf));
59    
60                  imap_authenticate(sock, out, 1);                  imap_authenticate(conn, out, 1);
61    
62                  xfree(buf);                  xfree(buf);
63                  xfree(out);                  xfree(out);
64          }          }
65          return authenticate_response(sock, t, NULL);          return authenticate_response(conn, t, NULL);
66  }  }
67    
68  #endif                          /* CRAM_MD5 */  #endif                          /* CRAM_MD5 */

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26