]>
Commit | Line | Data |
---|---|---|
b38d9d5a AS |
1 | /* |
2 | * Copyright (C) 2011 Sansar Choinyambuu | |
e77df5a1 | 3 | * Copyright (C) 2014 Andreas Steffen |
19ef2aec TB |
4 | * |
5 | * Copyright (C) secunet Security Networks AG | |
b38d9d5a AS |
6 | * |
7 | * This program is free software; you can redistribute it and/or modify it | |
8 | * under the terms of the GNU General Public License as published by the | |
9 | * Free Software Foundation; either version 2 of the License, or (at your | |
10 | * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. | |
11 | * | |
12 | * This program is distributed in the hope that it will be useful, but | |
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
14 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 | * for more details. | |
16 | */ | |
17 | ||
18 | /** | |
19 | * @defgroup tcg_pts_attr_dh_nonce_params_resp tcg_pts_attr_dh_nonce_params_resp | |
20 | * @{ @ingroup tcg_attr | |
21 | */ | |
22 | ||
23 | #ifndef TCG_PTS_ATTR_DH_NONCE_PARAMS_RESP_H_ | |
24 | #define TCG_PTS_ATTR_DH_NONCE_PARAMS_RESP_H_ | |
25 | ||
26 | typedef struct tcg_pts_attr_dh_nonce_params_resp_t | |
27 | tcg_pts_attr_dh_nonce_params_resp_t; | |
28 | ||
29 | #include "tcg/tcg_attr.h" | |
30 | #include "pa_tnc/pa_tnc_attr.h" | |
31 | #include "pts/pts_dh_group.h" | |
32 | #include "pts/pts_meas_algo.h" | |
33 | ||
34 | /** | |
35 | * Class implementing the TCG PTS DH Nonce Parameters Response Attribute | |
36 | */ | |
37 | struct tcg_pts_attr_dh_nonce_params_resp_t { | |
38 | ||
39 | /** | |
40 | * Public PA-TNC attribute interface | |
41 | */ | |
42 | pa_tnc_attr_t pa_tnc_attribute; | |
43 | ||
44 | /** | |
45 | * Get selected Diffie Hellman Group | |
46 | * | |
47 | * @return Selected Diffie Hellman Group | |
48 | */ | |
49 | pts_dh_group_t (*get_dh_group)(tcg_pts_attr_dh_nonce_params_resp_t *this); | |
50 | ||
51 | /** | |
52 | * Get supported hash algorithms | |
53 | * | |
54 | * @return Hash algorithm set | |
55 | */ | |
56 | pts_meas_algorithms_t (*get_hash_algo_set)( | |
57 | tcg_pts_attr_dh_nonce_params_resp_t *this); | |
58 | ||
59 | /** | |
60 | * Get DH Responder Nonce | |
61 | * | |
62 | * @return DH Responder Nonce | |
63 | */ | |
64 | chunk_t (*get_responder_nonce)(tcg_pts_attr_dh_nonce_params_resp_t *this); | |
65 | ||
66 | /** | |
67 | * Get DH Responder Public Value | |
68 | * | |
69 | * @return DH Responder Public Value | |
70 | */ | |
71 | chunk_t (*get_responder_value)(tcg_pts_attr_dh_nonce_params_resp_t *this); | |
72 | ||
73 | }; | |
74 | ||
75 | /** | |
76 | * Creates an tcg_pts_attr_dh_nonce_params_resp_t object | |
77 | * | |
78 | * @param dh_group Selected DH group | |
79 | * @param hash_algo_set Set of supported hash algorithms | |
80 | * @param responder_nonce DH Responder Nonce | |
81 | * @param responder_value DH Responder Public value | |
82 | */ | |
83 | pa_tnc_attr_t* tcg_pts_attr_dh_nonce_params_resp_create(pts_dh_group_t dh_group, | |
84 | pts_meas_algorithms_t hash_algo_set, | |
85 | chunk_t responder_nonce, | |
86 | chunk_t responder_value); | |
87 | ||
88 | /** | |
89 | * Creates an tcg_pts_attr_dh_nonce_params_resp_t object from received data | |
90 | * | |
e77df5a1 AS |
91 | * @param length Total length of attribute value |
92 | * @param value Unparsed attribute value (might be a segment) | |
b38d9d5a | 93 | */ |
e77df5a1 AS |
94 | pa_tnc_attr_t* tcg_pts_attr_dh_nonce_params_resp_create_from_data(size_t length, |
95 | chunk_t value); | |
b38d9d5a AS |
96 | |
97 | #endif /** TCG_PTS_ATTR_DH_NONCE_PARAMS_RESP_H_ @}*/ |