diff --git a/pySim/ota.py b/pySim/ota.py index c2b475eb..31b5040d 100644 --- a/pySim/ota.py +++ b/pySim/ota.py @@ -344,7 +344,9 @@ class OtaDialectSms(OtaDialect): if spi['ciphering']: # ciphering is requested # append padding bytes to end up with blocksize len_cipher = 6 + len_sig + len(apdu) - apdu += otak.crypt._get_padding(len_cipher, otak.crypt.blocksize) + padding = otak.crypt._get_padding(len_cipher, otak.crypt.blocksize) + pad_cnt = len(padding) + apdu += padding kic = {'key': otak.kic_idx, 'algo': otak.algo_crypt} kid = {'key': otak.kid_idx, 'algo': otak.algo_auth} diff --git a/pySim/sms.py b/pySim/sms.py index f5747e41..fb38e83c 100644 --- a/pySim/sms.py +++ b/pySim/sms.py @@ -41,8 +41,8 @@ class UserDataHeader: def __init__(self, ies=[]): self.ies = ies - def __str__(self) -> str: - return 'UDH(%s)' % self.ies + def __repr__(self) -> str: + return 'UDH(%r)' % self.ies def has_ie(self, iei:int) -> bool: for ie in self.ies: