transport: Pass status word interpreter to exception handler

Prior to this patch, any SwMatchError raised within the 'transport'
would not be interpreted.

EXCEPTION of type 'SwMatchError' occurred with message: 'SW match failed! Expected 9000 and got 6982.'

vs (now)

EXCEPTION of type 'SwMatchError' occurred with message: 'SW match failed! Expected 9000 and got 6982: Command not allowed - Security status not satisfied'

Change-Id: I08b7f2b6bd422f7f2f36094bc8a29b187ff882a6
This commit is contained in:
Harald Welte
2021-04-03 11:48:22 +02:00
parent be9516f157
commit 4f2c546613
2 changed files with 9 additions and 1 deletions

View File

@@ -433,6 +433,8 @@ if __name__ == '__main__':
profile.add_application(CardApplicationISIM)
rs = RuntimeState(card, profile)
# inform the transport that we can do context-specific SW interpretation
sl.set_sw_interpreter(rs)
# FIXME: do this dynamically
rs.mf.add_file(DF_TELECOM())