NetSurf
Data Structures | Functions | Variables
cert.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "utils/ring.h"
#include "utils/nsurl.h"
#include "content/urldb.h"
#include "monkey/output.h"
#include "monkey/cert.h"
Include dependency graph for cert.c:

Go to the source code of this file.

Data Structures

struct  monkey_cert
 

Functions

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...
 
static struct monkey_certmonkey_find_sslcert_by_num (uint32_t sslcert_num)
 
static void free_sslcert_context (struct monkey_cert *mcrt_ctx)
 
static void monkey_sslcert_handle_go (int argc, char **argv)
 
static void monkey_sslcert_handle_destroy (int argc, char **argv)
 
void monkey_sslcert_handle_command (int argc, char **argv)
 

Variables

static struct monkey_certcert_ring = NULL
 
static uint32_t cert_ctr = 0
 

Function Documentation

◆ free_sslcert_context()

static void free_sslcert_context ( struct monkey_cert mcrt_ctx)
static

Definition at line 83 of file cert.c.

References MOUT_SSLCERT, moutf(), nsurl_unref(), monkey_cert::num, RING_REMOVE, and monkey_cert::url.

Referenced by monkey_sslcert_handle_destroy(), and monkey_sslcert_handle_go().

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

◆ 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.

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

Definition at line 42 of file cert.c.

◆ monkey_find_sslcert_by_num()

static struct monkey_cert* monkey_find_sslcert_by_num ( uint32_t  sslcert_num)
static

Definition at line 69 of file cert.c.

References RING_ITERATE_END, RING_ITERATE_START, and RING_ITERATE_STOP.

Referenced by monkey_sslcert_handle_destroy(), and monkey_sslcert_handle_go().

Here is the caller graph for this function:

◆ monkey_sslcert_handle_command()

void monkey_sslcert_handle_command ( int  argc,
char **  argv 
)

Definition at line 137 of file cert.c.

References monkey_sslcert_handle_destroy(), monkey_sslcert_handle_go(), MOUT_ERROR, and moutf().

Referenced by main().

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

◆ monkey_sslcert_handle_destroy()

static void monkey_sslcert_handle_destroy ( int  argc,
char **  argv 
)
static

Definition at line 116 of file cert.c.

References monkey_cert::cb, monkey_cert::cbpw, free_sslcert_context(), monkey_find_sslcert_by_num(), MOUT_ERROR, and moutf().

Referenced by monkey_sslcert_handle_command().

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

◆ monkey_sslcert_handle_go()

static void monkey_sslcert_handle_go ( int  argc,
char **  argv 
)
static

Definition at line 93 of file cert.c.

References monkey_cert::cb, monkey_cert::cbpw, free_sslcert_context(), monkey_find_sslcert_by_num(), MOUT_ERROR, moutf(), monkey_cert::url, and urldb_set_cert_permissions().

Referenced by monkey_sslcert_handle_command().

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

Variable Documentation

◆ cert_ctr

uint32_t cert_ctr = 0
static

Definition at line 39 of file cert.c.

Referenced by gui_cert_verify().

◆ cert_ring

struct monkey_cert* cert_ring = NULL
static

Definition at line 38 of file cert.c.