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 <encoding/payloads/id_payload.h>
31 #include <network/packet.h>
32 #include <sa/ike_sa.h>
35 typedef struct authenticator_t authenticator_t
;
39 * @brief Class authenticator_t. Used to authenticate a peer.
41 * Currently only preshared secret as auth_method supported!
45 struct authenticator_t
{
48 * @brief Verifying of given authentication data.
51 * @param this authenticator_t object
53 * - NOT_SUPPORTED if auth_method is not supported
55 status_t (*verify_auth_data
) (authenticator_t
*this,auth_payload_t
*auth_payload
, chunk_t last_received_packet
,chunk_t my_nonce
,id_payload_t
*other_id_payload
, bool initiator
,bool *verified
);
58 * @brief Verifying of given authentication data.
61 * @param this authenticator_t object
63 * - NOT_SUPPORTED if auth_method is not supported
65 status_t (*compute_auth_data
) (authenticator_t
*this,auth_payload_t
**auth_payload
, chunk_t last_sent_packet
,chunk_t other_nonce
,id_payload_t
*my_id_payload
, bool initiator
);
67 * @brief Destroys a authenticator_t object.
69 * @param this authenticator_t object
71 void (*destroy
) (authenticator_t
*this);
74 authenticator_t
*authenticator_create(protected_ike_sa_t
*ike_sa
);
76 #endif //_AUTHENTICATOR_H_