From ce29019ec06d076ecc2f8ce7d2949aa9e4838b80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Tue, 8 Mar 2016 00:00:46 +0100 Subject: [PATCH] Add gnupg. --- MAPPING | 2 +- gnupg/dirmngr.conf | 5 +++++ gnupg/gpg-agent.conf | 9 +++++++++ gnupg/gpg.conf | 26 ++++++++++++++++++++++++++ zsh/zprofile | 24 ++++++++++++++++-------- 5 files changed, 57 insertions(+), 9 deletions(-) create mode 100644 gnupg/dirmngr.conf create mode 100644 gnupg/gpg-agent.conf create mode 100644 gnupg/gpg.conf diff --git a/MAPPING b/MAPPING index 8b13789..9a4aa5b 100644 --- a/MAPPING +++ b/MAPPING @@ -1 +1 @@ - +gnupg::.gnupg diff --git a/gnupg/dirmngr.conf b/gnupg/dirmngr.conf new file mode 100644 index 0000000..adbc2a8 --- /dev/null +++ b/gnupg/dirmngr.conf @@ -0,0 +1,5 @@ +keyserver hkps://hkps.pool.sks-keyservers.net +hkp-cacert ~/.gnupg/sks-keyservers.netCA.pem + +disable-ldap +disable-http diff --git a/gnupg/gpg-agent.conf b/gnupg/gpg-agent.conf new file mode 100644 index 0000000..4a6d2a2 --- /dev/null +++ b/gnupg/gpg-agent.conf @@ -0,0 +1,9 @@ +default-cache-ttl 3600 +default-cache-ttl-ssh 3600 + +max-cache-ttl 86400 +max-cache-ttl-ssh 86400 + +enable-ssh-support + +pinentry-program /usr/bin/pinentry-qt diff --git a/gnupg/gpg.conf b/gnupg/gpg.conf new file mode 100644 index 0000000..bbba127 --- /dev/null +++ b/gnupg/gpg.conf @@ -0,0 +1,26 @@ +openpgp + +no-greeting + +no-comments +no-emit-version + +keyid-format 0xlong +with-fingerprint + +no-escape-from-lines + +display-charset utf-8 + +fixed-list-mode + +verify-options show-uid-validity +list-options show-uid-validity + +no-mangle-dos-filenames + +keyserver-options no-honor-keyserver-url no-auto-key-retrieve + +personal-digest-preferences SHA512 SHA384 SHA256 +cert-digest-algo SHA512 +default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed diff --git a/zsh/zprofile b/zsh/zprofile index 3935f59..d50abff 100644 --- a/zsh/zprofile +++ b/zsh/zprofile @@ -1,5 +1,3 @@ -# exec startx breaks some logind fuckery, without exec it works -#tmux start-server & _path=("$HOME/bin" "/usr/local/sbin" "/usr/local/bin" @@ -28,11 +26,21 @@ export WINEPATH="/media/hdd1/games/wine" export LOGDIR="$HOME/.var/log" export RUNDIR="$HOME/.var/run" -if [[ -z "$SSH_CONNECTION" ]] ; then - if ! pgrep ssh-agent --uid $USER >/dev/null 2>&1 ; then - eval $(ssh-agent -s) - fi - - [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx +# Start the gpg-agent if not already running +if ! pgrep -x --uid "${USER}" gpg-agent >/dev/null 2>&1; then + gpg-connect-agent /bye >/dev/null 2>&1 fi +# Set SSH to use gpg-agent +unset SSH_AGENT_PID +if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then + export SSH_AUTH_SOCK="${HOME}/.gnupg/S.gpg-agent.ssh" +fi + +# Set GPG TTY +export GPG_TTY=$(tty) + +gpg-connect-agent updatestartuptty /bye >/dev/null + +# exec startx breaks some logind fuckery, without exec it works +[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx