X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=mutt_sasl.c;h=017d6913adab1848c04ef75b0db15ca4bd35e1df;hp=5c661c7f3bf430cb8f77d7bb0b2c9f2c35b86047;hb=a8477ebaa09990b3688164cbe5cf661c4189541d;hpb=96d53ff49c308769efbf708e1e65819077cb7af6 diff --git a/mutt_sasl.c b/mutt_sasl.c index 5c661c7..017d691 100644 --- a/mutt_sasl.c +++ b/mutt_sasl.c @@ -123,7 +123,7 @@ static int iptostring (const struct sockaddr *addr, socklen_t addrlen, if (ret) return getnameinfo_err (ret); - if (outlen < mutt_strlen (hbuf) + mutt_strlen (pbuf) + 2) + if (outlen < str_len (hbuf) + str_len (pbuf) + 2) return SASL_BUFOVER; snprintf (out, outlen, "%s;%s", hbuf, pbuf); @@ -243,8 +243,8 @@ int mutt_sasl_client_new (CONNECTION * conn, sasl_conn_t ** saslconn) /*** set sasl IP properties, necessary for use with krb4 ***/ /* Do we need to fail if this fails? I would assume having these unset - * would just disable KRB4. Who wrote this code? I'm not sure how this - * interacts with the NSS code either, since that mucks with the fd. */ + * would just disable KRB4. Who wrote this code? + */ #ifndef USE_SASL2 /* with SASLv2 this all happens in sasl_client_new */ { struct sockaddr_in local, remote; @@ -288,12 +288,8 @@ int mutt_sasl_client_new (CONNECTION * conn, sasl_conn_t ** saslconn) return -1; } - /* we currently don't have an SSF finder for NSS (I don't know the API). - * If someone does it'd probably be trivial to write mutt_nss_get_ssf(). - * I have a feeling more SSL code could be shared between those two files, - * but I haven't looked into it yet, since I still don't know the APIs. */ -#if (defined(USE_SSL) || defined(USE_GNUTLS) && !defined(USE_NSS)) - if (conn->account.flags & M_ACCT_SSL) { +#if defined(USE_SSL) || defined(USE_GNUTLS) + if (conn->ssf) { #ifdef USE_SASL2 /* I'm not sure this actually has an effect, at least with SASLv2 */ debug_print (2, ("External SSF: %d\n", conn->ssf)); if (sasl_setprop (*saslconn, SASL_SSF_EXTERNAL, &(conn->ssf)) != SASL_OK) @@ -367,9 +363,9 @@ int mutt_sasl_interact (sasl_interact_t * interaction) if (mutt_get_field (prompt, resp, sizeof (resp), 0)) return SASL_FAIL; - interaction->len = mutt_strlen (resp) + 1; + interaction->len = str_len (resp) + 1; interaction->result = safe_malloc (interaction->len); - memcpy (interaction->result, resp, interaction->len); + memcpy ((char*) interaction->result, resp, interaction->len); interaction++; } @@ -471,7 +467,7 @@ static int mutt_sasl_cb_authname (void *context, int id, const char **result, } if (len) - *len = mutt_strlen (*result); + *len = str_len (*result); return SASL_OK; } @@ -491,11 +487,11 @@ static int mutt_sasl_cb_pass (sasl_conn_t * conn, void *context, int id, if (mutt_account_getpass (account)) return SASL_FAIL; - len = mutt_strlen (account->pass); + len = str_len (account->pass); *psecret = (sasl_secret_t *) safe_malloc (sizeof (sasl_secret_t) + len); (*psecret)->len = len; - strcpy ((*psecret)->data, account->pass); /* __STRCPY_CHECKED__ */ + strcpy ((char*) (*psecret)->data, account->pass); /* __STRCPY_CHECKED__ */ return SASL_OK; }