Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 168 svn_boolean_t *success)
- 169 {
- 170 const char *out; // unused
- 171 const char *mech;
- 172 const svn_string_t *arg = NULL, *in;
- 173 unsigned int outlen; // unsused
- 174 int result; // 0 = SASL_OK, -13 = SASL_FAIL
- 175 svn_boolean_t use_base64;
- 176 int i; // debug usage
- 177 printf("try_auth\n");
- 178 *success = FALSE;
- 179
- 180 printf("- svn_ra_svn_read_tuple\n");
- 181 /* Read the client's chosen mech and the initial token. */
- 182 SVN_ERR(svn_ra_svn_read_tuple(conn, pool, "w(?s)", &mech, &in));
- 183
- 184 printf("mech: %s\n", mech);
- 185
- 186 if (strcmp(mech, "EXTERNAL") == 0 && !in)
- 187 in = svn_string_create(b->tunnel_user, pool);
- 188 else if (in)
- 189 in = svn_base64_decode_string(in, pool);
- 190
- 191
- 192
- 193 /* For CRAM-MD5, we don't base64-encode stuff. */
- 194 use_base64 = (strcmp(mech, "CRAM-MD5") != 0);
- 195
- 196 printf("- sasl_server_start\n");
- 197 result = sasl_server_start(sasl_ctx, mech,
- 198 in ? in->data : NULL,
- 199 in ? in->len : 0, &out, &outlen);
- 200 printf("in->data = ");
- 201 for (i = 0; i < in->len; i++)
- 202 printf("%c", in->data[i]);
- 203 printf("\n");
- 204
- 205 if (result != SASL_OK && result != SASL_CONTINUE)
- 206 return fail_auth(conn, pool, sasl_ctx);
- 207
- 208 while (result == SASL_CONTINUE)
- 209 {
- 210
- 211 svn_ra_svn_item_t *item;
- 212
- 213 arg = svn_string_ncreate(out, outlen, pool);
- 214 /* Encode what we send to the client. */
- 215 if (use_base64)
- 216 arg = svn_base64_encode_string2(arg, TRUE, pool);
- 217
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement