NetSurf
Data Structures | Functions
ssl_cert.c File Reference

Implementation of gtk certificate viewing using gtk core windows. More...

#include <stdint.h>
#include <stdlib.h>
#include <gtk/gtk.h>
#include "utils/log.h"
#include "netsurf/keypress.h"
#include "netsurf/plotters.h"
#include "desktop/sslcert_viewer.h"
#include "gtk/plotters.h"
#include "gtk/scaffolding.h"
#include "gtk/resources.h"
#include "gtk/ssl_cert.h"
#include "gtk/corewindow.h"
Include dependency graph for ssl_cert.c:

Go to the source code of this file.

Data Structures

struct  nsgtk_crtvrfy_window
 GTK certificate viewing window context. More...
 

Functions

static nserror nsgtk_crtvrfy_destroy (struct nsgtk_crtvrfy_window *crtvrfy_win)
 destroy a previously created certificate view More...
 
static void nsgtk_crtvrfy_accept (GtkButton *w, gpointer data)
 
static void nsgtk_crtvrfy_reject (GtkWidget *w, gpointer data)
 
static gboolean nsgtk_crtvrfy_delete_event (GtkWidget *w, GdkEvent *event, gpointer data)
 
static nserror nsgtk_crtvrfy_mouse (struct nsgtk_corewindow *nsgtk_cw, browser_mouse_state mouse_state, int x, int y)
 callback for mouse action for certificate verify on core window More...
 
static nserror nsgtk_crtvrfy_key (struct nsgtk_corewindow *nsgtk_cw, uint32_t nskey)
 callback for keypress for certificate verify on core window More...
 
static nserror nsgtk_crtvrfy_draw (struct nsgtk_corewindow *nsgtk_cw, struct rect *r)
 callback on draw event for certificate verify on core window More...
 
nserror gtk_cert_verify (struct nsurl *url, const struct ssl_cert_info *certs, unsigned long num, nserror(*cb)(bool proceed, void *pw), void *cbpw)
 Prompt the user to verify a certificate with issuse. More...
 

Detailed Description

Implementation of gtk certificate viewing using gtk core windows.

Definition in file ssl_cert.c.

Function Documentation

◆ gtk_cert_verify()

nserror gtk_cert_verify ( struct nsurl url,
const struct ssl_cert_info certs,
unsigned long  num,
nserror(*)(bool proceed, void *pw)  cb,
void *  cbpw 
)

Prompt the user to verify a certificate with issuse.

Parameters
urlThe URL being verified.
certsThe certificate to be verified
numThe number of certificates to be verified.
cbCallback upon user decision.
cbpwContext pointer passed to cb
Returns
NSERROR_OK or error code if prompt creation failed.

Definition at line 170 of file ssl_cert.c.

References nsgtk_crtvrfy_window::builder, nsgtk_corewindow::cb_table, nsgtk_crtvrfy_window::core, nsgtk_crtvrfy_window::dlg, nsgtk_corewindow::draw, nsgtk_corewindow::drawing_area, nsgtk_corewindow::key, nsgtk_corewindow::mouse, NSERROR_NOMEM, NSERROR_OK, nsgtk_builder_new_from_resname(), nsgtk_corewindow_init(), nsgtk_crtvrfy_accept(), nsgtk_crtvrfy_delete_event(), nsgtk_crtvrfy_draw(), nsgtk_crtvrfy_key(), nsgtk_crtvrfy_mouse(), nsgtk_crtvrfy_reject(), nsgtk_current_scaffolding(), nsgtk_scaffolding_window(), NSLOG, nsgtk_corewindow::scrolled, nsgtk_crtvrfy_window::ssl_data, sslcert_viewer_create_session_data(), and sslcert_viewer_init().

Here is the call graph for this function:

◆ nsgtk_crtvrfy_accept()

static void nsgtk_crtvrfy_accept ( GtkButton *  w,
gpointer  data 
)
static

Definition at line 72 of file ssl_cert.c.

References nsgtk_crtvrfy_destroy(), nsgtk_crtvrfy_window::ssl_data, and sslcert_viewer_accept().

Referenced by gtk_cert_verify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsgtk_crtvrfy_delete_event()

static gboolean nsgtk_crtvrfy_delete_event ( GtkWidget *  w,
GdkEvent *  event,
gpointer  data 
)
static

Definition at line 94 of file ssl_cert.c.

References nsgtk_crtvrfy_reject().

Referenced by gtk_cert_verify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsgtk_crtvrfy_destroy()

static nserror nsgtk_crtvrfy_destroy ( struct nsgtk_crtvrfy_window crtvrfy_win)
static

destroy a previously created certificate view

Definition at line 57 of file ssl_cert.c.

References nsgtk_crtvrfy_window::builder, nsgtk_crtvrfy_window::core, nsgtk_crtvrfy_window::dlg, NSERROR_OK, nsgtk_corewindow_fini(), nsgtk_crtvrfy_window::ssl_data, and sslcert_viewer_fini().

Referenced by nsgtk_crtvrfy_accept(), and nsgtk_crtvrfy_reject().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsgtk_crtvrfy_draw()

static nserror nsgtk_crtvrfy_draw ( struct nsgtk_corewindow nsgtk_cw,
struct rect r 
)
static

callback on draw event for certificate verify on core window

Parameters
nsgtk_cwThe nsgtk core window structure.
rThe rectangle of the window that needs updating.
Returns
NSERROR_OK on success otherwise appropriate error code

Definition at line 152 of file ssl_cert.c.

References redraw_context::interactive, NSERROR_OK, nsgtk_plotters, nsgtk_crtvrfy_window::ssl_data, and sslcert_viewer_redraw().

Referenced by gtk_cert_verify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsgtk_crtvrfy_key()

static nserror nsgtk_crtvrfy_key ( struct nsgtk_corewindow nsgtk_cw,
uint32_t  nskey 
)
static

callback for keypress for certificate verify on core window

Parameters
nsgtk_cwThe nsgtk core window structure.
nskeyThe netsurf key code
Returns
NSERROR_OK on success otherwise appropriate error code

Definition at line 131 of file ssl_cert.c.

References NSERROR_NOT_IMPLEMENTED, NSERROR_OK, nsgtk_crtvrfy_window::ssl_data, and sslcert_viewer_keypress().

Referenced by gtk_cert_verify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsgtk_crtvrfy_mouse()

static nserror nsgtk_crtvrfy_mouse ( struct nsgtk_corewindow nsgtk_cw,
browser_mouse_state  mouse_state,
int  x,
int  y 
)
static

callback for mouse action for certificate verify on core window

Parameters
nsgtk_cwThe nsgtk core window structure.
mouse_statenetsurf mouse state on event
xlocation of event
ylocation of event
Returns
NSERROR_OK on success otherwise appropriate error code

Definition at line 110 of file ssl_cert.c.

References NSERROR_OK, nsgtk_crtvrfy_window::ssl_data, and sslcert_viewer_mouse_action().

Referenced by gtk_cert_verify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsgtk_crtvrfy_reject()

static void nsgtk_crtvrfy_reject ( GtkWidget *  w,
gpointer  data 
)
static

Definition at line 83 of file ssl_cert.c.

References nsgtk_crtvrfy_destroy(), nsgtk_crtvrfy_window::ssl_data, and sslcert_viewer_reject().

Referenced by gtk_cert_verify(), and nsgtk_crtvrfy_delete_event().

Here is the call graph for this function:
Here is the caller graph for this function: