smpp_ota_apdu2: Re-try decoding PoR without crypto if it fails with

If something prevents the response from being ciphered, we need to fall
back to plaintext.

Change-Id: I748c5690029c28a0fcf39a2d99bc6c03fcb33dbd
This commit is contained in:
Harald Welte
2024-07-10 18:05:52 +02:00
parent dc5fdfca39
commit 82c6575a77

View File

@@ -19,7 +19,13 @@ class Foo:
def smpp_rx_handler(self, pdu):
sys.stdout.write('delivered {}\n'.format(pdu.receipted_message_id))
if pdu.short_message:
dec = self.ota_dialect.decode_resp(self.ota_keyset, self.spi, pdu.short_message)
try:
dec = self.ota_dialect.decode_resp(self.ota_keyset, self.spi, pdu.short_message)
except ValueError:
spi = self.spi.copy()
spi['por_shall_be_ciphered'] = False
spi['por_rc_cc_ds'] = 'no_rc_cc_ds'
dec = self.ota_dialect.decode_resp(self.ota_keyset, spi, pdu.short_message)
pp(dec)
return None