You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2013/11/21 01:11:35 UTC
svn commit: r1543992 - in /subversion/trunk/subversion: include/svn_auth.h
libsvn_subr/auth.c libsvn_subr/auth.h libsvn_subr/deprecated.c
libsvn_subr/gpg_agent.c libsvn_subr/macos_keychain.c
libsvn_subr/win32_crypto.c
Author: breser
Date: Thu Nov 21 00:11:35 2013
New Revision: 1543992
URL: http://svn.apache.org/r1543992
Log:
Mark platform specific svn_auth_get_* functions as deprecated to discourage
api consumers from using them and point them towards
svn_auth_get_platform_specific_provider().
* subversion/include/svn_auth.h
(svn_auth_get_windows_simple_provider,
svn_auth_get_windows_ssl_client_cert_pw_provider,
svn_auth_get_windows_ssl_server_trust_provider,
svn_auth_get_keychain_simple_provider,
svn_auth_get_keychain_ssl_client_cert_pw_provider,
svn_auth_get_gnome_keyring_simple_provider,
svn_auth_get_gnome_keyring_ssl_client_cert_pw_provider,
svn_auth_get_kwallet_simple_provider,
svn_auth_get_kwallet_ssl_client_cert_pw_provider,
svn_auth_get_gpg_agent_simple_provider): Deprecate
* subversion/libsvn_subr/auth.h
(svn_auth__get_windows_simple_provider,
svn_auth__get_windows_ssl_client_cert_pw_provider,
svn_auth__get_windows_ssl_server_trust_provider,
svn_auth__get_keychain_simple_provider,
svn_auth__get_keychain_ssl_client_cert_pw_provider,
svn_auth__get_gnome_keyring_simple_provider,
svn_auth__get_gnome_keyring_ssl_client_cert_pw_provider,
svn_auth__get_kwallet_simple_provider,
svn_auth__get_kwallet_ssl_client_cert_pw_provider,
svn_auth__get_gpg_agent_simple_provider): Add private delcartions.
* subversion/libsvn_subr/gpg_agent.c,
subversion/libsvn_subr/macos_keychain.c,
subversion/libsvn_subr/win32_crypto.c:
(svn_auth__get_*): Convert public versions to private versions.
* subversion/libsvn_subr/deprecated.c
(svn_auth_get_*): Implement public versions as wrappers of the new private
versions.
* subversion/libsvn_subr/auth.c
(svn_auth_get_platform_specific_provider): Use private versions
of the platform specific svn_auth_get_* functions in order
to avoid warnings about using deprecated functions.
Modified:
subversion/trunk/subversion/include/svn_auth.h
subversion/trunk/subversion/libsvn_subr/auth.c
subversion/trunk/subversion/libsvn_subr/auth.h
subversion/trunk/subversion/libsvn_subr/deprecated.c
subversion/trunk/subversion/libsvn_subr/gpg_agent.c
subversion/trunk/subversion/libsvn_subr/macos_keychain.c
subversion/trunk/subversion/libsvn_subr/win32_crypto.c
Modified: subversion/trunk/subversion/include/svn_auth.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_auth.h?rev=1543992&r1=1543991&r2=1543992&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_auth.h (original)
+++ subversion/trunk/subversion/include/svn_auth.h Thu Nov 21 00:11:35 2013
@@ -884,7 +884,10 @@ svn_auth_get_platform_specific_client_pr
* @note An administrative password reset may invalidate the account's
* secret key. This function will detect that situation and behave as
* if the password were not cached at all.
+ * @deprecated Use svn_auth_get_platform_specific_provider with provider_name
+ * of "windows" and provider_type of "simple".
*/
+SVN_DEPRECATED
void
svn_auth_get_windows_simple_provider(svn_auth_provider_object_t **provider,
apr_pool_t *pool);
@@ -906,7 +909,10 @@ svn_auth_get_windows_simple_provider(svn
* @note An administrative password reset may invalidate the account's
* secret key. This function will detect that situation and behave as
* if the password were not cached at all.
+ * @deprecated Use svn_auth_get_platform_specific_provider with provider_name
+ * of "windows" and provider_type of "ssl_client_cert_pw".
*/
+SVN_DEPRECATED
void
svn_auth_get_windows_ssl_client_cert_pw_provider(
svn_auth_provider_object_t **provider,
@@ -923,7 +929,10 @@ svn_auth_get_windows_ssl_client_cert_pw_
*
* @since New in 1.5.
* @note This function is only available on Windows.
+ * @deprecated Use svn_auth_get_platform_specific_provider with provider_name
+ * of "windows" and provider_type of "ssl_server_trust".
*/
+SVN_DEPRECATED
void
svn_auth_get_windows_ssl_server_trust_provider(
svn_auth_provider_object_t **provider,
@@ -943,7 +952,10 @@ svn_auth_get_windows_ssl_server_trust_pr
*
* @since New in 1.4
* @note This function is only available on Mac OS 10.2 and higher.
+ * @deprecated Use svn_auth_get_platform_specific_provider with provider_name
+ * of "keychain" and provider_type of "simple".
*/
+SVN_DEPRECATED
void
svn_auth_get_keychain_simple_provider(svn_auth_provider_object_t **provider,
apr_pool_t *pool);
@@ -959,7 +971,10 @@ svn_auth_get_keychain_simple_provider(sv
*
* @since New in 1.6
* @note This function is only available on Mac OS 10.2 and higher.
+ * @deprecated Use svn_auth_get_platform_specific_provider with provider_name
+ * of "keychain" and provider_type of "ssl_client_cert_pw".
*/
+SVN_DEPRECATED
void
svn_auth_get_keychain_ssl_client_cert_pw_provider(
svn_auth_provider_object_t **provider,
@@ -1029,7 +1044,10 @@ svn_auth_gnome_keyring_version(void);
* @since New in 1.6
* @note This function actually works only on systems with
* libsvn_auth_gnome_keyring and GNOME Keyring installed.
+ * @deprecated Use svn_auth_get_platform_specific_provider with provider_name
+ * of "gnome_keyring" and provider_type of "simple".
*/
+SVN_DEPRECATED
void
svn_auth_get_gnome_keyring_simple_provider(
svn_auth_provider_object_t **provider,
@@ -1056,7 +1074,10 @@ svn_auth_get_gnome_keyring_simple_provid
* @since New in 1.6
* @note This function actually works only on systems with
* libsvn_auth_gnome_keyring and GNOME Keyring installed.
+ * @deprecated Use svn_auth_get_platform_specific_provider with provider_name
+ * of "gnome_keyring" and provider_type of "ssl_client_cert_pw".
*/
+SVN_DEPRECATED
void
svn_auth_get_gnome_keyring_ssl_client_cert_pw_provider(
svn_auth_provider_object_t **provider,
@@ -1084,7 +1105,10 @@ svn_auth_kwallet_version(void);
* @since New in 1.6
* @note This function actually works only on systems with libsvn_auth_kwallet
* and KWallet installed.
+ * @deprecated Use svn_auth_get_platform_specific_provider with provider_name
+ * of "kwallet" and provider_type of "simple".
*/
+SVN_DEPRECATED
void
svn_auth_get_kwallet_simple_provider(svn_auth_provider_object_t **provider,
apr_pool_t *pool);
@@ -1102,7 +1126,10 @@ svn_auth_get_kwallet_simple_provider(svn
* @since New in 1.6
* @note This function actually works only on systems with libsvn_auth_kwallet
* and KWallet installed.
+ * @deprecated Use svn_auth_get_platform_specific_provider with provider_name
+ * of "kwallet" and provider_type of "ssl_client_cert_pw".
*/
+SVN_DEPRECATED
void
svn_auth_get_kwallet_ssl_client_cert_pw_provider(
svn_auth_provider_object_t **provider,
@@ -1124,7 +1151,10 @@ svn_auth_get_kwallet_ssl_client_cert_pw_
* @since New in 1.8
* @note This function actually works only on systems with
* GNU Privacy Guard installed.
+ * @deprecated Use svn_auth_get_platform_specific_provider with provider_name
+ * of "gpg_agent" and provider_type of "simple".
*/
+SVN_DEPRECATED
void
svn_auth_get_gpg_agent_simple_provider
(svn_auth_provider_object_t **provider,
Modified: subversion/trunk/subversion/libsvn_subr/auth.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/auth.c?rev=1543992&r1=1543991&r2=1543992&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/auth.c (original)
+++ subversion/trunk/subversion/libsvn_subr/auth.c Thu Nov 21 00:11:35 2013
@@ -511,19 +511,19 @@ svn_auth_get_platform_specific_provider(
if (strcmp(provider_name, "gpg_agent") == 0 &&
strcmp(provider_type, "simple") == 0)
{
- svn_auth_get_gpg_agent_simple_provider(provider, pool);
+ svn_auth__get_gpg_agent_simple_provider(provider, pool);
}
#endif
#ifdef SVN_HAVE_KEYCHAIN_SERVICES
if (strcmp(provider_name, "keychain") == 0 &&
strcmp(provider_type, "simple") == 0)
{
- svn_auth_get_keychain_simple_provider(provider, pool);
+ svn_auth__get_keychain_simple_provider(provider, pool);
}
else if (strcmp(provider_name, "keychain") == 0 &&
strcmp(provider_type, "ssl_client_cert_pw") == 0)
{
- svn_auth_get_keychain_ssl_client_cert_pw_provider(provider, pool);
+ svn_auth__get_keychain_ssl_client_cert_pw_provider(provider, pool);
}
#endif
@@ -531,17 +531,17 @@ svn_auth_get_platform_specific_provider(
if (strcmp(provider_name, "windows") == 0 &&
strcmp(provider_type, "simple") == 0)
{
- svn_auth_get_windows_simple_provider(provider, pool);
+ svn_auth__get_windows_simple_provider(provider, pool);
}
else if (strcmp(provider_name, "windows") == 0 &&
strcmp(provider_type, "ssl_client_cert_pw") == 0)
{
- svn_auth_get_windows_ssl_client_cert_pw_provider(provider, pool);
+ svn_auth__get_windows_ssl_client_cert_pw_provider(provider, pool);
}
else if (strcmp(provider_name, "windows") == 0 &&
strcmp(provider_type, "ssl_server_trust") == 0)
{
- svn_auth_get_windows_ssl_server_trust_provider(provider, pool);
+ svn_auth__get_windows_ssl_server_trust_provider(provider, pool);
}
else if (strcmp(provider_name, "windows") == 0 &&
strcmp(provider_type, "ssl_server_authority") == 0)
Modified: subversion/trunk/subversion/libsvn_subr/auth.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/auth.h?rev=1543992&r1=1543991&r2=1543992&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/auth.h (original)
+++ subversion/trunk/subversion/libsvn_subr/auth.h Thu Nov 21 00:11:35 2013
@@ -41,6 +41,121 @@ svn_auth__file_path(const char **path,
const char *config_dir,
apr_pool_t *pool);
+#if (defined(WIN32) && !defined(__MINGW32__)) || defined(DOXYGEN)
+/**
+ * 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. Allocate @a *provider in
+ * @a pool.
+ *
+ * This is like svn_auth_get_simple_provider(), except that, when
+ * running on Window 2000 or newer (or any other Windows version that
+ * includes the CryptoAPI), the provider encrypts the password before
+ * storing it to disk. On earlier versions of Windows, the provider
+ * does nothing.
+ *
+ * @note This function is only available on Windows.
+ *
+ * @note An administrative password reset may invalidate the account's
+ * secret key. This function will detect that situation and behave as
+ * if the password were not cached at all.
+ */
+void
+svn_auth__get_windows_simple_provider(svn_auth_provider_object_t **provider,
+ apr_pool_t *pool);
+
+/**
+ * Set @a *provider to an authentication provider of type @c
+ * svn_auth_cred_ssl_client_cert_pw_t that gets/sets information from the
+ * user's ~/.subversion configuration directory. Allocate @a *provider in
+ * @a pool.
+ *
+ * This is like svn_auth_get_ssl_client_cert_pw_file_provider(), except that
+ * when running on Window 2000 or newer, the provider encrypts the password
+ * before storing it to disk. On earlier versions of Windows, the provider
+ * does nothing.
+ *
+ * @note This function is only available on Windows.
+ *
+ * @note An administrative password reset may invalidate the account's
+ * secret key. This function will detect that situation and behave as
+ * if the password were not cached at all.
+ */
+void
+svn_auth__get_windows_ssl_client_cert_pw_provider(
+ svn_auth_provider_object_t **provider,
+ apr_pool_t *pool);
+
+/**
+ * Set @a *provider to an authentication provider of type @c
+ * svn_auth_cred_ssl_server_trust_t, allocated in @a pool.
+ *
+ * This provider automatically validates ssl server certificates with
+ * the CryptoApi, like Internet Explorer and the Windows network API do.
+ * This allows the rollout of root certificates via Windows Domain
+ * policies, instead of Subversion specific configuration.
+ *
+ * @note This function is only available on Windows.
+ */
+void
+svn_auth__get_windows_ssl_server_trust_provider(
+ svn_auth_provider_object_t **provider,
+ apr_pool_t *pool);
+#endif /* WIN32 && !__MINGW32__ || DOXYGEN */
+
+#if defined(DARWIN) || defined(DOXYGEN)
+/**
+ * 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. Allocate @a *provider in
+ * @a pool.
+ *
+ * This is like svn_auth_get_simple_provider(), except that the
+ * password is stored in the Mac OS KeyChain.
+ *
+ * @note This function is only available on Mac OS 10.2 and higher.
+ */
+void
+svn_auth__get_keychain_simple_provider(svn_auth_provider_object_t **provider,
+ apr_pool_t *pool);
+
+/**
+ * Set @a *provider to an authentication provider of type @c
+ * svn_auth_cred_ssl_client_cert_pw_t that gets/sets information from the
+ * user's ~/.subversion configuration directory. Allocate @a *provider in
+ * @a pool.
+ *
+ * This is like svn_auth_get_ssl_client_cert_pw_file_provider(), except
+ * that the password is stored in the Mac OS KeyChain.
+ *
+ * @note This function is only available on Mac OS 10.2 and higher.
+ */
+void
+svn_auth__get_keychain_ssl_client_cert_pw_provider(
+ svn_auth_provider_object_t **provider,
+ apr_pool_t *pool);
+#endif /* DARWIN || DOXYGEN */
+
+#if !defined(WIN32) || defined(DOXYGEN)
+/**
+ * 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.
+ *
+ * @note This function actually works only on systems with
+ * GNU Privacy Guard installed.
+ */
+void
+svn_auth__get_gpg_agent_simple_provider
+ (svn_auth_provider_object_t **provider,
+ apr_pool_t *pool);
+#endif /* !defined(WIN32) || defined(DOXYGEN) */
#ifdef __cplusplus
}
Modified: subversion/trunk/subversion/libsvn_subr/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/deprecated.c?rev=1543992&r1=1543991&r2=1543992&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_subr/deprecated.c Thu Nov 21 00:11:35 2013
@@ -44,8 +44,10 @@
#include "svn_mergeinfo.h"
#include "svn_utf.h"
#include "svn_xml.h"
+#include "svn_auth.h"
#include "opt.h"
+#include "auth.h"
#include "private/svn_opt_private.h"
#include "private/svn_mergeinfo_private.h"
@@ -1321,3 +1323,54 @@ svn_ver_check_list(const svn_version_t *
return svn_ver_check_list2(my_version, checklist, svn_ver_compatible);
}
+/*** From win32_crypto.c ***/
+#if defined(WIN32) && !defined(__MINGW32__)
+void
+svn_auth_get_windows_simple_provider(svn_auth_provider_object_t **provider,
+ apr_pool_t *pool)
+{
+ svn_auth__get_windows_simple_provider(provider, pool);
+}
+
+void
+svn_auth_get_windows_ssl_client_cert_pw_provider
+ (svn_auth_provider_object_t **provider,
+ apr_pool_t *pool)
+{
+ svn_auth__get_windows_ssl_client_cert_pw_provider(provider, pool);
+}
+
+void
+svn_auth_get_windows_ssl_server_trust_provider
+ (svn_auth_provider_object_t **provider, apr_pool_t *pool)
+{
+ svn_auth__get_windows_ssl_server_trust_provider(provider, pool);
+}
+#endif /* WIN32 && !__MINGW32__ */
+
+/*** From macos_keychain.c ***/
+#if defined(DARWIN)
+void
+svn_auth_get_keychain_simple_provider(svn_auth_provider_object_t **provider,
+ apr_pool_t *pool)
+{
+ svn_auth__get_keychain_simple_provider(provider, pool);
+}
+
+void
+svn_auth_get_keychain_ssl_client_cert_pw_provider
+ (svn_auth_provider_object_t **provider,
+ apr_pool_t *pool)
+{
+ svn_auth__get_keychain_ssl_client_cert_pw_provider(provider, pool);
+}
+#endif /* DARWIN */
+
+#if !defined(WIN32)
+void
+svn_auth_get_gpg_agent_simple_provider(svn_auth_provider_object_t **provider,
+ apr_pool_t *pool)
+{
+ svn_auth__get_gpg_agent_simple_provider(provider, pool);
+}
+#endif /* !WIN32 */
Modified: subversion/trunk/subversion/libsvn_subr/gpg_agent.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/gpg_agent.c?rev=1543992&r1=1543991&r2=1543992&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/gpg_agent.c (original)
+++ subversion/trunk/subversion/libsvn_subr/gpg_agent.c Thu Nov 21 00:11:35 2013
@@ -73,6 +73,7 @@
#include "svn_checksum.h"
#include "svn_string.h"
+#include "auth.h"
#include "private/svn_auth_private.h"
#include "svn_private_config.h"
@@ -475,7 +476,7 @@ static const svn_auth_provider_t gpg_age
/* Public API */
void
-svn_auth_get_gpg_agent_simple_provider(svn_auth_provider_object_t **provider,
+svn_auth__get_gpg_agent_simple_provider(svn_auth_provider_object_t **provider,
apr_pool_t *pool)
{
svn_auth_provider_object_t *po = apr_pcalloc(pool, sizeof(*po));
Modified: subversion/trunk/subversion/libsvn_subr/macos_keychain.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/macos_keychain.c?rev=1543992&r1=1543991&r2=1543992&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/macos_keychain.c (original)
+++ subversion/trunk/subversion/libsvn_subr/macos_keychain.c Thu Nov 21 00:11:35 2013
@@ -32,6 +32,7 @@
#include "svn_config.h"
#include "svn_user.h"
+#include "auth.h"
#include "private/svn_auth_private.h"
#include "svn_private_config.h"
@@ -241,7 +242,7 @@ static const svn_auth_provider_t keychai
/* Public API */
void
-svn_auth_get_keychain_simple_provider(svn_auth_provider_object_t **provider,
+svn_auth__get_keychain_simple_provider(svn_auth_provider_object_t **provider,
apr_pool_t *pool)
{
svn_auth_provider_object_t *po = apr_pcalloc(pool, sizeof(*po));
@@ -251,7 +252,7 @@ svn_auth_get_keychain_simple_provider(sv
}
void
-svn_auth_get_keychain_ssl_client_cert_pw_provider
+svn_auth__get_keychain_ssl_client_cert_pw_provider
(svn_auth_provider_object_t **provider,
apr_pool_t *pool)
{
Modified: subversion/trunk/subversion/libsvn_subr/win32_crypto.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/win32_crypto.c?rev=1543992&r1=1543991&r2=1543992&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/win32_crypto.c (original)
+++ subversion/trunk/subversion/libsvn_subr/win32_crypto.c Thu Nov 21 00:11:35 2013
@@ -42,6 +42,7 @@ typedef int win32_crypto__dummy;
#include "svn_user.h"
#include "svn_base64.h"
+#include "auth.h"
#include "private/svn_auth_private.h"
#include <wincrypt.h>
@@ -213,7 +214,7 @@ static const svn_auth_provider_t windows
/* Public API */
void
-svn_auth_get_windows_simple_provider(svn_auth_provider_object_t **provider,
+svn_auth__get_windows_simple_provider(svn_auth_provider_object_t **provider,
apr_pool_t *pool)
{
svn_auth_provider_object_t *po = apr_pcalloc(pool, sizeof(*po));
@@ -331,7 +332,7 @@ static const svn_auth_provider_t windows
/* Public API */
void
-svn_auth_get_windows_ssl_client_cert_pw_provider
+svn_auth__get_windows_ssl_client_cert_pw_provider
(svn_auth_provider_object_t **provider,
apr_pool_t *pool)
{
@@ -482,7 +483,7 @@ static const svn_auth_provider_t windows
/* Public API */
void
-svn_auth_get_windows_ssl_server_trust_provider
+svn_auth__get_windows_ssl_server_trust_provider
(svn_auth_provider_object_t **provider, apr_pool_t *pool)
{
svn_auth_provider_object_t *po = apr_pcalloc(pool, sizeof(*po));