The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
Loading...
Searching...
No Matches
xlat.c
Go to the documentation of this file.
1/*
2 * This program 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 * @file src/lib/eap_aka_sim/xlat.c
19 * @brief EAP-SIM/EAP-AKA identity detection, creation, and decyption.
20 *
21 * Implements the encrypted IMSI scheme described in TS 33.402 Release 14,
22 * section 14.
23 *
24 * @copyright 2017 The FreeRADIUS server project
25 */
26
27#include <freeradius-devel/server/base.h>
28#include <freeradius-devel/unlang/xlat_func.h>
29
30#include "base.h"
31#include "attrs.h"
32
33static int aka_sim_xlat_refs = 0;
34
35
37 { .required = true, .single = true, .type = FR_TYPE_STRING },
39};
40
41/** Returns the SIM method EAP-SIM or EAP-AKA hinted at by the user identifier
42 *
43@verbatim
44%aka_sim_id_method(%{id_attr})
45@endverbatim
46 *
47 * @ingroup xlat_functions
48 */
50 UNUSED xlat_ctx_t const *xctx,
52 fr_value_box_list_t *in)
53{
54 char const *method;
55 fr_aka_sim_id_type_t type_hint;
56 fr_aka_sim_method_hint_t method_hint;
57 fr_value_box_t *id = fr_value_box_list_head(in);
59
60 if (fr_aka_sim_id_type(&type_hint, &method_hint, id->vb_strvalue, id->vb_length) < 0) {
61 RPEDEBUG2("AKA/SIM Id \"%pV\" has unrecognised format", id);
62 return XLAT_ACTION_FAIL;
63 }
64
65 switch (method_hint) {
66 default:
68 return XLAT_ACTION_DONE;
69
72 fr_box_uint32(FR_METHOD_HINT_VALUE_SIM));
73 break;
74
77 fr_box_uint32(FR_METHOD_HINT_VALUE_AKA));
78 break;
79
82 fr_box_uint32(FR_METHOD_HINT_VALUE_AKA_PRIME));
83 break;
84 }
85
86 if (!method) {
87 REDEBUG2("No dictionary value name for method hint");
88 return XLAT_ACTION_FAIL;
89 }
90
91 MEM(vb = fr_value_box_alloc(ctx, FR_TYPE_STRING, NULL));
92 fr_value_box_bstrndup(vb, vb, NULL, method, strlen(method), false);
94
95 return XLAT_ACTION_DONE;
96}
97
99 { .required = true, .single = true, .type = FR_TYPE_STRING },
101};
102
103/** Returns the type of identity used
104 *
105@verbatim
106%aka_sim_id_type(%{id_attr})
107@endverbatim
108 *
109 * @ingroup xlat_functions
110 */
112 UNUSED xlat_ctx_t const *xctx,
113 request_t *request, fr_value_box_list_t *in)
114{
115 char const *type;
116 fr_aka_sim_id_type_t type_hint;
117 fr_aka_sim_method_hint_t method_hint;
118 fr_value_box_t *id = fr_value_box_list_head(in);
119 fr_value_box_t *vb;
120
121 if (fr_aka_sim_id_type(&type_hint, &method_hint, id->vb_strvalue, id->vb_length) < 0) {
122 RPEDEBUG2("AKA/AKA/SIM Id \"%pV\" has unrecognised format", id);
123 return XLAT_ACTION_FAIL;
124 }
125
126 switch (type_hint) {
127 default:
129 return XLAT_ACTION_DONE;
130
133 fr_box_uint32(FR_IDENTITY_TYPE_VALUE_PERMANENT));
134 break;
135
138 fr_box_uint32(FR_IDENTITY_TYPE_VALUE_PSEUDONYM));
139 break;
140
143 fr_box_uint32(FR_IDENTITY_TYPE_VALUE_FASTAUTH));
144 break;
145 }
146
147 if (!type) {
148 REDEBUG2("No dictionary value name for identity type");
149 return XLAT_ACTION_FAIL;
150 }
151
152 MEM(vb = fr_value_box_alloc(ctx, FR_TYPE_STRING, NULL));
153 fr_value_box_bstrndup(vb, vb, NULL, type, strlen(type), false);
155
156 return XLAT_ACTION_DONE;
157}
158
163
164/** Returns the key index from a 3gpp temporary id
165 *
166@verbatim
167%3gpp_temporary_id.key_index(%{id_attr})
168@endverbatim
169 *
170 * @ingroup xlat_functions
171 */
173 UNUSED xlat_ctx_t const *xctx,
174 request_t *request, fr_value_box_list_t *in)
175{
176 fr_value_box_t *id = fr_value_box_list_head(in);
177 fr_value_box_t *vb;
178
179 if (id->vb_length != AKA_SIM_3GPP_PSEUDONYM_LEN) {
180 REDEBUG2("3gpp pseudonym incorrect length, expected %u bytes, got %zu bytes",
181 AKA_SIM_3GPP_PSEUDONYM_LEN, id->vb_length);
182 return XLAT_ACTION_FAIL;
183 }
184
185 MEM(vb = fr_value_box_alloc(ctx, FR_TYPE_UINT8, NULL));
186 vb->vb_uint8 = fr_aka_sim_id_3gpp_pseudonym_tag(id->vb_strvalue);
188
189 return XLAT_ACTION_DONE;
190}
191
193 { .required = true, .concat = true, .single = false, .type = FR_TYPE_STRING,
194 .func = NULL, .uctx = NULL },
195 { .required = true, .concat = true, .single = false, .type = FR_TYPE_OCTETS,
196 .func = NULL, .uctx = NULL },
197 { .required = false, .concat = false, .single = true, .type = FR_TYPE_BOOL,
198 .func = NULL, .uctx = NULL },
200};
201
202/** Decrypt a 3gpp temporary id
203 *
204 @verbatim
205 %3gpp_temporary_id.decrypt(<id> <key>)
206 @endverbatim
207 *
208 * The pseudonym is in the format
209 @verbatim
210 0 1 2 3
211 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
212 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
213 | Tag | KeyID | Encrypted IMSI
214 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
215 |
216 | Encrypted IMSI (cont) |
217 | |
218 | |-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
219 +-+-+-+-+-+-+-+-+-+-+
220 @endverbatim
221 *
222 * Tag (6 bits) - Used to mark the identity as a temporary pseudonym
223 * or re-authentication identity. The idea of this being 6 bits is
224 * so that we can choose values that match base64 sextets, so the
225 * first character in the base64 output matches one of the known tags
226 * for EAP-SIM/AKA/AKA' identities.
227 *
228 * Key Indicator (4 bits) - Used to select the appropriate key from
229 * multiple keys the server may have used to encrypt IMSIs.
230 *
231 * Encrypted IMSI (128 bits) - The original IMSI encrypted with
232 * AES-128-ECB.
233 *
234 * @ingroup xlat_functions
235 */
237 UNUSED xlat_ctx_t const *xctx,
238 request_t *request, fr_value_box_list_t *in)
239{
240 uint8_t tag;
241 char out_tag = '\0', *buff;
242
243 char decrypted[AKA_SIM_IMSI_MAX_LEN + 1];
244
245 fr_value_box_t *id_vb = fr_value_box_list_head(in);
246 char const *id = id_vb->vb_strvalue;
247 size_t id_len = id_vb->vb_length;
248
249 fr_value_box_t *key_vb = fr_value_box_list_next(in, id_vb);
250 uint8_t const *key = key_vb->vb_octets;
251 size_t key_len = key_vb->vb_length;
252
253 fr_value_box_t *tag_vb = fr_value_box_list_next(in, key_vb);
254 bool include_tag = true;
255
256 fr_value_box_t *vb;
258
259 if (tag_vb) include_tag = tag_vb->vb_bool;
260
261 if (id_len != (AKA_SIM_3GPP_PSEUDONYM_LEN)) {
262 REDEBUG2("3gpp pseudonym incorrect length, expected %u bytes, got %zu bytes",
264 error:
265 return XLAT_ACTION_FAIL;
266 }
267
268 if (key_len != 16) {
269 REDEBUG2("Decryption key incorrect length, expected %i bytes, got %zu bytes", 16, key_len);
270 goto error;
271 }
272
273 if (include_tag) {
274 /*
275 * Figure out what tag we should add to the permanent id
276 */
277 eap_type = fr_pair_find_by_da(&request->request_pairs, NULL, attr_eap_type);
278 if (eap_type) {
279 if (eap_type->vp_uint32 == enum_eap_type_sim->vb_uint32) {
280 out_tag = ID_TAG_SIM_PERMANENT;
281 } else if (eap_type->vp_uint32 == enum_eap_type_aka->vb_uint32) {
282 out_tag = ID_TAG_AKA_PERMANENT;
283 } else if (eap_type->vp_uint32 == enum_eap_type_aka_prime->vb_uint32) {
285 } else {
286 goto use_existing_tag;
287 }
288 } else {
289 use_existing_tag:
291 switch (tag) {
294 out_tag = ID_TAG_SIM_PERMANENT;
295 break;
296
299 out_tag = ID_TAG_AKA_PERMANENT;
300 break;
301
305 break;
306
307 default:
308 REDEBUG2("Unexpected tag value (%u) in AKA/SIM Id \"%pV\"", tag, fr_box_strvalue_len(id, id_len));
309 goto error;
310 }
311 }
312 }
313
314 RDEBUG2("Decrypting \"%pV\"", fr_box_strvalue_len(id, id_len));
315 if (fr_aka_sim_id_3gpp_pseudonym_decrypt(decrypted, id, key) < 0) {
316 RPEDEBUG2("Failed decrypting AKA/SIM Id");
317 goto error;
318 }
319
320 /*
321 * Recombine unencrypted IMSI with tag
322 */
323 MEM(vb = fr_value_box_alloc_null(ctx));
324 if (include_tag) {
325 MEM(fr_value_box_bstr_alloc(vb, &buff, vb, NULL, AKA_SIM_IMSI_MAX_LEN + 1, false) == 0);
326 *buff = out_tag;
327 memcpy(buff + 1, decrypted, AKA_SIM_IMSI_MAX_LEN);
328 } else {
329 MEM(fr_value_box_bstrndup(vb, vb, NULL, decrypted, AKA_SIM_IMSI_MAX_LEN, true) == 0);
330 }
332
333 return XLAT_ACTION_DONE;
334}
335
337 { .required = true, .concat = true, .single = false, .type = FR_TYPE_STRING },
338 { .required = true, .concat = true, .single = false, .type = FR_TYPE_OCTETS },
339 { .required = true, .concat = false, .single = true, .type = FR_TYPE_UINT8 },
340 { .required = false, .concat = false, .single = true, .type = FR_TYPE_STRING },
342};
343
344/** Encrypts a 3gpp pseudonym
345 *
346@verbatim
347%3gpp_temporary_id.encrypt(<id>, <key>, <index>, [(pseudonym|fastauth)])
348@endverbatim
349 *
350 * @ingroup xlat_functions
351 */
353 UNUSED xlat_ctx_t const *xctx,
354 request_t *request, fr_value_box_list_t *in)
355{
356 char encrypted[AKA_SIM_3GPP_PSEUDONYM_LEN + 1];
357 uint8_t tag = 0;
358
359 char const *id_p, *id_end;
360 fr_aka_sim_id_type_t type_hint;
361 fr_aka_sim_method_hint_t method_hint;
362
363 fr_value_box_t *id_vb = fr_value_box_list_head(in);
364 char const *id = id_vb->vb_strvalue;
365 size_t id_len = id_vb->vb_length;
366
367 fr_value_box_t *key_vb = fr_value_box_list_next(in, id_vb);
368 uint8_t const *key = key_vb->vb_octets;
369 size_t key_len = key_vb->vb_length;
370
371 fr_value_box_t *index_vb = fr_value_box_list_next(in, key_vb);
372 uint8_t key_index = index_vb->vb_uint8;
373
374 fr_value_box_t *type_vb = fr_value_box_list_next(in, index_vb);
375
376 bool fastauth = false;
377
378 fr_value_box_t *vb;
379
380 /*
381 * Get the key index
382 */
383 if (key_index > 15) {
384 REDEBUG2("Key index must be between 0-15");
385 error:
386 return XLAT_ACTION_FAIL;
387 }
388
389 if (key_len != 16) {
390 REDEBUG2("Encryption key incorrect length, expected %i bytes, got %zu bytes", 16, key_len);
391 goto error;
392 }
393
394 /*
395 * Check for the optional type argument
396 */
397 if (type_vb) {
398 fr_dict_enum_value_t const *type_enum;
399
401 type_vb->vb_strvalue, type_vb->vb_length);
402 if (!type_enum) {
403 bad_type:
404 REDEBUG2("Bad type %pV, must be one of 'fastauth' or 'pseudonym'", type_vb);
405 goto error;
406 }
407
408 switch (type_enum->value->vb_uint32) {
409 case FR_IDENTITY_TYPE_VALUE_PSEUDONYM:
410 break;
411
412 case FR_IDENTITY_TYPE_VALUE_FASTAUTH:
413 fastauth = true;
414 break;
415
416 default:
417 goto bad_type;
418 }
419 }
420
421 /*
422 * Determine what type/method hints are in the current ID.
423 */
424 if (id_len == (AKA_SIM_IMSI_MAX_LEN + 1)) { /* +1 for ID tag */
425 if (fr_aka_sim_id_type(&type_hint, &method_hint, id, id_len) < 0) {
426 RPEDEBUG2("ID \"%pV\" has unrecognised format", fr_box_strvalue_len(id, id_len));
427 goto error;
428 }
429
430 if (type_hint != AKA_SIM_ID_TYPE_PERMANENT) {
431 REDEBUG2("ID \"%pV\" is not a permanent identity (IMSI)", fr_box_strvalue_len(id, id_len));
432 goto error;
433 }
434
435 switch (method_hint) {
438 break;
439
442 break;
443
446 break;
447
450 REDEBUG2("ID \"%pV\" does not contain a method hint", fr_box_strvalue_len(id, id_len));
451 goto error;
452 }
453
454 id_p = id + 1;
455 id_end = (id_p + id_len) - 1;
456 /*
457 * ID lacks a hint byte, figure it out from &request.EAP-Type
458 */
459 } else if ((id_len >= AKA_SIM_IMSI_MIN_LEN) && (id_len <= AKA_SIM_IMSI_MAX_LEN)) {
461
462 eap_type = fr_pair_find_by_da(&request->request_pairs, NULL, attr_eap_type);
463 if (!eap_type) {
464 REDEBUG("ID does not contain method hint, and no request.EAP-Type found. "
465 "Don't know what tag to prepend to encrypted identity");
466 goto error;
467 }
468
469 if (eap_type->vp_uint32 == enum_eap_type_sim->vb_uint32) {
471 } else if (eap_type->vp_uint32 == enum_eap_type_aka->vb_uint32) {
473 } else if (eap_type->vp_uint32 == enum_eap_type_aka_prime->vb_uint32) {
475 } else {
476 REDEBUG("request.EAP-Type does not match a SIM based EAP-Type (SIM, AKA, AKA-Prime)");
477 goto error;
478 }
479
480 id_p = id;
481 id_end = id_p + id_len;
482 } else {
483 REDEBUG2("IMSI incorrect length, expected %u bytes, got %zu bytes", AKA_SIM_IMSI_MAX_LEN + 1,
484 id_len);
485 goto error;
486
487 }
488
489 /*
490 * Encrypt the IMSI
491 *
492 * Strip existing tag from the permanent id
493 */
494 if (fr_aka_sim_id_3gpp_pseudonym_encrypt(encrypted, id_p, id_end - id_p, tag, (uint8_t)key_index, key) < 0) {
495 RPEDEBUG2("Failed encrypting SIM ID \"%pV\"", fr_box_strvalue_len(id, id_len));
496 return XLAT_ACTION_FAIL;
497 }
498
499 MEM(vb = fr_value_box_alloc(ctx, FR_TYPE_STRING, NULL));
500 fr_value_box_bstrndup(vb, vb, NULL, encrypted, strlen(encrypted), false);
502
503 return XLAT_ACTION_DONE;
504}
505
507{
508 xlat_t *xlat;
509
510 if (aka_sim_xlat_refs) {
512 return 0;
513 }
514
515 if (unlikely((xlat = xlat_func_register(NULL, "aka_sim_id_method", aka_sim_xlat_id_method_xlat, FR_TYPE_STRING)) == NULL)) return -1;
517 if (unlikely((xlat = xlat_func_register(NULL, "aka_sim_id_type", aka_sim_xlat_id_type_xlat, FR_TYPE_STRING)) == NULL)) return -1;
519 if (unlikely((xlat = xlat_func_register(NULL, "3gpp_temporary_id_key_index", aka_sim_id_3gpp_temporary_id_key_index_xlat, FR_TYPE_UINT8)) == NULL)) return -1;
521 if (unlikely((xlat = xlat_func_register(NULL, "3gpp_temporary_id.key_index", aka_sim_id_3gpp_temporary_id_key_index_xlat, FR_TYPE_UINT8)) == NULL)) return -1;
523
524 if (unlikely((xlat = xlat_func_register(NULL, "3gpp_temporary_id_decrypt", aka_sim_3gpp_temporary_id_decrypt_xlat, FR_TYPE_STRING)) == NULL)) return -1;
526
527 if (unlikely((xlat = xlat_func_register(NULL, "3gpp_temporary_id.decrypt", aka_sim_3gpp_temporary_id_decrypt_xlat, FR_TYPE_STRING)) == NULL)) return -1;
529
530 if (unlikely((xlat = xlat_func_register(NULL, "3gpp_temporary_id_encrypt", aka_sim_3gpp_temporary_id_encrypt_xlat, FR_TYPE_STRING)) == NULL)) return -1;
532 if (unlikely((xlat = xlat_func_register(NULL, "3gpp_temporary_id.encrypt", aka_sim_3gpp_temporary_id_encrypt_xlat, FR_TYPE_STRING)) == NULL)) return -1;
534
536
537 return 0;
538}
539
541{
542 if (aka_sim_xlat_refs > 1) {
544 return;
545 }
546
547 xlat_func_unregister("aka_sim_id_method");
548 xlat_func_unregister("aka_sim_id_type");
549 xlat_func_unregister("3gpp_temporary_id_key_index");
550 xlat_func_unregister("3gpp_temporary_id.key_index");
551 xlat_func_unregister("3gpp_temporary_id_decrypt");
552 xlat_func_unregister("3gpp_temporary_id.decrypt");
553 xlat_func_unregister("3gpp_temporary_id_encrypt");
554 xlat_func_unregister("3gpp_temporary_id.encrypt");
556}
static uint8_t request[4]
#define unlikely(_x)
Definition build.h:486
#define UNUSED
Definition build.h:415
static int fr_dcursor_append(fr_dcursor_t *cursor, void *v)
Insert a single item at the end of the list.
Definition dcursor.h:406
#define MEM(x)
Definition debug.h:38
fr_value_box_t const * value
Enum value (what name maps to).
Definition dict.h:281
char const * fr_dict_enum_name_by_value(fr_dict_attr_t const *da, fr_value_box_t const *value)
Lookup the name of an enum value in a fr_dict_attr_t.
Definition dict_util.c:3765
fr_dict_enum_value_t const * fr_dict_enum_by_name(fr_dict_attr_t const *da, char const *name, ssize_t len)
Definition dict_util.c:3778
Value of an enumerated attribute.
Definition dict.h:277
eap_type
Definition types.h:44
static xlat_arg_parser_t aka_sim_3gpp_temporary_id_encrypt_xlat_args[]
Definition xlat.c:336
static xlat_arg_parser_t const aka_sim_id_3gpp_temporary_id_key_index_xlat_args[]
Definition xlat.c:159
static xlat_arg_parser_t const aka_sim_xlat_id_method_xlat_args[]
Definition xlat.c:36
int fr_aka_sim_xlat_func_register(void)
Definition xlat.c:506
static xlat_arg_parser_t aka_sim_3gpp_temporary_id_decrypt_xlat_args[]
Definition xlat.c:192
static xlat_arg_parser_t const aka_sim_xlat_id_type_xlat_args[]
Definition xlat.c:98
static int aka_sim_xlat_refs
Definition xlat.c:33
void fr_aka_sim_xlat_func_unregister(void)
Definition xlat.c:540
static xlat_action_t aka_sim_id_3gpp_temporary_id_key_index_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in)
Returns the key index from a 3gpp temporary id.
Definition xlat.c:172
static xlat_action_t aka_sim_xlat_id_method_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in)
Returns the SIM method EAP-SIM or EAP-AKA hinted at by the user identifier.
Definition xlat.c:49
static xlat_action_t aka_sim_xlat_id_type_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in)
Returns the type of identity used.
Definition xlat.c:111
static xlat_action_t aka_sim_3gpp_temporary_id_encrypt_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in)
Encrypts a 3gpp pseudonym.
Definition xlat.c:352
static xlat_action_t aka_sim_3gpp_temporary_id_decrypt_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in)
Decrypt a 3gpp temporary id.
Definition xlat.c:236
HIDDEN fr_dict_attr_t const * attr_eap_type
Definition base.c:90
fr_value_box_t const * enum_eap_type_aka
Definition base.c:190
fr_value_box_t const * enum_eap_type_sim
Definition base.c:189
fr_value_box_t const * enum_eap_type_aka_prime
Definition base.c:191
HIDDEN fr_dict_attr_t const * attr_eap_aka_sim_method_hint
Definition base.c:87
HIDDEN fr_dict_attr_t const * attr_eap_aka_sim_identity_type
Definition base.c:75
int fr_aka_sim_id_3gpp_pseudonym_decrypt(char out[AKA_SIM_IMSI_MAX_LEN+1], char const encr_id[AKA_SIM_3GPP_PSEUDONYM_LEN], uint8_t const key[16])
Decrypt the 3GPP pseudonym.
Definition id.c:576
uint8_t fr_aka_sim_id_3gpp_pseudonym_tag(char const encr_id[AKA_SIM_3GPP_PSEUDONYM_LEN])
Return the tag from a 3gpp pseudonym.
Definition id.c:550
int fr_aka_sim_id_3gpp_pseudonym_encrypt(char out[AKA_SIM_3GPP_PSEUDONYM_LEN+1], char const *imsi, size_t imsi_len, uint8_t tag, uint8_t key_ind, uint8_t const key[16])
Create a 3gpp pseudonym from a permanent ID.
Definition id.c:397
int fr_aka_sim_id_type(fr_aka_sim_id_type_t *type, fr_aka_sim_method_hint_t *hint, char const *id, size_t id_len)
Determine what type of ID was provided in the initial identity response.
Definition id.c:167
#define ID_TAG_SIM_PSEUDONYM_B64
Definition id.h:90
#define ID_TAG_AKA_PSEUDONYM_B64
Definition id.h:92
#define AKA_SIM_IMSI_MAX_LEN
Length of an IMSI number in ASCII.
Definition id.h:32
#define ID_TAG_AKA_FASTAUTH_B64
Definition id.h:93
#define ID_TAG_SIM_FASTAUTH_B64
Definition id.h:91
#define ID_TAG_AKA_PRIME_PSEUDONYM_B64
Definition id.h:94
fr_aka_sim_method_hint_t
SIM/AKA method hints.
Definition id.h:39
@ AKA_SIM_METHOD_HINT_AKA
The identity hints the supplicant wants to use EAP-AKA.
Definition id.h:43
@ AKA_SIM_METHOD_HINT_SIM
The identity hints the supplicant wants to use EAP-SIM.
Definition id.h:41
@ AKA_SIM_METHOD_HINT_AKA_PRIME
Definition id.h:45
@ AKA_SIM_METHOD_HINT_MAX
Definition id.h:46
@ AKA_SIM_METHOD_HINT_UNKNOWN
We don't know what method the identity hints at.
Definition id.h:40
#define AKA_SIM_IMSI_MIN_LEN
Minimum length of an IMSI number in ASCII.
Definition id.h:33
#define AKA_SIM_3GPP_PSEUDONYM_LEN
Length of a base64 encoded 3gpp pseudonym.
Definition id.h:31
#define ID_TAG_AKA_PRIME_FASTAUTH_B64
Definition id.h:95
@ ID_TAG_AKA_PERMANENT
IMSI, and hint that client wants to do EAP-AKA.
Definition id.h:66
@ ID_TAG_SIM_PERMANENT
IMSI, and hint that client wants to do EAP-SIM.
Definition id.h:62
@ ID_TAG_AKA_PRIME_PERMANENT
IMSI, and hint that client wants to do EAP-AKA-Prime.
Definition id.h:70
fr_aka_sim_id_type_t
SIM/AKA identity type hints.
Definition id.h:53
@ AKA_SIM_ID_TYPE_UNKNOWN
We don't know what type of identity this is.
Definition id.h:54
@ AKA_SIM_ID_TYPE_PSEUDONYM
This is a custom pseudonym.
Definition id.h:56
@ AKA_SIM_ID_TYPE_PERMANENT
This is a permanent identity (the IMSI of the SIM).
Definition id.h:55
@ AKA_SIM_ID_TYPE_FASTAUTH
This is a fastauth (session-resumption) id.
Definition id.h:57
#define RPEDEBUG2(fmt,...)
Definition log.h:394
#define REDEBUG2(fmt,...)
Definition log.h:389
@ FR_TYPE_STRING
String of printable characters.
@ FR_TYPE_UINT8
8 Bit unsigned integer.
@ FR_TYPE_BOOL
A truth value.
@ FR_TYPE_OCTETS
Raw octets.
unsigned char uint8_t
fr_pair_t * fr_pair_find_by_da(fr_pair_list_t const *list, fr_pair_t const *prev, fr_dict_attr_t const *da)
Find the first pair with a matching da.
Definition pair.c:707
VQP attributes.
#define REDEBUG(fmt,...)
#define RDEBUG2(fmt,...)
static char buff[sizeof("18446744073709551615")+3]
Definition size_tests.c:37
fr_aka_sim_id_type_t type
Stores an attribute, a value and various bits of other data.
Definition pair.h:68
xlat_action_t
Definition xlat.h:37
@ XLAT_ACTION_FAIL
An xlat function failed.
Definition xlat.h:44
@ XLAT_ACTION_DONE
We're done evaluating this level of nesting.
Definition xlat.h:43
unsigned int required
Argument must be present, and non-empty.
Definition xlat.h:136
#define XLAT_ARG_PARSER_TERMINATOR
Definition xlat.h:160
Definition for a single argument consumed by an xlat function.
Definition xlat.h:135
Master include file to access all functions and structures in the library.
int fr_value_box_bstr_alloc(TALLOC_CTX *ctx, char **out, fr_value_box_t *dst, fr_dict_attr_t const *enumv, size_t len, bool tainted)
Alloc and assign an empty \0 terminated string to a fr_value_box_t.
Definition value.c:4879
int fr_value_box_bstrndup(TALLOC_CTX *ctx, fr_value_box_t *dst, fr_dict_attr_t const *enumv, char const *src, size_t len, bool tainted)
Copy a string to to a fr_value_box_t.
Definition value.c:4953
#define fr_value_box_alloc(_ctx, _type, _enumv)
Allocate a value box of a specific type.
Definition value.h:668
static fr_sbuff_err_t char size_t fr_sbuff_t * in
Definition value.h:1061
#define fr_box_strvalue_len(_val, _len)
Definition value.h:340
static fr_sbuff_err_t char ** out
Definition value.h:1061
#define fr_value_box_alloc_null(_ctx)
Allocate a value box for later use with a value assignment function.
Definition value.h:679
#define fr_box_uint32(_val)
Definition value.h:366
An xlat calling ctx.
Definition xlat_ctx.h:49
int xlat_func_args_set(xlat_t *x, xlat_arg_parser_t const args[])
Register the arguments of an xlat.
Definition xlat_func.c:374
xlat_t * xlat_func_register(TALLOC_CTX *ctx, char const *name, xlat_func_t func, fr_type_t return_type)
Register an xlat function.
Definition xlat_func.c:225
void xlat_func_unregister(char const *name)
Unregister an xlat function.
Definition xlat_func.c:520