![]() |
The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Code common to EAP-SIM/AKA/AKA' clients and servers. More...
#include <freeradius-devel/io/test_point.h>#include <freeradius-devel/server/module.h>#include <freeradius-devel/tls/base.h>#include <freeradius-devel/tls/strerror.h>#include <freeradius-devel/util/dbuff.h>#include <freeradius-devel/util/rand.h>#include <freeradius-devel/util/debug.h>#include <freeradius-devel/util/sha1.h>#include <freeradius-devel/eap/types.h>#include "base.h"#include "attrs.h"#include "crypto_priv.h"
Include dependency graph for encode.c:Go to the source code of this file.
Macros | |
| #define | SIM_MAX_ATTRIBUTE_VALUE_LEN ((255 * 4) - 2) /* max length field value less Type + Length fields */ |
Functions | |
| static int | _test_ctx_free (UNUSED fr_aka_sim_ctx_t *ctx) |
| static ssize_t | encode_array (fr_dbuff_t *dbuff, fr_da_stack_t *da_stack, int depth, fr_dcursor_t *cursor, void *encode_ctx) |
| Encodes the data portion of an attribute. | |
| static ssize_t | encode_encrypted_value (fr_dbuff_t *dbuff, uint8_t const *in, size_t inlen, void *encode_ctx) |
| encrypt a value with AES-CBC-128 | |
| static ssize_t | encode_iv (fr_dbuff_t *dbuff, void *encode_ctx) |
| Add an IV to a packet. | |
| static ssize_t | encode_rfc (fr_dbuff_t *dbuff, fr_da_stack_t *da_stack, unsigned int depth, fr_dcursor_t *cursor, void *encode_ctx) |
| Encode an RFC format attribute header. | |
| static int | encode_test_ctx_aka (void **out, TALLOC_CTX *ctx, UNUSED fr_dict_t const *dict, UNUSED fr_dict_attr_t const *root_da) |
| static int | encode_test_ctx_sim (void **out, TALLOC_CTX *ctx, UNUSED fr_dict_t const *dict, UNUSED fr_dict_attr_t const *root_da) |
| static int | encode_test_ctx_sim_rfc4186 (void **out, TALLOC_CTX *ctx, UNUSED fr_dict_t const *dict, UNUSED fr_dict_attr_t const *root_da) |
| static ssize_t | encode_tlv (fr_dbuff_t *dbuff, fr_da_stack_t *da_stack, unsigned int depth, fr_dcursor_t *cursor, void *encode_ctx) |
| static ssize_t | encode_tlv_internal (fr_dbuff_t *dbuff, fr_da_stack_t *da_stack, unsigned int depth, fr_dcursor_t *cursor, void *encode_ctx) |
| static ssize_t | encode_value (fr_dbuff_t *dbuff, fr_da_stack_t *da_stack, int depth, fr_dcursor_t *cursor, void *encode_ctx) |
| Encodes the data portion of an attribute. | |
| ssize_t | fr_aka_sim_encode (request_t *request, fr_pair_list_t *to_encode, void *encode_ctx) |
| ssize_t | fr_aka_sim_encode_pair (fr_dbuff_t *dbuff, fr_dcursor_t *cursor, void *encode_ctx) |
| static void * | fr_eap_aka_sim_next_encodable (fr_dcursor_t *cursor, void *current, UNUSED void *uctx) |
| Implements the iterator for EAP-AKA. | |
| static fr_aka_sim_ctx_t * | test_ctx_init (TALLOC_CTX *ctx, uint8_t const *k_encr, size_t k_encr_len) |
Variables | |
| fr_test_point_pair_encode_t | aka_tp_encode |
| fr_test_point_pair_encode_t | sim_tp_encode |
| fr_test_point_pair_encode_t | sim_tp_encode_rfc4186 |
Code common to EAP-SIM/AKA/AKA' clients and servers.
Definition in file encode.c.
|
static |
|
static |
Encodes the data portion of an attribute.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| AT_VERSION_L..| Length | Actual Version List Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Supported Version 1 | Supported Version 2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Supported Version N | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Definition at line 521 of file encode.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
encrypt a value with AES-CBC-128
encrypts a value using AES-CBC-128, padding the value with AT_PADDING attributes until it matches the block length of the cipher (16).
May also write out an AT_IV attribute if this is the first encrypted value being encoded.
1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| AT_ENCR_DATA | Length | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. Encrypted Data .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Definition at line 160 of file encode.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Add an IV to a packet.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| AT_IV | Length = 5 | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| Initialization Vector |
| |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Definition at line 109 of file encode.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Encode an RFC format attribute header.
This could be a standard attribute, or a TLV data type. If it's a standard attribute, then vp->da->attr == attribute. Otherwise, attribute may be something else.
Definition at line 592 of file encode.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
|
static |
|
static |
|
static |
|
inlinestatic |
|
static |
Encodes the data portion of an attribute.
Definition at line 277 of file encode.c.
Here is the call graph for this function:
Here is the caller graph for this function:| ssize_t fr_aka_sim_encode | ( | request_t * | request, |
| fr_pair_list_t * | to_encode, | ||
| void * | encode_ctx | ||
| ) |
| ssize_t fr_aka_sim_encode_pair | ( | fr_dbuff_t * | dbuff, |
| fr_dcursor_t * | cursor, | ||
| void * | encode_ctx | ||
| ) |
|
static |
Implements the iterator for EAP-AKA.
| [in] | cursor | to iterate over. |
| [in] | current | The fr_pair_t cursor->current. Will be advanced and checked to see if it matches the specified fr_dict_t. |
| [in] | uctx | The fr_dict_t to search for. |
Definition at line 74 of file encode.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
| fr_test_point_pair_encode_t aka_tp_encode |
| fr_test_point_pair_encode_t sim_tp_encode |
| fr_test_point_pair_encode_t sim_tp_encode_rfc4186 |
1.9.8