From: sev Date: Wed, 14 Oct 2020 04:26:29 +0000 (-0500) Subject: more gpg stuff X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/commitdiff_plain/03b903de311946827e690f4db8b082c0ab32dc47?ds=sidebyside more gpg stuff revert pointless gpg-agent.conf comments update pinentry config to point to user-local bin add pinentry script to auto-pick pinentry like Debian, but portable add sshcontrol --- diff --git a/bin/pinentry b/bin/pinentry new file mode 100755 index 0000000..7b83ff5 --- /dev/null +++ b/bin/pinentry @@ -0,0 +1,19 @@ +#!/bin/sh +# https://kevinlocke.name/bits/2019/07/31/prefer-terminal-for-gpg-pinentry + +set -Ce +graphics="gtk-2 gtk qt x11 gnome" +tty="curses tty" +case "${PINENTRY_USER_DATA-}" in + *USE_TTY=1*) list="$tty $graphics";; + *) list="$graphics $tty";; +esac + +for x in $list; do + p=which "pinentry-$x" 2>/dev/null + if [ $? = 0 ]; then + exec "$p" "$@" + fi +done + +echo "No pinentry program found" >&2 diff --git a/gpg/gpg-agent.conf b/gpg/gpg-agent.conf index 513e54c..8075100 100644 --- a/gpg/gpg-agent.conf +++ b/gpg/gpg-agent.conf @@ -1,4 +1,2 @@ -# support ssh with gpg-agent enable-ssh-support -# try to use X11 pinentry if possible -pinentry-program /usr/bin/pinentry-x11 +pinentry-program ~/bin/pinentry diff --git a/gpg/sshcontrol b/gpg/sshcontrol new file mode 100644 index 0000000..0da20a5 --- /dev/null +++ b/gpg/sshcontrol @@ -0,0 +1 @@ +0C19EB483691C8F2F85E0F00A2DA56C990E448DE