aboutsummaryrefslogtreecommitdiffstats
path: root/card/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'card/utils.py')
-rw-r--r--card/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/card/utils.py b/card/utils.py
index 05e7a9e..3c1b1f1 100644
--- a/card/utils.py
+++ b/card/utils.py
@@ -163,8 +163,8 @@ def first_BERTLV_parser(bytelist):
Tag_num += Tag_bits[len(Tag_bits)-j-1] * pow(2, j)
# Length coded with more than 1 byte
- if bytelist[i+1] > 0x50:
- Len_num = bytelist[i+1] - 0x50
+ if bytelist[i+1] & 0x80 > 0:
+ Len_num = bytelist[i+1] - 0x80
Len_bytes = bytelist[i+2:i+1+Len_num]
Len = 0
for j in range(len(Len_bytes)):