summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b85f52d)
- fix SASL 1.x removal
git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@484
e385b8ad-14ed-0310-8656-
cc95a2468c6d
MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_sasl.o"
MUTTLIBS="$MUTTLIBS -lsasl2"
LIBS="$saved_LIBS"
MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_sasl.o"
MUTTLIBS="$MUTTLIBS -lsasl2"
LIBS="$saved_LIBS"
[ Define if want to use version 2 of the Cyrus SASL library. ])
need_sasl=yes
fi
[ Define if want to use version 2 of the Cyrus SASL library. ])
need_sasl=yes
fi
#include "lib/intl.h"
#include "lib/debug.h"
#include "lib/intl.h"
#include "lib/debug.h"
#include <sasl/sasl.h>
#include <sasl/saslutil.h>
#include <sasl/sasl.h>
#include <sasl/saslutil.h>
/* imap_auth_sasl: Default authenticator if available. */
imap_auth_res_t imap_auth_sasl (IMAP_DATA * idata, const char *method)
/* imap_auth_sasl: Default authenticator if available. */
imap_auth_res_t imap_auth_sasl (IMAP_DATA * idata, const char *method)
char buf[HUGE_STRING];
const char *mech;
char buf[HUGE_STRING];
const char *mech;
unsigned int len, olen;
unsigned char client_start;
unsigned int len, olen;
unsigned char client_start;
if (mutt_bit_isset (idata->capabilities, AUTH_ANON) &&
(!idata->conn->account.user[0] ||
!ascii_strncmp (idata->conn->account.user, "anonymous", 9)))
if (mutt_bit_isset (idata->capabilities, AUTH_ANON) &&
(!idata->conn->account.user[0] ||
!ascii_strncmp (idata->conn->account.user, "anonymous", 9)))
rc = sasl_client_start (saslconn, "AUTH=ANONYMOUS", NULL, &pc, &olen,
&mech);
rc = sasl_client_start (saslconn, "AUTH=ANONYMOUS", NULL, &pc, &olen,
&mech);
}
if (rc != SASL_OK && rc != SASL_CONTINUE)
do {
}
if (rc != SASL_OK && rc != SASL_CONTINUE)
do {
rc = sasl_client_start (saslconn, method, &interaction,
&pc, &olen, &mech);
rc = sasl_client_start (saslconn, method, &interaction,
&pc, &olen, &mech);
if (rc == SASL_INTERACT)
mutt_sasl_interact (interaction);
}
if (rc == SASL_INTERACT)
mutt_sasl_interact (interaction);
}
goto bail;
if (irc == IMAP_CMD_RESPOND) {
goto bail;
if (irc == IMAP_CMD_RESPOND) {
if (sasl_decode64
(idata->cmd.buf + 2, str_len (idata->cmd.buf + 2), buf,
LONG_STRING - 1,
if (sasl_decode64
(idata->cmd.buf + 2, str_len (idata->cmd.buf + 2), buf,
LONG_STRING - 1,
&len) != SASL_OK) {
debug_print (1, ("error base64-decoding server response.\n"));
goto bail;
&len) != SASL_OK) {
debug_print (1, ("error base64-decoding server response.\n"));
goto bail;
/* sasl_client_st(art|ep) allocate pc with malloc, expect me to
* free it */
/* sasl_client_st(art|ep) allocate pc with malloc, expect me to
* free it */
}
if (irc == IMAP_CMD_RESPOND) {
}
if (irc == IMAP_CMD_RESPOND) {
/* arbitrary. SASL will probably use a smaller buffer anyway. OTOH it's
* been a while since I've had access to an SASL server which negotiated
/* arbitrary. SASL will probably use a smaller buffer anyway. OTOH it's
* been a while since I've had access to an SASL server which negotiated
/* mutt_sasl_start: called before doing a SASL exchange - initialises library
* (if necessary). */
/* mutt_sasl_start: called before doing a SASL exchange - initialises library
* (if necessary). */
#ifndef _MUTT_SASL_H_
#define _MUTT_SASL_H_ 1
#ifndef _MUTT_SASL_H_
#define _MUTT_SASL_H_ 1