Subject: 24.2; EPA Verify fails with encrypted signed message

From: Matt Puumala <[email-masked]>
Date: Tue, 25 Jun 2013 20:56:25 -0500

This bug report will be sent to the Bug-GNU-Emacs mailing list
and the GNU bug tracker at debbugs.gnu.org.  Please check that
the From: line contains a valid email address.  After a delay of up
to one day, you should receive an acknowledgement at that address.

Please write in English if possible, as the Emacs maintainers
usually do not have translators for other languages.

Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug.  If you can, give a recipe
starting from `emacs -Q':

Problem: Both verification and decryption fail with an ascii-armored,
encrypted, signed message.

----------------------------------------------------------------------
To recreate the bug:

* Remove all custom .emacs file... plain vanilla run
* NO ~/gpg.conf file!!! plain vanilla run
* start emacs
* Customize->EPG->Epg Debug On
* Customize->EPG->Epg Gpg Home Directory
* Customize->EPG->Epg Gpg Program
* Set For Current Session

* load testmsg.asc into a buffer
* Set region to include entire pgp message
* M-x epa-verify-region
* Enter passphrase when asked (to decrypt message)

> In the *Message* buffer (and briefly in echo area), I see:
>  Verifying...
>  error in process filter: Process epg not running [2 times]
>  Verifying...done

> I see mini-buffer query "Replace the original text? (y or n)"
* enter 'n'

> I see empty *Temp* buffer (decryption did not succeed)

> I never see any feedback about signature verification.

----------------------------------------------------------------------
System configuration

GNU Emacs 24.2.1 (i386-mingw-nt6.1.7601)
 of 2012-08-28 on MARVIN

Windows 7 on 64 bit machine.

GPG version 1.4.4 (see below for output of gpg --version)

----------------------------------------------------------------------
Contents of ' *epg-debug*'

e:/other apps/gpg/gpg.exe --no-tty --status-fd 1 --yes
--enable-progress-filter --homedir e:/other apps/gpg --command-fd 0
--output c:/Users/puumalma/AppData/Local/Temp/epg-output89403ug -
[GNUPG:] ENC_TO 50AD4600C8C530D6 1 0

[GNUPG:] ENC_TO 25AEE6AD66BD70EE 1 0

[GNUPG:] USERID_HINT 25AEE6AD66BD70EE Matt Puumala <[email-masked]>

[GNUPG:] NEED_PASSPHRASE 25AEE6AD66BD70EE E9B47A74BE075ED2 1 0

[GNUPG:] GET_HIDDEN passphrase.enter

[GNUPG:] GOT_IT

[GNUPG:] BAD_PASSPHRASE 25AEE6AD66BD70EE

[GNUPG:] USERID_HINT 25AEE6AD66BD70EE Matt Puumala <[email-masked]>

[GNUPG:] NEED_PASSPHRASE 25AEE6AD66BD70EE E9B47A74BE075ED2 1 0

[GNUPG:] GET_HIDDEN passphrase.enter

[GNUPG:] GOT_IT

[GNUPG:] BAD_PASSPHRASE 25AEE6AD66BD70EE

[GNUPG:] USERID_HINT 25AEE6AD66BD70EE Matt Puumala <[email-masked]>

[GNUPG:] NEED_PASSPHRASE 25AEE6AD66BD70EE E9B47A74BE075ED2 1 0

[GNUPG:] GET_HIDDEN passphrase.enter

[GNUPG:] GOT_IT

[GNUPG:] BAD_PASSPHRASE 25AEE6AD66BD70EE

[GNUPG:] NO_SECKEY 50AD4600C8C530D6

[GNUPG:] BEGIN_DECRYPTION

[GNUPG:] DECRYPTION_FAILED

[GNUPG:] END_DECRYPTION

gpg: Invalid passphrase; please try again ...

gpg: Invalid passphrase; please try again ...

gpg: encrypted with 2048-bit RSA key, ID 66BD70EE, created 2013-06-08

      "Matt Puumala <[email-masked]>"

gpg: public key decryption failed: bad passphrase

gpg: encrypted with 4096-bit RSA key, ID C8C530D6, created 2010-02-04

      "Daiki Ueno <[email-masked]>"

gpg: decryption failed: secret key not available

----------------------------------------------------------------------
GPG Version:

E:\Other Apps\gpg>gpg --version
gpg (GnuPG) 1.4.4
Copyright (C) 2006 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.

Home: .
Supported algorithms:
Pubkey: RSA, RSA-E, RSA-S, ELG-E, DSA
Cipher: 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH
Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

----------------------------------------------------------------------
Message (testmsg.asc)

----------------------------------------------------------------------
Public key used to verify signature:

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
c:/Users/puumalma/Documents/mybin/emacs-24.2/etc/DEBUG.

In GNU Emacs 24.2.1 (i386-mingw-nt6.1.7601)
 of 2012-08-28 on MARVIN
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --with-gcc (4.6) --cflags
 -ID:/devel/emacs/libs/libXpm-3.5.8/include
 -ID:/devel/emacs/libs/libXpm-3.5.8/src
 -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
 -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
 -ID:/devel/emacs/libs/giflib-4.1.4-1/include
 -ID:/devel/emacs/libs/jpeg-6b-4/include
 -ID:/devel/emacs/libs/tiff-3.8.2-1/include
 -ID:/devel/emacs/libs/gnutls-3.0.9/include'

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ENU
  value of $XMODIFIERS: nil
  locale-coding-system: cp1252
  default enable-multibyte-characters: t

Major mode: Text

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
i n e . <return> <return> G P G SPC v e r s i o n SPC
1 . 4 . 4 SPC ( s e e SPC b l <backspace> e l o w SPC
f o r SPC o u t p u t SPC o v <backspace> f SPC g p
g - <backspace> SPC - - v e r s i o n ) <return> C-x
C-w <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> d e s k <tab> b u g r e p o
r t . t x t <return> C-p C-p C-p C-p C-SPC C-p C-p
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <menu-bar> <edit> <props> <fc>
d <down-mouse-1> <mouse-1> C-x C-s C-a <escape> < <escape>
> C-x C-x <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <menu-bar>
<edit> <props> <fc> d <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<down-mouse-1> <mouse-1> <return> C-u 7 0 - <return>
T o SPC r e c r e a t e SPC t h e SPC b u g : <return>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<return> > S-SPC I SPC n e v e r SPC s e e SPC a n
y SPC f e e d b a c k SPC a b o u t SPC v <backspace>
s i g n a t u r e SPC v e r i f i c a t i o n . <return>
<down> <down> <down> <down> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<menu-bar> <help-menu> <send-emacs-bug-report>

Recent messages:
Mark set [2 times]
For information about GNU Emacs and the GNU system, type C-h C-a.
Mark set
Saving file c:/Users/puumalma/Desktop/bugreport.txt...
Wrote c:/Users/puumalma/Desktop/bugreport.txt
Mark set
Saving file c:/Users/puumalma/Desktop/bugreport.txt...
Wrote c:/Users/puumalma/Desktop/bugreport.txt
Mark set [2 times]
Auto-saving...done

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail regexp-opt rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils epa-file epa derived epg epg-config
cus-edit cus-start cus-load wid-edit help-mode easymenu view help-fns
time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel dos-w32
disp-table ls-lisp w32-win w32-vars tool-bar dnd fontset image fringe
lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer loaddefs button faces cus-face files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process multi-tty emacs)