Rocco Rutte:
[apps/madmutt.git] / mutt_sasl.c
index de8b9de..017d691 100644 (file)
@@ -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,10 +288,6 @@ 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)
   if (conn->ssf) {
 #ifdef USE_SASL2                /* I'm not sure this actually has an effect, at least with SASLv2 */
@@ -367,7 +363,7 @@ 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 ((char*) interaction->result, resp, interaction->len);
 
@@ -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,7 +487,7 @@ 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;