summaryrefslogtreecommitdiffstats
path: root/g10/mainproc.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2019-07-18 03:59:29 +0200
committerNIIBE Yutaka <gniibe@fsij.org>2019-07-18 04:02:34 +0200
commit44be675b759d27bac310c2de8bae1b7882a26b65 (patch)
tree5713852e465da439d445547b41ac987e99d9ef56 /g10/mainproc.c
parentdoc: Fix description of the field 11. (diff)
downloadgnupg2-44be675b759d27bac310c2de8bae1b7882a26b65.tar.xz
gnupg2-44be675b759d27bac310c2de8bae1b7882a26b65.zip
gpg: More check for symmetric key encryption.
* g10/dek.h (DEK): Use debugger friendly type of unsigned int. * g10/mainproc.c (symkey_decrypt_seskey): Add another check. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'g10/mainproc.c')
-rw-r--r--g10/mainproc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/g10/mainproc.c b/g10/mainproc.c
index 8a9005c21..e98d1f89c 100644
--- a/g10/mainproc.c
+++ b/g10/mainproc.c
@@ -325,7 +325,8 @@ symkey_decrypt_seskey (DEK *dek, byte *seskey, size_t slen)
* the gnupg < 2.2 bug compatible case which would terminate the
* process on GPG_ERR_CIPHER_ALGO. Note that with AEAD (above)
* we will have a reliable test here. */
- if (openpgp_cipher_test_algo (seskey[0]))
+ if (openpgp_cipher_test_algo (seskey[0])
+ || openpgp_cipher_get_algo_keylen (seskey[0]) != slen - 1)
{
err = gpg_error (GPG_ERR_CHECKSUM);
goto leave;