NetSurf
|
Implementation of Amiga certificate viewing using core windows. More...
#include <stdint.h>
#include <stdlib.h>
#include <proto/intuition.h>
#include <classes/window.h>
#include <gadgets/button.h>
#include <gadgets/layout.h>
#include <gadgets/scroller.h>
#include <gadgets/space.h>
#include <images/label.h>
#include <intuition/icclass.h>
#include <reaction/reaction_macros.h>
#include "utils/log.h"
#include "netsurf/keypress.h"
#include "netsurf/plotters.h"
#include "desktop/sslcert_viewer.h"
#include "utils/messages.h"
#include "utils/nsoption.h"
#include "amiga/corewindow.h"
#include "amiga/libs.h"
#include "amiga/sslcert.h"
#include "amiga/utf8.h"
Go to the source code of this file.
Data Structures | |
struct | ami_crtvrfy_window |
Macros | |
#define | GID_SSLCERT_SIZE GID_SSLCERT_LAST - GID_CW_LAST |
Enumerations | |
enum | { GID_SSLCERT_ACCEPT = GID_CW_LAST, GID_SSLCERT_REJECT, GID_SSLCERT_LAST } |
Amiga certificate viewing window context. More... | |
Functions | |
static nserror | ami_crtvrfy_destroy (struct ami_crtvrfy_window *crtvrfy_win) |
destroy a previously created certificate view More... | |
static void | ami_crtvrfy_accept (struct ami_corewindow *ami_cw) |
static void | ami_crtvrfy_reject (struct ami_corewindow *ami_cw) |
static BOOL | ami_crtvrfy_event (struct ami_corewindow *ami_cw, ULONG result) |
callback for unknown events on Amiga core window eg. More... | |
static nserror | ami_crtvrfy_mouse (struct ami_corewindow *ami_cw, browser_mouse_state mouse_state, int x, int y) |
callback for mouse action for certificate verify on core window More... | |
static nserror | ami_crtvrfy_key (struct ami_corewindow *ami_cw, uint32_t nskey) |
callback for keypress for certificate verify on core window More... | |
static nserror | ami_crtvrfy_draw (struct ami_corewindow *ami_cw, int x, int y, struct rect *r, struct redraw_context *ctx) |
callback on draw event for certificate verify on core window More... | |
static nserror | ami_crtvrfy_create_window (struct ami_crtvrfy_window *crtvrfy_win) |
nserror | ami_cert_verify (struct nsurl *url, const struct cert_chain *chain, nserror(*cb)(bool proceed, void *pw), void *cbpw) |
Prompt the user to verify a certificate with issues. More... | |
Implementation of Amiga certificate viewing using core windows.
Definition in file sslcert.c.
#define GID_SSLCERT_SIZE GID_SSLCERT_LAST - GID_CW_LAST |
anonymous enum |
nserror ami_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 issues.
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 300 of file sslcert.c.
References ami_corewindow_init(), ami_crtvrfy_create_window(), ami_crtvrfy_draw(), ami_crtvrfy_event(), ami_crtvrfy_key(), ami_crtvrfy_mouse(), ami_crtvrfy_reject(), ami_utf8_easy(), ami_utf8_free(), ami_corewindow::cb_table, ami_corewindow::close, ami_crtvrfy_window::core, ami_corewindow::draw, ami_corewindow::event, GID_CW_WIN, ami_corewindow::key, messages_get(), ami_corewindow::mouse, NSERROR_NOMEM, NSERROR_OK, NSLOG, ami_corewindow::objects, ami_crtvrfy_window::ssl_data, ami_crtvrfy_window::sslaccept, sslcert_viewer_create_session_data(), sslcert_viewer_init(), ami_crtvrfy_window::sslerr, ami_crtvrfy_window::sslreject, and ami_corewindow::wintitle.
|
static |
Definition at line 97 of file sslcert.c.
References ami_crtvrfy_destroy(), ami_crtvrfy_window::ssl_data, and sslcert_viewer_accept().
Referenced by ami_crtvrfy_event().
|
static |
Definition at line 217 of file sslcert.c.
References ami_gui_get_screen(), ami_gui_get_screen_title(), ami_gui_get_shared_msgport(), ButtonObj, BVS_DISPLAY, ami_crtvrfy_window::core, GID_CW_DRAW, GID_CW_HSCROLL, GID_CW_HSCROLLLAYOUT, GID_CW_MAIN, GID_CW_VSCROLL, GID_CW_VSCROLLLAYOUT, GID_CW_WIN, GID_SSLCERT_ACCEPT, GID_SSLCERT_REJECT, IDCMP_EXTENDEDMOUSE, ami_corewindow::idcmp_hook, LabelObj, LayoutHObj, LayoutVObj, NSERROR_NOMEM, NSERROR_OK, nsoption_bool, ami_corewindow::objects, scrn, ScrollerObj, SpaceObj, WindowObj, and ami_corewindow::wintitle.
Referenced by ami_cert_verify().
|
static |
destroy a previously created certificate view
Definition at line 82 of file sslcert.c.
References ami_corewindow_fini(), ami_utf8_free(), ami_crtvrfy_window::core, NSERROR_OK, ami_crtvrfy_window::ssl_data, ami_crtvrfy_window::sslaccept, sslcert_viewer_fini(), ami_crtvrfy_window::sslerr, and ami_crtvrfy_window::sslreject.
Referenced by ami_crtvrfy_accept(), and ami_crtvrfy_reject().
|
static |
callback on draw event for certificate verify on core window
ami_cw | The Amiga core window structure. |
x | the x coordinate to draw |
y | the y coordinate to draw |
r | The rectangle of the window that needs updating. |
ctx | The drawing context |
Definition at line 204 of file sslcert.c.
References NSERROR_OK, ami_crtvrfy_window::ssl_data, and sslcert_viewer_redraw().
Referenced by ami_cert_verify().
|
static |
callback for unknown events on Amiga core window eg.
buttons in the ssl cert window (result & WMHI_CLASSMASK) gives the class of event (eg. WMHI_GADGETUP) (result & WMHI_GADGETMASK) gives the gadget ID (eg. GID_SSLCERT_ACCEPT)
ami_cw | The Amiga core window structure. |
result | event as returned by RA_HandleInput() |
Definition at line 131 of file sslcert.c.
References ami_crtvrfy_accept(), ami_crtvrfy_reject(), GID_SSLCERT_ACCEPT, and GID_SSLCERT_REJECT.
Referenced by ami_cert_verify().
|
static |
callback for keypress for certificate verify on core window
ami_cw | The Amiga core window structure. |
nskey | The netsurf key code |
Definition at line 180 of file sslcert.c.
References NSERROR_NOT_IMPLEMENTED, NSERROR_OK, ami_crtvrfy_window::ssl_data, and sslcert_viewer_keypress().
Referenced by ami_cert_verify().
|
static |
callback for mouse action for certificate verify on core window
ami_cw | The Amiga core window structure. |
mouse_state | netsurf mouse state on event |
x | location of event |
y | location of event |
Definition at line 159 of file sslcert.c.
References NSERROR_OK, ami_crtvrfy_window::ssl_data, and sslcert_viewer_mouse_action().
Referenced by ami_cert_verify().
|
static |
Definition at line 109 of file sslcert.c.
References ami_crtvrfy_destroy(), ami_crtvrfy_window::ssl_data, and sslcert_viewer_reject().
Referenced by ami_cert_verify(), and ami_crtvrfy_event().