aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base/diameter_capx.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2013-06-02 15:02:55 +0200
committerAnders Svensson <[email protected]>2013-06-02 15:02:55 +0200
commit107625c4fd3e3a50f9c5cc3716899ff595bcda99 (patch)
treeeb01db6e9606cc3fc432dd60626216def1da599f /lib/diameter/src/base/diameter_capx.erl
parent28bb4559b2fada7028e253bb842b239ec8891345 (diff)
parent7417446d0e3c4e5e5a15f60b1879cabef1e26408 (diff)
downloadotp-107625c4fd3e3a50f9c5cc3716899ff595bcda99.tar.gz
otp-107625c4fd3e3a50f9c5cc3716899ff595bcda99.tar.bz2
otp-107625c4fd3e3a50f9c5cc3716899ff595bcda99.zip
Merge branch 'maint'
Diffstat (limited to 'lib/diameter/src/base/diameter_capx.erl')
-rw-r--r--lib/diameter/src/base/diameter_capx.erl19
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/diameter/src/base/diameter_capx.erl b/lib/diameter/src/base/diameter_capx.erl
index 9a443fead0..4b821f5139 100644
--- a/lib/diameter/src/base/diameter_capx.erl
+++ b/lib/diameter/src/base/diameter_capx.erl
@@ -282,9 +282,26 @@ build_CEA(_, LCaps, RCaps, Dict, CEA) ->
[] ->
Dict:'#set-'({'Result-Code', ?NOSECURITY}, CEA);
[_] = IS ->
- Dict:'#set-'({'Inband-Security-Id', IS}, CEA)
+ Dict:'#set-'({'Inband-Security-Id', inband_security(IS)}, CEA)
end.
+%% Only set Inband-Security-Id if different from the default, since
+%% RFC 6733 recommends against the AVP:
+%%
+%% 6.10. Inband-Security-Id AVP
+%%
+%% The Inband-Security-Id AVP (AVP Code 299) is of type Unsigned32 and
+%% is used in order to advertise support of the security portion of the
+%% application. The use of this AVP in CER and CEA messages is NOT
+%% RECOMMENDED. Instead, discovery of a Diameter entity's security
+%% capabilities can be done either through static configuration or via
+%% Diameter Peer Discovery as described in Section 5.2.
+
+inband_security([?NO_INBAND_SECURITY]) ->
+ [];
+inband_security([_] = IS) ->
+ IS.
+
%% common_security/2
common_security(#diameter_caps{inband_security_id = LS},