Skip to content

Commit

Permalink
daemon: Remove the GnuPG agent
Browse files Browse the repository at this point in the history
The GnuPG agent is incomplete and incompatible with many uses of
GnuPG 2.x.

There is a new pinentry that replaces this. It prompts via system
modal dialogs, and allows optional caching of passphrases.

https://bugzilla.gnome.org/show_bug.cgi?id=750514
  • Loading branch information
stefwalter committed Jun 7, 2015
1 parent ab2182a commit a8862f7
Show file tree
Hide file tree
Showing 22 changed files with 10 additions and 1,586 deletions.
3 changes: 0 additions & 3 deletions HACKING
Expand Up @@ -40,9 +40,6 @@ daemon/control
daemon/dbus
Various DBus bits of the daemon including the Secret Service API.

daemon/gpg-agent
A GPG agent implementation that uses a PKCS#11 module for it's password storage.

daemon/login
Used to lock and unlock the daemon.

Expand Down
2 changes: 0 additions & 2 deletions Makefile.am
Expand Up @@ -10,7 +10,6 @@ DISTCHECK_CONFIGURE_FLAGS = \
--enable-doc \
--enable-pam \
--enable-ssh-agent \
--enable-gpg-agent \
--disable-strict \
--disable-coverage \
--disable-silent-rules \
Expand Down Expand Up @@ -198,7 +197,6 @@ include egg/Makefile.am
include daemon/Makefile.am
include daemon/control/Makefile.am
include daemon/dbus/Makefile.am
include daemon/gpg-agent/Makefile.am
include daemon/login/Makefile.am
include daemon/ssh-agent/Makefile.am
include pkcs11/Makefile.am
Expand Down
18 changes: 0 additions & 18 deletions configure.ac
Expand Up @@ -349,23 +349,6 @@ fi

AM_CONDITIONAL(WITH_SSH, test "$enable_ssh_agent" != "no")

# --------------------------------------------------------------------
# GPG Agent support
#

AC_ARG_ENABLE([gpg-agent],
AC_HELP_STRING([--disable-gpg-agent],
[Don't include GPG agent in gnome-keyring]))

if test "$enable_gpg_agent" != "no"; then
AC_DEFINE(WITH_GPG, 1, [Whether to build GPG agent or not])
gpg_status="yes"
else
gpg_status="no"
fi

AM_CONDITIONAL(WITH_GPG, test "$enable_gpg_agent" != "no")

# --------------------------------------------------------------------
# libgcrypt
#
Expand Down Expand Up @@ -664,7 +647,6 @@ echo " SELinux: $selinux_status"
echo
echo "CONFIGURATION"
echo " SSH Agent: $ssh_status"
echo " GPG Agent: $gpg_status"
echo
echo "BUILD"
echo " Debug Build: $debug_status"
Expand Down
2 changes: 0 additions & 2 deletions daemon/.gitignore
@@ -1,8 +1,6 @@
/gnome-keyring-daemon
/org.gnome.keyring.service
/org.freedesktop.secrets.service
/gnome-keyring-gpg.desktop
/gnome-keyring-gpg.desktop.in
/gnome-keyring-pkcs11.desktop
/gnome-keyring-pkcs11.desktop.in
/gnome-keyring-secrets.desktop
Expand Down
3 changes: 1 addition & 2 deletions daemon/Makefile.am
Expand Up @@ -19,7 +19,6 @@ gnome_keyring_daemon_LDADD = \
libgkd-login.la \
libgkd-control.la \
libgkd-ssh-agent.la \
libgkd-gpg-agent.la \
libgkm-wrap-layer.la \
libgkm-rpc-layer.la \
libgkm-secret-store.la \
Expand All @@ -41,7 +40,7 @@ desktop_in_in_files = \
daemon/gnome-keyring-pkcs11.desktop.in.in \
daemon/gnome-keyring-secrets.desktop.in.in \
daemon/gnome-keyring-ssh.desktop.in.in \
daemon/gnome-keyring-gpg.desktop.in.in
$(NULL)
desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in)
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)

Expand Down
41 changes: 0 additions & 41 deletions daemon/gkd-glue.c
Expand Up @@ -23,7 +23,6 @@
#include "gkd-glue.h"
#include "gkd-util.h"

#include "gpg-agent/gkd-gpg-agent.h"
#include "ssh-agent/gkd-ssh-agent.h"

#include "egg/egg-cleanup.h"
Expand Down Expand Up @@ -67,43 +66,3 @@ gkd_daemon_startup_ssh (void)

return TRUE;
}

static void
pkcs11_gpg_cleanup (gpointer unused)
{
gkd_gpg_agent_shutdown ();
}

static gboolean
accept_gpg_client (GIOChannel *channel, GIOCondition cond, gpointer unused)
{
if (cond == G_IO_IN)
gkd_gpg_agent_accept ();
return TRUE;
}

gboolean
gkd_daemon_startup_gpg (void)
{
GIOChannel *channel;
const gchar *base_dir;
int sock;

base_dir = gkd_util_get_master_directory ();
g_return_val_if_fail (base_dir, FALSE);

sock = gkd_gpg_agent_startup (base_dir);
if (sock == -1)
return FALSE;

channel = g_io_channel_unix_new (sock);
g_io_add_watch (channel, G_IO_IN | G_IO_HUP, accept_gpg_client, NULL);
g_io_channel_unref (channel);

/* gpg-agent sets the environment variable */
gkd_util_push_environment ("GPG_AGENT_INFO", g_getenv ("GPG_AGENT_INFO"));

egg_cleanup_register (pkcs11_gpg_cleanup, NULL);

return TRUE;
}
2 changes: 0 additions & 2 deletions daemon/gkd-glue.h
Expand Up @@ -26,6 +26,4 @@

gboolean gkd_daemon_startup_ssh (void);

gboolean gkd_daemon_startup_gpg (void);

#endif /* GKD_GLUE_H_ */
18 changes: 1 addition & 17 deletions daemon/gkd-main.c
Expand Up @@ -78,7 +78,6 @@ typedef int socklen_t;
#define GKD_COMP_PKCS11 "pkcs11"
#define GKD_COMP_SECRETS "secrets"
#define GKD_COMP_SSH "ssh"
#define GKD_COMP_GPG "gpg"

EGG_SECURE_DECLARE (daemon_main);

Expand Down Expand Up @@ -112,7 +111,6 @@ static gchar* run_components = DEFAULT_COMPONENTS;
static gboolean pkcs11_started = FALSE;
static gboolean secrets_started = FALSE;
static gboolean ssh_started = FALSE;
static gboolean gpg_started = FALSE;
static gboolean dbus_started = FALSE;

static gboolean run_foreground = FALSE;
Expand Down Expand Up @@ -533,7 +531,7 @@ replace_daemon_at (const gchar *directory)

/*
* The first control_directory is the environment one, always
* prefer that since it's the one that ssh and gpg will connect to
* prefer that since it's the one that ssh will connect to
*/
if (control_directory == NULL)
control_directory = g_strdup (directory);
Expand Down Expand Up @@ -709,20 +707,6 @@ gkr_daemon_startup_steps (const gchar *components)
}
#endif

#ifdef WITH_GPG
if (strstr (components, GKD_COMP_GPG)) {
if (gpg_started) {
g_message ("The GPG agent was already initialized");
} else {
gpg_started = TRUE;
if (!gkd_daemon_startup_gpg ()) {
gpg_started = FALSE;
return FALSE;
}
}
}
#endif

return TRUE;
}

Expand Down
5 changes: 1 addition & 4 deletions daemon/gkd-pkcs11.c
Expand Up @@ -32,7 +32,6 @@
#include "pkcs11/gnome2-store/gkm-gnome2-store.h"
#include "pkcs11/xdg-store/gkm-xdg-store.h"

#include "gpg-agent/gkd-gpg-agent.h"
#include "ssh-agent/gkd-ssh-agent.h"

#include <string.h>
Expand All @@ -52,7 +51,6 @@ pkcs11_daemon_cleanup (gpointer unused)

gkd_ssh_agent_uninitialize ();
gkm_rpc_layer_uninitialize ();
gkd_gpg_agent_uninitialize ();
rv = (pkcs11_roof->C_Finalize) (NULL);

if (rv != CKR_OK)
Expand Down Expand Up @@ -115,8 +113,7 @@ gkd_pkcs11_initialize (void)

egg_cleanup_register (pkcs11_daemon_cleanup, NULL);

ret = gkd_gpg_agent_initialize (pkcs11_roof) &&
gkd_ssh_agent_initialize (pkcs11_roof) &&
ret = gkd_ssh_agent_initialize (pkcs11_roof) &&
gkm_rpc_layer_initialize (pkcs11_roof);

return ret;
Expand Down
13 changes: 0 additions & 13 deletions daemon/gnome-keyring-gpg.desktop.in.in

This file was deleted.

1 change: 0 additions & 1 deletion daemon/gpg-agent/.gitignore

This file was deleted.

15 changes: 0 additions & 15 deletions daemon/gpg-agent/Makefile.am

This file was deleted.

0 comments on commit a8862f7

Please sign in to comment.