diff options
author | NIIBE Yutaka <[email protected]> | 2020-04-08 00:29:43 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2020-04-08 00:39:29 +0000 |
commit | 2f08a4f25df7d1cbf037bdf0d7f5c1ef5859fa1e (patch) | |
tree | f3fd98cf6a290c14ed4af665b4b6b2779cea5704 | |
parent | scd:p15: Add missing keygrip retrieval for decryption. (diff) | |
download | gnupg-2f08a4f25df7d1cbf037bdf0d7f5c1ef5859fa1e.tar.gz gnupg-2f08a4f25df7d1cbf037bdf0d7f5c1ef5859fa1e.zip |
gpg: ECDH: Accept longer padding.
* g10/pubkey-enc.c (get_it): Remove check which mandates shorter
padding.
--
Cherry-picked master commit of:
fd79cadf7ba5ce45dfb5e266975f58bf5c7ce145
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 <[email protected]>
-rw-r--r-- | g10/pubkey-enc.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/g10/pubkey-enc.c b/g10/pubkey-enc.c index 4e6f893f3..80043488b 100644 --- a/g10/pubkey-enc.c +++ b/g10/pubkey-enc.c @@ -288,10 +288,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); |