2 * @file authenticator.h
4 * @brief Interface of authenticator.
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
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>.
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
24 #ifndef _AUTHENTICATOR_H_
25 #define _AUTHENTICATOR_H_
29 #include <encoding/payloads/auth_payload.h>
30 #include <utils/identification.h>
31 #include <sa/ike_sa.h>
34 typedef struct authenticator_t authenticator_t
;
38 * @brief Class authenticator_t. Used to authenticate a peer.
40 * Currently only preshared secret as auth_method supported!
44 struct authenticator_t
{
47 * @brief Verifying of given authentication data.
50 * @param this authenticator_t object
52 * - NOT_SUPPORTED if auth_method is not supported
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
);
57 * @brief Verifying of given authentication data.
60 * @param this authenticator_t object
62 * - NOT_SUPPORTED if auth_method is not supported
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
);
68 * @brief Destroys a authenticator_t object.
70 * @param this authenticator_t object
72 void (*destroy
) (authenticator_t
*this);
75 authenticator_t
*authenticator_create(protected_ike_sa_t
*ike_sa
);
77 #endif //_AUTHENTICATOR_H_