The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
module.h
Go to the documentation of this file.
1#pragma once
2/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or (at
6 * your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
16 */
17
18/**
19 * $Id: 869c0a23553b26df9b6ab68c8815f64b6ff7ddeb $
20 * @file lib/eap_aka_sim/module.h
21 * @brief Declarations for the common module functions used by EAP-SIM/AKA submodules
22 *
23 * @author Arran Cudbard-Bell (a.cudbardb@freeradius.org)
24 *
25 * @copyright 2016-2019 The FreeRADIUS server project
26 * @copyright 2016-2019 Network RADIUS SAS <legal.com>
27 */
28RCSIDH(lib_eap_aka_sim_module_h, "$Id: 869c0a23553b26df9b6ab68c8815f64b6ff7ddeb $")
29
30#include <freeradius-devel/server/cf_util.h>
31#include <freeradius-devel/server/virtual_servers.h>
32#include <freeradius-devel/eap/types.h>
33
34#include <freeradius-devel/tls/openssl_user_macros.h>
35#include <openssl/evp.h>
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41typedef struct {
42 virtual_server_t *virtual_server; //!< Virtual server.
43
44 /** Whether we should include a bid-down prevention attribute by default
45 *
46 * Only used for EAP-AKA, as a signal that EAP-AKA' was available/enabled
47 * on the server, and if the client supports EAP-AKA', it should continue
48 * with that EAP-Method instead.
49 */
50 struct {
51 bool send_at_bidding_prefer_prime; //!< Include the AT bidding attribute in
52 ///< challenge requests.
53 bool send_at_bidding_prefer_prime_is_set; //!< Whether the user specified
54 ///< a value.
55 } aka;
56
59
60/** Structure used to track session state at the module level
61 *
62 * The process module has a similar structure (eap_aka_sim_module_t) which tracks
63 * all of the cryptographic parameters for the session.
64 *
65 * The structure here stores copies of the cryptographic parameters used for
66 * validating incoming packets, and signing outgoing packets, from control attributes
67 * provided by the state machine.
68 *
69 * This separation is to allow the process module to be executed without the
70 * submodule, so that the state machine can be tested independently of the
71 * encode/decode/crypto code.
72 */
73typedef struct {
74 uint8_t id; //!< Last ID used, monotonically increments.
75
76 uint8_t *response_hmac_extra; //!< Data to concatenate to response packet
77 ///< before validating.
79
81
82 fr_aka_sim_checkcode_t *checkcode_state; //!< Digest of all identity packets we've seen.
85
87
88#ifdef __cplusplus
89}
90#endif
unlang_action_t
Returned by unlang_op_t calls, determine the next action of the interpreter.
Definition action.h:35
#define RCSIDH(h, id)
Definition build.h:507
enum eap_type eap_type_t
Stores our checkcode state.
Definition base.h:140
Encoder/decoder ctx.
Definition base.h:234
uint8_t * response_hmac_extra
Data to concatenate to response packet before validating.
Definition module.h:76
size_t response_hmac_extra_len
Definition module.h:78
fr_aka_sim_ctx_t ctx
Definition module.h:83
unlang_action_t eap_aka_sim_process(unlang_result_t *p_result, module_ctx_t const *mctx, request_t *request)
Decode EAP session data into attribute.
Definition module.c:292
virtual_server_t * virtual_server
Virtual server.
Definition module.h:42
unlang_result_t virtual_server_result
Definition module.h:80
uint8_t id
Last ID used, monotonically increments.
Definition module.h:74
fr_aka_sim_checkcode_t * checkcode_state
Digest of all identity packets we've seen.
Definition module.h:82
Structure used to track session state at the module level.
Definition module.h:73
unsigned char uint8_t
Temporary structure to hold arguments for module calls.
Definition module_ctx.h:41