projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rework some things with sasl.
[apps/madmutt.git]
/
pop
/
pop_auth.c
diff --git
a/pop/pop_auth.c
b/pop/pop_auth.c
index
2743910
..
976317c
100644
(file)
--- a/
pop/pop_auth.c
+++ b/
pop/pop_auth.c
@@
-10,18
+10,15
@@
#include <lib-lib/lib-lib.h>
#include <lib-hash/hash.h>
#include <lib-lib/lib-lib.h>
#include <lib-hash/hash.h>
+#include <lib-mx/mx.h>
#include "mutt.h"
#include "mutt.h"
-#include "mx.h"
#include "pop.h"
#include "pop.h"
-#ifdef USE_SASL
#include <sasl/sasl.h>
#include <sasl/saslutil.h>
#include "mutt_sasl.h"
#include <sasl/sasl.h>
#include <sasl/saslutil.h>
#include "mutt_sasl.h"
-#endif
-#ifdef USE_SASL
/* SASL authenticator */
static pop_auth_res_t pop_auth_sasl (POP_DATA * pop_data, const char *method)
{
/* SASL authenticator */
static pop_auth_res_t pop_auth_sasl (POP_DATA * pop_data, const char *method)
{
@@
-32,9
+29,7
@@
static pop_auth_res_t pop_auth_sasl (POP_DATA * pop_data, const char *method)
char inbuf[LONG_STRING];
const char *mech;
char inbuf[LONG_STRING];
const char *mech;
-#ifdef USE_SASL
const char *pc = NULL;
const char *pc = NULL;
-#endif
unsigned int len, olen;
unsigned char client_start;
unsigned int len, olen;
unsigned char client_start;
@@
-46,10
+41,8
@@
static pop_auth_res_t pop_auth_sasl (POP_DATA * pop_data, const char *method)
method = pop_data->auth_list;
for (;;) {
method = pop_data->auth_list;
for (;;) {
-#ifdef USE_SASL
- rc =
- sasl_client_start (saslconn, method, &interaction, &pc, &olen, &mech);
-#endif
+ rc = sasl_client_start (saslconn, method, &interaction, &pc, &olen,
+ &mech);
if (rc != SASL_INTERACT)
break;
mutt_sasl_interact (interaction);
if (rc != SASL_INTERACT)
break;
mutt_sasl_interact (interaction);
@@
-80,11
+73,9
@@
static pop_auth_res_t pop_auth_sasl (POP_DATA * pop_data, const char *method)
if (rc != SASL_CONTINUE)
break;
if (rc != SASL_CONTINUE)
break;
-#ifdef USE_SASL
if (!m_strncmp(inbuf, "+ ", 2)
&& sasl_decode64 (inbuf, strlen (inbuf), buf, LONG_STRING - 1,
&len) != SASL_OK)
if (!m_strncmp(inbuf, "+ ", 2)
&& sasl_decode64 (inbuf, strlen (inbuf), buf, LONG_STRING - 1,
&len) != SASL_OK)
-#endif
{
goto bail;
}
{
goto bail;
}
@@
-110,9
+101,7
@@
static pop_auth_res_t pop_auth_sasl (POP_DATA * pop_data, const char *method)
/* 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 */
-#ifndef USE_SASL
- p_delete(&pc);
-#endif
+ p_delete((char **)&pc);
}
}
}
}
@@
-140,7
+129,6
@@
bail:
return POP_A_FAILURE;
}
return POP_A_FAILURE;
}
-#endif
/* Get the server timestamp for APOP authentication */
void pop_apop_timestamp (POP_DATA * pop_data, char *buf)
/* Get the server timestamp for APOP authentication */
void pop_apop_timestamp (POP_DATA * pop_data, char *buf)
@@
-232,7
+220,7
@@
static pop_auth_res_t pop_auth_user (POP_DATA * pop_data,
if (ret == PQ_OK) {
snprintf (buf, sizeof (buf), "PASS %s\r\n", pop_data->conn->account.pass);
if (ret == PQ_OK) {
snprintf (buf, sizeof (buf), "PASS %s\r\n", pop_data->conn->account.pass);
- ret = pop_query
_d (pop_data, buf, sizeof (buf), NULL
);
+ ret = pop_query
(pop_data, buf, sizeof (buf)
);
}
switch (ret) {
}
switch (ret) {
@@
-253,9
+241,7
@@
static pop_auth_res_t pop_auth_user (POP_DATA * pop_data,
}
static pop_auth_t pop_authenticators[] = {
}
static pop_auth_t pop_authenticators[] = {
-#ifdef USE_SASL
{pop_auth_sasl, NULL},
{pop_auth_sasl, NULL},
-#endif
{pop_auth_apop, "apop"},
{pop_auth_user, "user"},
{NULL, NULL}
{pop_auth_apop, "apop"},
{pop_auth_user, "user"},
{NULL, NULL}