Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/c50b19469e88148dc666eb8881bcdaa53f1b6c14
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/c50b19469e88148dc666eb8881bcdaa53f1b6c14
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/c50b19469e88148dc666eb8881bcdaa53f1b6c14

The branch, master has been updated
       via  c50b19469e88148dc666eb8881bcdaa53f1b6c14 (commit)
      from  09accc91e95dd19db95d59837a7b264dcb4ceef1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=c50b19469e88148dc666eb8881bcdaa53f1b6c14
commit c50b19469e88148dc666eb8881bcdaa53f1b6c14
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>

    Display errors properly in certificate window

diff --git a/content/fetchers/about.c b/content/fetchers/about.c
index 6eb882e..3b81473 100644
--- a/content/fetchers/about.c
+++ b/content/fetchers/about.c
@@ -1260,6 +1260,13 @@ format_certificate(struct fetch_about_context *ctx,
                return res;
        }
 
+       if (cert_info->err != SSL_CERT_ERR_OK) {
+               res = ssenddataf(ctx,
+                                "<div class=\"error\">\n"
+                                "<p><b>%s</b></p>\n",
+                                messages_get_sslcode(cert_info->err));
+       }
+
        res = ssenddataf(ctx,
                         "<table class=\"info\">\n"
                         "<tr><th>Issued To</th><td><hr></td></tr>\n");
@@ -1348,7 +1355,13 @@ format_certificate(struct fetch_about_context *ctx,
        }
 
        res = format_certificate_fingerprint(ctx, cert_info);
+       if (res != NSERROR_OK) {
+               return res;
+       }
 
+       if (cert_info->err != SSL_CERT_ERR_OK) {
+               res = ssenddataf(ctx, "</div>\n");
+       }
 
        return res;
 }
@@ -1416,6 +1429,12 @@ static bool fetch_about_certificate_handler(struct 
fetch_about_context *ctx)
 
                        }
 
+                       res = ssenddataf(ctx, "</ul>\n");
+                       if (res != NSERROR_OK) {
+                               free_ns_cert_info(cert_info);
+                               goto fetch_about_certificate_handler_aborted;
+                       }
+
                        for (depth = 0; depth < chain->depth; depth++) {
                                res = format_certificate(ctx, cert_info + depth,
                                                depth);
@@ -1427,11 +1446,6 @@ static bool fetch_about_certificate_handler(struct 
fetch_about_context *ctx)
                        }
                        free_ns_cert_info(cert_info);
 
-                       res = ssenddataf(ctx, "</ul>\n");
-                       if (res != NSERROR_OK) {
-                               free_ns_cert_info(cert_info);
-                               goto fetch_about_certificate_handler_aborted;
-                       }
                } else {
                        res = ssenddataf(ctx,
                                         "<p>Invalid certificate data</p>\n");
diff --git a/resources/internal.css b/resources/internal.css
index a6b666b..d6278ca 100644
--- a/resources/internal.css
+++ b/resources/internal.css
@@ -214,6 +214,10 @@ body#certificate table.info td.data {
        font-size: 90%;
 }
 
+body#certificate div.error {
+    background: #FFEAEA;
+}
+
 
 /* 
  * configuration listing style 


-----------------------------------------------------------------------

Summary of changes:
 content/fetchers/about.c |   24 +++++++++++++++++++-----
 resources/internal.css   |    4 ++++
 2 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/content/fetchers/about.c b/content/fetchers/about.c
index 6eb882e..3b81473 100644
--- a/content/fetchers/about.c
+++ b/content/fetchers/about.c
@@ -1260,6 +1260,13 @@ format_certificate(struct fetch_about_context *ctx,
                return res;
        }
 
+       if (cert_info->err != SSL_CERT_ERR_OK) {
+               res = ssenddataf(ctx,
+                                "<div class=\"error\">\n"
+                                "<p><b>%s</b></p>\n",
+                                messages_get_sslcode(cert_info->err));
+       }
+
        res = ssenddataf(ctx,
                         "<table class=\"info\">\n"
                         "<tr><th>Issued To</th><td><hr></td></tr>\n");
@@ -1348,7 +1355,13 @@ format_certificate(struct fetch_about_context *ctx,
        }
 
        res = format_certificate_fingerprint(ctx, cert_info);
+       if (res != NSERROR_OK) {
+               return res;
+       }
 
+       if (cert_info->err != SSL_CERT_ERR_OK) {
+               res = ssenddataf(ctx, "</div>\n");
+       }
 
        return res;
 }
@@ -1416,6 +1429,12 @@ static bool fetch_about_certificate_handler(struct 
fetch_about_context *ctx)
 
                        }
 
+                       res = ssenddataf(ctx, "</ul>\n");
+                       if (res != NSERROR_OK) {
+                               free_ns_cert_info(cert_info);
+                               goto fetch_about_certificate_handler_aborted;
+                       }
+
                        for (depth = 0; depth < chain->depth; depth++) {
                                res = format_certificate(ctx, cert_info + depth,
                                                depth);
@@ -1427,11 +1446,6 @@ static bool fetch_about_certificate_handler(struct 
fetch_about_context *ctx)
                        }
                        free_ns_cert_info(cert_info);
 
-                       res = ssenddataf(ctx, "</ul>\n");
-                       if (res != NSERROR_OK) {
-                               free_ns_cert_info(cert_info);
-                               goto fetch_about_certificate_handler_aborted;
-                       }
                } else {
                        res = ssenddataf(ctx,
                                         "<p>Invalid certificate data</p>\n");
diff --git a/resources/internal.css b/resources/internal.css
index a6b666b..d6278ca 100644
--- a/resources/internal.css
+++ b/resources/internal.css
@@ -214,6 +214,10 @@ body#certificate table.info td.data {
        font-size: 90%;
 }
 
+body#certificate div.error {
+    background: #FFEAEA;
+}
+
 
 /* 
  * configuration listing style 


-- 
NetSurf Browser
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to