2 * Copyright (C) 2011 Sansar Choinyambuu
3 * HSR Hochschule fuer Technik Rapperswil
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>.
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
17 * @defgroup tcg_pts_attr_dh_nonce_finish tcg_pts_attr_dh_nonce_finish
18 * @{ @ingroup tcg_pts_attr_dh_nonce_finish
21 #ifndef TCG_PTS_ATTR_DH_NONCE_FINISH_H_
22 #define TCG_PTS_ATTR_DH_NONCE_FINISH_H_
24 typedef struct tcg_pts_attr_dh_nonce_finish_t tcg_pts_attr_dh_nonce_finish_t
;
27 #include "pa_tnc/pa_tnc_attr.h"
28 #include "pts/pts_meas_algo.h"
31 * Class implementing the TCG PTS DH Nonce Finish Attribute
33 struct tcg_pts_attr_dh_nonce_finish_t
{
36 * Public PA-TNC attribute interface
38 pa_tnc_attr_t pa_tnc_attribute
;
43 * @return Length of nonce
45 u_int8_t (*get_nonce_len
)(tcg_pts_attr_dh_nonce_finish_t
*this);
48 * Get selected hash algorithm
50 * @return Selected hash algorithm
52 pts_meas_algorithms_t (*get_hash_algo
)(tcg_pts_attr_dh_nonce_finish_t
*this);
55 * Get DH Initiator Public Value
57 * @return DH Initiator Public Value
59 chunk_t (*get_initiator_pub_val
)(tcg_pts_attr_dh_nonce_finish_t
*this);
62 * Get DH Initiator Nonce
64 * @return DH Initiator Nonce
66 chunk_t (*get_initiator_nonce
)(tcg_pts_attr_dh_nonce_finish_t
*this);
71 * Creates an tcg_pts_attr_dh_nonce_finish_t object
73 * @param nonce_len Length of nonce
74 * @param hash_algo Selected hash algorithm
75 * @param initiator_nonce DH Initiator Nonce
76 * @param initiator_pub_val DH Initiator Public value
78 pa_tnc_attr_t
* tcg_pts_attr_dh_nonce_finish_create(u_int8_t nonce_len
,
79 pts_meas_algorithms_t hash_algo
,
80 chunk_t initiator_nonce
,
81 chunk_t initiator_pub_val
);
84 * Creates an tcg_pts_attr_dh_nonce_finish_t object from received data
86 * @param value unparsed attribute value
88 pa_tnc_attr_t
* tcg_pts_attr_dh_nonce_finish_create_from_data(chunk_t value
);
90 #endif /** TCG_PTS_ATTR_DH_NONCE_FINISH_H_ @}*/