The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Data Structures | Macros | Enumerations | Functions | Variables
der.h File Reference
#include <freeradius-devel/build.h>
#include <freeradius-devel/util/dict.h>
#include <freeradius-devel/util/value.h>
+ Include dependency graph for der.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  fr_der_attr_flags_t
 
union  fr_der_attr_flags_t.__unnamed192__
 

Macros

#define DER_BOOLEAN_FALSE   0x00
 DER encoded boolean false value.
 
#define DER_BOOLEAN_TRUE   0xff
 DER encoded boolean true value.
 
#define DER_GENERALIZED_TIME_LEN_MIN   15
 Minimum length of the generalized time string.
 
#define DER_GENERALIZED_TIME_PRECISION_MAX   4
 Maximum precision of the generalized time string.
 
#define DER_LEN_MULTI_BYTE   0x80
 Mask to check if the length is multi-byte.
 
#define DER_MAX_STR   16384
 
#define DER_TAG_CLASS_MASK   0xc0
 Mask to extract the class from the tag.
 
#define DER_TAG_CONSTRUCTED_MASK   0x20
 Mask to check if the tag is constructed.
 
#define DER_TAG_CONTINUATION   0x1f
 Mask to check if the tag is a continuation.
 
#define DER_TAG_NUM_MASK   0x1f
 Mask to extract the tag number from the tag.
 
#define DER_UTC_TIME_LEN   13
 Length of the UTC time string.
 
#define fr_der_flag_class(_da)   (fr_der_attr_flags(_da)->class)
 
#define fr_der_flag_der_type(_da)   (fr_der_attr_flags(_da)->der_type)
 
#define fr_der_flag_has_default_value(_da)   ((fr_der_attr_flags(_da)->has_default_value) != NULL);
 
#define fr_der_flag_is_choice(_da)   (fr_der_attr_flags(_da)->is_choice)
 
#define fr_der_flag_is_extensions(_da)   (fr_der_attr_flags(_da)->is_extensions)
 
#define fr_der_flag_is_oid_and_value(_da)   (fr_der_attr_flags(_da)->is_oid_and_value)
 
#define fr_der_flag_is_oid_leaf(_da)   (fr_der_attr_flags(_da)->is_oid_leaf)
 
#define fr_der_flag_is_sequence_of(_da)   (fr_der_attr_flags(_da)->is_sequence_of)
 
#define fr_der_flag_is_set_of(_da)   (fr_der_attr_flags(_da)->is_set_of)
 
#define fr_der_flag_max(_da)   (fr_der_attr_flags(_da)->max)
 
#define fr_der_flag_option(_da)   (fr_der_attr_flags(_da)->option)
 
#define fr_der_flag_optional(_da)   (fr_der_attr_flags(_da)->optional)
 
#define fr_der_flag_sequence_of(_da)   (fr_der_attr_flags(_da)->sequence_of)
 
#define fr_der_flag_set_of(_da)   (fr_der_attr_flags(_da)->set_of)
 
#define FR_DER_TAG_VALUE_MAX   (0x1f)
 tags >=max can't exist
 

Enumerations

enum  fr_der_tag_class_t {
  FR_DER_CLASS_UNIVERSAL = 0x00 ,
  FR_DER_CLASS_APPLICATION = 0x40 ,
  FR_DER_CLASS_CONTEXT = 0x80 ,
  FR_DER_CLASS_PRIVATE = 0xC0 ,
  FR_DER_CLASS_INVALID = 0x04
}
 
enum  fr_der_tag_constructed_t {
  FR_DER_TAG_PRIMITIVE = 0x00 ,
  FR_DER_TAG_CONSTRUCTED = 0x20
}
 
enum  fr_der_tag_t {
  FR_DER_TAG_INVALID = 0x00 ,
  FR_DER_TAG_BOOLEAN = 0x01 ,
  FR_DER_TAG_INTEGER = 0x02 ,
  FR_DER_TAG_BITSTRING = 0x03 ,
  FR_DER_TAG_OCTETSTRING = 0x04 ,
  FR_DER_TAG_NULL = 0x05 ,
  FR_DER_TAG_OID = 0x06 ,
  FR_DER_TAG_ENUMERATED = 0x0a ,
  FR_DER_TAG_UTF8_STRING = 0x0c ,
  FR_DER_TAG_SEQUENCE = 0x10 ,
  FR_DER_TAG_SET = 0x11 ,
  FR_DER_TAG_PRINTABLE_STRING = 0x13 ,
  FR_DER_TAG_T61_STRING = 0x14 ,
  FR_DER_TAG_IA5_STRING = 0x16 ,
  FR_DER_TAG_UTC_TIME = 0x17 ,
  FR_DER_TAG_GENERALIZED_TIME = 0x18 ,
  FR_DER_TAG_VISIBLE_STRING = 0x1a ,
  FR_DER_TAG_GENERAL_STRING = 0x1b ,
  FR_DER_TAG_UNIVERSAL_STRING = 0x1c ,
  FR_DER_TAG_BMP_STRING = 0x1e ,
  FR_DER_TAG_CHOICE = 0x23 ,
  FR_DER_TAG_MAX = 0x24
}
 Enumeration describing the data types in a DER encoded structure. More...
 

Functions

static fr_der_attr_flags_t const * fr_der_attr_flags (fr_dict_attr_t const *da)
 
void fr_der_global_free (void)
 
int fr_der_global_init (void)
 
char const * fr_der_tag_to_str (fr_der_tag_t tag)
 
bool fr_der_tags_compatible (fr_der_tag_t tag1, fr_der_tag_t tag2)
 
fr_der_tag_t fr_type_to_der_tag_default (fr_type_t type)
 
bool fr_type_to_der_tag_valid (fr_type_t type, fr_der_tag_t tag)
 

Variables

HIDDEN fr_dict_t const * dict_der
 

Data Structure Documentation

◆ fr_der_attr_flags_t

struct fr_der_attr_flags_t

Definition at line 95 of file der.h.

Data Fields
union fr_der_attr_flags_t.__unnamed192__ __unnamed__
fr_der_tag_class_t class tag Class
fr_der_tag_t der_type the DER type, which is different from the FreeRADIUS type
bool has_default_value: 1 a default value exists
bool is_choice: 1 DER name "choice".
bool is_extensions: 1 a list of X.509 extensions
bool is_oid_and_value: 1 is OID+value
bool is_oid_leaf: 1
bool is_option: 1 has an option defined
bool is_sequence_of: 1 sequence_of has been defined
bool is_set_of: 1 set_of has been defined
uint64_t max maximum count of items in a sequence, set, or string.
uint8_t min mininum count
uint8_t option an "attribute number" encoded in the tag field.
bool optional: 1 optional, we MUST already have set 'option'
uint32_t restrictions for choice of options and tags - no dups allowed

◆ fr_der_attr_flags_t.__unnamed192__

union fr_der_attr_flags_t.__unnamed192__

Definition at line 98 of file der.h.

Data Fields
fr_value_box_t * default_value
fr_der_tag_t sequence_of
fr_der_tag_t set_of

Macro Definition Documentation

◆ DER_BOOLEAN_FALSE

#define DER_BOOLEAN_FALSE   0x00

DER encoded boolean false value.

Definition at line 92 of file der.h.

◆ DER_BOOLEAN_TRUE

#define DER_BOOLEAN_TRUE   0xff

DER encoded boolean true value.

Definition at line 93 of file der.h.

◆ DER_GENERALIZED_TIME_LEN_MIN

#define DER_GENERALIZED_TIME_LEN_MIN   15

Minimum length of the generalized time string.

Definition at line 81 of file der.h.

◆ DER_GENERALIZED_TIME_PRECISION_MAX

#define DER_GENERALIZED_TIME_PRECISION_MAX   4

Maximum precision of the generalized time string.

Definition at line 82 of file der.h.

◆ DER_LEN_MULTI_BYTE

#define DER_LEN_MULTI_BYTE   0x80

Mask to check if the length is multi-byte.

Definition at line 90 of file der.h.

◆ DER_MAX_STR

#define DER_MAX_STR   16384

Definition at line 78 of file der.h.

◆ DER_TAG_CLASS_MASK

#define DER_TAG_CLASS_MASK   0xc0

Mask to extract the class from the tag.

Definition at line 84 of file der.h.

◆ DER_TAG_CONSTRUCTED_MASK

#define DER_TAG_CONSTRUCTED_MASK   0x20

Mask to check if the tag is constructed.

Definition at line 85 of file der.h.

◆ DER_TAG_CONTINUATION

#define DER_TAG_CONTINUATION   0x1f

Mask to check if the tag is a continuation.

Definition at line 88 of file der.h.

◆ DER_TAG_NUM_MASK

#define DER_TAG_NUM_MASK   0x1f

Mask to extract the tag number from the tag.

Definition at line 86 of file der.h.

◆ DER_UTC_TIME_LEN

#define DER_UTC_TIME_LEN   13

Length of the UTC time string.

Definition at line 80 of file der.h.

◆ fr_der_flag_class

#define fr_der_flag_class (   _da)    (fr_der_attr_flags(_da)->class)

Definition at line 126 of file der.h.

◆ fr_der_flag_der_type

#define fr_der_flag_der_type (   _da)    (fr_der_attr_flags(_da)->der_type)

Definition at line 127 of file der.h.

◆ fr_der_flag_has_default_value

#define fr_der_flag_has_default_value (   _da)    ((fr_der_attr_flags(_da)->has_default_value) != NULL);

Definition at line 135 of file der.h.

◆ fr_der_flag_is_choice

#define fr_der_flag_is_choice (   _da)    (fr_der_attr_flags(_da)->is_choice)

Definition at line 137 of file der.h.

◆ fr_der_flag_is_extensions

#define fr_der_flag_is_extensions (   _da)    (fr_der_attr_flags(_da)->is_extensions)

Definition at line 134 of file der.h.

◆ fr_der_flag_is_oid_and_value

#define fr_der_flag_is_oid_and_value (   _da)    (fr_der_attr_flags(_da)->is_oid_and_value)

Definition at line 133 of file der.h.

◆ fr_der_flag_is_oid_leaf

#define fr_der_flag_is_oid_leaf (   _da)    (fr_der_attr_flags(_da)->is_oid_leaf)

Definition at line 136 of file der.h.

◆ fr_der_flag_is_sequence_of

#define fr_der_flag_is_sequence_of (   _da)    (fr_der_attr_flags(_da)->is_sequence_of)

Definition at line 129 of file der.h.

◆ fr_der_flag_is_set_of

#define fr_der_flag_is_set_of (   _da)    (fr_der_attr_flags(_da)->is_set_of)

Definition at line 131 of file der.h.

◆ fr_der_flag_max

#define fr_der_flag_max (   _da)    (fr_der_attr_flags(_da)->max)

Definition at line 132 of file der.h.

◆ fr_der_flag_option

#define fr_der_flag_option (   _da)    (fr_der_attr_flags(_da)->option)

Definition at line 124 of file der.h.

◆ fr_der_flag_optional

#define fr_der_flag_optional (   _da)    (fr_der_attr_flags(_da)->optional)

Definition at line 125 of file der.h.

◆ fr_der_flag_sequence_of

#define fr_der_flag_sequence_of (   _da)    (fr_der_attr_flags(_da)->sequence_of)

Definition at line 128 of file der.h.

◆ fr_der_flag_set_of

#define fr_der_flag_set_of (   _da)    (fr_der_attr_flags(_da)->set_of)

Definition at line 130 of file der.h.

◆ FR_DER_TAG_VALUE_MAX

#define FR_DER_TAG_VALUE_MAX   (0x1f)

tags >=max can't exist

Definition at line 63 of file der.h.

Enumeration Type Documentation

◆ fr_der_tag_class_t

Enumerator
FR_DER_CLASS_UNIVERSAL 
FR_DER_CLASS_APPLICATION 
FR_DER_CLASS_CONTEXT 
FR_DER_CLASS_PRIVATE 
FR_DER_CLASS_INVALID 

Definition at line 70 of file der.h.

◆ fr_der_tag_constructed_t

Enumerator
FR_DER_TAG_PRIMITIVE 

This is a leaf value, it contains no children.

FR_DER_TAG_CONSTRUCTED 

This is a sequence or set, it contains children.

Definition at line 65 of file der.h.

◆ fr_der_tag_t

Enumeration describing the data types in a DER encoded structure.

Enumerator
FR_DER_TAG_INVALID 

Invalid tag.

FR_DER_TAG_BOOLEAN 

Boolean true/false.

FR_DER_TAG_INTEGER 

Arbitrary width signed integer.

FR_DER_TAG_BITSTRING 

String of bits (length field specifies bits).

FR_DER_TAG_OCTETSTRING 

String of octets (length field specifies bytes).

FR_DER_TAG_NULL 

An empty value.

FR_DER_TAG_OID 

Reference to an OID based attribute.

FR_DER_TAG_ENUMERATED 

An enumerated value.

FR_DER_TAG_UTF8_STRING 

String of UTF8 chars.

FR_DER_TAG_SEQUENCE 

A sequence of DER encoded data (a structure).

FR_DER_TAG_SET 

A set of DER encoded data (a structure).

FR_DER_TAG_PRINTABLE_STRING 

String of printable chars.

FR_DER_TAG_T61_STRING 

String of T61 (8bit) chars.

FR_DER_TAG_IA5_STRING 

String of IA5 (7bit) chars.

FR_DER_TAG_UTC_TIME 

A time in UTC "YYMMDDhhmmssZ" format.

FR_DER_TAG_GENERALIZED_TIME 

A time in "YYYYMMDDHHMMSS[.fff]Z" format.

FR_DER_TAG_VISIBLE_STRING 

String of visible chars.

FR_DER_TAG_GENERAL_STRING 

String of general chars.

FR_DER_TAG_UNIVERSAL_STRING 

String of universal chars.

FR_DER_TAG_BMP_STRING 

String of BMP chars.

FR_DER_TAG_CHOICE 

A choice of types. Techically not a DER tag, but used to represent a choice.

FR_DER_TAG_MAX 

Definition at line 36 of file der.h.

Function Documentation

◆ fr_der_attr_flags()

static fr_der_attr_flags_t const * fr_der_attr_flags ( fr_dict_attr_t const *  da)
inlinestatic

Definition at line 119 of file der.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_der_global_free()

void fr_der_global_free ( void  )

Definition at line 203 of file base.c.

◆ fr_der_global_init()

int fr_der_global_init ( void  )

Definition at line 180 of file base.c.

+ Here is the call graph for this function:

◆ fr_der_tag_to_str()

char const * fr_der_tag_to_str ( fr_der_tag_t  tag)

Definition at line 75 of file base.c.

+ Here is the caller graph for this function:

◆ fr_der_tags_compatible()

bool fr_der_tags_compatible ( fr_der_tag_t  tag1,
fr_der_tag_t  tag2 
)

Definition at line 98 of file base.c.

+ Here is the caller graph for this function:

◆ fr_type_to_der_tag_default()

fr_der_tag_t fr_type_to_der_tag_default ( fr_type_t  type)

Definition at line 804 of file base.c.

+ Here is the caller graph for this function:

◆ fr_type_to_der_tag_valid()

bool fr_type_to_der_tag_valid ( fr_type_t  type,
fr_der_tag_t  tag 
)

Definition at line 172 of file base.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ dict_der

HIDDEN fr_dict_t const* dict_der
extern

Definition at line 38 of file base.c.