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