NetSurf
|
Implementation of win32 certificate viewing using nsw32 core windows. More...
#include <stdint.h>
#include <stdlib.h>
#include <windows.h>
#include "utils/log.h"
#include "utils/nsoption.h"
#include "netsurf/keypress.h"
#include "netsurf/plotters.h"
#include "desktop/sslcert_viewer.h"
#include "windows/windbg.h"
#include "windows/plot.h"
#include "windows/corewindow.h"
#include "windows/gui.h"
#include "windows/resourceid.h"
#include "windows/ssl_cert.h"
Go to the source code of this file.
Data Structures | |
struct | nsw32_sslcert_window |
win32 ssl certificate view context More... | |
Macros | |
#define | DLG_MRGN 11 |
dialog margin More... | |
#define | WRN_ICO_H 32 |
warning icon height More... | |
#define | CMD_BTN_W 75 |
comand button width More... | |
#define | CMD_BTN_H 23 |
command button height More... | |
Functions | |
static nserror | nsw32_sslcert_viewer_key (struct nsw32_corewindow *nsw32_cw, uint32_t nskey) |
callback for keypress on ssl certificate window More... | |
static nserror | nsw32_sslcert_viewer_mouse (struct nsw32_corewindow *nsw32_cw, browser_mouse_state mouse_state, int x, int y) |
callback for mouse action on ssl certificate window More... | |
static nserror | nsw32_sslcert_viewer_draw (struct nsw32_corewindow *nsw32_cw, int scrollx, int scrolly, struct rect *r) |
callback on draw event for ssl certificate window More... | |
static nserror | nsw32_sslcert_viewer_close (struct nsw32_corewindow *nsw32_cw) |
callback on close event for ssl certificate window More... | |
nserror | nsw32_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 issuse. More... | |
static void | nsw32_window_ssl_cert_size (HWND hwnd, struct nsw32_sslcert_window *certwin) |
position and size ssl cert window widgets. More... | |
static nserror | nsw32_crtvrfy_destroy (struct nsw32_sslcert_window *crtwin) |
Destroy a certificate viewing window. More... | |
static LRESULT | nsw32_window_ssl_cert_command (HWND hwnd, struct nsw32_sslcert_window *crtwin, int notification_code, int identifier, HWND ctrl_window) |
handle command message on ssl certificate viewing window. More... | |
static LRESULT CALLBACK | nsw32_window_ssl_cert_event_callback (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) |
callback for SSL certificate window win32 events More... | |
nserror | nsws_create_cert_verify_class (HINSTANCE hInstance) |
Create the ssl viewer window class. More... | |
Variables | |
static const char | windowclassname_sslcert [] = "nswssslcertwindow" |
Implementation of win32 certificate viewing using nsw32 core windows.
Definition in file ssl_cert.c.
#define CMD_BTN_H 23 |
command button height
Definition at line 51 of file ssl_cert.c.
Referenced by nsw32_cert_verify(), and nsw32_window_ssl_cert_size().
#define CMD_BTN_W 75 |
comand button width
Definition at line 49 of file ssl_cert.c.
Referenced by nsw32_cert_verify(), and nsw32_window_ssl_cert_size().
#define DLG_MRGN 11 |
dialog margin
Definition at line 45 of file ssl_cert.c.
Referenced by nsw32_cert_verify(), and nsw32_window_ssl_cert_size().
#define WRN_ICO_H 32 |
warning icon height
Definition at line 47 of file ssl_cert.c.
Referenced by nsw32_cert_verify(), and nsw32_window_ssl_cert_size().
nserror nsw32_cert_verify | ( | struct nsurl * | url, |
const struct cert_chain * | certs, | ||
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 172 of file ssl_cert.c.
References nsw32_corewindow::cb_table, nsw32_corewindow::close, CMD_BTN_H, CMD_BTN_W, nsw32_sslcert_window::core, DLG_MRGN, nsw32_corewindow::draw, hinst, nsw32_sslcert_window::hWnd, IDC_SSLCERT_BTN_ACCEPT, IDC_SSLCERT_BTN_REJECT, nsw32_corewindow::key, nsw32_corewindow::mouse, NSERROR_NOMEM, NSERROR_OK, NSLOG, nsw32_corewindow_init(), nsw32_sslcert_viewer_close(), nsw32_sslcert_viewer_draw(), nsw32_sslcert_viewer_key(), nsw32_sslcert_viewer_mouse(), ShowWindow, nsw32_sslcert_window::ssl_data, sslcert_viewer_create_session_data(), sslcert_viewer_init(), nsw32_corewindow::title, windowclassname_sslcert, and WRN_ICO_H.
|
static |
Destroy a certificate viewing window.
crtwin | The certificate viewer context |
Definition at line 345 of file ssl_cert.c.
References nsw32_sslcert_window::core, nsw32_sslcert_window::hWnd, NSERROR_OK, nsw32_corewindow_fini(), nsw32_sslcert_window::ssl_data, and sslcert_viewer_fini().
Referenced by nsw32_window_ssl_cert_command(), and nsw32_window_ssl_cert_event_callback().
|
static |
callback on close event for ssl certificate window
nsw32_cw | The nsw32 core window structure. |
Definition at line 163 of file ssl_cert.c.
References nsw32_corewindow::hWnd, and NSERROR_OK.
Referenced by nsw32_cert_verify().
|
static |
callback on draw event for ssl certificate window
nsw32_cw | The nsw32 core window structure. |
scrollx | The horizontal scroll offset. |
scrolly | The vertical scroll offset. |
r | The rectangle of the window that needs updating. |
Definition at line 133 of file ssl_cert.c.
References redraw_context::interactive, NSERROR_OK, nsw32_sslcert_window::ssl_data, sslcert_viewer_redraw(), and win_plotters.
Referenced by nsw32_cert_verify().
|
static |
callback for keypress on ssl certificate window
nsw32_cw | The nsw32 core window structure. |
nskey | The netsurf key code |
Definition at line 84 of file ssl_cert.c.
References NSERROR_NOT_IMPLEMENTED, NSERROR_OK, nsw32_sslcert_window::ssl_data, and sslcert_viewer_keypress().
Referenced by nsw32_cert_verify().
|
static |
callback for mouse action on ssl certificate window
nsw32_cw | The nsw32 core window structure. |
mouse_state | netsurf mouse state on event |
x | location of event |
y | location of event |
Definition at line 108 of file ssl_cert.c.
References NSERROR_OK, nsw32_sslcert_window::ssl_data, and sslcert_viewer_mouse_action().
Referenced by nsw32_cert_verify().
|
static |
handle command message on ssl certificate viewing window.
hwnd | The win32 window handle. |
crtwin | certificate window context. |
notification_code | notifiction code |
identifier | notification identifier |
ctrl_window | The win32 control window handle |
Definition at line 370 of file ssl_cert.c.
References IDC_SSLCERT_BTN_ACCEPT, IDC_SSLCERT_BTN_REJECT, NSLOG, nsw32_crtvrfy_destroy(), nsw32_sslcert_window::ssl_data, sslcert_viewer_accept(), and sslcert_viewer_reject().
Referenced by nsw32_window_ssl_cert_event_callback().
|
static |
callback for SSL certificate window win32 events
hwnd | The win32 window handle |
msg | The win32 message identifier |
wparam | The w win32 parameter |
lparam | The l win32 parameter |
Definition at line 409 of file ssl_cert.c.
References nsw32_crtvrfy_destroy(), nsw32_window_ssl_cert_command(), nsw32_window_ssl_cert_size(), nsw32_sslcert_window::ssl_data, and sslcert_viewer_reject().
Referenced by nsws_create_cert_verify_class().
|
static |
position and size ssl cert window widgets.
hwnd | The win32 handle of the window |
certwin | The certificate viewer context |
Definition at line 304 of file ssl_cert.c.
References CMD_BTN_H, CMD_BTN_W, nsw32_sslcert_window::core, DLG_MRGN, nsw32_sslcert_window::hAccept, nsw32_sslcert_window::hReject, nsw32_sslcert_window::hTxt, nsw32_corewindow::hWnd, and WRN_ICO_H.
Referenced by nsw32_window_ssl_cert_event_callback().
nserror nsws_create_cert_verify_class | ( | HINSTANCE | hinstance | ) |
Create the ssl viewer window class.
hinstance | The application instance |
Definition at line 444 of file ssl_cert.c.
References NSERROR_INIT_FAILED, NSERROR_OK, nsw32_window_ssl_cert_event_callback(), win_perror(), and windowclassname_sslcert.
Referenced by WinMain().
|
static |
Definition at line 53 of file ssl_cert.c.
Referenced by nsw32_cert_verify(), and nsws_create_cert_verify_class().