Enlightenment CVS committal

Author  : englebass
Project : e_modules
Module  : mail

Dir     : e_modules/mail


Modified Files:
        e_mod_config_box.c imap2.c 


Log Message:
Support SSLv3

===================================================================
RCS file: /cvs/e/e_modules/mail/e_mod_config_box.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -3 -r1.24 -r1.25
--- e_mod_config_box.c  8 Jan 2008 20:02:14 -0000       1.24
+++ e_mod_config_box.c  8 Jan 2008 21:14:01 -0000       1.25
@@ -1,3 +1,6 @@
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
 #include <e.h>
 #include "e_mod_main.h"
 #include "mbox.h"
@@ -10,6 +13,7 @@
   char *port;
   int monitor;
   int ssl;
+  int ssl_version;
   int local;
   char *host;
   char *user;
@@ -27,6 +31,8 @@
   Evas_Object *cur_path_label;
   Evas_Object *cur_path_entry;
   Evas_Object *monitor_check;
+  Evas_Object *sslv2;
+  Evas_Object *sslv3;
 };
 
 static void *_create_data (E_Config_Dialog * cfd);
@@ -75,6 +81,7 @@
       cfdata->type = 0;
       cfdata->monitor = 1;
       cfdata->ssl = 0;
+      cfdata->ssl_version = 2;
       cfdata->use_exec = 0;
       cfdata->local = 0;
       snprintf (buf, sizeof (buf), "110");
@@ -87,7 +94,17 @@
 
   cfdata->type = cb->type;
   cfdata->monitor = cb->monitor;
-  cfdata->ssl = cb->ssl;
+  if (cb->ssl)
+    {
+      cfdata->ssl = 1;
+      cfdata->ssl_version = cb->ssl;
+    }
+  else
+    {
+      cfdata->ssl = 0;
+      cfdata->ssl_version = 2;
+    }
+  E_CONFIG_LIMIT(cfdata->ssl_version, 2, 3);
   cfdata->use_exec = cb->use_exec;
   cfdata->local = cb->local;
    
@@ -202,16 +219,24 @@
   e_widget_on_change_hook_set (ob, _type_cb_change, cfdata);
   e_widget_frametable_object_append (of, ob, 1, 0, 1, 1, 0, 0, 1, 0);
 
+  rg = e_widget_radio_group_new (&(cfdata->ssl_version));
+  cfdata->sslv2 = e_widget_radio_add (evas, D_("v2"), 2, rg);
+  if (!cfdata->ssl) e_widget_disabled_set(cfdata->sslv2, 1);
+  e_widget_frametable_object_append (of, cfdata->sslv2, 2, 0, 1, 1, 0, 0, 1, 
0);
+  cfdata->sslv3 = e_widget_radio_add (evas, D_("v3"), 3, rg);
+  if (!cfdata->ssl) e_widget_disabled_set(cfdata->sslv3, 1);
+  e_widget_frametable_object_append (of, cfdata->sslv3, 3, 0, 1, 1, 0, 0, 1, 
0);
+
   ob = e_widget_label_add (evas, D_("Port:"));
   e_widget_frametable_object_append (of, ob, 0, 1, 1, 1, 0, 0, 1, 0);
   ob = e_widget_entry_add (evas, &cfdata->port, NULL, NULL, NULL);
   cfdata->port_entry = ob;
-  e_widget_frametable_object_append (of, ob, 1, 1, 1, 1, 0, 0, 1, 0);
+  e_widget_frametable_object_append (of, ob, 1, 1, 3, 1, 0, 0, 1, 0);
 
   ob = e_widget_label_add (evas, D_("Local:"));
   e_widget_frametable_object_append (of, ob, 0, 2, 1, 1, 0, 0, 1, 0);
   ob = e_widget_check_add (evas, "", &(cfdata->local));
-  e_widget_frametable_object_append (of, ob, 1, 2, 1, 1, 0, 0, 1, 0);   
+  e_widget_frametable_object_append (of, ob, 1, 2, 3, 1, 0, 0, 1, 0);   
    e_widget_list_object_append (o, of, 1, 1, 0.5);
    
   of = e_widget_frametable_add (evas, D_("Mailbox Settings"), 1);
@@ -295,7 +320,10 @@
   cb->type = cfdata->type;
   cb->port = atoi (cfdata->port);
   cb->monitor = cfdata->monitor;
-  cb->ssl = cfdata->ssl;
+  if (cfdata->ssl)
+    cb->ssl = cfdata->ssl_version;
+  else
+    cb->ssl = 0;
   cb->local = cfdata->local;
    
   cb->use_exec = cfdata->use_exec;
@@ -433,6 +461,17 @@
     {
       e_widget_check_checked_set (cfdata->monitor_check, 0);
       e_widget_disabled_set (cfdata->monitor_check, 1);
+    }
+
+  if (cfdata->ssl)
+    {
+      e_widget_disabled_set (cfdata->sslv2, 0);
+      e_widget_disabled_set (cfdata->sslv3, 0);
+    }
+  else
+    {
+      e_widget_disabled_set (cfdata->sslv2, 1);
+      e_widget_disabled_set (cfdata->sslv3, 1);
     }
 }
 
===================================================================
RCS file: /cvs/e/e_modules/mail/imap2.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- imap2.c     4 Jan 2008 08:31:21 -0000       1.14
+++ imap2.c     8 Jan 2008 21:14:01 -0000       1.15
@@ -58,8 +58,17 @@
 
             if (ecore_con_ssl_available_get () && (ic->config->ssl))
               {
-                 type |= ECORE_CON_USE_SSL;
                  D ("Use SSL for %s:%s\n", ic->config->host, 
ic->config->new_path);
+                 switch (ic->config->ssl)
+                   {
+                    case 3:
+                       type |= ECORE_CON_USE_SSL3;
+                       break;
+                    case 2:
+                    default:
+                       type |= ECORE_CON_USE_SSL;
+                       break;
+                   }
               }
             ic->state = IMAP_STATE_DISCONNECTED;
             ic->server =
@@ -114,6 +123,9 @@
    if (!ic)
      return;
    iclients = evas_list_remove (iclients, ic);
+   _mail_imap_client_logout (ic);
+   E_FREE (ic);
+
    if (!iclients)
      {
        if (add_handler)
@@ -126,8 +138,6 @@
          ecore_event_handler_del (data_handler);
        data_handler = NULL;
      }
-   _mail_imap_client_logout (ic);
-   E_FREE (ic);
 }
 
 void
@@ -329,6 +339,7 @@
             /* parse data */
             if (!_mail_imap_server_data_parse (ic, p))
               {
+                 printf ("Imap Failure: Couldn't parse data\n");
                  _mail_imap_client_logout (ic);
                  return 0;
               }



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to