changeset 1966:f2b37c93764b

merge in recent changes from main repo
author corvid <corvid@lavabit.com>
date Sat, 16 Apr 2011 14:11:16 +0000
parents 648b1506e9aa (current diff) 58c7f6c80d2f (diff)
children fa525b466aef
files dw/fltkimgbuf.cc dw/style.cc src/html.cc
diffstat 7 files changed, 43 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/dlib/Makefile.am	Fri Apr 15 18:16:05 2011 -0300
+++ b/dlib/Makefile.am	Sat Apr 16 14:11:16 2011 +0000
@@ -6,4 +6,3 @@
 libDlib_a_SOURCES = \
 	dlib.h \
 	dlib.c
-	      
--- a/dpi/https.c	Fri Apr 15 18:16:05 2011 -0300
+++ b/dpi/https.c	Sat Apr 16 14:11:16 2011 +0000
@@ -409,6 +409,9 @@
  * allow the user to decide what to do.  It may save the
  * certificate to the user's .dillo directory if it is
  * trusted.
+ *
+ * TODO: Rearrange this to get rid of redundancy.
+ *
  * Return value: -1 on abort, 0 or higher on continue
  */
 static int handle_certificate_problem(SSL * ssl_connection)
@@ -613,6 +616,40 @@
             "Continue", "Cancel");
          a_Dpip_dsh_write_str(sh, 1, d_cmd);
          dFree(d_cmd);
+         response_number = dialog_get_answer_number();
+         if (response_number == 1) {
+            ret = 0;
+         }
+         break;
+      case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN:
+         d_cmd = a_Dpip_build_cmd(
+            "cmd=%s msg=%s alt1=%s alt2=%s",
+            "dialog",
+            "Self signed certificate in certificate chain. The certificate "
+            "chain could be built up using the untrusted certificates but the "
+            "root could not be found locally.",
+            "Continue", "Cancel");
+         a_Dpip_dsh_write_str(sh, 1, d_cmd);
+         dFree(d_cmd);
+         response_number = dialog_get_answer_number();
+         if (response_number == 1) {
+            ret = 0;
+         }
+         break;
+      case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY:
+         d_cmd = a_Dpip_build_cmd(
+            "cmd=%s msg=%s alt1=%s alt2=%s",
+            "dialog",
+            "Unable to get local issuer certificate. The issuer certificate "
+            "of an untrusted certificate cannot be found.",
+            "Continue", "Cancel");
+         a_Dpip_dsh_write_str(sh, 1, d_cmd);
+         dFree(d_cmd);
+         response_number = dialog_get_answer_number();
+         if (response_number == 1) {
+            ret = 0;
+         }
+         break;
       default:             /*Need to add more options later*/
          snprintf(buf, 80,
                   "The remote certificate cannot be verified (code %ld)", st);
--- a/dw/fltkimgbuf.cc	Fri Apr 15 18:16:05 2011 -0300
+++ b/dw/fltkimgbuf.cc	Sat Apr 16 14:11:16 2011 +0000
@@ -190,7 +190,7 @@
     */
    if (width <= 0 || height <= 0 ||
        width > IMAGE_MAX_AREA / height) {
-      MSG("FltkImgbuf::getScaledBuf: suspicious image size request %dx%d\n",
+      MSG("FltkImgbuf::getScaledBuf: suspicious image size request %d x %d\n",
            width, height);
       ref ();
       return this;
--- a/src/gif.c	Fri Apr 15 18:16:05 2011 -0300
+++ b/src/gif.c	Sat Apr 16 14:11:16 2011 +0000
@@ -804,7 +804,7 @@
    /* check max image size */
    if (gif->Width <= 0 || gif->Height <= 0 ||
        gif->Width > IMAGE_MAX_AREA / gif->Height) {
-      MSG("Gif_do_img_desc: suspicious image size request %ux%u\n",
+      MSG("Gif_do_img_desc: suspicious image size request %u x %u\n",
           gif->Width, gif->Height);
       gif->state = 999;
       return 0;
--- a/src/html.cc	Fri Apr 15 18:16:05 2011 -0300
+++ b/src/html.cc	Sat Apr 16 14:11:16 2011 +0000
@@ -2044,7 +2044,7 @@
       dFree(width_ptr);
       dFree(height_ptr);
       width_ptr = height_ptr = NULL;
-      MSG("a_Html_image_new: suspicious image size request %dx%d\n", w, h);
+      MSG("a_Html_image_new: suspicious image size request %d x %d\n", w, h);
    } else {
       if (CSS_LENGTH_TYPE(l_w) != CSS_LENGTH_TYPE_AUTO)
          html->styleEngine->setNonCssHint (CSS_PROPERTY_WIDTH,
@@ -3720,11 +3720,8 @@
 static int Html_write_raw(DilloHtml *html, char *buf, int bufsize, int Eof)
 {
    char ch = 0, *p, *text;
-   Textblock *textblock;
    int token_start, buf_index;
 
-   dReturn_val_if_fail ((textblock = HT2TB(html)) != NULL, 0);
-
    /* Now, 'buf' and 'bufsize' define a buffer aligned to start at a token
     * boundary. Iterate through tokens until end of buffer is reached. */
    buf_index = 0;
@@ -3843,7 +3840,7 @@
       }
    }/*while*/
 
-   textblock->flush ();
+   HT2TB(html)->flush ();
 
    return token_start;
 }
--- a/src/jpeg.c	Fri Apr 15 18:16:05 2011 -0300
+++ b/src/jpeg.c	Sat Apr 16 14:11:16 2011 +0000
@@ -291,7 +291,7 @@
          if (jpeg->cinfo.image_width <= 0 || jpeg->cinfo.image_height <= 0 ||
              jpeg->cinfo.image_width >
              IMAGE_MAX_AREA / jpeg->cinfo.image_height) {
-            MSG("Jpeg_write: suspicious image size request %ux%u\n",
+            MSG("Jpeg_write: suspicious image size request %u x %u\n",
                 (uint_t)jpeg->cinfo.image_width,
                 (uint_t)jpeg->cinfo.image_height);
             jpeg->state = DILLO_JPEG_ERROR;
--- a/src/png.c	Fri Apr 15 18:16:05 2011 -0300
+++ b/src/png.c	Sat Apr 16 14:11:16 2011 +0000
@@ -137,7 +137,7 @@
    /* check max image size */
    if (png->width == 0 || png->height == 0 ||
        png->width > IMAGE_MAX_AREA / png->height) {
-      MSG("Png_datainfo_callback: suspicious image size request %lux%lu\n",
+      MSG("Png_datainfo_callback: suspicious image size request %lu x %lu\n",
           (ulong_t) png->width, (ulong_t) png->height);
       Png_error_handling(png_ptr, "Aborting...");
       return; /* not reached */