aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src/asn1rtt_per_common.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-08-10 14:52:31 +0200
committerRaimo Niskanen <[email protected]>2017-08-16 16:28:57 +0200
commit5d33ec9021ff4fa8e3ffac01bdd0228871636edd (patch)
tree5364028375eee410b120d75a3c4c6d36abfd1a31 /lib/asn1/src/asn1rtt_per_common.erl
parent6ede2da826335960037299d9f3b0e66d072ea5a0 (diff)
downloadotp-5d33ec9021ff4fa8e3ffac01bdd0228871636edd.tar.gz
otp-5d33ec9021ff4fa8e3ffac01bdd0228871636edd.tar.bz2
otp-5d33ec9021ff4fa8e3ffac01bdd0228871636edd.zip
Fix broken handling of default values in extensions for PER
Default values have never worked in extension for PER. Note that for default values in the root part of SEQUENCE, giving a value equal to the DEFAULT value, will result in the same encoding as if asn1_DEFAULT was given. However, that behavior is not promised by the documentation. The documentation says that asn1_DEFAULT should be used for default values. For DEFAULT in extensions, only implement what the documentation promises and nothing more. ERIERL-60
Diffstat (limited to 'lib/asn1/src/asn1rtt_per_common.erl')
-rw-r--r--lib/asn1/src/asn1rtt_per_common.erl1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/asn1/src/asn1rtt_per_common.erl b/lib/asn1/src/asn1rtt_per_common.erl
index 2ecc9e4bc7..5b5f47dfee 100644
--- a/lib/asn1/src/asn1rtt_per_common.erl
+++ b/lib/asn1/src/asn1rtt_per_common.erl
@@ -542,6 +542,7 @@ extension_bitmap(_Val, Pos, Limit, Acc) when Pos >= Limit ->
extension_bitmap(Val, Pos, Limit, Acc) ->
Bit = case element(Pos, Val) of
asn1_NOVALUE -> 0;
+ asn1_DEFAULT -> 0;
_ -> 1
end,
extension_bitmap(Val, Pos+1, Limit, (Acc bsl 1) bor Bit).