Merge branch 'chrysn/for-29033' into chrysn/ota

Change-Id: Iebc7444fc32184d24c7bccc8ce694755cbbcc04b
This commit is contained in:
Christian Amsüss 2022-08-19 20:37:56 +02:00
commit 28af6966aa
2 changed files with 5 additions and 3 deletions

View File

@ -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}

View File

@ -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: