- forgot to add
[strongswan.git] / Source / charon / sa / authenticator.h
1 /**
2 * @file authenticator.h
3 *
4 * @brief Interface of authenticator.
5 *
6 */
7
8 /*
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 * for more details.
21 */
22
23
24 #ifndef _AUTHENTICATOR_H_
25 #define _AUTHENTICATOR_H_
26
27
28 #include <types.h>
29 #include <encoding/payloads/auth_payload.h>
30 #include <utils/identification.h>
31 #include <sa/ike_sa.h>
32
33
34 typedef struct authenticator_t authenticator_t;
35
36
37 /**
38 * @brief Class authenticator_t. Used to authenticate a peer.
39 *
40 * Currently only preshared secret as auth_method supported!
41 *
42 * @ingroup sa
43 */
44 struct authenticator_t {
45
46 /**
47 * @brief Verifying of given authentication data.
48 *
49 * TODO
50 * @param this authenticator_t object
51 * @return
52 * - NOT_SUPPORTED if auth_method is not supported
53 */
54 status_t (*verify_authentication) (authenticator_t *this,auth_method_t auth_method, chunk_t auth_data, chunk_t last_message, chunk_t other_nonce,identification_t *my_id,bool *verified);
55
56 /**
57 * @brief Verifying of given authentication data.
58 *
59 * TODO
60 * @param this authenticator_t object
61 * @return
62 * - NOT_SUPPORTED if auth_method is not supported
63 */
64 status_t (*allocate_auth_data) (authenticator_t *this,auth_method_t auth_method,chunk_t last_message, chunk_t other_nonce,identification_t *my_id,chunk_t *auth_data);
65
66
67 /**
68 * @brief Destroys a authenticator_t object.
69 *
70 * @param this authenticator_t object
71 */
72 void (*destroy) (authenticator_t *this);
73 };
74
75 authenticator_t *authenticator_create(protected_ike_sa_t *ike_sa);
76
77 #endif //_AUTHENTICATOR_H_