--- subversion/libsvn_client/simple_providers.c.orig 2005-05-04 15:32:38.000000000 -0700 +++ subversion/libsvn_client/simple_providers.c 2006-03-12 21:25:16.000000000 -0800 @@ -267,6 +267,31 @@ return TRUE; } +/* Implementation of password_mangler_t that encodes the incoming + password using base64 algorithm. */ +static svn_boolean_t +base64_password_encoder (const char **out, const char *in, apr_pool_t *pool) +{ + int len = strlen(in); + char *encoded_password = apr_palloc(pool, apr_base64_encode_len(len)); + apr_base64_encode(encoded_password, in, len); + *out = encoded_password; + return TRUE; +} + +/* Implementation of password_mangler_t that decodes the incoming + password using base64 algorithm. */ +static svn_boolean_t +base64_password_decoder (const char **out, const char *in, apr_pool_t *pool) +{ + char *decoded_password; + decoded_password = apr_palloc(pool, apr_base64_decode_len(in)); + apr_base64_decode(decoded_password, in); + *out = decoded_password; + return TRUE; +} + + /* Get cached (unencrypted) credentials from the simple provider's cache. */ static svn_error_t * simple_first_creds (void **credentials, @@ -279,7 +304,7 @@ return simple_first_creds_helper (credentials, iter_baton, provider_baton, parameters, realmstring, - simple_password_mangler, + base64_password_decoder, SVN_CLIENT__SIMPLE_PASSWORD_TYPE, pool); } @@ -295,7 +320,7 @@ { return simple_save_creds_helper (saved, credentials, provider_baton, parameters, realmstring, - simple_password_mangler, + base64_password_encoder, SVN_CLIENT__SIMPLE_PASSWORD_TYPE, pool); }