1 /*
2  * Copyright (c) 2019-2021 Free Software Foundation, Inc.
3  *
4  * This file is part of libwget.
5  *
6  * Libwget is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Libwget is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with Libwget.  If not, see <https://www.gnu.org/licenses/>.
18  *
19  *
20  * Header file for HPKP code
21  */
22 
23 #ifndef LIBWGET_HPKP_H
24 #define LIBWGET_HPKP_H
25 
26 #include <wget.h>
27 
28 struct wget_hpkp_st {
29 	const char *
30 		host;
31 	int64_t
32 		expires;
33 	int64_t
34 		created;
35 	int64_t
36 		maxage;
37 	wget_vector *
38 		pins;
39 	bool
40 		include_subdomains : 1;
41 };
42 
43 typedef struct {
44 	const char *
45 		pin_b64; /* base64 encoded <pin> */
46 	const void *
47 		pin; /* binary hash */
48 	const char *
49 		hash_type; /* type of <pin>, e.g. 'sha-256' */
50 	size_t
51 		pinsize; /* size of <pin> */
52 } wget_hpkp_pin;
53 
54 
55 #endif /* LIBWGET_HPKP_H */
56