forked from public/pysim
61541e7502
The method get_field in the base class can be optimized out. This also allows us to remove code dup in the card_key_provider_get_field function. Let's also fix the return code behavior. A get method in a CardKeyProvider implementation should always return None in case nothing is found. Also it should not crash in that case. This will allow the card_key_provider_get function to move on to the next CardKeyProvider. In case no CardKeyProvider yields any results, an exception is appropriate since it is pointless to continue execution with "None" as key material. To make the debugging of problems easier, let's also print some debug messages that inform the user what key/value pair and which CardKeyProvider was queried. This will make it easier to investigate in case an expected result was not found. Related: SYS#7725 Change-Id: I4d6367b8eb057e7b2c06c8625094d8a1e4c8eef9