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"
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. More... | |
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 More... | |
static ssize_t | encode_iv (fr_dbuff_t *dbuff, void *encode_ctx) |
Add an IV to a packet. More... | |
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. More... | |
static int | encode_test_ctx_aka (void **out, TALLOC_CTX *ctx) |
static int | encode_test_ctx_sim (void **out, TALLOC_CTX *ctx) |
static int | encode_test_ctx_sim_rfc4186 (void **out, TALLOC_CTX *ctx) |
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. More... | |
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 bool | is_eap_aka_encodable (void const *item, UNUSED void const *uctx) |
Evaluation function for EAP-AKA-encodability. More... | |
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 516 of file encode.c.
|
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 155 of file encode.c.
|
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 104 of file encode.c.
|
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 587 of file encode.c.
|
static |
|
static |
|
static |
|
static |
|
inlinestatic |
|
static |
Encodes the data portion of an attribute.
Definition at line 272 of file encode.c.
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 |
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 |