pinentry.git
3 years agoReinitialize PINENTRY when the Assuan RESET command is invoke. neal/next
Neal H. Walfield [Sat, 16 May 2015 12:57:29 +0000 (14:57 +0200)]
Reinitialize PINENTRY when the Assuan RESET command is invoke.

* pinentry/pinentry.c (pinentry_loop2): Register pinentry_reset as the
assuan reset handler.

3 years agoDon't use a static initializer to initialize PINENTRY.
Neal H. Walfield [Sat, 16 May 2015 12:56:27 +0000 (14:56 +0200)]
Don't use a static initializer to initialize PINENTRY.

* pinentry/pinentry.c (pinentry): Don't use a static initializer.
(pinentry_reset): Initialize PINENTRY here.
(pinentry_loop2): Call pinentry_reset here.

3 years agoDon't emit the LC_CTYPE-not-set warning more than once.
Neal H. Walfield [Sat, 16 May 2015 11:37:46 +0000 (13:37 +0200)]
Don't emit the LC_CTYPE-not-set warning more than once.

* pinentry/pinentry.c (lc_ctype_unknown_warning): New variable.
(pinentry_utf8_to_local): Only emit the LC_CTYPE warning if
lc_ctype_unknown_warning is not set.  After emitted such a warning,
set lc_ctype_unknown_warning.
(pinentry_local_to_utf8): Likewise.

3 years agocurses: Use default-ok and default-cancel if set.
Neal H. Walfield [Sat, 16 May 2015 11:28:16 +0000 (13:28 +0200)]
curses: Use default-ok and default-cancel if set.

* pinentry/pinentry-curses.c (default_notok): New macro.
(MAKE_BUTTON): Also check if default variant is set.

3 years agocurses: Don't show the notok button in pin entry mode.
Neal H. Walfield [Sat, 16 May 2015 11:10:41 +0000 (13:10 +0200)]
curses: Don't show the notok button in pin entry mode.

* pinentry/pinentry-curses.c (dialog_create): Don't show the notok
button in pin entry mode.

3 years agoAvoid implicit declaration of function addnwstr.
Daniel Kahn Gillmor [Wed, 13 May 2015 20:36:26 +0000 (16:36 -0400)]
Avoid implicit declaration of function addnwstr.

* pinentry/pinentry-curses.c [HAVE_NCURSESW]: Include <ncursesw/curses.h>.
[! HAVE_NCURSESW]: Only include <curses.h> in this case.

--

When built with libncursesw, we see this problem:

pinentry-curses.c:440:8: warning: implicit declaration of function ‘addnwstr’ [-Wimplicit-function-declaration]
        ADDCH (start[i]);
        ^

3 years agotty: Handle the case where the user needs to repeat the passphrase.
Neal H. Walfield [Wed, 13 May 2015 21:13:30 +0000 (23:13 +0200)]
tty: Handle the case where the user needs to repeat the passphrase.

* tty/pinentry-tty.c: Include "memory.h".
(read_password): Break into two functions: read_password and password.
(read_password): Just read the password from the terminal and return
it in secure memory (or NULL if the user canceled the entry or there
was an error).
(password): Improve output.  Handle the repeat passphrase case (i.e.,
when pinentry->repeat_passphrase is set).
* tty/Makefile.am (AM_CPPFLAGS): Add "-I$(top_srcdir)/secmem".

3 years agoAdd a new helper function, pinentry_setbuffer_use.
Neal H. Walfield [Wed, 13 May 2015 21:09:46 +0000 (23:09 +0200)]
Add a new helper function, pinentry_setbuffer_use.

* pinentry/pinentry.c (pinentry_setbuffer_use): New function.
* pinentry/pinentry.h (pinentry_setbuffer_use): New declaration.

3 years agotty: Always call do_touch_file if we (potentially) touched the screen.
Neal H. Walfield [Wed, 13 May 2015 20:12:59 +0000 (22:12 +0200)]
tty: Always call do_touch_file if we (potentially) touched the screen.

* tty/pinentry-tty.c (tty_cmd_handler): Always call do_touch_file.

3 years agotty: Improve confirmation mode functionality.
Neal H. Walfield [Wed, 13 May 2015 20:09:15 +0000 (22:09 +0200)]
tty: Improve confirmation mode functionality.

* tty/pinentry-tty.c: Include <ctype.h>.
(UNDERLINE_START): Define.
(ALERT_START): Define.
(NORMAL_RESTORE): Define.
(button): New function.
(confirm): Rewrite to include all confirmation mode functionality.
(tty_cmd_handler): Don't include any confirmation mode functionality.
Just call confirm.

3 years agoFix linking order to work when linked with --as-needed.
Neal H. Walfield [Wed, 13 May 2015 19:47:11 +0000 (21:47 +0200)]
Fix linking order to work when linked with --as-needed.

* curses/Makefile.am (LDADD): Add $(COMMON_LIBS) after all of the
local objects and object archives.
* gnome3/Makefile.am (LDADD): Likewise.
* gtk+-2/Makefile.am (LDADD): Likewise.
* qt4/Makefile.am (pinentry_qt4_LDADD): Likewise.
* tty/Makefile.am (LDADD): Likewise.

Reported-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
3 years agoDon't interpret the handler's return value as the passphrase's length.
Neal H. Walfield [Wed, 13 May 2015 12:20:23 +0000 (14:20 +0200)]
Don't interpret the handler's return value as the passphrase's length.

* pinentry/pinentry.c (cmd_getpin): Don't interpret the return value
as the passphrase length.  Use strlen instead.

3 years agoMake the management of pinentry.pin more explicit.
Neal H. Walfield [Wed, 13 May 2015 11:52:03 +0000 (13:52 +0200)]
Make the management of pinentry.pin more explicit.

* pinentry/pinentry.c: Include <assert.h>.
(pinentry): Set pin_len to 0.
(pinentry_setbufferlen): If len is less than 2048, set it to 2048.
Add an assertion.
(pinentry_setbuffer_clear): New function that releases the pin buffer.
(pinentry_setbuffer_init): New function that initializes the pin
buffer.
(cmd_getpin): Use pinentry_setbuffer_init and pinentry_setbuffer_clear
instead of manual memory management.
(cmd_confirm): Use pinentry_setbuffer_clear instead of manual memory
management.

3 years agoBetter document struct pinentry.
Neal H. Walfield [Wed, 13 May 2015 12:21:19 +0000 (14:21 +0200)]
Better document struct pinentry.

* pinentry/pinentry.h (struct pinentry): Better document the various
fields.

3 years agoFix some documentation details.
Neal H. Walfield [Tue, 12 May 2015 15:09:34 +0000 (17:09 +0200)]
Fix some documentation details.

* doc/pinentry.texi: Fix some details.

3 years agoAdd a GNOME3 pinentry based on gcr.
Neal H. Walfield [Tue, 12 May 2015 15:07:49 +0000 (17:07 +0200)]
Add a GNOME3 pinentry based on gcr.

* configure.ac (--enable-pinentry-gnome3): Option to enable the GNOME3
pinentry.
(pinentry_gnome_3): Set to yes if enabled and gcr-3 and gcr-base-3 gcr
is available.
(GNOME3CFLAGS): Define and AC_SUBST.
(GNOME3LIBS): Define and AC_SUBST.
(GCR_API_SUBJECT_TO_CHANGE): Define.
(BUILD_PINENTRY_GNOME_3): Define.
* Makefile.am (pinentry_gnome_3): Define.
(SUBDIRS): Add ${pinentry_gnome_3}.
* gnome3/Makefile.am: New file.
* gnome3/pinentry-gnome3.c: New file.

3 years agoAdd new chapter to documentation describing implementation details.
Neal H. Walfield [Tue, 12 May 2015 13:47:27 +0000 (15:47 +0200)]
Add new chapter to documentation describing implementation details.

* doc/pinentry.texi: Add new chapter describing some implementation
details.

3 years agoSimplify code.
Neal H. Walfield [Mon, 11 May 2015 14:35:12 +0000 (16:35 +0200)]
Simplify code.

* pinentry/pinentry.c (cmd_confirm): Don't use nested ternary
expressions.

3 years agoImplement cmd_confirm in terms of cmd_message.
Neal H. Walfield [Mon, 11 May 2015 14:14:58 +0000 (16:14 +0200)]
Implement cmd_confirm in terms of cmd_message.

* pinentry/pinentry.c (cmd_confirm): Implement cmd_confirm in terms of
cmd_message.

3 years agoFix memory allocation in pinentry_setbufferlen.
Neal H. Walfield [Mon, 11 May 2015 14:14:18 +0000 (16:14 +0200)]
Fix memory allocation in pinentry_setbufferlen.

* pinentry/pinentry.c (pinentry_setbufferlen): Set PIN->PIN to a
buffer that is LEN bytes large, not 2 * PIN->PIN_LENGTH.

3 years agoPost release updates.
Werner Koch [Mon, 11 May 2015 13:40:49 +0000 (15:40 +0200)]
Post release updates.

--

3 years agoRelease 0.9.2 pinentry-0.9.2
Werner Koch [Mon, 11 May 2015 13:30:24 +0000 (15:30 +0200)]
Release 0.9.2

3 years agogtk: Silence compiler warning at another place.
Werner Koch [Mon, 11 May 2015 11:12:17 +0000 (13:12 +0200)]
gtk: Silence compiler warning at another place.

--

This extends
commit 3d02645d757e573e4628a1caf2e36bb92d523e77

3 years agoReturn better error codes.
Werner Koch [Mon, 11 May 2015 11:10:14 +0000 (13:10 +0200)]
Return better error codes.

* assuan/assuan.h (ASSUAN_Too_Short): New
(ASSUAN_ENOENT, ASSUAN_ENOTTY): New.
* pinentry/pinentry-curses.c: Include assuan.h.
(dialog_create, dialog_run): Set specific error codes.
* pinentry/pinentry.h (struct pinentry): Add field specific_err.
* pinentry/pinentry.c (cmd_getpin): Return specific_err.
(cmd_confirm, cmd_message): Ditto.
--

GnuPG-bug-id: 1463

3 years agocurses: Reset tty state on failed dialog creation.
Werner Koch [Mon, 11 May 2015 10:22:48 +0000 (12:22 +0200)]
curses: Reset tty state on failed dialog creation.

* pinentry/pinentry-curses.c (dialog_run): Cleanup on dialog_create
error.
--

This may happen due to a too small tty.  We need to cleanup in this
case to keep the tty in a usable state.

GnuPG-bug-id: 1383

3 years agogtk: Use a description string from gpg-agent for libsecret.
Werner Koch [Mon, 11 May 2015 08:53:08 +0000 (10:53 +0200)]
gtk: Use a description string from gpg-agent for libsecret.

* pinentry/pinentry.h (struct pinentry): Add field default_pwmngr.
* pinentry/pinentry.c (option_handler): Set it.
* gtk+-2/pinentry-gtk-2.c (create_window) [HAVE_LIBSECRET]: Use new
string.

3 years agogtk: Silence compiler warning
Werner Koch [Mon, 11 May 2015 08:51:34 +0000 (10:51 +0200)]
gtk: Silence compiler warning

3 years agoDon't use asprintf.
Neal H. Walfield [Thu, 7 May 2015 13:42:50 +0000 (15:42 +0200)]
Don't use asprintf.

* pinentry/password-cache.c (keygrip_to_label): Don't use asprintf.

3 years agoImprove documentation.
Neal H. Walfield [Thu, 7 May 2015 13:42:19 +0000 (15:42 +0200)]
Improve documentation.

* doc/pinentry.texi: Improve description of SETKEYINFO's format.

3 years agoMinor documentation cleanups.
Neal H. Walfield [Thu, 7 May 2015 12:44:37 +0000 (14:44 +0200)]
Minor documentation cleanups.

3 years agoAdd support for saving the passphrase with libsecret.
Neal H. Walfield [Thu, 7 May 2015 12:43:48 +0000 (14:43 +0200)]
Add support for saving the passphrase with libsecret.

* configure.ac (COMMON_CFLAGS): New variable.  AC_SUBST it.
(COMMON_LIBS): Likewise.  AC_SUBST it.
(LIBSECRET_CFLAGS): Likewise.
(LIBSECRET_LIBS): Likewise.
(--enable-libsecret): Add option to enable support for libsecret.  If
enabled, check for its presense.
* pinentry/password-cache.h: New field.
* pinentry/password-cache.c: New field.
* pinentry/pinentry.h (struct pinentry): Add fields pin_from_cache,
allow_external_password_cache, tried_password_cache, keyinfo, and
may_cache_password.
* pinentry/pinentry.c: Include "password-cache.h".
(pinentry): Initialize new fields.
(option_handler): Handle the "allow-external-password-cache" option.
(cmd_setkeyinfo): Implement it.
(cmd_getpin): Read the password from the cache, if appropriate.  Save
it to the cache, if appropriate.
* pinentry/Makefile.am (AM_CPPFLAGS): Add $(COMMON_CFLAGS).
(LDADD): Add $(COMMON_LIBS).
(libpinentry_a_SOURCES): Add password-cache.h
password-cache.c.
* gtk+-2/pinentry-gtk-2.c (may_save_passphrase_toggled): New function.
(create_window): Take additional parameter, the pinentry's context.
Update callers.
[HAVE_LIBSECRET]: Show a checkbox asking whether the passphrase should
be saved.
* gtk+-2/Makefile.am (AM_CPPFLAGS): Add $(COMMON_CFLAGS).
(LDADD): Add $(COMMON_LIBS).
* curses/Makefile.am (AM_CPPFLAGS): Add $(COMMON_CFLAGS).
(LDADD): Add $(COMMON_LIBS).
* tty/Makefile.am (AM_CPPFLAGS): Add $(COMMON_CFLAGS).
(LDADD): Add $(COMMON_LIBS).
* doc/pinentry.texi (Protocol): Update documentation.  Describe the
protocol and provide some justification.

3 years agow32: Do not build gtk pinentry by default.
Werner Koch [Thu, 7 May 2015 11:29:26 +0000 (13:29 +0200)]
w32: Do not build gtk pinentry by default.

* autogen.rc: Remove obsolete options.

3 years agoAlign secmem_realloc behavior with realloc's.
Neal H. Walfield [Thu, 7 May 2015 09:31:01 +0000 (11:31 +0200)]
Align secmem_realloc behavior with realloc's.

* secmem/secmem.c (secmem_realloc): If passed a NULL pointer, then
call secmem_malloc instead of crashing.

3 years agow32: Minor changes to the dialog.
Werner Koch [Tue, 5 May 2015 20:02:58 +0000 (22:02 +0200)]
w32: Minor changes to the dialog.

* w32/main.c (set_bitmap): New.
(dlg_proc): Show error prompt in red.
* w32/pinentry-w32.rc: Add icons and chnage dialog.
* w32/logo-128.bmp: New.
* w32/logo-32.bmp: New.
* w32/logo-48.bmp: New.
* w32/logo-64.bmp: New.
* w32/logo-96.bmp: New.

--

The logos need some manual tweaking.  Due to the scaling a gradient is
used for the circle and Windows shows white ugly white spots.  This
can be avoided by using a a palette with less colors but I found no
easy way to do that in gimp.  When using less than 256 index the
transparency feature does not work correctly.

3 years agoRemove the Manifest files
Werner Koch [Tue, 5 May 2015 07:10:10 +0000 (09:10 +0200)]
Remove the Manifest files

--

These files are not in use for more than a decade.  Their indented
purpose was to sign source files.  With GIT we have a way better
system to detect tampering of the source.

3 years agopinentry-tty: Fix problem with zero length prompt.
Werner Koch [Tue, 5 May 2015 07:03:30 +0000 (09:03 +0200)]
pinentry-tty: Fix problem with zero length prompt.

* tty/pinentry-tty.c (read_password): Use default prompt also for an
empty prompt argument.
--

strlen(prompt)-1 is used thus we need to make sure that
the length is > 0.

3 years agoImprove documentation.
Neal H. Walfield [Fri, 1 May 2015 18:38:22 +0000 (20:38 +0200)]
Improve documentation.

Improve documentation: clean up wording and add some minor
improvements to the content.

--

3 years agoImprove comment.
Neal H. Walfield [Fri, 1 May 2015 18:37:00 +0000 (20:37 +0200)]
Improve comment.

* tty/pinentry-tty.c (tty_cmd_handler): Add comment.

--

3 years agoWhen reading the pin, correctly handle backspace.
Neal H. Walfield [Fri, 1 May 2015 18:35:59 +0000 (20:35 +0200)]
When reading the pin, correctly handle backspace.

* tty/pinentry-tty.c (read_password): Handle backspace.

--

3 years agoImprove prompt for pin.
Neal H. Walfield [Fri, 1 May 2015 18:33:55 +0000 (20:33 +0200)]
Improve prompt for pin.

* tty/pinentry-tty.c (read_password): Improve prompt for pin.

--

3 years agofix small memory leak in pinentry-curses
Daniel Kahn Gillmor [Tue, 28 Apr 2015 17:01:16 +0000 (13:01 -0400)]
fix small memory leak in pinentry-curses

* pinentry/pinentry-curses.c: free internally allocated local string.

3 years agopinentry-tty: make confirm actions work
Daniel Kahn Gillmor [Tue, 28 Apr 2015 17:01:15 +0000 (13:01 -0400)]
pinentry-tty: make confirm actions work

* tty/pinentry-tty.c: treat the situation where no PIN is requested
  and one_button is not set as a confirmation prompt.

--

When user confirmation is requested on a dumb terminal, we use the
value of the "OK" button followed with [y/N]? as the confirmation
prompt.  User typing is echoed as normal, since a confirmation prompt
is not a password entry.

3 years agopinentry-tty: fix segfault on MESSAGE or CONFIRM
Daniel Kahn Gillmor [Tue, 28 Apr 2015 17:01:14 +0000 (13:01 -0400)]
pinentry-tty: fix segfault on MESSAGE or CONFIRM

* tty/pinentry-tty.c: avoid prompting for a PIN when one was not asked
  for.

--

Before this, pinentry-tty would segfault when asked for MESSAGE or
CONFIRM:

0 dkg@alice:~$ pinentry-tty
OK Your orders please
SETDESC testing testing
OK
MESSAGE
testing testing
PIN? :
Segmentation fault
139 dkg@alice:~$

3 years agopinentry-tty: handle designated tty outside of read_password
Daniel Kahn Gillmor [Tue, 28 Apr 2015 17:01:13 +0000 (13:01 -0400)]
pinentry-tty: handle designated tty outside of read_password

* tty/pinentry-tty.c: reorganize, wrapping read_password in tty
  open/close.

--

This patch sets the stage to simplify the subsequent fixes.

3 years agogtk: Make Escape key work.
Yuri D'Elia [Thu, 16 Apr 2015 09:34:58 +0000 (11:34 +0200)]
gtk: Make Escape key work.

* gtk+-2/pinentry-gtk-2.c: Include gdk/gdkkeysyms.h.
(enter_callback): Pass confirm_value_t to button_clicked.
(confirm_button_clicked): Use confirm_value_t cast.
(cancel_callback): New.
(create_window): Add accelerator for the Escape key.
--

GnuPG-bug-id: 1453

Original patch slighty modified by wk.

3 years agoAdd stub command SETKEYINFO.
Werner Koch [Tue, 14 Apr 2015 16:37:07 +0000 (18:37 +0200)]
Add stub command SETKEYINFO.

* pinentry/pinentry.c (cmd_setkeyinfo): New.
(register_commands): Addd command.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoPost release updates
Werner Koch [Wed, 18 Mar 2015 11:18:02 +0000 (12:18 +0100)]
Post release updates

--

3 years agoRelease 0.9.1 pinentry-0.9.1
Werner Koch [Wed, 18 Mar 2015 11:11:19 +0000 (12:11 +0100)]
Release 0.9.1

3 years agoFix build problems on AIX.
Werner Koch [Wed, 18 Mar 2015 11:06:44 +0000 (12:06 +0100)]
Fix build problems on AIX.

* pinentry/pinentry.c: Do not include getopt.h.
* pinentry/pinentry-curses.c (dialog_run): Call use_default_colors
only with ncurses.

3 years agoUpdate to automake 1.14.
Werner Koch [Wed, 18 Mar 2015 11:05:16 +0000 (12:05 +0100)]
Update to automake 1.14.

3 years agoUpdate build-aux files.
Werner Koch [Wed, 18 Mar 2015 10:40:24 +0000 (11:40 +0100)]
Update build-aux files.

--

3 years agoGet rid of getopt_long and improve --help output.
Werner Koch [Tue, 17 Mar 2015 10:28:40 +0000 (11:28 +0100)]
Get rid of getopt_long and improve --help output.

* pinentry/argparse.c, pinentry/argparse.h: New. Taken from GnuPG
master.
* pinentry/Makefile.am (libpinentry_a_SOURCES): Add them.
* pinentry/pinentry.c: Include argparse.h.
(usage): Remove.
(my_strusage): New.
(pinentry_parse_opts): Rewrite.  Do not return a value.  Change call
callers.
--

getopt_long is not generally available, for example it is missing on
AIX.  Instead of adding replacement code we use the option parser
from GnuPG and thus also gain a better --version and --help.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoUse CH type instead of wchar_t for curses.
Werner Koch [Tue, 17 Mar 2015 08:56:18 +0000 (09:56 +0100)]
Use CH type instead of wchar_t for curses.

* pinentry/pinentry-curses.c (collect_line): Change second arg to CH.
* pinentry/pinentry.c (pinentry_utf8_to_local): Make args const.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoqt4: Improve moc handling
Andre Heinecke [Mon, 15 Dec 2014 17:07:32 +0000 (18:07 +0100)]
qt4: Improve moc handling

    * configure.ac: Disable pinentry-qt4 or exit if moc not found.
    * m4/qt.m4: Look for and prefer moc-qt4.
    * qt4/Makefile.am: Add moc files to nodist and clean them.

--

    Files generated by MOC vary over the used Qt versions
    (even inside a Major release). Distributing them leads to
    errors if a different qt version is installed.

    GnuPG-bug-id: 1784

3 years agodoc: Update gpl.texi to match version from gcrypt
Andre Heinecke [Mon, 15 Dec 2014 16:38:05 +0000 (17:38 +0100)]
doc: Update gpl.texi to match version from gcrypt

    * doc/gpl.texi: Use version from gcrypt.

--
   This fixes build errors with texinfo 5.2

3 years agopinentry-qt4: make the accessibility part optional
Vicente Olivert Riera [Mon, 8 Dec 2014 16:42:42 +0000 (16:42 +0000)]
pinentry-qt4: make the accessibility part optional

Check if the Qt libraries have support for QT Accessibility before using
it. Otherwise it will raise error like these one:

main.cpp: In function 'int qt_cmd_handler(pinentry_t)':
main.cpp:220:51: error: 'class QAbstractButton' has no member named
'setAccessibleDescription'

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
3 years agoPost release updates.
Werner Koch [Sun, 26 Oct 2014 11:26:17 +0000 (12:26 +0100)]
Post release updates.

--

3 years agoRelease 0.9.0 pinentry-0.9.0
Werner Koch [Sun, 26 Oct 2014 11:19:05 +0000 (12:19 +0100)]
Release 0.9.0

3 years agogtk: Aboid segv for opaste keys.
Werner Koch [Sun, 26 Oct 2014 11:18:45 +0000 (12:18 +0100)]
gtk: Aboid segv for opaste keys.

* gtk+-2/gtksecentry.c (gtk_secure_entry_class_init): Disable paste
key bindings.

3 years agoRemove support form QT3 and GTK+-1.
Werner Koch [Fri, 24 Oct 2014 14:20:20 +0000 (16:20 +0200)]
Remove support form QT3 and GTK+-1.

* configure.ac: Remove old qt and gtk+-1 support.
* Makefile.am: Ditto.

3 years agoCheck if we are on tty before initializing curses.
Stanislav Ochotnicky [Fri, 14 Feb 2014 11:58:38 +0000 (12:58 +0100)]
Check if we are on tty before initializing curses.

* pinentry/pinentry-curses.c (dialog_run): Check stant stdin and stout
are connected to ttys.

--

When we did not have a ttyname we just used stdin/out without checking
if it's a proper TTY or a pipe. In some cases this can cause endless
loop or escape seqeunces on the terminal.

This commit changes behaviour so that if stdin/out is not tty and no
ttyname is specified we error-out with errno set to ENOTTY

3 years agogtk: Allow pasting using the mouse.
Werner Koch [Fri, 24 Oct 2014 14:20:20 +0000 (16:20 +0200)]
gtk: Allow pasting using the mouse.

* gtk+-2/gtksecentry.h (_GtkSecureEntry): Add fields insert_pos,
real_changed, cand change_count.
(_GtkSecureEntryClass): Add field paste_clipboard.
* gtk+-2/gtksecentry.c (PASTE_CLIPBOARD): New.
(gtk_secure_entry_class_init): Set paste_clipboard and create
paste-clipboard signal.
(gtk_secure_entry_button_press): Call gtk_secure_entry_pase.
(begin_change, end_change, emit_changed): New.
(gtk_secure_entry_real_insert_text): Use emit_changed.
(gtk_secure_entry_real_delete_text): Ditto.
(paste_received, gtk_secure_entry_paste)
(gtk_secure_entry_paste_clipboard): New.
--

The new code as been taken from gtk 2.20.1.

I have not figured out why the keybindings for C-v and s-Insert do not
work.

3 years agogtk+-2: Make current focus visible again.
Werner Koch [Fri, 24 Oct 2014 14:10:15 +0000 (16:10 +0200)]
gtk+-2: Make current focus visible again.

* gtk+-2/pinentry-gtk-2.c (grab_keyboard): Return false
(ungrab_keyboard): Ditto.
--

Probably due to a change in GTK+ the grab handler now need to return a
flag wether to call the other event handler.  Without that the focus
was not visible.

3 years agogtk+-2: Implement the SETREPEAT command.
Werner Koch [Fri, 24 Oct 2014 14:11:59 +0000 (16:11 +0200)]
gtk+-2: Implement the SETREPEAT command.

* gtk+-2/pinentry-gtk-2.c (repeat_entry, error_label): New.
(button_clicked): Implement repeat check.
(changed_text_handler): Clear repeat field.
(create_window): Add repeat entry.

3 years agoAdd commands to allow implementing a "repeat passphrase" field.
Werner Koch [Fri, 24 Oct 2014 14:20:20 +0000 (16:20 +0200)]
Add commands to allow implementing a "repeat passphrase" field.

* pinentry/pinentry.c (cmd_setrepeat): New.
(cmd_setrepeaterror): New.
(register_commands): Add new commands.
(cmd_getpin): Print "PIN_REPEATED" status.

4 years agoPost release updates.
Werner Koch [Thu, 18 Sep 2014 08:36:59 +0000 (10:36 +0200)]
Post release updates.

--

4 years agoRelease 0.8.4. pinentry-0.8.4
Werner Koch [Thu, 18 Sep 2014 08:23:50 +0000 (10:23 +0200)]
Release 0.8.4.

4 years agoAdd missing build support files and move them to build-aux.
Werner Koch [Thu, 18 Sep 2014 08:22:34 +0000 (10:22 +0200)]
Add missing build support files and move them to build-aux.

4 years agoUse generic autogen.sh script.
Werner Koch [Thu, 18 Sep 2014 08:21:19 +0000 (10:21 +0200)]
Use generic autogen.sh script.

* autogen.rc: New.
* autogen.sh: New.  Take from GnuPG.
* Makefile.am (EXTRA_DIST): Add autogen.rc.
(DISTCHECK_CONFIGURE_FLAGS): Disable qt4.

4 years agocommon: Fix compiler warning.
Werner Koch [Tue, 12 Aug 2014 08:32:56 +0000 (10:32 +0200)]
common: Fix compiler warning.

* pinentry/pinentry.c (pinentry_utf8_to_local): Use cast for iconv arg.
(pinentry_local_to_utf8): Ditto.
--

There are a couple of other warnings.  They still need to be fixed.

4 years agoNew pinentry-tty version for dumb terminals.
Werner Koch [Tue, 12 Aug 2014 08:36:30 +0000 (10:36 +0200)]
New pinentry-tty version for dumb terminals.

* Makefile.am: Add pinentry-tty.
* NEWS: Add news about pinentry-tty.
* README: Update.
* configure.ac: Add support for this pinentry.
* tty/Makefile.am: New.
* tty/pinentry-tty.c: New.
--

(Minor changes and re-indention by wk)

4 years agoCheck for MOC also if pinentry-qt is disabled
Andre Heinecke [Wed, 6 Aug 2014 14:09:55 +0000 (16:09 +0200)]
Check for MOC also if pinentry-qt is disabled

  * configure.ac: Call QT_PATH_MOC if pinentry_qt4 is not no.

--
  Previously the MOC lookup from m4/qt.m4 would only be called
  if pinentry-qt was at least maybe. The MOC variable defined by
  this macro is also used in pinentry-qt4 though.

4 years agoAdd fallbacks for SetForegroundWindow
Andre Heinecke [Wed, 6 Aug 2014 13:05:25 +0000 (15:05 +0200)]
Add fallbacks for SetForegroundWindow

    If that foreground window fails pinentry-qt now tries to
    attach to the current foreground process and then tries
    to set the foreground window again. If that fails it also
    calls ShowWindow as a last resort.

    * qt4/pinentrydialog.cpp (raiseWindow): Add fallbacks in
    case SetForegroundWindow fails.

4 years agoUse raiseWindow also for confirm dialogs
Andre Heinecke [Wed, 6 Aug 2014 13:01:54 +0000 (15:01 +0200)]
Use raiseWindow also for confirm dialogs

    This should fix the case that the dialog opened
    in the foreground but a warning / confirm dialog
    opened in the background.

    * qt4/pinentryconfirm.cpp, qt4/pinentryconfirm.h (showEvent):
    New overwrite base class method to call raiseWindow.
    * NEWS: Mention this.

4 years agoSet some accessibility information
Andre Heinecke [Wed, 30 Jul 2014 09:34:26 +0000 (11:34 +0200)]
Set some accessibility information

    * qt4/main.cpp (qt_cmd_handler): Build buttons with accessibile
    Description.
    * qt4/pinentrydialog.cpp (setDescription, setError, setOkText)
    (setCancelText, setQualityBar): Set an accessible description.
    * qt4/pinentryconfirm.cpp (PinentryConfirm): Set message
    box contents also as accessible values.
    * NEWS: Mention it and the copy/paste change from last year.

4 years agoUse #if 0 for the emacs indentation helper.
Werner Koch [Tue, 15 Apr 2014 14:40:48 +0000 (16:40 +0200)]
Use #if 0 for the emacs indentation helper.

--

5 years agoLower paste length limit to 300
Andre Heinecke [Mon, 15 Jul 2013 12:43:18 +0000 (12:43 +0000)]
Lower paste length limit to 300

    This should be more then enough and avoids possible problems
    with libassuan cmd line lenght or percent escaping etc.

    * qt4/qsecurelineedit.cpp (insert): Lower paste limit

5 years agoLimit paste length to 1023 characters
Andre Heinecke [Mon, 15 Jul 2013 10:48:15 +0000 (10:48 +0000)]
Limit paste length to 1023 characters

    * qt4/qsecurelineedit.cpp (insert): Check for a maximum
    length before allocation the secmem string.

5 years agoFix contextmenu support for pasting.
Andre Heinecke [Mon, 15 Jul 2013 09:43:54 +0000 (09:43 +0000)]
Fix contextmenu support for pasting.

    MOC ignores preprocessor definitions so we can not conditionally
    declare SLOTS. So we now move the ifdefs in the definition and
    always declare the SLOTS.

    * qt4/qsecurelinedit.cpp (cut, copy, paste): Do nothing if
    QT_NO_CLIPBOARD is defined.
    * qt4/qsecurelinedit.h: Always declare cut, copy and paste slots

5 years agoRemove check for RTL extensions
Andre Heinecke [Mon, 15 Jul 2013 08:59:51 +0000 (08:59 +0000)]
Remove check for RTL extensions

    Our code does nothing RTL specific there anyway. And the
    qt_use_rtl_extensions symbol has been removed.

    * qt4/qsecurelinedit.cpp: Remove check for RTL extensions.

5 years agoFix for commit fb38be9 to allow for "make distcheck".
Werner Koch [Fri, 12 Jul 2013 12:57:00 +0000 (14:57 +0200)]
Fix for commit fb38be9 to allow for "make distcheck".

* qt4/Makefile.am: Make correct use of BUILT_SOURCES.
--
This also remove some GNU make specific hacks.

5 years agoAdd pinentry-qt4-clipboard option
Andre Heinecke [Wed, 29 May 2013 17:38:18 +0000 (17:38 +0000)]
Add pinentry-qt4-clipboard option

    Enabling this option will make it possible to paste a
    passphrase into pinentry-qt4. This defeats the secmem
    mechanism but drastically increases usability for some
    users.

    * configure.ac: New option pinentry-qt4-clipboard.
    * qt4/qsecurelineedit.cpp, qt4/qsecurelineedit.h: Activate
    clipboard and context menu if PINENTRY_QT4_CLIPBOARD is defined.

5 years agoRemove qt4 moc files and add moc to buildsystem
Andre Heinecke [Wed, 29 May 2013 17:32:31 +0000 (17:32 +0000)]
Remove qt4 moc files and add moc to buildsystem

    This is neccessary to conditionally enable signals/slots
    at build time.

    * qt4/Makefile.am: Moc files automatically.
    * qt4/pinentryconfirm.moc, qt4/pinentrydialog.moc,
    qsecurelineedit.moc: Removed.

--
    While this removes the hard version requirement to Qt 4.8.2
    caused by the old generated files it breaks the possibillity
    to compile pinentry-qt and pinentry-qt4 in one go as the MOC
    variable is only set once either the qt4 variant or the qt3
    variant will be broken. At least there is a decent
    error message in that case.

5 years agoPost release version number updates.
Werner Koch [Fri, 26 Apr 2013 15:47:16 +0000 (17:47 +0200)]
Post release version number updates.

--

5 years agoRelease 0.8.3 pinentry-0.8.3
Werner Koch [Fri, 26 Apr 2013 13:09:59 +0000 (15:09 +0200)]
Release 0.8.3

5 years agoSwitch to i686-w64-mingw32 as default Windows toolchain.
Andre Heinecke [Fri, 26 Apr 2013 10:27:35 +0000 (12:27 +0200)]
Switch to i686-w64-mingw32 as default Windows toolchain.

* autogen.sh <build-w32>: Insert i686-w64-mingw32.
* configure.ac: Pretty print final info.

5 years agoFix declaration of lock_set_foreground_window for pinnetry-w32.
Andre Heinecke [Fri, 26 Apr 2013 10:17:52 +0000 (12:17 +0200)]
Fix declaration of lock_set_foreground_window for pinnetry-w32.

* w32/main.c (lock_set_foreground_window): Remove WINUSERAPI
qualifier.
--

WINUSERAPI is expanded to dllimport which is not what we want if we
load the symbol at runtime. This produces an error with mingw-w64
4.6.3-14+8

(backport from a gpg4win patch)

5 years agoFix ressource compilation of pinentry-w32
Andre Heinecke [Fri, 26 Apr 2013 10:06:02 +0000 (12:06 +0200)]
Fix ressource compilation of pinentry-w32

* w32/pinentry-w32.rc: Include windows.h
--

MSDN says that to use the Dialog Styles one should include windows.h
and this is also necessary with at least mingw-w64 4.6.3-14+8
otherwise there is a syntax error because the DS_* macros are not
defined

(backport from gpg4win patch)

5 years agoFix help output.
Thomas Gries [Tue, 26 Feb 2013 13:23:18 +0000 (14:23 +0100)]
Fix help output.

--

5 years agoCurses build fix for DOS'ish systems.
Ben Kibbey [Fri, 15 Feb 2013 11:40:01 +0000 (06:40 -0500)]
Curses build fix for DOS'ish systems.

5 years agoDocument the --timeout and SETTIMEOUT feature.
Ben Kibbey [Thu, 14 Feb 2013 02:31:24 +0000 (21:31 -0500)]
Document the --timeout and SETTIMEOUT feature.

5 years agoAdd timeout support to the Gtk+2 pinentry.
Ben Kibbey [Thu, 14 Feb 2013 02:14:23 +0000 (21:14 -0500)]
Add timeout support to the Gtk+2 pinentry.

* gtk+-2/pinentry-gtk-2.c (create_window): Add timer.
(timeout_cb): New.

5 years agoAdd timeout support to the curses pinentry.
Ben Kibbey [Thu, 14 Feb 2013 00:45:24 +0000 (19:45 -0500)]
Add timeout support to the curses pinentry.

* pinentry/pinentry-curses.c (dialog_run): Set the window input to
non-blocking.
(catchsig): New.
(main): Catch SIGALRM and set the timeout.

5 years agoFix initializing the timeout timer.
Ben Kibbey [Sat, 5 Jan 2013 23:27:11 +0000 (18:27 -0500)]
Fix initializing the timeout timer.

When timeout == 0 a segfault would occur.

6 years agoPost release version number bump
Werner Koch [Wed, 8 Aug 2012 14:22:50 +0000 (16:22 +0200)]
Post release version number bump

--

6 years agoRelease 0.8.2. pinentry-0.8.2
Werner Koch [Wed, 8 Aug 2012 14:17:57 +0000 (16:17 +0200)]
Release 0.8.2.

6 years agoDistribute only bzip2 tarballs
Werner Koch [Wed, 8 Aug 2012 14:13:57 +0000 (16:13 +0200)]
Distribute only bzip2 tarballs

* Makefile.am (AUTOMAKE_OPTIONS): New.

6 years agoqt4: Update all moc files to Qt version 4.8.2
Werner Koch [Wed, 8 Aug 2012 14:12:49 +0000 (16:12 +0200)]
qt4: Update all moc files to Qt version 4.8.2

6 years agoUpdate config.guess and config.sub
Werner Koch [Wed, 8 Aug 2012 13:50:47 +0000 (15:50 +0200)]
Update config.guess and config.sub

* config.guess, config.sub: Update to version 2012-07-31 from gnulib.

6 years agoChange build system to auto-generate the ChangeLog
Werner Koch [Wed, 8 Aug 2012 13:45:16 +0000 (15:45 +0200)]
Change build system to auto-generate the ChangeLog

* build-aux/gitlog-to-changelog: New script.  Taken from GnuPG.
* build-aux/git-log-fix: New file.
* build-aux/git-log-footer: New file.
* doc/HACKING: Describe the ChangeLog policy
* ChangeLog: New file.
* Makefile.am (EXTRA_DIST): Add new files.
(gen-ChangeLog): New.
(dist-hook): Run gen-ChangeLog.

Rename existing ChangeLog files to ChangeLog-old.