nmh-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nmh-commits] CVS: nmh/mts/smtp smtp.c,1.14,1.15


From: Ken Hornstein <address@hidden>
Subject: [Nmh-commits] CVS: nmh/mts/smtp smtp.c,1.14,1.15
Date: Fri, 05 Sep 2003 17:07:52 -0400

Update of /cvsroot/nmh/nmh/mts/smtp
In directory subversions:/tmp/cvs-serv2428/mts/smtp

Modified Files:
        smtp.c 
Log Message:
Merge in changes from the 1.1 branch.


Index: smtp.c
===================================================================
RCS file: /cvsroot/nmh/nmh/mts/smtp/smtp.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** smtp.c      2 Jul 2002 22:09:14 -0000       1.14
--- smtp.c      5 Sep 2003 21:07:49 -0000       1.15
***************
*** 20,23 ****
--- 20,24 ----
  #ifdef CYRUS_SASL
  #include <sasl.h>
+ #include <saslutil.h>
  #include <sys/socket.h>
  #include <netinet/in.h>
***************
*** 1109,1118 ****
  sm_auth_sasl(char *user, char *mechlist, char *host)
  {
!     int result, status, outlen;
!     unsigned int buflen;
      char *buf, outbuf[BUFSIZ];
      const char *chosen_mech;
      sasl_security_properties_t secprops;
-     sasl_external_properties_t extprops;
      sasl_ssf_t *ssf;
      int *outbufmax;
--- 1110,1118 ----
  sm_auth_sasl(char *user, char *mechlist, char *host)
  {
!     int result, status;
!     unsigned int buflen, outlen;
      char *buf, outbuf[BUFSIZ];
      const char *chosen_mech;
      sasl_security_properties_t secprops;
      sasl_ssf_t *ssf;
      int *outbufmax;
***************
*** 1167,1171 ****
      }
  
!     result = sasl_client_new("smtp", host, NULL, SASL_SECURITY_LAYER, &conn);
  
      if (result != SASL_OK) {
--- 1167,1171 ----
      }
  
!     result = sasl_client_new("smtp", host, NULL, NULL, NULL, 0, &conn);
  
      if (result != SASL_OK) {
***************
*** 1182,1186 ****
      secprops.maxbufsize = BUFSIZ;
      secprops.max_ssf = 0;     /* XXX change this when we do encryption */
-     memset(&extprops, 0, sizeof(extprops));
  
      result = sasl_setprop(conn, SASL_SEC_PROPS, &secprops);
--- 1182,1185 ----
***************
*** 1192,1203 ****
      }
  
-     result = sasl_setprop(conn, SASL_SSF_EXTERNAL, &extprops);
- 
-     if (result != SASL_OK) {
-       sm_ierror("SASL external property initialization failed: %s",
-                 sasl_errstring(result, NULL, NULL));
-       return NOTOK;
-     }
- 
      /*
       * Start the actual protocol.  Feed the mech list into the library
--- 1191,1194 ----
***************
*** 1205,1210 ****
       */
  
!     result = sasl_client_start(conn, mechlist, NULL, NULL, &buf, &buflen,
!                              &chosen_mech);
  
      if (result != SASL_OK && result != SASL_CONTINUE) {
--- 1196,1201 ----
       */
  
!     result = sasl_client_start(conn, mechlist, NULL, (const char **) &buf,
!                              &buflen, (const char **) &chosen_mech);
  
      if (result != SASL_OK && result != SASL_CONTINUE) {
***************
*** 1221,1225 ****
      if (buflen) {
        status = sasl_encode64(buf, buflen, outbuf, sizeof(outbuf), NULL);
-       free(buf);
        if (status != SASL_OK) {
            sm_ierror("SASL base64 encode failed: %s",
--- 1212,1215 ----
***************
*** 1264,1268 ****
        } else {
            result = sasl_decode64(sm_reply.text, sm_reply.length,
!                                  outbuf, &outlen);
        
            if (result != SASL_OK) {
--- 1254,1258 ----
        } else {
            result = sasl_decode64(sm_reply.text, sm_reply.length,
!                                  outbuf, sizeof(outbuf), &outlen);
        
            if (result != SASL_OK) {
***************
*** 1274,1278 ****
        }
  
!       result = sasl_client_step(conn, outbuf, outlen, NULL, &buf, &buflen);
  
        if (result != SASL_OK && result != SASL_CONTINUE) {
--- 1264,1269 ----
        }
  
!       result = sasl_client_step(conn, outbuf, outlen, NULL,
!                                 (const char **) &buf, &buflen);
  
        if (result != SASL_OK && result != SASL_CONTINUE) {
***************
*** 1284,1288 ****
  
        status = sasl_encode64(buf, buflen, outbuf, sizeof(outbuf), NULL);
-       free(buf);
  
        if (status != SASL_OK) {
--- 1275,1278 ----
***************
*** 1304,1325 ****
  
      /*
-      * Depending on the mechanism, we need to do a FINAL call to
-      * sasl_client_step().  Do that now.
-      */
- 
-     result = sasl_client_step(conn, NULL, 0, NULL, &buf, &buflen);
- 
-     if (result != SASL_OK) {
-       sm_ierror("SASL final client negotiation failed: %s",
-                 sasl_errstring(result, NULL, NULL));
-       return NOTOK;
-     }
- 
-     /*
       * We _should_ have completed the authentication successfully.
       * Get a few properties from the authentication exchange.
       */
  
!     result = sasl_getprop(conn, SASL_MAXOUTBUF, (void **) &outbufmax);
  
      if (result != SASL_OK) {
--- 1294,1302 ----
  
      /*
       * We _should_ have completed the authentication successfully.
       * Get a few properties from the authentication exchange.
       */
  
!     result = sasl_getprop(conn, SASL_MAXOUTBUF, (const void **) &outbufmax);
  
      if (result != SASL_OK) {
***************
*** 1331,1335 ****
      maxoutbuf = *outbufmax;
  
!     result = sasl_getprop(conn, SASL_SSF, (void **) &ssf);
  
      sasl_ssf = *ssf;
--- 1308,1312 ----
      maxoutbuf = *outbufmax;
  
!     result = sasl_getprop(conn, SASL_SSF, (const void **) &ssf);
  
      sasl_ssf = *ssf;
***************
*** 1391,1395 ****
  
      (*psecret)->len = len;
!     strcpy((*psecret)->data, pass);
  /*    free(pass); */
  
--- 1368,1372 ----
  
      (*psecret)->len = len;
!     strcpy((char *) (*psecret)->data, pass);
  /*    free(pass); */
  





reply via email to

[Prev in Thread] Current Thread [Next in Thread]