1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-06-15 06:41:43 +03:00

Reject block cipher modes that are not implemented in Mbed TLS

Mbed TLS doesn't support certain block cipher mode combinations. This
limitation should probably be lifted, but for now, test them as unsupported.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine
2022-03-19 10:49:43 +01:00
parent b0537ba3b9
commit ae93ee6ddc
4 changed files with 15 additions and 188 deletions

View File

@ -228,6 +228,9 @@ class KeyType:
alg.head in frozenset.union(BLOCK_MAC_MODES,
BLOCK_CIPHER_MODES,
BLOCK_AEAD_MODES):
if alg.head in ['CMAC', 'OFB'] and \
self.head in ['ARIA', 'CAMELLIA']:
return False # not implemented in Mbed TLS
return True
if self.head == 'CHACHA20' and alg.head == 'CHACHA20_POLY1305':
return True