aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Falkenberg <robert.falkenberg@tu-dortmund.de>2021-04-01 16:14:27 +0200
committerlaforge <laforge@osmocom.org>2021-04-07 16:23:11 +0000
commit75487aed9028e183fbb20bb8e44ce221385761c7 (patch)
tree1785e4c88b3c83787946e3323309657ee6d02036
parentc98ef8a79db83903dc98197e2d968511affe4609 (diff)
Use zero padding for EF['ACC'] field
The ``EF_ACC`` field defines the access control class (ACC) for a subscriber. Without this patch, the implementation adds padding 1 towards the most significant bits if the input is shorter than 2 bytes. However, it should be padded with 0, otherwise additional ACCs are allocated to the subscriber. (Probably only a single bit shall be set to 1) Excerpt from [ETSI TS 131 102, 4.2.15](https://www.etsi.org/deliver/etsi_ts/131100_131199/131102/04.15.00_60/ts_131102v041500p.pdf): ``` EF_ACC: Two bytes: B1, B2 B1.b8...B1.b4: high priority users (class 15...11) B1.b3: always 0 B1.b2...B1.b2 and B2.b7...B2.b0: normal priority users (class 9...0) - to be evenly distributed across subscribers ``` **Legend:** Byte X, bit Y: BX.bY Change-Id: I1b8dc01a6c48adad1ed8158de59b12519ed688e9
-rw-r--r--pySim/cards.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pySim/cards.py b/pySim/cards.py
index ad6ddbc..8ac80bf 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -76,7 +76,7 @@ class Card(object):
return sw
def update_acc(self, acc):
- data, sw = self._scc.update_binary(EF['ACC'], lpad(acc, 4))
+ data, sw = self._scc.update_binary(EF['ACC'], lpad(acc, 4, c='0'))
return sw
def read_hplmn_act(self):