[PATCH] crypto: testmgr - Add missing DES weak and semi-weak key tests
Herbert Xu
herbert at gondor.apana.org.au
Mon Nov 24 01:48:35 PST 2025
On Mon, Nov 17, 2025 at 12:44:26PM +0100, Thorsten Blum wrote:
> Ever since commit da7f033ddc9f ("crypto: cryptomgr - Add test
> infrastructure"), the DES test suite has tested only one of the four
> weak keys and none of the twelve semi-weak keys.
>
> DES has four weak keys and twelve semi-weak keys, and the kernel's DES
> implementation correctly detects and rejects all of these keys when the
> CRYPTO_TFM_REQ_FORBID_WEAK_KEYS flag is set. However, only a single weak
> key was being tested. Add tests for all 16 weak and semi-weak keys.
>
> While DES is deprecated, it is still used in some legacy protocols, and
> weak/semi-weak key detection should be tested accordingly.
>
> Tested on arm64 with cryptographic self-tests.
>
> Signed-off-by: Thorsten Blum <thorsten.blum at linux.dev>
> ---
> crypto/testmgr.h | 120 +++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 120 insertions(+)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert at gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
More information about the linux-arm-kernel
mailing list