NetSurf
|
SSL related types and values. More...
Go to the source code of this file.
Data Structures | |
struct | cert_chain |
X509 certificate chain. More... | |
Macros | |
#define | SSL_CERT_ERR_MAX_KNOWN SSL_CERT_ERR_HOSTNAME_MISMATCH |
Always the max known ssl certificate error type. More... | |
#define | MAX_CERT_DEPTH 10 |
maximum number of X509 certificates in chain for TLS connection More... | |
Enumerations | |
enum | ssl_cert_err { SSL_CERT_ERR_OK , SSL_CERT_ERR_UNKNOWN , SSL_CERT_ERR_BAD_ISSUER , SSL_CERT_ERR_BAD_SIG , SSL_CERT_ERR_TOO_YOUNG , SSL_CERT_ERR_TOO_OLD , SSL_CERT_ERR_SELF_SIGNED , SSL_CERT_ERR_CHAIN_SELF_SIGNED , SSL_CERT_ERR_REVOKED , SSL_CERT_ERR_HOSTNAME_MISMATCH , SSL_CERT_ERR_CERT_MISSING } |
ssl certificate error status More... | |
Functions | |
nserror | cert_chain_alloc (size_t depth, struct cert_chain **chain_out) |
create new certificate chain More... | |
nserror | cert_chain_dup_into (const struct cert_chain *src, struct cert_chain *dst) |
duplicate a certificate chain into an existing chain More... | |
nserror | cert_chain_dup (const struct cert_chain *src, struct cert_chain **dst_out) |
duplicate a certificate chain More... | |
nserror | cert_chain_from_query (struct nsurl *url, struct cert_chain **chain_out) |
create a certificate chain from a fetch query string More... | |
nserror | cert_chain_to_query (struct cert_chain *chain, struct nsurl **url_out) |
create a fetch query string from a certificate chain More... | |
nserror | cert_chain_free (struct cert_chain *chain) |
free a certificate chain More... | |
size_t | cert_chain_size (const struct cert_chain *chain) |
total number of data bytes in a chain More... | |
SSL related types and values.
Definition in file ssl_certs.h.
#define MAX_CERT_DEPTH 10 |
maximum number of X509 certificates in chain for TLS connection
Definition at line 54 of file ssl_certs.h.
#define SSL_CERT_ERR_MAX_KNOWN SSL_CERT_ERR_HOSTNAME_MISMATCH |
Always the max known ssl certificate error type.
Definition at line 51 of file ssl_certs.h.
enum ssl_cert_err |
ssl certificate error status
Do not reorder / remove entries because these may be persisted to the disk cache as simple ints.
Definition at line 36 of file ssl_certs.h.
nserror cert_chain_alloc | ( | size_t | depth, |
struct cert_chain ** | chain_out | ||
) |
create new certificate chain
dpth | the depth to set in the new chain. |
chain_out | A pointer to recive the new chain. |
Definition at line 41 of file ssl_certs.c.
References cert_chain::depth, NSERROR_NOMEM, and NSERROR_OK.
Referenced by cert_chain_dup(), cert_chain_from_query(), curl_fetch_ssl_value_alloc(), and llcache_process_metadata().
nserror cert_chain_dup | ( | const struct cert_chain * | src, |
struct cert_chain ** | dst_out | ||
) |
duplicate a certificate chain
src | The certificate chain to copy from |
dst_out | A pointer to recive the duplicated chain |
Definition at line 101 of file ssl_certs.c.
References cert_chain_alloc(), cert_chain_free(), cert_chain::certs, cert_chain::depth, cert_chain::der, cert_chain::der_length, cert_chain::err, NSERROR_NOMEM, and NSERROR_OK.
Referenced by browser_window_callback(), llcache_fetch_callback(), and llcache_object_snapshot().
nserror cert_chain_dup_into | ( | const struct cert_chain * | src, |
struct cert_chain * | dst | ||
) |
duplicate a certificate chain into an existing chain
src | The certificate chain to copy from |
dst | The chain to overwrite with a copy of src |
NOTE: if this returns NSERROR_NOMEM then the destination chain will have some amount of content and should be cleaned up with cert_chain_free.
Definition at line 64 of file ssl_certs.c.
References cert_chain::certs, cert_chain::depth, cert_chain::der, cert_chain::der_length, cert_chain::err, NSERROR_NOMEM, and NSERROR_OK.
nserror cert_chain_free | ( | struct cert_chain * | chain | ) |
free a certificate chain
chain | The certificate chain to free |
Definition at line 317 of file ssl_certs.c.
References cert_chain::certs, cert_chain::depth, cert_chain::der, and NSERROR_OK.
Referenced by browser_window_callback(), browser_window_content_ready(), browser_window_destroy_internal(), cert_chain_dup(), curl_fetch_ssl_value_destroy(), llcache_fetch_callback(), llcache_object_destroy(), llcache_process_metadata(), and navigate_internal_real().
nserror cert_chain_from_query | ( | struct nsurl * | url, |
struct cert_chain ** | chain_out | ||
) |
create a certificate chain from a fetch query string
url | The url to convert the query from |
dst_out | A pointer to recive the duplicated chain |
Definition at line 169 of file ssl_certs.c.
References cert_chain_alloc(), cert_chain::depth, MIN_CERT_LEN, NSERROR_INVALID, NSERROR_NEED_DATA, NSERROR_OK, nsurl_get(), NSURL_QUERY, and process_query_section().
size_t cert_chain_size | ( | const struct cert_chain * | chain | ) |
total number of data bytes in a chain
chain | The chain to size |
Definition at line 340 of file ssl_certs.c.
References cert_chain::certs, cert_chain::depth, cert_chain::der, and cert_chain::der_length.
Referenced by total_object_size().
nserror cert_chain_to_query | ( | struct cert_chain * | chain, |
struct nsurl ** | url_out | ||
) |
create a fetch query string from a certificate chain
Definition at line 226 of file ssl_certs.c.
References cert_chain::certs, cert_chain::depth, cert_chain::der, cert_chain::der_length, cert_chain::err, NSERROR_NOMEM, NSERROR_OK, NSERROR_UNKNOWN, nsurl_create(), and SSL_CERT_ERR_OK.
Referenced by browser_window__handle_bad_certs(), and browser_window_show_certificates().