Files
MSYS2-packages/subversion/09-wincrypt.patch
2014-11-05 23:30:55 +03:00

139 lines
5.1 KiB
Diff
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Support wincrypt for password encryption on Cygwin.
From: David Rothenberger <daveroth@acm.org>
---
build.conf | 6 +++++-
subversion/include/svn_auth.h | 2 +-
subversion/libsvn_subr/auth.c | 2 +-
subversion/libsvn_subr/config_file.c | 2 +-
subversion/libsvn_subr/win32_crypto.c | 5 ++++-
subversion/tests/libsvn_subr/auth-test.c | 6 ++++--
6 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/build.conf b/build.conf
index 8cf7184..e6e1c5e 100644
--- a/build.conf
+++ b/build.conf
@@ -323,7 +323,7 @@ description = Subversion General Utility Library
type = lib
install = fsmod-lib
path = subversion/libsvn_subr
-libs = aprutil apriconv apr xml zlib apr_memcache sqlite magic
+libs = aprutil apriconv apr xml zlib apr_memcache sqlite magic wincrypt
msvc-libs = kernel32.lib advapi32.lib shfolder.lib ole32.lib
crypt32.lib version.lib
msvc-export =
@@ -1218,6 +1218,10 @@ type = lib
external-lib = -lhttpd2core
libs = aprutil apr
+[wincrypt]
+type = lib
+external-lib = -lcrypt32
+
[__ALL__]
type = project
path = build/win32
diff --git a/subversion/include/svn_auth.h b/subversion/include/svn_auth.h
index 3e9f45e..155c063 100644
--- a/subversion/include/svn_auth.h
+++ b/subversion/include/svn_auth.h
@@ -865,7 +865,7 @@ svn_auth_get_platform_specific_client_providers(
svn_config_t *config,
apr_pool_t *pool);
-#if (defined(WIN32) && !defined(__MINGW32__)) || defined(DOXYGEN)
+#if ((defined(WIN32) && !defined(__MINGW32__)) || defined(__CYGWIN__)) || 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
diff --git a/subversion/libsvn_subr/auth.c b/subversion/libsvn_subr/auth.c
index 3c874cf..a999711 100644
--- a/subversion/libsvn_subr/auth.c
+++ b/subversion/libsvn_subr/auth.c
@@ -525,7 +525,7 @@ svn_auth_get_platform_specific_provider(svn_auth_provider_object_t **provider,
}
#endif
-#if defined(WIN32) && !defined(__MINGW32__)
+#if (defined(WIN32) && !defined(__MINGW32__)) || defined(__CYGWIN__)
if (strcmp(provider_name, "windows") == 0 &&
strcmp(provider_type, "simple") == 0)
{
diff --git a/subversion/libsvn_subr/config_file.c b/subversion/libsvn_subr/config_file.c
index c705b14..a0a3847 100644
--- a/subversion/libsvn_subr/config_file.c
+++ b/subversion/libsvn_subr/config_file.c
@@ -1058,7 +1058,7 @@ svn_config_ensure(const char *config_dir, apr_pool_t *pool)
"### windows-cryptoapi (Windows)" NL
#ifdef SVN_HAVE_KEYCHAIN_SERVICES
"# password-stores = keychain" NL
-#elif defined(WIN32) && !defined(__MINGW32__)
+#elif (defined(WIN32) && !defined(__MINGW32__)) || defined(__CYGWIN__)
"# password-stores = windows-cryptoapi" NL
#else
"# password-stores = gpg-agent,gnome-keyring,kwallet" NL
diff --git a/subversion/libsvn_subr/win32_crypto.c b/subversion/libsvn_subr/win32_crypto.c
index e16866a..96eaa93 100644
--- a/subversion/libsvn_subr/win32_crypto.c
+++ b/subversion/libsvn_subr/win32_crypto.c
@@ -26,7 +26,7 @@ typedef int win32_crypto__dummy;
/* ==================================================================== */
-#if defined(WIN32) && !defined(__MINGW32__)
+#if (defined(WIN32) && !defined(__MINGW32__)) || defined(__CYGWIN__)
/*** Includes. ***/
@@ -44,6 +44,9 @@ typedef int win32_crypto__dummy;
#include "svn_private_config.h"
+#ifdef __CYGWIN__
+#include <windows.h>
+#endif
#include <wincrypt.h>
diff --git a/subversion/tests/libsvn_subr/auth-test.c b/subversion/tests/libsvn_subr/auth-test.c
index 9d7d866..58ff760 100644
--- a/subversion/tests/libsvn_subr/auth-test.c
+++ b/subversion/tests/libsvn_subr/auth-test.c
@@ -62,7 +62,7 @@ test_platform_specific_auth_providers(apr_pool_t *pool)
#ifdef SVN_HAVE_KEYCHAIN_SERVICES
number_of_providers += 2;
#endif
-#if defined(WIN32) && !defined(__MINGW32__)
+#if (defined(WIN32) && !defined(__MINGW32__)) || defined(__CYGWIN__)
number_of_providers += 2;
#endif
if (providers->nelts != number_of_providers)
@@ -103,7 +103,7 @@ test_platform_specific_auth_providers(apr_pool_t *pool)
#endif
/* Test Windows auth providers */
-#if defined(WIN32) && !defined(__MINGW32__)
+#if (defined(WIN32) && !defined(__MINGW32__)) || defined(__CYGWIN__)
svn_auth_get_platform_specific_provider(&provider, "windows",
"simple", pool);
@@ -164,6 +164,7 @@ test_platform_specific_auth_providers(apr_pool_t *pool)
"'ssl_client_cert_pw') should not return NULL");
/* Make sure you do not get a Windows auth provider */
+#ifndef __CYGWIN__
SVN_ERR(svn_auth_get_platform_specific_provider(&provider, "windows",
"simple", pool));
@@ -173,6 +174,7 @@ test_platform_specific_auth_providers(apr_pool_t *pool)
"svn_auth_get_platform_specific_provider('windows', 'simple') should " \
"return NULL");
#endif
+#endif
/* Test KWallet auth providers */
#ifdef SVN_HAVE_KWALLET