summaryrefslogtreecommitdiff
path: root/src/libpts/tcg/tcg_pts_attr_dh_nonce_finish.h
blob: 7148065c52fde1e3a984846bdca2f1477f5292c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
 * Copyright (C) 2011 Sansar Choinyambuu
 * HSR Hochschule fuer Technik Rapperswil
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or (at your
 * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 */

/**
 * @defgroup tcg_pts_attr_dh_nonce_finish tcg_pts_attr_dh_nonce_finish
 * @{ @ingroup tcg_pts_attr_dh_nonce_finish
 */

#ifndef TCG_PTS_ATTR_DH_NONCE_FINISH_H_
#define TCG_PTS_ATTR_DH_NONCE_FINISH_H_

typedef struct tcg_pts_attr_dh_nonce_finish_t tcg_pts_attr_dh_nonce_finish_t;

#include "tcg_attr.h"
#include "pa_tnc/pa_tnc_attr.h"
#include "pts/pts_meas_algo.h"

/**
 * Class implementing the TCG PTS DH Nonce Finish Attribute
 */
struct tcg_pts_attr_dh_nonce_finish_t {

	/**
	 * Public PA-TNC attribute interface
	 */
	pa_tnc_attr_t pa_tnc_attribute;

	/**
	 * Get nonce length
	 *
	 * @return				Length of nonce
	 */
	u_int8_t (*get_nonce_len)(tcg_pts_attr_dh_nonce_finish_t *this);

	/**
	 * Get selected hash algorithm
	 *
	 * @return				Selected hash algorithm
	 */
	pts_meas_algorithms_t (*get_hash_algo)(tcg_pts_attr_dh_nonce_finish_t *this);

	/**
	 * Get DH Initiator Public Value
	 *
	 * @return				DH Initiator Public Value
	 */
	chunk_t (*get_initiator_value)(tcg_pts_attr_dh_nonce_finish_t *this);

	/**
	 * Get DH Initiator Nonce
	 *
	 * @return				DH Initiator Nonce
	 */
	chunk_t (*get_initiator_nonce)(tcg_pts_attr_dh_nonce_finish_t *this);
	
};

/**
 * Creates an tcg_pts_attr_dh_nonce_finish_t object
 *
 * @param hash_algo					Selected hash algorithm
 * @param initiator_value			DH Initiator Public Value
 * @param initiator_nonce			DH Initiator Nonce
 */
pa_tnc_attr_t* tcg_pts_attr_dh_nonce_finish_create(
										pts_meas_algorithms_t hash_algo,
   										chunk_t initiator_value,
										chunk_t initiator_nonce);

/**
 * Creates an tcg_pts_attr_dh_nonce_finish_t object from received data
 *
 * @param value						unparsed attribute value
 */
pa_tnc_attr_t* tcg_pts_attr_dh_nonce_finish_create_from_data(chunk_t value);

#endif /** TCG_PTS_ATTR_DH_NONCE_FINISH_H_ @}*/