mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-16 18:38:32 +03:00
pySim.ota: Handle cases where 'secured_data' is empty
while it's true that in situations where response_status == 'por_ok' we are guaranteed to have a 'secured_data' key in the dict, its value could well be b'', which in turn causes us to run into an exception, calling a decoder on an empty byte value; let's avoid that. Change-Id: I7c919f9987585d3b42347c54bd3082a54b8c2a0a
This commit is contained in:
@@ -478,7 +478,7 @@ class OtaDialectSms(OtaDialect):
|
||||
raise OtaCheckError('Unknown por_rc_cc_ds: %s' % spi['por_rc_cc_ds'])
|
||||
|
||||
# TODO: ExpandedRemoteResponse according to TS 102 226 5.2.2
|
||||
if res.response_status == 'por_ok':
|
||||
if res.response_status == 'por_ok' and len(res['secured_data']):
|
||||
dec = CompactRemoteResp.parse(res['secured_data'])
|
||||
else:
|
||||
dec = None
|
||||
|
||||
Reference in New Issue
Block a user