1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

Mbed TLS supports RC4 only with 128-bit keys

In PSA tests, don't try to exercise RC4 keys with other sizes. Do test that
attempts to use RC4 keys of other sizes fail with NOT_SUPPORTED (import does
work, which is not really useful, but removing import support would
technically break backward compatibility).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine
2022-04-20 16:31:37 +02:00
parent ce78c9600f
commit c768600de7
3 changed files with 33 additions and 6 deletions

View File

@ -539,6 +539,9 @@ class StorageFormat:
# loss of test coverage.
if key_type.string == 'PSA_KEY_TYPE_RAW_DATA':
return False
# Mbed TLS only supports 128-bit keys for RC4.
if key_type.string == 'PSA_KEY_TYPE_ARC4' and bits != 128:
return False
# OAEP requires room for two hashes plus wrapping
m = cls.RSA_OAEP_RE.match(alg.string)
if m: