Skip to content
Success

Changes

Summary

  1. card_key_provider: refactor code and optimize out get_field method (details)
Commit dc5199d9a7c9116dd981be73b14b0db28f5ecca0 by pmaier@sysmocom.de
card_key_provider: refactor code and optimize out get_field method

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
The file was modifiedpySim/card_key_provider.py