NetSurf
|
Implementation of RISC OS certificate verification UI. More...
#include <oslib/wimp.h>
#include "utils/log.h"
#include "utils/nsurl.h"
#include "netsurf/plotters.h"
#include "desktop/sslcert_viewer.h"
#include "riscos/dialog.h"
#include "riscos/wimp.h"
#include "riscos/wimp_event.h"
#include "riscos/wimputils.h"
#include "riscos/gui.h"
#include "riscos/toolbar.h"
#include "riscos/corewindow.h"
#include "riscos/sslcert.h"
Go to the source code of this file.
Data Structures | |
struct | ro_cert_window |
RISC OS certificate viewer context. More... | |
Macros | |
#define | ICON_SSL_PANE 1 |
#define | ICON_SSL_REJECT 3 |
#define | ICON_SSL_ACCEPT 4 |
Functions | |
static void | ro_gui_cert_release_window (struct ro_cert_window *certw) |
Handle closing of the RISC OS certificate verification dialog. More... | |
static void | ro_gui_cert_accept (wimp_pointer *pointer) |
Handle acceptance of certificate via event callback. More... | |
static void | ro_gui_cert_reject (wimp_pointer *pointer) |
Handle rejection of certificate via event callback. More... | |
static void | ro_gui_cert_close_window (wimp_w w) |
Callback to handle the closure of the SSL dialogue by other means. More... | |
static nserror | cert_attach_pane (wimp_w parent, wimp_w pane) |
Attach tree window as a pane to ssl window. More... | |
static nserror | cert_draw (struct ro_corewindow *ro_cw, int originx, int originy, struct rect *r) |
Callback to draw on drawable area of ro certificate viewer window. More... | |
static nserror | cert_key (struct ro_corewindow *ro_cw, uint32_t nskey) |
callback for keypress on ro certificate viewer window More... | |
static nserror | cert_mouse (struct ro_corewindow *ro_cw, browser_mouse_state mouse_state, int x, int y) |
callback for mouse event on ro certificate viewer window More... | |
nserror | gui_cert_verify (nsurl *url, const struct cert_chain *chain, nserror(*cb)(bool proceed, void *pw), void *cbpw) |
Prompt the user to verify a certificate with issuse. More... | |
void | ro_gui_cert_initialise (void) |
Load and initialise the certificate window template. More... | |
Variables | |
static wimp_window * | dialog_cert_template |
riscos dialog template for certificate viewer window. More... | |
static wimp_window * | cert_tree_template |
riscos template for certificate tree pane. More... | |
Implementation of RISC OS certificate verification UI.
Definition in file sslcert.c.
#define ICON_SSL_ACCEPT 4 |
Definition at line 44 of file sslcert.c.
Referenced by gui_cert_verify().
#define ICON_SSL_PANE 1 |
Definition at line 42 of file sslcert.c.
Referenced by cert_attach_pane().
#define ICON_SSL_REJECT 3 |
Definition at line 43 of file sslcert.c.
Referenced by gui_cert_verify().
|
static |
Attach tree window as a pane to ssl window.
Nest the tree window inside the pane window. To do this, we:
Definition at line 158 of file sslcert.c.
References ICON_SSL_PANE, NSERROR_INIT_FAILED, NSERROR_OK, NSLOG, parent, PTR_WIMP_OPEN, ro_get_hscroll_height(), and ro_get_vscroll_width().
Referenced by gui_cert_verify().
|
static |
Callback to draw on drawable area of ro certificate viewer window.
ro_cw | The riscos core window structure. |
originx | The risc os plotter x origin. |
originy | The risc os plotter y origin. |
r | The rectangle of the window that needs updating. |
Definition at line 248 of file sslcert.c.
References redraw_context::interactive, no_font_blending, NSERROR_OK, ro_plot_origin_x, ro_plot_origin_y, ro_plotters, ro_cert_window::ssl_data, and sslcert_viewer_redraw().
Referenced by gui_cert_verify().
|
static |
callback for keypress on ro certificate viewer window
ro_cw | The ro core window structure. |
nskey | The netsurf key code. |
Definition at line 278 of file sslcert.c.
References NSERROR_NOT_IMPLEMENTED, NSERROR_OK, ro_cert_window::ssl_data, and sslcert_viewer_keypress().
Referenced by gui_cert_verify().
|
static |
callback for mouse event on ro certificate viewer window
ro_cw | The ro core window structure. |
mouse_state | mouse state |
x | location of event |
y | location of event |
Definition at line 300 of file sslcert.c.
References NSERROR_OK, ro_cert_window::ssl_data, and sslcert_viewer_mouse_action().
Referenced by gui_cert_verify().
nserror gui_cert_verify | ( | struct nsurl * | url, |
const struct cert_chain * | chain, | ||
nserror(*)(bool proceed, void *pw) | cb, | ||
void * | cbpw | ||
) |
Prompt the user to verify a certificate with issuse.
url | The URL being verified. |
certs | The certificate to be verified |
num | The number of certificates to be verified. |
cb | Callback upon user decision. |
cbpw | Context pointer passed to cb |
Definition at line 314 of file sslcert.c.
References monkey_cert::cb, ro_corewindow::cb_table, monkey_cert::cbpw, cert_attach_pane(), cert_ctr, cert_draw(), cert_key(), cert_mouse(), cert_tree_template, ro_cert_window::core, dialog_cert_template, ro_corewindow::draw, ICON_SSL_ACCEPT, ICON_SSL_REJECT, ro_corewindow::key, ro_corewindow::mouse, MOUT_SSLCERT, moutf(), NSERROR_INIT_FAILED, NSERROR_NOMEM, NSERROR_OK, NSLOG, nsurl_access(), nsurl_ref(), monkey_cert::num, RING_INSERT, ro_corewindow_init(), ro_gui_cert_accept(), ro_gui_cert_close_window(), ro_gui_cert_reject(), ro_gui_cert_release_window(), ro_gui_dialog_open_persistent(), ro_gui_wimp_event_register_button(), ro_gui_wimp_event_register_close_window(), ro_gui_wimp_event_set_user_data(), ro_cert_window::ssl_data, sslcert_viewer_create_session_data(), sslcert_viewer_init(), monkey_cert::url, ro_corewindow::wh, and ro_cert_window::wh.
|
static |
Handle acceptance of certificate via event callback.
pointer | The wimp pointer event. |
Definition at line 104 of file sslcert.c.
References ro_gui_cert_release_window(), ro_gui_dialog_close(), ro_gui_wimp_event_get_user_data(), ro_cert_window::ssl_data, sslcert_viewer_accept(), and ro_cert_window::wh.
Referenced by gui_cert_verify().
|
static |
Callback to handle the closure of the SSL dialogue by other means.
w | The window handle being closed. |
Definition at line 136 of file sslcert.c.
References ro_gui_cert_release_window(), and ro_gui_wimp_event_get_user_data().
Referenced by gui_cert_verify().
void ro_gui_cert_initialise | ( | void | ) |
Load and initialise the certificate window template.
Definition at line 401 of file sslcert.c.
References cert_tree_template, dialog_cert_template, and ro_gui_dialog_load_template().
Referenced by ro_gui_dialog_init().
|
static |
Handle rejection of certificate via event callback.
pointer | The wimp pointer block. |
Definition at line 120 of file sslcert.c.
References ro_gui_cert_release_window(), ro_gui_dialog_close(), ro_gui_wimp_event_get_user_data(), ro_cert_window::ssl_data, sslcert_viewer_reject(), and ro_cert_window::wh.
Referenced by gui_cert_verify().
|
static |
Handle closing of the RISC OS certificate verification dialog.
Deleting wimp windows, freeing up the core window and ssl data block.
certw | The context associated with the dialogue. |
Definition at line 74 of file sslcert.c.
References ro_cert_window::core, NSLOG, ro_corewindow_fini(), ro_gui_wimp_event_finalise(), ro_cert_window::ssl_data, sslcert_viewer_fini(), ro_corewindow::wh, and ro_cert_window::wh.
Referenced by gui_cert_verify(), ro_gui_cert_accept(), ro_gui_cert_close_window(), and ro_gui_cert_reject().
|
static |
riscos template for certificate tree pane.
Definition at line 64 of file sslcert.c.
Referenced by gui_cert_verify(), and ro_gui_cert_initialise().
|
static |
riscos dialog template for certificate viewer window.
Definition at line 61 of file sslcert.c.
Referenced by gui_cert_verify(), and ro_gui_cert_initialise().