mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 01:55:52 +01:00
Fix RC4 multipart PSA
RC4 doesn't take an IV. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
c768600de7
commit
4a83c1047f
3
ChangeLog.d/psa-rc4.txt
Normal file
3
ChangeLog.d/psa-rc4.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Bugfix
|
||||||
|
* Fix PSA cipher multipart operations using RC4. Previously, an IV was
|
||||||
|
required but discarded. Now, an IV is rejected, as it should be.
|
@ -3359,6 +3359,8 @@ static psa_status_t psa_cipher_setup( psa_cipher_operation_t *operation,
|
|||||||
operation->iv_set = 0;
|
operation->iv_set = 0;
|
||||||
if( alg == PSA_ALG_ECB_NO_PADDING )
|
if( alg == PSA_ALG_ECB_NO_PADDING )
|
||||||
operation->iv_required = 0;
|
operation->iv_required = 0;
|
||||||
|
else if( slot->attr.type == PSA_KEY_TYPE_ARC4 )
|
||||||
|
operation->iv_required = 0;
|
||||||
else
|
else
|
||||||
operation->iv_required = 1;
|
operation->iv_required = 1;
|
||||||
operation->default_iv_length = PSA_CIPHER_IV_LENGTH( slot->attr.type, alg );
|
operation->default_iv_length = PSA_CIPHER_IV_LENGTH( slot->attr.type, alg );
|
||||||
|
@ -11,21 +11,27 @@ hash_fail:PSA_ALG_ECDSA_ANY:PSA_ERROR_INVALID_ARGUMENT
|
|||||||
# The RC4 construction allows any whole number of bytes from 1 to 256 bytes
|
# The RC4 construction allows any whole number of bytes from 1 to 256 bytes
|
||||||
# (8 to 2048 bits).
|
# (8 to 2048 bits).
|
||||||
PSA cipher STREAM_CIPHER: 8-bit ARC4 never supported
|
PSA cipher STREAM_CIPHER: 8-bit ARC4 never supported
|
||||||
|
depends_on:PSA_WANT_KEY_TYPE_ARC4
|
||||||
cipher_fail:PSA_KEY_TYPE_ARC4:"41":PSA_ALG_STREAM_CIPHER:PSA_ERROR_NOT_SUPPORTED
|
cipher_fail:PSA_KEY_TYPE_ARC4:"41":PSA_ALG_STREAM_CIPHER:PSA_ERROR_NOT_SUPPORTED
|
||||||
|
|
||||||
PSA cipher STREAM_CIPHER: 40-bit ARC4 never supported
|
PSA cipher STREAM_CIPHER: 40-bit ARC4 never supported
|
||||||
|
depends_on:PSA_WANT_KEY_TYPE_ARC4
|
||||||
cipher_fail:PSA_KEY_TYPE_ARC4:"4152433420":PSA_ALG_STREAM_CIPHER:PSA_ERROR_NOT_SUPPORTED
|
cipher_fail:PSA_KEY_TYPE_ARC4:"4152433420":PSA_ALG_STREAM_CIPHER:PSA_ERROR_NOT_SUPPORTED
|
||||||
|
|
||||||
PSA cipher STREAM_CIPHER: 120-bit ARC4 never supported
|
PSA cipher STREAM_CIPHER: 120-bit ARC4 never supported
|
||||||
|
depends_on:PSA_WANT_KEY_TYPE_ARC4
|
||||||
cipher_fail:PSA_KEY_TYPE_ARC4:"41524334206b657941524334206b65":PSA_ALG_STREAM_CIPHER:PSA_ERROR_NOT_SUPPORTED
|
cipher_fail:PSA_KEY_TYPE_ARC4:"41524334206b657941524334206b65":PSA_ALG_STREAM_CIPHER:PSA_ERROR_NOT_SUPPORTED
|
||||||
|
|
||||||
PSA cipher STREAM_CIPHER: 136-bit ARC4 never supported
|
PSA cipher STREAM_CIPHER: 136-bit ARC4 never supported
|
||||||
|
depends_on:PSA_WANT_KEY_TYPE_ARC4
|
||||||
cipher_fail:PSA_KEY_TYPE_ARC4:"41524334206b657941524334206b657941":PSA_ALG_STREAM_CIPHER:PSA_ERROR_NOT_SUPPORTED
|
cipher_fail:PSA_KEY_TYPE_ARC4:"41524334206b657941524334206b657941":PSA_ALG_STREAM_CIPHER:PSA_ERROR_NOT_SUPPORTED
|
||||||
|
|
||||||
PSA cipher STREAM_CIPHER: 256-bit ARC4 never supported
|
PSA cipher STREAM_CIPHER: 256-bit ARC4 never supported
|
||||||
|
depends_on:PSA_WANT_KEY_TYPE_ARC4
|
||||||
cipher_fail:PSA_KEY_TYPE_ARC4:"41524334206b657941524334206b657941524334206b657941524334206b6579":PSA_ALG_STREAM_CIPHER:PSA_ERROR_NOT_SUPPORTED
|
cipher_fail:PSA_KEY_TYPE_ARC4:"41524334206b657941524334206b657941524334206b657941524334206b6579":PSA_ALG_STREAM_CIPHER:PSA_ERROR_NOT_SUPPORTED
|
||||||
|
|
||||||
PSA cipher STREAM_CIPHER: 2048-bit ARC4 never supported
|
PSA cipher STREAM_CIPHER: 2048-bit ARC4 never supported
|
||||||
|
depends_on:PSA_WANT_KEY_TYPE_ARC4
|
||||||
cipher_fail:PSA_KEY_TYPE_ARC4:"41524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b6579":PSA_ALG_STREAM_CIPHER:PSA_ERROR_NOT_SUPPORTED
|
cipher_fail:PSA_KEY_TYPE_ARC4:"41524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b657941524334206b6579":PSA_ALG_STREAM_CIPHER:PSA_ERROR_NOT_SUPPORTED
|
||||||
|
|
||||||
# Redundant, to help debugging the test code
|
# Redundant, to help debugging the test code
|
||||||
|
Loading…
Reference in New Issue
Block a user