Change in pysim[master]: commands: improve exception string of verify_chv()

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
Thu Mar 25 19:37:07 UTC 2021


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/23502 )


Change subject: commands: improve exception string of verify_chv()
......................................................................

commands: improve exception string of verify_chv()

The execption string in verify_chv() is ADM centric, but since
pySim-shell also allows the user to verify a regular chv (PIN), this
string also appears when the verify_chv command is used with a wrong
PIN. Lets make it more generic and lets also output the CHV number so
that the user knows which CHV type was tried.

Change-Id: I41602de8edd22bea30ac68cb1c41e20ea1e4549c
Related: OS#4963
---
M pySim/commands.py
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/02/23502/1

diff --git a/pySim/commands.py b/pySim/commands.py
index 9aed588..cd045c9 100644
--- a/pySim/commands.py
+++ b/pySim/commands.py
@@ -207,5 +207,5 @@
 		fc = rpad(b2h(code), 16)
 		data, sw = self._tp.send_apdu(self.cla_byte + '2000' + ('%02X' % chv_no) + '08' + fc)
 		if (sw != '9000'):
-			raise RuntimeError('Failed to authenticate with ADM key %s, %i tries left.' % (code, int(sw[3])))
+			raise RuntimeError('Failed to authenticate chv_no 0x%02X with code 0x%s, %i tries left.' % (chv_no, b2h(code).upper(), int(sw[3])))
 		return (data,sw)

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

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


More information about the gerrit-log mailing list