System
Debian 11 amd64
Tools
CMake project
GCC 10.2.1 x86_64-linux-gnu
Library version
libgcrypt 1.10.1
Compilation options
no-thread no-shared
Description
When I use the gcry_cipher_setkey function to set a 3DES-CBC key, it returns an GPG_ERR_WEAK.
I tried to use gcry_cipher_ctl, with the parameter GCRYCTL_SET_ALLOW_WEAK_KEY, which enables code execution to enter the condition at line 766 of cipher.c.
But the subsequent switch has no case for CBC mode, and the function returns an error.
Key third portion is equal to 0, so I think that's the reason why it triggers an error.
I tried with a key with size = 16 bytes, but gcry_cipher_setkey needs a keylen of 24 bytes.
Expected result
gcry_cipher_setkey should set my key without error.
dec_payload should read 45 de ae ae e1 f4 6a 29 (see pastebin).
Step to reproduce
Here: https://pastebin.com/8Fri9HKW
Thank you :)