Diffusion GnuPG 344b548dc716

gpg: Also detect a plaintext packet before an encrypted packet.

Authored by werner on Jun 6 2018, 3:46 PM.

Description

gpg: Also detect a plaintext packet before an encrypted packet.

* g10/mainproc.c (proc_encrypted): Print warning and later force an
error.

Note that when this error is triggered the plaintext from the literal
data packet has already been outputted before the BEGIN_DECRYPTION
status line. We fail only later to get more information. Callers
need to check and act upon the decryption error code anyway.

Thanks to Marcus for pointing out this case.

  • GnuPG-bug-id: T4000
  • Signed-off-by: Werner Koch <wk@gnupg.org>