[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] OSX Keychain support

From: mark benedetto king <mbk_at_lowlatency.com>
Date: 2005-12-03 19:20:35 CET

On Sat, Dec 03, 2005 at 10:30:14AM -0500, David James wrote:
> On 12/3/05, mark benedetto king <mbk@lowlatency.com> wrote:
> > > The only thing I don't understand is whether the patch to
> > > subversion/libsvn_ra_dav/session.c is actually necessary. I don't
> > > have a client side cert for any svn repo, so I couldn't test the SSL
> > > cert password bits.
> > >
> >
> > I had the same question about the original patch. I haven't tried to
> > store cert passwords in the keychain yet. I will commit the simple
> > work first and then work through the SSL case.
> I haven't tested the SSL code, but I noticed a small bug:
>
> >+ svn_auth_save_credentials(state, pool);
> > svn_auth_cred_ssl_client_cert_pw_t *pw_creds = creds;
> Looks like we've got a declaration here after a statement. To allow
> this code to parse as C89, we'll need to switch the order of these two
> lines.
>

Yes. I'll make sure to address this issue if the extra line is
necessary.

> > 2.) Configury.
> >
>
> Shouldn't SVN_KEYCHAIN_INCLUDES and SVN_KEYCHAIN_LIBS be substituted
> unconditionally? In Makefile.in, I see that @SVN_KEYCHAIN_INCLUDES@
> was used inside INCLUDES on all platforms.
>

How about this configure.in change? I think it does everything we
need, and shouldn't break anything:

Index: configure.in
===================================================================
--- configure.in (revision 17595)
+++ configure.in (working copy)
@@ -277,7 +277,7 @@
 fi
 
 
-dnl Check for libraries --------------------
+dnl Berkeley DB --------------------
 
 # Berkeley DB on SCO OpenServer needs -lsocket
 AC_CHECK_LIB(socket, socket)
@@ -301,6 +301,37 @@
 SVN_LIB_BERKELEY_DB($SVN_FS_WANT_DB_MAJOR, $SVN_FS_WANT_DB_MINOR,
                     $SVN_FS_WANT_DB_PATCH, [db4 db])
 
+dnl Mac OS KeyChain -------------------
+
+AC_ARG_ENABLE(keychain,
+ AC_HELP_STRING([--disable-keychain],
+ [Disable use of Mac OS KeyChain for auth credentials]),
+ [enable_keychain=$enableval],[enable_keychain=yes])
+
+AC_MSG_CHECKING([for Mac OS KeyChain Services])
+
+if test "$enable_keychain" = "yes"; then
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <AvailabilityMacros.h>
+#if !DARWIN || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_2)
+#error KeyChain API unavailable.
+#endif]], [[]])],[],[enable_keychain=no])
+fi
+
+SVN_KEYCHAIN_INCLUDES=""
+if test "$enable_keychain" = "yes"; then
+ SVN_KEYCHAIN_LIBS="-framework Security"
+ SVN_KEYCHAIN_LIBS="$SVN_KEYCHAIN_LIBS -framework CoreFoundation"
+ SVN_KEYCHAIN_LIBS="$SVN_KEYCHAIN_LIBS -framework CoreServices"
+ AC_DEFINE([SVN_HAVE_KEYCHAIN_SERVICES], [1], [Is Mac OS KeyChain support enabled?])
+ AC_MSG_RESULT([yes])
+else
+ SVN_KEYCHAIN_LIBS=""
+ AC_MSG_RESULT([no])
+fi
+AC_SUBST(SVN_KEYCHAIN_INCLUDES)
+AC_SUBST(SVN_KEYCHAIN_LIBS)
+
+
 dnl I18n -------------------
 
 AC_ARG_ENABLE(nls,

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Dec 3 19:17:51 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.