summaryrefslogtreecommitdiffstats
path: root/g10/pubkey-enc.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2020-04-08 02:29:43 +0200
committerNIIBE Yutaka <gniibe@fsij.org>2020-04-08 02:29:43 +0200
commitfd79cadf7ba5ce45dfb5e266975f58bf5c7ce145 (patch)
treea60da959368c67ed24cd3517ff99fee9049a5f52 /g10/pubkey-enc.c
parentscd:p15: Show a pretty PIN prompt. (diff)
downloadgnupg2-fd79cadf7ba5ce45dfb5e266975f58bf5c7ce145.tar.xz
gnupg2-fd79cadf7ba5ce45dfb5e266975f58bf5c7ce145.zip
gpg: ECDH: Accept longer padding.
* g10/pubkey-enc.c (get_it): Remove check which mandates shorter padding. -- According to the section 8 of RFC 6637, the sender MAY use 21 bytes of padding for AES-128 to provide 40-byte "m". Reported-by: Metin Savignano GnuPG-bug-id: 4908 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'g10/pubkey-enc.c')
-rw-r--r--g10/pubkey-enc.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/g10/pubkey-enc.c b/g10/pubkey-enc.c
index fb1b17143..9ec86df3e 100644
--- a/g10/pubkey-enc.c
+++ b/g10/pubkey-enc.c
@@ -302,10 +302,7 @@ get_it (ctrl_t ctrl,
goto leave;
/* Now the frame are the bytes decrypted but padded session key. */
-
- /* Allow double padding for the benefit of DEK size concealment.
- Higher than this is wasteful. */
- if (!nframe || frame[nframe-1] > 8*2 || nframe <= 8
+ if (!nframe || nframe <= 8
|| frame[nframe-1] > nframe)
{
err = gpg_error (GPG_ERR_WRONG_SECKEY);