summaryrefslogtreecommitdiff
path: root/frontends/gtk
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2020-02-23 16:06:52 +0000
committerVincent Sanders <vince@kyllikki.org>2020-02-23 16:23:50 +0000
commit0c34d06494afe217ace7460c66df800d457dd2e8 (patch)
tree17cc135e3513e7235421502e2e58a2f44ff1a137 /frontends/gtk
parent214478fc15a2b9ee67e19e08cf27657c0157037a (diff)
downloadnetsurf-0c34d06494afe217ace7460c66df800d457dd2e8.tar.gz
netsurf-0c34d06494afe217ace7460c66df800d457dd2e8.tar.bz2
Keep the complete certificate chain from a fetch
Instead of extracting information from the X509 certificate chain in the fetcher the entire chain is propagated in Distinguished Encoding Rules (DER) format. This allows all the information contained in a certificate chain to be retained which can subsequently be presented to the user
Diffstat (limited to 'frontends/gtk')
-rw-r--r--frontends/gtk/page_info.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/frontends/gtk/page_info.c b/frontends/gtk/page_info.c
index adc2dfa66..1401fdca9 100644
--- a/frontends/gtk/page_info.c
+++ b/frontends/gtk/page_info.c
@@ -52,6 +52,7 @@ struct nsgtk_crtvrfy_window {
struct sslcert_session_data *ssl_data;
};
+
/**
* destroy a previously created certificate view
*/
@@ -178,11 +179,14 @@ nserror nsgtk_page_info(struct browser_window *bw)
struct nsgtk_crtvrfy_window *ncwin;
nserror res;
- size_t num;
- struct ssl_cert_info *chain;
+ struct cert_chain *chain;
struct nsurl *url;
- browser_window_get_ssl_chain(bw, &num, &chain);
+ res = browser_window_get_ssl_chain(bw, &chain);
+ if (res != NSERROR_OK) {
+ NSLOG(netsurf, WARNING, "Unable to get certificate chain");
+ return NSERROR_INVALID;
+ }
url = browser_window_access_url(bw);
ncwin = malloc(sizeof(struct nsgtk_crtvrfy_window));
@@ -245,8 +249,8 @@ nserror nsgtk_page_info(struct browser_window *bw)
}
/* initialise certificate viewing interface */
- res = sslcert_viewer_create_session_data(num, url, dummy_cb, NULL, chain,
- &ncwin->ssl_data);
+ res = sslcert_viewer_create_session_data(
+ url, dummy_cb, NULL, chain, &ncwin->ssl_data);
if (res != NSERROR_OK) {
g_object_unref(G_OBJECT(ncwin->dlg));
free(ncwin);