laforge has uploaded this change for review. (
https://gerrit.osmocom.org/c/pysim/+/37484?usp=email )
Change subject: pySim.ota: Raise exception if encoded length would exceed 140 bytes
......................................................................
pySim.ota: Raise exception if encoded length would exceed 140 bytes
SMS cannot exceed 140 bytes, and TS 31.115 explicitly states that larger
messages must use multi-part SMS, which we don't yet implement here.
Change-Id: I8a1543838be2add1c3cfdf7155676cf2b9827e6e
---
M pySim/ota.py
1 file changed, 15 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/84/37484/1
diff --git a/pySim/ota.py b/pySim/ota.py
index 00a4b6b..751461a 100644
--- a/pySim/ota.py
+++ b/pySim/ota.py
@@ -386,6 +386,9 @@
#print("envelope_data: %s" % b2h(envelope_data))
+ if len(envelope_data) > 140:
+ raise ValueError('Cannot encode command in a single SMS; Fragmentation
not implemented')
+
return envelope_data
def decode_cmd(self, otak: OtaKeyset, encoded: bytes) -> Tuple[bytes, dict,
bytes]:
--
To view, visit
https://gerrit.osmocom.org/c/pysim/+/37484?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I8a1543838be2add1c3cfdf7155676cf2b9827e6e
Gerrit-Change-Number: 37484
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange