projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rework includes a bit
[apps/madmutt.git]
/
mutt_sasl.c
diff --git
a/mutt_sasl.c
b/mutt_sasl.c
index
5bc1b70
..
d904164
100644
(file)
--- a/
mutt_sasl.c
+++ b/
mutt_sasl.c
@@
-13,22
+13,20
@@
# include "config.h"
#endif
# include "config.h"
#endif
-#include <lib-lib/mem.h>
-
-#include "mutt.h"
-#include "account.h"
-#include "mutt_sasl.h"
-#include "mutt_socket.h"
-
-#include "lib/debug.h"
-
#include <errno.h>
#include <netdb.h>
#include <sasl/sasl.h>
#include <errno.h>
#include <netdb.h>
#include <sasl/sasl.h>
-
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <netinet/in.h>
+#include <lib-lib/mem.h>
+#include <lib-lib/debug.h>
+
+#include "mutt.h"
+#include "account.h"
+#include "mutt_sasl.h"
+#include <lib-sys/mutt_socket.h>
+
static int getnameinfo_err (int ret)
{
int err;
static int getnameinfo_err (int ret)
{
int err;
@@
-93,9
+91,9
@@
static int mutt_sasl_cb_pass (sasl_conn_t * conn, void *context, int id,
/* socket wrappers for a SASL security layer */
static int mutt_sasl_conn_open (CONNECTION * conn);
static int mutt_sasl_conn_close (CONNECTION * conn);
/* socket wrappers for a SASL security layer */
static int mutt_sasl_conn_open (CONNECTION * conn);
static int mutt_sasl_conn_close (CONNECTION * conn);
-static int mutt_sasl_conn_read (CONNECTION * conn, char *buf, size_t len);
+static int mutt_sasl_conn_read (CONNECTION * conn, char *buf, s
s
ize_t len);
static int mutt_sasl_conn_write (CONNECTION * conn, const char *buf,
static int mutt_sasl_conn_write (CONNECTION * conn, const char *buf,
- size_t count);
+ s
s
ize_t count);
/* utility function, stolen from sasl2 sample code */
static int iptostring (const struct sockaddr *addr, socklen_t addrlen,
/* utility function, stolen from sasl2 sample code */
static int iptostring (const struct sockaddr *addr, socklen_t addrlen,
@@
-116,7
+114,7
@@
static int iptostring (const struct sockaddr *addr, socklen_t addrlen,
if (ret)
return getnameinfo_err (ret);
if (ret)
return getnameinfo_err (ret);
- if (outlen <
str_len (hbuf) + str_len
(pbuf) + 2)
+ if (outlen <
m_strlen(hbuf) + m_strlen
(pbuf) + 2)
return SASL_BUFOVER;
snprintf (out, outlen, "%s;%s", hbuf, pbuf);
return SASL_BUFOVER;
snprintf (out, outlen, "%s;%s", hbuf, pbuf);
@@
-257,7
+255,7
@@
int mutt_sasl_client_new (CONNECTION * conn, sasl_conn_t ** saslconn)
* just fall back to LOGIN in the IMAP case anyway. If that doesn't
* work for POP, we can make it a flag or move this code into
* imap/auth_sasl.c */
* just fall back to LOGIN in the IMAP case anyway. If that doesn't
* work for POP, we can make it a flag or move this code into
* imap/auth_sasl.c */
-
memset (&secprops, 0, sizeof (secprops)
);
+
p_clear(&secprops, 1
);
/* Work around a casting bug in the SASL krb4 module */
secprops.max_ssf = 0x7fff;
secprops.maxbufsize = M_SASL_MAXBUF;
/* Work around a casting bug in the SASL krb4 module */
secprops.max_ssf = 0x7fff;
secprops.maxbufsize = M_SASL_MAXBUF;
@@
-331,7
+329,7
@@
int mutt_sasl_interact (sasl_interact_t * interaction)
if (mutt_get_field (prompt, resp, sizeof (resp), 0))
return SASL_FAIL;
if (mutt_get_field (prompt, resp, sizeof (resp), 0))
return SASL_FAIL;
- interaction->len =
str_len
(resp) + 1;
+ interaction->len =
m_strlen
(resp) + 1;
interaction->result = p_dupstr(resp, interaction->len - 1);
interaction++;
}
interaction->result = p_dupstr(resp, interaction->len - 1);
interaction++;
}
@@
-429,7
+427,7
@@
static int mutt_sasl_cb_authname (void *context, int id, const char **result,
}
if (len)
}
if (len)
- *len =
str_len
(*result);
+ *len =
m_strlen
(*result);
return SASL_OK;
}
return SASL_OK;
}
@@
-449,7
+447,7
@@
static int mutt_sasl_cb_pass (sasl_conn_t * conn, void *context, int id,
if (mutt_account_getpass (account))
return SASL_FAIL;
if (mutt_account_getpass (account))
return SASL_FAIL;
- len =
str_len
(account->pass);
+ len =
m_strlen
(account->pass);
*psecret = xmalloc(sizeof(sasl_secret_t) + len);
(*psecret)->len = len;
*psecret = xmalloc(sizeof(sasl_secret_t) + len);
(*psecret)->len = len;
@@
-502,7
+500,7
@@
static int mutt_sasl_conn_close (CONNECTION * conn)
return rc;
}
return rc;
}
-static int mutt_sasl_conn_read (CONNECTION * conn, char *buf, size_t len)
+static int mutt_sasl_conn_read (CONNECTION * conn, char *buf, s
s
ize_t len)
{
SASL_DATA *sasldata;
int rc;
{
SASL_DATA *sasldata;
int rc;
@@
-564,7
+562,7
@@
out:
}
static int mutt_sasl_conn_write (CONNECTION * conn, const char *buf,
}
static int mutt_sasl_conn_write (CONNECTION * conn, const char *buf,
- size_t len)
+ s
s
ize_t len)
{
SASL_DATA *sasldata;
int rc;
{
SASL_DATA *sasldata;
int rc;