implemented xauth as a pluto plugin
[strongswan.git] / src / pluto / xauth / xauth_verifier.h
1 /*
2 * Copyright (C) 2010 Andreas Steffen
3 * Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16 /**
17 * @defgroup xauth_verifier xauth_verifier
18 * @{ @ingroup xauth
19 */
20
21 #ifndef XAUTH_VERIFIER_H_
22 #define XAUTH_VERIFIER_H_
23
24 #include <library.h>
25
26 #include <connections.h>
27
28 typedef struct xauth_verifier_t xauth_verifier_t;
29
30 /**
31 * An xauth verifier verifies xauth user secrets on the server side.
32 */
33 struct xauth_verifier_t {
34
35 /**
36 * Verify an XAUTH user secret base on connection information
37 *
38 * @param c connection information
39 * @param secret secret to be compared
40 * @return TRUE if secret matches
41 */
42 bool (*verify_secret)(xauth_verifier_t *this, connection_t *c, chunk_t secret);
43
44 /**
45 * Destroy an xauth_verifier instance.
46 */
47 void (*destroy)(xauth_verifier_t *this);
48 };
49
50 /**
51 * Create an xauth_verifier instance.
52 */
53 xauth_verifier_t *xauth_verifier_create();
54
55 #endif /** XAUTH_VERIFIER_H_ @}*/
56