Started implementing handling of DH Nonce attributes
[strongswan.git] / src / libpts / pts / pts_dh_group.h
1 /*
2 * Copyright (C) 2011 Sansar Choinyambuu
3 * HSR Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16 /**
17 * @defgroup pts_dh_group pts_dh_group
18 * @{ @ingroup pts
19 */
20
21 #ifndef PTS_DH_GROUP_H_
22 #define PTS_DH_GROUP_H_
23
24 #include <library.h>
25 #include <crypto/diffie_hellman.h>
26
27 typedef enum pts_dh_group_t pts_dh_group_t;
28
29 /**
30 * PTS Diffie Hellman Group Values
31 */
32 enum pts_dh_group_t {
33 /** IKE Group 2 */
34 PTS_DH_GROUP_IKE2 = (1<<15),
35 /** IKE Group 5 */
36 PTS_DH_GROUP_IKE5 = (1<<14),
37 /** IKE Group 14 */
38 PTS_DH_GROUP_IKE14 = (1<<13),
39 /** IKE Group 19 */
40 PTS_DH_GROUP_IKE19 = (1<<12),
41 /** IKE Group 20 */
42 PTS_DH_GROUP_IKE20 = (1<<11),
43 };
44
45 /**
46 * Diffie-Hellman Group Values
47 * see section 3.8.6 of PTS Protocol: Binding to TNC IF-M Specification
48 *
49 * 1
50 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
51 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
52 * |1|2|3|4|5|R|R|R|R|R|R|R|R|R|R|R|
53 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
54 *
55 */
56
57 /**
58 * Probe available PTS measurement algorithms
59 *
60 * @param groups set of available groups
61 * @return TRUE if mandatory group PTS_DH_GROUP_IKE19 is available
62 */
63 bool pts_probe_dh_groups(pts_dh_group_t *groups);
64
65 /**
66 * Update supported Diffie Hellman Groups according to configuration
67 *
68 * @param dh_group configured Diffie Hellman Group
69 * @param groups set of available groups
70 */
71 bool pts_update_supported_dh_groups(char *dh_group, pts_dh_group_t *groups);
72
73 /**
74 * Convert pts_dh_group_t to diffie_hellman_group_t
75 *
76 * @param dh_group PTS Diffie Hellman Group type
77 * @return libstrongswan diffie hellman group type
78 */
79 diffie_hellman_group_t pts_dh_group_to_strongswan_dh_group(pts_dh_group_t dh_group);
80
81 #endif /** PTS_DH_GROUP_H_ @}*/