Change in pysim[master]: cards: update smsp with fixed record length

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Tue Jun 12 12:07:41 UTC 2018


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9561


Change subject: cards: update smsp with fixed record length
......................................................................

cards: update smsp with fixed record length

When updating ths spsp then rpad() is used to pad the supplied smsp
to 48 bytes length. So the length than update_record will dreive is
always the same.

the method update_record() will then do a select_file() and will
use the response to determine the record length from the response.
Then this length is used in the APDU that is sent to the card.

However, the record size is fixed since it is gets padded to a
hardcoded fixed size but not all cards (USIM?) seem to return the
record length with their response so we should set the force_len flag
in order to cover also those cases.

Change-Id: Iea078f8171b6dbe94bd966807802bc30b5824758
Related: SYS#4245
---
M pySim/cards.py
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/61/9561/1

diff --git a/pySim/cards.py b/pySim/cards.py
index 0c9c2b8..a3c4d87 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -84,7 +84,7 @@
 		return sw
 
 	def update_smsp(self, smsp):
-		data, sw = self._scc.update_record(EF['SMSP'], 1, rpad(smsp, 84))
+		data, sw = self._scc.update_record(EF['SMSP'], 1, rpad(smsp, 84), True)
 		return sw
 
 	def read_spn(self):

-- 
To view, visit https://gerrit.osmocom.org/9561
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iea078f8171b6dbe94bd966807802bc30b5824758
Gerrit-Change-Number: 9561
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180612/c49fb3d7/attachment.htm>


More information about the gerrit-log mailing list