aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src/asn1rtt_per_common.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-02-15 14:04:25 +0100
committerBjörn Gustavsson <[email protected]>2017-02-17 09:51:20 +0100
commit2a206d87470fc61656dcfc67e428fd61cb8ee39c (patch)
treeea86ced4b786c0ce6cb50a607059a4d39ffa31fc /lib/asn1/src/asn1rtt_per_common.erl
parent5b80964cabcb5ec6c7961d3714fa9ed4bdcc6585 (diff)
downloadotp-2a206d87470fc61656dcfc67e428fd61cb8ee39c.tar.gz
otp-2a206d87470fc61656dcfc67e428fd61cb8ee39c.tar.bz2
otp-2a206d87470fc61656dcfc67e428fd61cb8ee39c.zip
PER: Slightly improve error reporting for encoding
Generate slightly better error reasons when encoding of INTEGER, ENUMERATED, or BOOLEAN fails.
Diffstat (limited to 'lib/asn1/src/asn1rtt_per_common.erl')
-rw-r--r--lib/asn1/src/asn1rtt_per_common.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/asn1/src/asn1rtt_per_common.erl b/lib/asn1/src/asn1rtt_per_common.erl
index 3896cb7fa5..e7edfb1ee0 100644
--- a/lib/asn1/src/asn1rtt_per_common.erl
+++ b/lib/asn1/src/asn1rtt_per_common.erl
@@ -140,6 +140,8 @@ encode_relative_oid(Val) when is_tuple(Val) ->
encode_relative_oid(Val) when is_list(Val) ->
list_to_binary([e_object_element(X)||X <- Val]).
+encode_unconstrained_number(Val) when not is_integer(Val) ->
+ exit({error,{asn1,{illegal_integer,Val}}});
encode_unconstrained_number(Val) when Val >= 0 ->
if
Val < 16#80 ->