mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-13 14:29:20 +03:00
Display certificate subject in list rather than issuer
svn path=/trunk/netsurf/; revision=2760
This commit is contained in:
parent
2ebc9d2c50
commit
dc612b767c
@ -49,8 +49,8 @@ static wimp_window *dialog_cert_template;
|
|||||||
static wimp_window *dialog_display_template;
|
static wimp_window *dialog_display_template;
|
||||||
|
|
||||||
struct session_data {
|
struct session_data {
|
||||||
struct session_cert *certs;
|
struct session_cert *certs;
|
||||||
unsigned long num;
|
unsigned long num;
|
||||||
struct browser_window *bw;
|
struct browser_window *bw;
|
||||||
char *url;
|
char *url;
|
||||||
struct tree *tree;
|
struct tree *tree;
|
||||||
@ -114,7 +114,7 @@ void gui_cert_verify(struct browser_window *bw, struct content *c,
|
|||||||
}
|
}
|
||||||
data->url = strdup(c->url);
|
data->url = strdup(c->url);
|
||||||
if (!data->url) {
|
if (!data->url) {
|
||||||
free(data);
|
free(data);
|
||||||
warn_user("NoMemory", 0);
|
warn_user("NoMemory", 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -122,28 +122,28 @@ void gui_cert_verify(struct browser_window *bw, struct content *c,
|
|||||||
data->num = num;
|
data->num = num;
|
||||||
data->certs = calloc(num, sizeof(struct session_cert));
|
data->certs = calloc(num, sizeof(struct session_cert));
|
||||||
if (!data->certs) {
|
if (!data->certs) {
|
||||||
free(data->url);
|
free(data->url);
|
||||||
free(data);
|
free(data);
|
||||||
warn_user("NoMemory", 0);
|
warn_user("NoMemory", 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (i = 0; i < (long)num; i++) {
|
for (i = 0; i < (long)num; i++) {
|
||||||
to = &data->certs[i];
|
to = &data->certs[i];
|
||||||
from = &certs[i];
|
from = &certs[i];
|
||||||
to->subject_t = strdup(from->subject);
|
to->subject_t = strdup(from->subject);
|
||||||
to->issuer_t = strdup(from->issuer);
|
to->issuer_t = strdup(from->issuer);
|
||||||
if ((!to->subject_t) || (!to->issuer_t)) {
|
if ((!to->subject_t) || (!to->issuer_t)) {
|
||||||
for (; i >= 0; i--) {
|
for (; i >= 0; i--) {
|
||||||
to = &data->certs[i];
|
to = &data->certs[i];
|
||||||
free(to->subject_t);
|
free(to->subject_t);
|
||||||
free(to->issuer_t);
|
free(to->issuer_t);
|
||||||
}
|
}
|
||||||
free(data->certs);
|
free(data->certs);
|
||||||
free(data->url);
|
free(data->url);
|
||||||
free(data);
|
free(data);
|
||||||
warn_user("NoMemory", 0);
|
warn_user("NoMemory", 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
snprintf(to->version, sizeof data->certs->version, "%ld",
|
snprintf(to->version, sizeof data->certs->version, "%ld",
|
||||||
from->version);
|
from->version);
|
||||||
snprintf(to->valid_from, sizeof data->certs->valid_from, "%s",
|
snprintf(to->valid_from, sizeof data->certs->valid_from, "%s",
|
||||||
@ -159,9 +159,9 @@ void gui_cert_verify(struct browser_window *bw, struct content *c,
|
|||||||
/* create the SSL window */
|
/* create the SSL window */
|
||||||
error = xwimp_create_window(dialog_cert_template, &ssl_w);
|
error = xwimp_create_window(dialog_cert_template, &ssl_w);
|
||||||
if (error) {
|
if (error) {
|
||||||
free(data->certs);
|
free(data->certs);
|
||||||
free(data->url);
|
free(data->url);
|
||||||
free(data);
|
free(data);
|
||||||
LOG(("xwimp_create_window: 0x%x: %s",
|
LOG(("xwimp_create_window: 0x%x: %s",
|
||||||
error->errnum, error->errmess));
|
error->errnum, error->errmess));
|
||||||
return;
|
return;
|
||||||
@ -176,20 +176,20 @@ void gui_cert_verify(struct browser_window *bw, struct content *c,
|
|||||||
/* create a tree window (styled as a list) */
|
/* create a tree window (styled as a list) */
|
||||||
error = xwimp_create_window(dialog_tree_template, &w);
|
error = xwimp_create_window(dialog_tree_template, &w);
|
||||||
if (error) {
|
if (error) {
|
||||||
ro_gui_cert_close(ssl_w);
|
ro_gui_cert_close(ssl_w);
|
||||||
LOG(("xwimp_create_window: 0x%x: %s",
|
LOG(("xwimp_create_window: 0x%x: %s",
|
||||||
error->errnum, error->errmess));
|
error->errnum, error->errmess));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tree = calloc(sizeof(struct tree), 1);
|
tree = calloc(sizeof(struct tree), 1);
|
||||||
if (!tree) {
|
if (!tree) {
|
||||||
ro_gui_cert_close(ssl_w);
|
ro_gui_cert_close(ssl_w);
|
||||||
warn_user("NoMemory", 0);
|
warn_user("NoMemory", 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tree->root = tree_create_folder_node(NULL, "Root");
|
tree->root = tree_create_folder_node(NULL, "Root");
|
||||||
if (!tree->root) {
|
if (!tree->root) {
|
||||||
ro_gui_cert_close(ssl_w);
|
ro_gui_cert_close(ssl_w);
|
||||||
warn_user("NoMemory", 0);
|
warn_user("NoMemory", 0);
|
||||||
free(tree);
|
free(tree);
|
||||||
tree = NULL;
|
tree = NULL;
|
||||||
@ -204,11 +204,11 @@ void gui_cert_verify(struct browser_window *bw, struct content *c,
|
|||||||
|
|
||||||
/* put the SSL names in the tree */
|
/* put the SSL names in the tree */
|
||||||
for (i = 0; i < (long)num; i++) {
|
for (i = 0; i < (long)num; i++) {
|
||||||
node = tree_create_leaf_node(tree->root, certs[i].issuer);
|
node = tree_create_leaf_node(tree->root, certs[i].subject);
|
||||||
if (node) {
|
if (node) {
|
||||||
node->data.data = TREE_ELEMENT_SSL;
|
node->data.data = TREE_ELEMENT_SSL;
|
||||||
tree_set_node_sprite(node, "small_xxx", "small_xxx");
|
tree_set_node_sprite(node, "small_xxx", "small_xxx");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* automated treeview event handling */
|
/* automated treeview event handling */
|
||||||
@ -223,7 +223,7 @@ void gui_cert_verify(struct browser_window *bw, struct content *c,
|
|||||||
state.w = ssl_w;
|
state.w = ssl_w;
|
||||||
error = xwimp_get_window_state(&state);
|
error = xwimp_get_window_state(&state);
|
||||||
if (error) {
|
if (error) {
|
||||||
ro_gui_cert_close(ssl_w);
|
ro_gui_cert_close(ssl_w);
|
||||||
LOG(("xwimp_get_window_state: 0x%x: %s",
|
LOG(("xwimp_get_window_state: 0x%x: %s",
|
||||||
error->errnum, error->errmess));
|
error->errnum, error->errmess));
|
||||||
return;
|
return;
|
||||||
@ -233,7 +233,7 @@ void gui_cert_verify(struct browser_window *bw, struct content *c,
|
|||||||
istate.i = ICON_SSL_PANE;
|
istate.i = ICON_SSL_PANE;
|
||||||
error = xwimp_get_icon_state(&istate);
|
error = xwimp_get_icon_state(&istate);
|
||||||
if (error) {
|
if (error) {
|
||||||
ro_gui_cert_close(ssl_w);
|
ro_gui_cert_close(ssl_w);
|
||||||
LOG(("xwimp_get_icon_state: 0x%x: %s",
|
LOG(("xwimp_get_icon_state: 0x%x: %s",
|
||||||
error->errnum, error->errmess));
|
error->errnum, error->errmess));
|
||||||
return;
|
return;
|
||||||
@ -254,7 +254,7 @@ void gui_cert_verify(struct browser_window *bw, struct content *c,
|
|||||||
wimp_CHILD_LINKS_PARENT_VISIBLE_BOTTOM_OR_LEFT
|
wimp_CHILD_LINKS_PARENT_VISIBLE_BOTTOM_OR_LEFT
|
||||||
<< wimp_CHILD_RS_EDGE_SHIFT);
|
<< wimp_CHILD_RS_EDGE_SHIFT);
|
||||||
if (error) {
|
if (error) {
|
||||||
ro_gui_cert_close(ssl_w);
|
ro_gui_cert_close(ssl_w);
|
||||||
LOG(("xwimp_open_window_nested: 0x%x: %s",
|
LOG(("xwimp_open_window_nested: 0x%x: %s",
|
||||||
error->errnum, error->errmess));
|
error->errnum, error->errmess));
|
||||||
return;
|
return;
|
||||||
@ -384,7 +384,7 @@ void ro_gui_cert_close(wimp_w w)
|
|||||||
free(data);
|
free(data);
|
||||||
|
|
||||||
if (data->tree) {
|
if (data->tree) {
|
||||||
tree_delete_node(data->tree, data->tree->root, false);
|
tree_delete_node(data->tree, data->tree->root, false);
|
||||||
xwimp_delete_window((wimp_w)data->tree->handle);
|
xwimp_delete_window((wimp_w)data->tree->handle);
|
||||||
free(data->tree);
|
free(data->tree);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user