Skip to content

Commit 701a48d

Browse files
committed
Add the "concat" flag
For EAP-Message, and RFC 5904 attributes. It means that the encoder/decoder takes care of splitting / concatenating the attributes
1 parent 19abde1 commit 701a48d

4 files changed

Lines changed: 26 additions & 4 deletions

File tree

share/dictionary.rfc2869

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ATTRIBUTE Password-Retry 75 integer
2020
ATTRIBUTE Prompt 76 integer
2121
ATTRIBUTE Connect-Info 77 string
2222
ATTRIBUTE Configuration-Token 78 string
23-
ATTRIBUTE EAP-Message 79 octets
23+
ATTRIBUTE EAP-Message 79 octets concat
2424
ATTRIBUTE Message-Authenticator 80 octets
2525

2626
ATTRIBUTE ARAP-Challenge-Response 84 octets[8]

share/dictionary.rfc5904

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
# $Id$
88
#
99

10-
# The next two attributes are continued, like EAP-Message/
11-
ATTRIBUTE PKM-SS-Cert 137 octets
12-
ATTRIBUTE PKM-CA-Cert 138 octets
10+
# The next two attributes are continued, like EAP-Message
11+
ATTRIBUTE PKM-SS-Cert 137 octets concat
12+
ATTRIBUTE PKM-CA-Cert 138 octets concat
1313

1414
# 28 bytes of data, 7 integers
1515
ATTRIBUTE PKM-Config-Settings 139 octets

src/include/libradius.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ typedef struct attr_flags {
112112
unsigned int evs : 1; //!< Extended VSA.
113113
unsigned int wimax: 1; //!< WiMAX format=1,1,c.
114114

115+
unsigned int concat : 1; //!< concatenate multiple instances
116+
115117
uint8_t encrypt; //!< Ecryption method.
116118
uint8_t length;
117119
} ATTR_FLAGS;

src/lib/dict.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,17 @@ int dict_addattr(char const *name, int attr, unsigned int vendor, int type,
684684
return -1;
685685
}
686686

687+
if (vendor && flags.concat) {
688+
fr_strerror_printf("VSAs cannot have the \"concat\" flag set.");
689+
return -1;
690+
}
691+
692+
if (flags.concat && (flags.has_tag || flags.array || flags.is_tlv || flags.has_tlv ||
693+
flags.length || flags.evs || flags.extended || flags.long_extended)) {
694+
fr_strerror_printf("Only the \"concat\" flag can be set.");
695+
return -1;
696+
}
697+
687698
if ((vendor & (FR_MAX_VENDOR -1)) != 0) {
688699
DICT_VENDOR *dv;
689700
static DICT_VENDOR *last_vendor = NULL;
@@ -1480,6 +1491,15 @@ static int process_attribute(char const* fn, int const line,
14801491
return -1;
14811492
}
14821493

1494+
} else if (strncmp(key, "concat", 6) == 0) {
1495+
flags.concat = 1;
1496+
1497+
if (type != PW_TYPE_OCTETS) {
1498+
fr_strerror_printf( "dict_init: %s[%d] Only \"octets\" type can have the \"concat\" flag set.",
1499+
fn, line);
1500+
return -1;
1501+
}
1502+
14831503
/*
14841504
* The only thing is the vendor name,
14851505
* and it's a known name: allow it.

0 commit comments

Comments
 (0)