Index: subversion/include/svn_config.h =================================================================== --- subversion/include/svn_config.h (revision 21513) +++ subversion/include/svn_config.h (working copy) @@ -67,6 +67,7 @@ #define SVN_CONFIG_OPTION_HTTP_TIMEOUT "http-timeout" #define SVN_CONFIG_OPTION_HTTP_COMPRESSION "http-compression" #define SVN_CONFIG_OPTION_NEON_DEBUG_MASK "neon-debug-mask" +#define SVN_CONFIG_OPTION_HTTP_AUTH "http-auth-protocols" #define SVN_CONFIG_OPTION_SSL_AUTHORITY_FILES "ssl-authority-files" #define SVN_CONFIG_OPTION_SSL_TRUST_DEFAULT_CA "ssl-trust-default-ca" #define SVN_CONFIG_OPTION_SSL_CLIENT_CERT_FILE "ssl-client-cert-file" Index: subversion/libsvn_subr/config_file.c =================================================================== --- subversion/libsvn_subr/config_file.c (revision 21513) +++ subversion/libsvn_subr/config_file.c (working copy) @@ -882,6 +882,8 @@ APR_EOL_STR "### neon-debug-mask Debug mask for Neon HTTP library" APR_EOL_STR + "### http-auth-protocols Auth types to use for HTTP library" + APR_EOL_STR "### ssl-authority-files List of files, each of a trusted CAs" APR_EOL_STR "### ssl-trust-default-ca Trust the system 'default' CAs" @@ -928,7 +930,7 @@ APR_EOL_STR "# [group1]" APR_EOL_STR -"# http-proxy-host = proxy1.some-domain-name.com" + "# http-proxy-host = proxy1.some-domain-name.com" APR_EOL_STR "# http-proxy-port = 80" APR_EOL_STR @@ -938,6 +940,8 @@ APR_EOL_STR "# http-timeout = 60" APR_EOL_STR + "# http-auth-protocols = basic;digest;negotiate" + APR_EOL_STR "# neon-debug-mask = 130" APR_EOL_STR "" @@ -1000,6 +1004,8 @@ APR_EOL_STR "# http-compression = no" APR_EOL_STR + "# http-auth-protocols = basic;digest;negotiate" + APR_EOL_STR "# No http-timeout, so just use the builtin default." APR_EOL_STR "# No neon-debug-mask, so neon debugging is disabled." Index: subversion/libsvn_ra_dav/session.c =================================================================== --- subversion/libsvn_ra_dav/session.c (revision 21513) +++ subversion/libsvn_ra_dav/session.c (working copy) @@ -351,12 +351,14 @@ } /* Set *PROXY_HOST, *PROXY_PORT, *PROXY_USERNAME, *PROXY_PASSWORD, - * *TIMEOUT_SECONDS and *NEON_DEBUG to the information for REQUESTED_HOST, - * allocated in POOL, if there is any applicable information. If there is - * no applicable information or if there is an error, then set *PROXY_PORT - * to (unsigned int) -1, *TIMEOUT_SECONDS and *NEON_DEBUG to zero, and the - * rest to NULL. This function can return an error, so before checking any - * values, check the error return value. + * *TIMEOUT_SECONDS, *NEON_DEBUG, *COMPRESSION, and *NEON_AUTO_PROTOCOLS + * to the information for REQUESTED_HOST, allocated in POOL, if there is + * any applicable information. If there is no applicable information or + * if there is an error, then set *PROXY_PORT to (unsigned int) -1, + * *TIMEOUT_SECONDS and *NEON_DEBUG to zero, *COMPRESSION to TRUE, + * *NEON_AUTH_PROTOCOLS is left untouched, and the rest are set to + * NULL. This function can return an error, so before checking any values, + * check the error return value. */ static svn_error_t *get_server_settings(const char **proxy_host, unsigned int *proxy_port, @@ -365,12 +367,14 @@ int *timeout_seconds, int *neon_debug, svn_boolean_t *compression, + unsigned int *neon_auth_protocols, svn_config_t *cfg, const char *requested_host, apr_pool_t *pool) { const char *exceptions, *port_str, *timeout_str, *server_group; const char *debug_str; + char *http_auth_str; svn_boolean_t is_exception = FALSE; /* If we find nothing, default to nulls. */ *proxy_host = NULL; @@ -380,6 +384,7 @@ port_str = NULL; timeout_str = NULL; debug_str = NULL; + http_auth_str = NULL; /* If there are defaults, use them, but only if the requested host is not one of the exceptions to the defaults. */ @@ -406,6 +411,10 @@ SVN_CONFIG_OPTION_HTTP_COMPRESSION, TRUE)); svn_config_get(cfg, &debug_str, SVN_CONFIG_SECTION_GLOBAL, SVN_CONFIG_OPTION_NEON_DEBUG_MASK, NULL); +#ifdef SVN_NEON_0_26 + svn_config_get(cfg, &http_auth_str, SVN_CONFIG_SECTION_GLOBAL, + SVN_CONFIG_OPTION_HTTP_AUTH, NULL); +#endif } if (cfg) @@ -431,6 +440,10 @@ *compression)); svn_config_get(cfg, &debug_str, server_group, SVN_CONFIG_OPTION_NEON_DEBUG_MASK, debug_str); +#ifdef SVN_NEON_0_26 + svn_config_get(cfg, &http_auth_str, SVN_CONFIG_SECTION_GLOBAL, + SVN_CONFIG_OPTION_HTTP_AUTH, NULL); +#endif } /* Special case: convert the port value, if any. */ @@ -487,6 +500,29 @@ else *neon_debug = 0; +#ifdef SVN_NEON_0_26 + if (http_auth_str) + { + char *token, *last; + + apr_collapse_spaces(http_auth_str, http_auth_str); + while ((token = apr_strtok(http_auth_str, ";", &last)) != NULL) + { + http_auth_str = NULL; + if (strcasecmp("basic", token) == 0) + *neon_auth_protocols |= NE_AUTH_BASIC; + else if (strcasecmp("digest", token) == 0) + *neon_auth_protocols |= NE_AUTH_DIGEST; + else if (strcasecmp("negotiate", token) == 0) + *neon_auth_protocols |= NE_AUTH_NEGOTIATE; + else + return svn_error_create(SVN_ERR_RA_DAV_INVALID_CONFIG_VALUE, NULL, + _("Invalid config: unknown http auth" + "protocol")); + } + } +#endif + return SVN_NO_ERROR; } @@ -618,6 +654,7 @@ svn_config_t *cfg; const char *server_group; char *itr; + unsigned int neon_auth_protocols; neonprogress_baton_t *neonprogress_baton = apr_pcalloc(pool, sizeof(*neonprogress_baton)); @@ -677,6 +714,11 @@ int debug; svn_error_t *err; +#ifdef SVN_NEON_0_26 + neon_auth_protocols = NE_AUTH_BASIC | NE_AUTH_DIGEST; + if (is_ssl_session) + neon_auth_protocols |= NE_AUTH_NEGOTIATE; +#endif err = get_server_settings(&proxy_host, &proxy_port, &proxy_username, @@ -684,6 +726,7 @@ &timeout, &debug, &compression, + &neon_auth_protocols, cfg, uri.host, pool); @@ -761,8 +804,13 @@ /* Register an authentication 'pull' callback with the neon sessions */ +#ifdef SVN_NEON_0_26 + ne_add_server_auth(sess, neon_auth_protocols, request_auth, ras); + ne_add_server_auth(sess2, neon_auth_protocols, request_auth, ras); +#else ne_set_server_auth(sess, request_auth, ras); ne_set_server_auth(sess2, request_auth, ras); +#endif /* Store our RA session baton in Neon's private data slot so we can get at it in functions that take only ne_session_t *sess