filesystem: fix decode_select_response
There are some problems with the usage of decode_select_response. At the moment the ADF files overload the related method to provide decoding of the select responses as per 3gpp TS 102 221. However, this also means that the decoder is only available under ADF.USIM and ADF.ISIM. DF.GSM and DF.TELECOM also overload the decoder method, just like an ADF would do. This decoding method is then implemented as per 3gpp TS 51 011. Since this a a problem on UICCs, the method detects the magic byte 0x62 that can be found at the beginning on every select response of an UICC to defer to the TS 102 221 decoding method. TS 51 011 defines the first two bytes of the select response as RFU. This at least problematic. To solve this there should be a default method for decode_select_response in the profile, which can be used if no file overloads it with a specific decoder. ADFs use specific decoders, but everything else should use the default decoder. When we deal with an UICC, we expect the select response to be consistantly conform to TS 102 221, if we deal with a clasic sim we expect responses as per TS 51 011 only. Since it is still possible to replace the select response decoder we still have the opportunity to have custom select response in cartain DFs and ADFs should we need them. Change-Id: I95e33ec1755727dc9bbbc6016ce2d99a9e66f214 Related: OS#5274
This commit is contained in:
@@ -684,3 +684,6 @@ class CardProfileUICC(CardProfile):
|
||||
}
|
||||
|
||||
super().__init__('UICC', desc='ETSI TS 102 221', files_in_mf=files, sw=sw)
|
||||
|
||||
def decode_select_response(self, data_hex:str) -> Any:
|
||||
return decode_select_response(data_hex)
|
||||
|
||||
Reference in New Issue
Block a user