Author: stsp Date: Mon Jul 25 17:14:15 2011 New Revision: 1150783 URL: http://svn.apache.org/viewvc?rev=1150783&view=rev Log: Reintegrate the gpg-agent-password-store branch. It is now working quite well. Further cleanup can happen on trunk.
The merge was an interesting experience. In addition to the problems fixed by r1150760 and r1150762, I ended up with 3 unrelated content and 8 unrelated svn:mergeinfo changes on the following files: M subversion/include/private/svn_temp_serializer.h M subversion/include/private/svn_string_private.h M subversion/include/private/svn_adler32.h M subversion/libsvn_fs_fs/temp_serializer.c M subversion/libsvn_fs_fs/temp_serializer.h M subversion/libsvn_subr/hash.c M subversion/libsvn_subr/svn_temp_serializer.c M subversion/libsvn_subr/adler32.c D tools/dist/templates/stable-release-ann.ezt D tools/dist/templates/rc-release-ann.ezt M notes/ra-serf-testing.txt All these changes were reverted before commit. I suppose they were due to faulty sync merges from trunk, probably done by myself. But I don't really know what happened here... Added: subversion/trunk/subversion/libsvn_auth_gpg_agent/ - copied from r1150766, subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/ Modified: subversion/trunk/ (props changed) subversion/trunk/Makefile.in subversion/trunk/build.conf subversion/trunk/configure.ac subversion/trunk/subversion/include/private/svn_auth_private.h subversion/trunk/subversion/include/svn_auth.h subversion/trunk/subversion/libsvn_subr/auth.c subversion/trunk/subversion/libsvn_subr/config_file.c subversion/trunk/subversion/libsvn_subr/simple_providers.c Propchange: subversion/trunk/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Jul 25 17:14:15 2011 @@ -11,6 +11,7 @@ /subversion/branches/fs-rep-sharing:869036-873803 /subversion/branches/fsfs-pack:873717-874575 /subversion/branches/gnome-keyring:870558-871410 +/subversion/branches/gpg-agent-password-store:1005036-1150766 /subversion/branches/http-protocol-v2:874395-876041 /subversion/branches/in-memory-cache:869829-871452 /subversion/branches/integrate-cache-item-serialization:1068724-1068739 Modified: subversion/trunk/Makefile.in URL: http://svn.apache.org/viewvc/subversion/trunk/Makefile.in?rev=1150783&r1=1150782&r2=1150783&view=diff ============================================================================== --- subversion/trunk/Makefile.in (original) +++ subversion/trunk/Makefile.in Mon Jul 25 17:14:15 2011 @@ -47,6 +47,7 @@ SVN_APR_LIBS = @SVN_APR_LIBS@ SVN_APRUTIL_LIBS = @SVN_APRUTIL_LIBS@ SVN_APR_MEMCACHE_LIBS = @SVN_APR_MEMCACHE_LIBS@ SVN_DB_LIBS = @SVN_DB_LIBS@ +SVN_GPG_AGENT_LIBS = @SVN_GPG_AGENT_LIBS@ SVN_GNOME_KEYRING_LIBS = @SVN_GNOME_KEYRING_LIBS@ SVN_GSSAPI_LIBS = @SVN_GSSAPI_LIBS@ SVN_KWALLET_LIBS = @SVN_KWALLET_LIBS@ @@ -66,6 +67,7 @@ fsmod_libdir = @libdir@ ramod_libdir = @libdir@ bdb_libdir = @libdir@ gnome_keyring_libdir = @libdir@ +gpg_agent_libdir = @libdir@ gssapi_libdir = @libdir@ kwallet_libdir = @libdir@ neon_libdir = @libdir@ @@ -235,6 +237,7 @@ INSTALL_FSMOD_LIB = $(INSTALL_LIB) INSTALL_RAMOD_LIB = $(INSTALL_LIB) INSTALL_APR_MEMCACHE_LIB = $(INSTALL_LIB) INSTALL_BDB_LIB = $(INSTALL_LIB) +INSTALL_GPG_AGENT_LIB = $(INSTALL_LIB) INSTALL_GNOME_KEYRING_LIB = $(INSTALL_LIB) INSTALL_GSSAPI_LIB = $(INSTALL_LIB) INSTALL_KWALLET_LIB = $(INSTALL_LIB) Modified: subversion/trunk/build.conf URL: http://svn.apache.org/viewvc/subversion/trunk/build.conf?rev=1150783&r1=1150782&r2=1150783&view=diff ============================================================================== --- subversion/trunk/build.conf (original) +++ subversion/trunk/build.conf Mon Jul 25 17:14:15 2011 @@ -174,6 +174,14 @@ libs = libsvn_client libsvn_ra libsvn_re install = bin manpages = subversion/svnrdump/svnrdump.1 +# Support for GPG Agent +[libsvn_auth_gpg_agent]] +description = Subversion GPG Agent library +type = lib +install = gpg-agent-lib +path = subversion/libsvn_auth_gpg_agent +libs = apr libsvn_subr + # Support for GNOME Keyring [libsvn_auth_gnome_keyring] description = Subversion GNOME Keyring Library Modified: subversion/trunk/configure.ac URL: http://svn.apache.org/viewvc/subversion/trunk/configure.ac?rev=1150783&r1=1150782&r2=1150783&view=diff ============================================================================== --- subversion/trunk/configure.ac (original) +++ subversion/trunk/configure.ac Mon Jul 25 17:14:15 2011 @@ -567,6 +567,25 @@ int main() fi fi +dnl GPG Agent ------------------- + +AC_ARG_WITH(gpg_agent, +AS_HELP_STRING([--without-gpg-agent], + [Disable support for GPG-Agent]), + [with_gpg_agent=no], [with_gpg_agent=yes]) +AC_MSG_CHECKING([whether to support GPG-Agent]) +if test "$svn_enable_shared" != "yes"; then + AC_MSG_RESULT([no (shared library support is disabled)]) +elif test "$with_gpg_agent" = "yes"; then + AC_MSG_RESULT([yes]) + AC_DEFINE([SVN_HAVE_GPG_AGENT], [1], + [Is GPG Agent support enabled?]) +else + AC_MSG_RESULT([no]) +fi + +AC_SUBST(SVN_HAVE_GPG_AGENT) + dnl GNOME Keyring ------------------- AC_ARG_WITH(gnome_keyring, @@ -801,6 +820,12 @@ if test "$with_gnome_keyring" = "yes"; t INSTALL_STATIC_RULES="$INSTALL_STATIC_RULES install-gnome-keyring-lib" fi +if test "$with_gpg_agent" = "yes"; then + BUILD_RULES="$BUILD_RULES gpg-agent-lib" + INSTALL_RULES="`echo $INSTALL_RULES | sed 's/install-lib/install-lib install-gpg-agent-lib/'`" + INSTALL_STATIC_RULES="$INSTALL_STATIC_RULES install-gpg-agent-lib" +fi + if test "$USE_NLS" = "yes"; then BUILD_RULES="$BUILD_RULES locale" INSTALL_RULES="$INSTALL_RULES install-locale" Modified: subversion/trunk/subversion/include/private/svn_auth_private.h URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_auth_private.h?rev=1150783&r1=1150782&r2=1150783&view=diff ============================================================================== --- subversion/trunk/subversion/include/private/svn_auth_private.h (original) +++ subversion/trunk/subversion/include/private/svn_auth_private.h Mon Jul 25 17:14:15 2011 @@ -46,6 +46,7 @@ extern "C" { #define SVN_AUTH__KEYCHAIN_PASSWORD_TYPE "keychain" #define SVN_AUTH__KWALLET_PASSWORD_TYPE "kwallet" #define SVN_AUTH__GNOME_KEYRING_PASSWORD_TYPE "gnome-keyring" +#define SVN_AUTH__GPG_AGENT_PASSWORD_TYPE "gpg-agent" /* A function that stores in *PASSWORD (potentially after decrypting it) the user's password. It might be obtained directly from CREDS, or Modified: subversion/trunk/subversion/include/svn_auth.h URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_auth.h?rev=1150783&r1=1150782&r2=1150783&view=diff ============================================================================== --- subversion/trunk/subversion/include/svn_auth.h (original) +++ subversion/trunk/subversion/include/svn_auth.h Mon Jul 25 17:14:15 2011 @@ -1069,6 +1069,35 @@ void svn_auth_get_kwallet_ssl_client_cert_pw_provider( svn_auth_provider_object_t **provider, apr_pool_t *pool); + + +/** + * Get libsvn_auth_gpg_agent version information. + * + */ +const svn_version_t * +svn_auth_gpg_agent_version(void); + + +/** + * Set @a *provider to an authentication provider of type @c + * svn_auth_cred_simple_t that gets/sets information from the user's + * ~/.subversion configuration directory. + * + * This is like svn_client_get_simple_provider(), except that the + * password is obtained from gpg_agent, which will keep it in + * a memory cache. + * + * Allocate @a *provider in @a pool. + * + * @since New in 1.7 + * @note This function actually works only on systems with + * libsvn_auth_gpg_agent and GNU Privacy Guard installed. + */ +void +svn_auth_get_gpg_agent_simple_provider + (svn_auth_provider_object_t **provider, + apr_pool_t *pool); #endif /* (!DARWIN && !WIN32) || DOXYGEN */ Modified: subversion/trunk/subversion/libsvn_subr/auth.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/auth.c?rev=1150783&r1=1150782&r2=1150783&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_subr/auth.c (original) +++ subversion/trunk/subversion/libsvn_subr/auth.c Mon Jul 25 17:14:15 2011 @@ -391,9 +391,11 @@ svn_auth_get_platform_specific_provider *provider = NULL; if (apr_strnatcmp(provider_name, "gnome_keyring") == 0 || - apr_strnatcmp(provider_name, "kwallet") == 0) + apr_strnatcmp(provider_name, "kwallet") == 0 || + apr_strnatcmp(provider_name, "gpg_agent") == 0) { -#if defined(SVN_HAVE_GNOME_KEYRING) || defined(SVN_HAVE_KWALLET) +#if defined(SVN_HAVE_GNOME_KEYRING) || defined(SVN_HAVE_KWALLET) || \ +defined(SVN_HAVE_GPG_AGENT) apr_dso_handle_t *dso; apr_dso_handle_sym_t provider_function_symbol, version_function_symbol; const char *library_label, *library_name; @@ -495,15 +497,17 @@ svn_auth_get_platform_specific_client_pr if (config) { - svn_config_get(config, - &password_stores_config_option, - SVN_CONFIG_SECTION_AUTH, - SVN_CONFIG_OPTION_PASSWORD_STORES, - "gnome-keyring,kwallet,keychain,windows-cryptoapi"); + svn_config_get + (config, + &password_stores_config_option, + SVN_CONFIG_SECTION_AUTH, + SVN_CONFIG_OPTION_PASSWORD_STORES, + "gpg-agent,gnome-keyring,kwallet,keychain,windows-cryptoapi"); } else { - password_stores_config_option = "gnome-keyring,kwallet,keychain,windows-cryptoapi"; + password_stores_config_option = + "gpg-agent,gnome-keyring,kwallet,keychain,windows-cryptoapi"; } *providers = apr_array_make(pool, 12, sizeof(svn_auth_provider_object_t *)); @@ -539,6 +543,20 @@ svn_auth_get_platform_specific_client_pr continue; } + /* GPG-AGENT */ + if (apr_strnatcmp(password_store, "gpg-agent") == 0) + { + SVN_ERR(svn_auth_get_platform_specific_provider(&provider, + "gpg_agent", + "simple", + pool)); + + if (provider) + APR_ARRAY_PUSH(*providers, svn_auth_provider_object_t *) = provider; + + continue; + } + /* KWallet */ if (apr_strnatcmp(password_store, "kwallet") == 0) { Modified: subversion/trunk/subversion/libsvn_subr/config_file.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/config_file.c?rev=1150783&r1=1150782&r2=1150783&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_subr/config_file.c (original) +++ subversion/trunk/subversion/libsvn_subr/config_file.c Mon Jul 25 17:14:15 2011 @@ -956,12 +956,13 @@ svn_config_ensure(const char *config_dir "### kwallet (Unix-like systems)" NL "### keychain (Mac OS X)" NL "### windows-cryptoapi (Windows)" NL + "### gpg-agent (All platforms)" NL #ifdef SVN_HAVE_KEYCHAIN_SERVICES - "# password-stores = keychain" NL + "# password-stores = keychain,gpg-agent" NL #elif defined(WIN32) && !defined(__MINGW32__) "# password-stores = windows-cryptoapi" NL #else - "# password-stores = gnome-keyring,kwallet" NL + "# password-stores = gpg-agent,gnome-keyring,kwallet" NL #endif "### To disable all password stores, use an empty list:" NL "# password-stores =" NL Modified: subversion/trunk/subversion/libsvn_subr/simple_providers.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/simple_providers.c?rev=1150783&r1=1150782&r2=1150783&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_subr/simple_providers.c (original) +++ subversion/trunk/subversion/libsvn_subr/simple_providers.c Mon Jul 25 17:14:15 2011 @@ -358,7 +358,8 @@ svn_auth__simple_save_creds_helper(svn_b (strcmp(passtype, SVN_AUTH__WINCRYPT_PASSWORD_TYPE) == 0 || strcmp(passtype, SVN_AUTH__KEYCHAIN_PASSWORD_TYPE) == 0 || strcmp(passtype, SVN_AUTH__KWALLET_PASSWORD_TYPE) == 0 - || strcmp(passtype, SVN_AUTH__GNOME_KEYRING_PASSWORD_TYPE) == 0) ) + || strcmp(passtype, SVN_AUTH__GNOME_KEYRING_PASSWORD_TYPE) == 0 + || strcmp(passtype, SVN_AUTH__GPG_AGENT_PASSWORD_TYPE) == 0)) { may_save_password = TRUE; }