]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
crypto: testmgr - Add missing DES weak and semi-weak key tests
authorThorsten Blum <thorsten.blum@linux.dev>
Mon, 17 Nov 2025 11:44:26 +0000 (12:44 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 24 Nov 2025 09:43:40 +0000 (17:43 +0800)
commitc637f3e4a59d710ffd80da1c11d2ebed162d8ff0
tree595a72aa7818a94bda1cc86a5ec8819f61a76033
parent20d868a77f11ba050fe96e7b8efb8ec3b6f2737f
crypto: testmgr - Add missing DES weak and semi-weak key tests

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@linux.dev>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/testmgr.h