aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src/asn1rtt_per.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/asn1/src/asn1rtt_per.erl')
-rw-r--r--lib/asn1/src/asn1rtt_per.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/asn1/src/asn1rtt_per.erl b/lib/asn1/src/asn1rtt_per.erl
index d0a4de65e0..7903dcf9e9 100644
--- a/lib/asn1/src/asn1rtt_per.erl
+++ b/lib/asn1/src/asn1rtt_per.erl
@@ -528,6 +528,10 @@ decode_length(Buffer, SingleValue) when is_integer(SingleValue) ->
%% Unused = integer(),
%% BinBits = binary().
+encode_bit_string(C, Bits, NamedBitList) when is_bitstring(Bits) ->
+ PadLen = (8 - (bit_size(Bits) band 7)) band 7,
+ Compact = {PadLen,<<Bits/bitstring,0:PadLen>>},
+ encode_bin_bit_string(C, Compact, NamedBitList);
encode_bit_string(C, {Unused,BinBits}=Bin, NamedBitList)
when is_integer(Unused), is_binary(BinBits) ->
encode_bin_bit_string(C,Bin,NamedBitList);