Page MenuHome GnuPG

Delete/backspace does nothing in pinentry 0.9.4 in OSX
Closed, ResolvedPublic

Description

Hitting the "delete" key on a Mac computer will not erase the previous
character entered into pinentry-curses. It will not even back the
cursor up.

This makes pinentry-curses pretty much unusable on OSX. You have to get
your password right.

This is pinentry 0.9.4, though I believe it happens at least in 0.9.3
and 0.9.2 as well.

This is reproducible by multiple users on multiple machines[1], with
multiple terminal programs (Terminal.app, iTerm2.app).

Mine is OSX 10.10.3.

[1] For example: https://github.com/Homebrew/homebrew/issues/40335

Details

Version
0.9.4

Event Timeline

chdiza set Version to 0.9.4.
chdiza added a subscriber: chdiza.

The delete key never did anything, because the cursor is always at the end of
the line. (Delete deletes the character in front of the cursor.) Perhaps you
mean the backspace key.

Please apply the following patch. The run: build-dir/curses/pinentry-curses and
type getpin. You'll be prompted for a pin. Type in some text and then press
"delete". Then please reply to this issue with the exact text that you typed
and the file /tmp/pinentry-curses-output.txt

Thanks.

The delete key never did anything, because the cursor is always at the end of

the line. (Delete deletes the character in front of the cursor.) Perhaps you
mean the backspace key.

I had to clone the git repo first. Once there, I applied the patch and I ran
autogen.sh. I can't get the resulting configure script to work. Both "./configure"
and "./configure --enable-maintainer-mode" result in the following:

---8<-----------------------------------
checking for ncursesw... no
checking for ncurses... no
checking for initscr in -lncursesw... no
checking for initscr in -lncurses... yes
checking for ncurses include dir... none
./configure: line 8466: syntax error near unexpected token `iconv'
./configure: line 8466: ` AC_LIB_LINKFLAGS_BODY(iconv)'
---8<-----------------------------------

The delete key never did anything, because the cursor is always at the end of

the line. (Delete deletes the character in front of the cursor.) Perhaps you
mean the backspace key.

I mean the key which has the word "delete" on it, as seen in the gallery here:
https://www.apple.com/keyboard/. It is in the same spot, and is labeled "delete",
on all Mac keyboards, not just the model shown in that gallery. They key in
question is the one that Mac users press to simultaneously back up the cursor and
delete whatever char was in the arrive-at position.

Probably now someone will tell me that the key is improperly labeled by Apple :)

It sounds like you are missing some build dependencies. Perhaps something
related to iconv?

Looking at the keyboard, that appears to be the backspace key. (The last Mac I
used was an Apple 2E in school.) The backspace key works fine for me and I
don't have access to a Mac to debug the issue, so I'm going to need help. It
would be great if you could get pinentry to compile and used git bisect to find
the change that caused the problem (I'm assuming that the bug didn't exist at
some point).

Thanks.

It sounds like you are missing some build dependencies. Perhaps something

related to iconv?

Well, I don't know. I'm not a programmer. I am not missing any deps when I build the
released versions of pinentry. I don't know what's different about the git repo
versions.

I made sure gettext was in my path and tried again, having applied your patch. It
compiled.

I then followed your original instructions. I typed:

onetwo<the-key-called-Delete-on-Mac>

and hit OK.

The contents of pinentry-curses-output.txt was:
6f
6e
65
74
77
6f
7f

Needless to say, "backspacing" still failed.

I attempted to bisect, but when I when back to version 0.8.1, I could not build. I get
stuff I don't understand and don't know how to fix, like:

config.status: error: cannot find input file: `gtk/Makefile.in'

And other stuff that seems related to older checkouts needing different versions of
autoconf/automake. I simply don't have the expertise to deal with that, or the time to
curate multiple versions of autotools. So I can't git bisect.

I did however find that the oldest release version of pinentry that I could build on my
system was 0.7.1, and it also had broken backspace/delete/whatever.

I also tried on OSX 10.5.8, same thing.

I suspect pinentry was always broken on OSX.

If get back as far as 0.9.1 and the bug is still present, then it wasn't
introduced by recent changes. That's good to know.

Can you still try building with the supplied patch and sending me the scancodes
for delete.

Thanks.

Can you still try building with the supplied patch and sending me the scancodes

for delete.

Sorry, I don't understand. I did build with the supplied patch, as I reported below,
and I included the output of /tmp/pinentry-curses-output.txt as instructed.

neal claimed this task.

chdiza: Thanks for your help! I'm sorry about the confusion. I overlooked your
previous message. I've change pinentry-curses to recognize 0xf7 (127) as
backspace (6ce1d0c curses: Recognize ASCII DEL as backspace.) If this change
didn't fix the issue, please reopen.

Neal: It works!

However you should be aware that I had to manually --disable-pinentry-emacs, or else
I got this:

-----8<-----------------------------
Making all in emacs
gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/local/Cellar/gnoopeegee/1.8.0/include -
I/usr/local/Cellar/gnoopeegee/1.8.0/include -I../pinentry -Wall -g -O2 -Wall -
Wcast-align -Wshadow -Wstrict-prototypes -Wformat -Wno-format-y2k -Wformat-security
-W -Wno-sign-compare -Wno-missing-field-initializers -Wdeclaration-after-statement -
Wno-pointer-sign -Wpointer-arith -MT pinentry-emacs.o -MD -MP -MF .deps/pinentry-
emacs.Tpo -c -o pinentry-emacs.o pinentry-emacs.c
mv -f .deps/pinentry-emacs.Tpo .deps/pinentry-emacs.Po
make[2]: * No rule to make target ../assuan/libassuan.a', needed by pinentry-
emacs'. Stop.
make[1]:
* [all-recursive] Error 1
make: *** [all] Error 2
------------8<----------------------------

I myself don't use emacs, but probably there are some OSX users who'd want pinentry-
emacs.

Also, the OSX community would much appreciate it if you guys would cut a release
containing this fix as soon as possible. We aren't any less likely to misenter our own
passwords than anyone else :)

chdiza: In the future, please open one issue per bug report. FWIW, I've also
fixed this new bug.

Given that this bug has existed since forever on Max OS X, I don't think this
issue is important enough to immediately do a release. However, there should be
a new release within the month.