aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src/asn1rtt_ber.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2014-01-21 16:12:46 +0100
committerBjörn Gustavsson <[email protected]>2014-01-24 16:24:56 +0100
commitaaa4ea283b2b7dad74fdcdd5963558e9d03d80b0 (patch)
tree765382e19e86d86a897daec07e7335571285966d /lib/asn1/src/asn1rtt_ber.erl
parent4bda9201055daf3abbdb5ef48bbdd0efacfd1fbc (diff)
downloadotp-aaa4ea283b2b7dad74fdcdd5963558e9d03d80b0.tar.gz
otp-aaa4ea283b2b7dad74fdcdd5963558e9d03d80b0.tar.bz2
otp-aaa4ea283b2b7dad74fdcdd5963558e9d03d80b0.zip
Fix OCTET STRING
Diffstat (limited to 'lib/asn1/src/asn1rtt_ber.erl')
-rw-r--r--lib/asn1/src/asn1rtt_ber.erl14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/asn1/src/asn1rtt_ber.erl b/lib/asn1/src/asn1rtt_ber.erl
index a4aa347aea..4bd814769f 100644
--- a/lib/asn1/src/asn1rtt_ber.erl
+++ b/lib/asn1/src/asn1rtt_ber.erl
@@ -40,6 +40,7 @@
encode_relative_oid/2,decode_relative_oid/2,
encode_object_identifier/2,decode_object_identifier/2,
encode_restricted_string/2,
+ decode_octet_string/2,decode_octet_string/3,
decode_restricted_string/2,decode_restricted_string/3,
encode_universal_string/2,decode_universal_string/3,
encode_UTF8_string/2,decode_UTF8_string/2,
@@ -1302,6 +1303,19 @@ encode_restricted_string(OctetList, TagIn) when is_list(OctetList) ->
encode_tags(TagIn, OctetList, length(OctetList)).
%%============================================================================
+%% decode OCTET STRING to binary
+%%============================================================================
+
+decode_octet_string(Tlv, TagsIn) ->
+ Bin = match_and_collect(Tlv, TagsIn),
+ binary:copy(Bin).
+
+decode_octet_string(Tlv, Range, TagsIn) ->
+ Bin0 = match_and_collect(Tlv, TagsIn),
+ Bin = binary:copy(Bin0),
+ check_restricted_string(Bin, byte_size(Bin), Range).
+
+%%============================================================================
%% decode Numeric Printable Teletex Videotex Visible IA5 Graphic General strings
%%============================================================================