NetSurf
|
#include <limits.h>
#include <stdlib.h>
#include "utils/corestrings.h"
#include "utils/http.h"
#include "utils/http/generics.h"
#include "utils/http/primitives.h"
Go to the source code of this file.
Data Structures | |
struct | http_strict_transport_security |
Representation of a Strict-Transport-Security. More... | |
struct | http_directive |
Representation of a directive. More... | |
Typedefs | |
typedef struct http_directive | http_directive |
Representation of a directive. More... | |
Functions | |
static void | http_destroy_directive (http_directive *self) |
static nserror | http__parse_directive (const char **input, http_directive **result) |
static void | http_directive_list_destroy (http_directive *list) |
static nserror | http_directive_list_find_item (const http_directive *list, lwc_string *name, lwc_string **value) |
static const http_directive * | http_directive_list_iterate (const http_directive *cur, lwc_string **name, lwc_string **value) |
static uint32_t | count (const http_directive *list, lwc_string *key) |
static bool | check_duplicates (const http_directive *directives) |
static nserror | parse_max_age (lwc_string *value, uint32_t *result) |
nserror | http_parse_strict_transport_security (const char *header_value, http_strict_transport_security **result) |
Parse an HTTP Strict-Transport-Security header value. More... | |
void | http_strict_transport_security_destroy (http_strict_transport_security *victim) |
Destroy a strict transport security object. More... | |
uint32_t | http_strict_transport_security_max_age (http_strict_transport_security *sts) |
Get the value of a strict transport security's max-age. More... | |
bool | http_strict_transport_security_include_subdomains (http_strict_transport_security *sts) |
Get the value of a strict transport security's includeSubDomains flag. More... | |
typedef struct http_directive http_directive |
Representation of a directive.
|
static |
Definition at line 172 of file strict-transport-security.c.
References count(), http_directive_list_iterate(), and result.
Referenced by http_parse_strict_transport_security().
|
static |
Definition at line 155 of file strict-transport-security.c.
References http_directive::base, count(), http_directive::name, and http__item::next.
Referenced by check_duplicates(), and count().
|
static |
Definition at line 56 of file strict-transport-security.c.
References HTTP__ITEM_INIT, http__parse_quoted_string(), http__parse_token(), http__skip_LWS(), http_destroy_directive(), http_directive::name, NSERROR_NOMEM, NSERROR_OK, result, and http_directive::value.
Referenced by http_parse_strict_transport_security().
|
static |
Definition at line 47 of file strict-transport-security.c.
References http_directive::name, and http_directive::value.
Referenced by http__parse_directive().
|
static |
Definition at line 108 of file strict-transport-security.c.
References http__item_list_destroy.
Referenced by http_parse_strict_transport_security().
|
static |
Definition at line 113 of file strict-transport-security.c.
References http_directive::base, http_directive::name, http__item::next, NSERROR_NOT_FOUND, NSERROR_OK, and http_directive::value.
Referenced by http_parse_strict_transport_security().
|
static |
Definition at line 138 of file strict-transport-security.c.
References http_directive::base, http_directive::name, http__item::next, and http_directive::value.
Referenced by check_duplicates().
nserror http_parse_strict_transport_security | ( | const char * | header_value, |
http_strict_transport_security ** | result | ||
) |
Parse an HTTP Strict-Transport-Security header value.
header_value | Header value to parse |
result | Pointer to location to receive result |
Definition at line 233 of file strict-transport-security.c.
References check_duplicates(), http__item_list_parse, http__parse_directive(), http__skip_LWS(), http_directive_list_destroy(), http_directive_list_find_item(), http_strict_transport_security::include_sub_domains, http_strict_transport_security::max_age, NSERROR_NOMEM, NSERROR_NOT_FOUND, NSERROR_OK, parse_max_age(), and result.
Referenced by urldb_set_hsts_policy().
void http_strict_transport_security_destroy | ( | http_strict_transport_security * | victim | ) |
Destroy a strict transport security object.
victim | Object to destroy |
Definition at line 322 of file strict-transport-security.c.
Referenced by urldb_set_hsts_policy().
bool http_strict_transport_security_include_subdomains | ( | http_strict_transport_security * | sts | ) |
Get the value of a strict transport security's includeSubDomains flag.
sts | Object to inspect |
Definition at line 336 of file strict-transport-security.c.
References http_strict_transport_security::include_sub_domains.
Referenced by urldb_set_hsts_policy().
uint32_t http_strict_transport_security_max_age | ( | http_strict_transport_security * | sts | ) |
Get the value of a strict transport security's max-age.
sts | Object to inspect |
Definition at line 329 of file strict-transport-security.c.
References http_strict_transport_security::max_age.
Referenced by urldb_set_hsts_policy().
|
static |
Definition at line 198 of file strict-transport-security.c.
References NSERROR_NOT_FOUND, NSERROR_OK, and result.
Referenced by http_parse_strict_transport_security().