Return to tcg_pts_attr_dh_nonce_finish.h CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / strongswan / src / libimcv / tcg / pts |
1.1 misho 1: /* 2: * Copyright (C) 2011 Sansar Choinyambuu 3: * Copyright (C) 2014 Andreas Steffen 4: * HSR Hochschule fuer Technik Rapperswil 5: * 6: * This program is free software; you can redistribute it and/or modify it 7: * under the terms of the GNU General Public License as published by the 8: * Free Software Foundation; either version 2 of the License, or (at your 9: * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. 10: * 11: * This program is distributed in the hope that it will be useful, but 12: * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14: * for more details. 15: */ 16: 17: /** 18: * @defgroup tcg_pts_attr_dh_nonce_finish tcg_pts_attr_dh_nonce_finish 19: * @{ @ingroup tcg_attr 20: */ 21: 22: #ifndef TCG_PTS_ATTR_DH_NONCE_FINISH_H_ 23: #define TCG_PTS_ATTR_DH_NONCE_FINISH_H_ 24: 25: typedef struct tcg_pts_attr_dh_nonce_finish_t tcg_pts_attr_dh_nonce_finish_t; 26: 27: #include "tcg/tcg_attr.h" 28: #include "pa_tnc/pa_tnc_attr.h" 29: #include "pts/pts_meas_algo.h" 30: 31: /** 32: * Class implementing the TCG PTS DH Nonce Finish Attribute 33: */ 34: struct tcg_pts_attr_dh_nonce_finish_t { 35: 36: /** 37: * Public PA-TNC attribute interface 38: */ 39: pa_tnc_attr_t pa_tnc_attribute; 40: 41: /** 42: * Get nonce length 43: * 44: * @return Length of nonce 45: */ 46: uint8_t (*get_nonce_len)(tcg_pts_attr_dh_nonce_finish_t *this); 47: 48: /** 49: * Get selected hash algorithm 50: * 51: * @return Selected hash algorithm 52: */ 53: pts_meas_algorithms_t (*get_hash_algo)(tcg_pts_attr_dh_nonce_finish_t *this); 54: 55: /** 56: * Get DH Initiator Public Value 57: * 58: * @return DH Initiator Public Value 59: */ 60: chunk_t (*get_initiator_value)(tcg_pts_attr_dh_nonce_finish_t *this); 61: 62: /** 63: * Get DH Initiator Nonce 64: * 65: * @return DH Initiator Nonce 66: */ 67: chunk_t (*get_initiator_nonce)(tcg_pts_attr_dh_nonce_finish_t *this); 68: 69: }; 70: 71: /** 72: * Creates an tcg_pts_attr_dh_nonce_finish_t object 73: * 74: * @param hash_algo Selected hash algorithm 75: * @param initiator_value DH Initiator Public Value 76: * @param initiator_nonce DH Initiator Nonce 77: */ 78: pa_tnc_attr_t* tcg_pts_attr_dh_nonce_finish_create( 79: pts_meas_algorithms_t hash_algo, 80: chunk_t initiator_value, 81: chunk_t initiator_nonce); 82: 83: /** 84: * Creates an tcg_pts_attr_dh_nonce_finish_t object from received data 85: * 86: * @param length Total length of attribute value 87: * @param value Unparsed attribute value (might be a segment) 88: */ 89: pa_tnc_attr_t* tcg_pts_attr_dh_nonce_finish_create_from_data(size_t length, 90: chunk_t value); 91: 92: #endif /** TCG_PTS_ATTR_DH_NONCE_FINISH_H_ @}*/