![]() |
wget2 2.3.0
|
Data Structures | |
| struct | wget_hpkp_db_st |
Typedefs | |
| typedef struct wget_hpkp_db_st | wget_hpkp_db |
| typedef struct wget_hpkp_st | wget_hpkp |
| typedef wget_hpkp_db * | wget_hpkp_db_init_fn(wget_hpkp_db *hpkp_db, const char *fname) |
Functions | |
| void | wget_hpkp_pin_add (wget_hpkp *hpkp, const char *pin_type, const char *pin_b64) |
| void | wget_hpkp_free (wget_hpkp *hpkp) |
| wget_hpkp * | wget_hpkp_new (void) |
| void | wget_hpkp_set_host (wget_hpkp *hpkp, const char *host) |
| void | wget_hpkp_set_maxage (wget_hpkp *hpkp, int64_t maxage) |
| void | wget_hpkp_set_include_subdomains (wget_hpkp *hpkp, bool include_subdomains) |
| int | wget_hpkp_get_n_pins (wget_hpkp *hpkp) |
| void | wget_hpkp_get_pins_b64 (wget_hpkp *hpkp, const char **pin_types, const char **pins_b64) |
| void | wget_hpkp_get_pins (wget_hpkp *hpkp, const char **pin_types, size_t *sizes, const void **pins) |
| const char * | wget_hpkp_get_host (wget_hpkp *hpkp) |
| int64_t | wget_hpkp_get_maxage (wget_hpkp *hpkp) |
| bool | wget_hpkp_get_include_subdomains (wget_hpkp *hpkp) |
This is an implementation of RFC 7469.
| typedef struct wget_hpkp_db_st wget_hpkp_db |
HPKP database for storing HTTP Public Key Pinning (HPKP) entries
| typedef struct wget_hpkp_st wget_hpkp |
HPKP database entry. Corresponds to one 'Public-Key-Pins' HTTP response header.
| typedef wget_hpkp_db * wget_hpkp_db_init_fn(wget_hpkp_db *hpkp_db, const char *fname) |
It is possible to implement a custom HPKP database as a plugin. See tests/test-plugin-dummy.c and tests/Makefile.am for details.
| void wget_hpkp_pin_add | ( | wget_hpkp * | hpkp, |
| const char * | pin_type, | ||
| const char * | pin_b64 ) |
| [in] | hpkp | An HPKP database entry |
| [in] | pin_type | The type of hash supplied, e.g. "sha256" |
| [in] | pin_b64 | The public key hash in base64 format |
Adds a public key hash to HPKP database entry.
| void wget_hpkp_free | ( | wget_hpkp * | hpkp | ) |
| [in] | hpkp | An HPKP database entry |
Free hpkp_t instance created by wget_hpkp_new() It can be used as destructor function in vectors and hashmaps. If hpkp is NULL this function does nothing.
| wget_hpkp * wget_hpkp_new | ( | void | ) |
Creates a new HPKP structure initialized with the given values.
| void wget_hpkp_set_host | ( | wget_hpkp * | hpkp, |
| const char * | host ) |
| [in] | hpkp | An HPKP database entry |
| [in] | host | Hostname of the web server |
Sets the hostname of the web server into given HPKP database entry.
| void wget_hpkp_set_maxage | ( | wget_hpkp * | hpkp, |
| int64_t | maxage ) |
| [in] | hpkp | An HPKP database entry |
| [in] | maxage | Maximum time the entry is valid (in seconds) |
Sets the maximum time the HPKP entry is valid. Corresponds to max-age directive in Public-Key-Pins HTTP response header.
| void wget_hpkp_set_include_subdomains | ( | wget_hpkp * | hpkp, |
| bool | include_subdomains ) |
| [in] | hpkp | An HPKP database entry |
| [in] | include_subdomains | Nonzero if this entry is also valid for all subdomains, zero otherwise. |
Sets whether the entry is also valid for all subdomains. Corresponds to the optional includeSubDomains directive in Public-Key-Pins HTTP response header.
| int wget_hpkp_get_n_pins | ( | wget_hpkp * | hpkp | ) |
| [in] | hpkp | An HPKP database entry |
Gets the number of public key hashes added to the given HPKP database entry.
| void wget_hpkp_get_pins_b64 | ( | wget_hpkp * | hpkp, |
| const char ** | pin_types, | ||
| const char ** | pins_b64 ) |
| [in] | hpkp | An HPKP database entry |
| [out] | pin_types | An array of pointers where hash types will be stored. |
| [out] | pins_b64 | An array of pointers where the public keys in base64 format will be stored |
Gets all the public key hashes added to the given HPKP database entry.
The size of the arrays used must be at least one returned by wget_hpkp_get_n_pins().
| void wget_hpkp_get_pins | ( | wget_hpkp * | hpkp, |
| const char ** | pin_types, | ||
| size_t * | sizes, | ||
| const void ** | pins ) |
| [in] | hpkp | An HPKP database entry |
| [out] | pin_types | An array of pointers where hash types will be stored. |
| [out] | sizes | An array of sizes where pin sizes will be stored. |
| [out] | pins | An array of pointers where the public keys in binary format will be stored |
Gets all the public key hashes added to the given HPKP database entry.
The size of the arrays used must be at least one returned by wget_hpkp_get_n_pins().
| const char * wget_hpkp_get_host | ( | wget_hpkp * | hpkp | ) |
| [in] | hpkp | An HPKP database entry |
Gets the hostname this entry is valid for, as set by wget_hpkp_set_host()
| int64_t wget_hpkp_get_maxage | ( | wget_hpkp * | hpkp | ) |
| [in] | hpkp | An HPKP database entry |
Gets the maximum time this entry is valid for, as set by wget_hpkp_set_maxage()
| bool wget_hpkp_get_include_subdomains | ( | wget_hpkp * | hpkp | ) |
| [in] | hpkp | An HPKP database entry |
Gets whether the HPKP database entry is also valid for the subdomains.