270 else { |
270 else { |
271 print_warning(lineno, "unknown ssl version: %s\n", value); |
271 print_warning(lineno, "unknown ssl version: %s\n", value); |
272 } |
272 } |
273 } else if(xstreq(key, "authmethods")) { |
273 } else if(xstreq(key, "authmethods")) { |
274 repo->authmethods = CURLAUTH_NONE; |
274 repo->authmethods = CURLAUTH_NONE; |
275 const char *delims = " \r\n"; |
275 const char *delims = " \t\r\n"; |
276 char *meths = strdup(value); |
276 char *meths = strdup(value); |
277 char *meth = strtok(meths, delims); |
277 char *meth = strtok(meths, delims); |
278 while (meth) { |
278 while (meth) { |
279 if(xstrEQ(value, "basic")) { |
279 if(xstrEQ(meth, "basic")) { |
280 repo->authmethods |= CURLAUTH_BASIC; |
280 repo->authmethods |= CURLAUTH_BASIC; |
281 } else if(xstrEQ(value, "digest")) { |
281 } else if(xstrEQ(meth, "digest")) { |
282 repo->authmethods |= CURLAUTH_DIGEST; |
282 repo->authmethods |= CURLAUTH_DIGEST; |
283 } else if(xstrEQ(value, "negotiate")) { |
283 } else if(xstrEQ(meth, "negotiate")) { |
284 repo->authmethods |= CURLAUTH_GSSNEGOTIATE; |
284 repo->authmethods |= CURLAUTH_GSSNEGOTIATE; |
285 } else if(xstrEQ(value, "ntlm")) { |
285 } else if(xstrEQ(meth, "ntlm")) { |
286 repo->authmethods |= CURLAUTH_NTLM; |
286 repo->authmethods |= CURLAUTH_NTLM; |
287 } else if(xstrEQ(value, "any")) { |
287 } else if(xstrEQ(meth, "any")) { |
288 repo->authmethods = CURLAUTH_ANY; |
288 repo->authmethods = CURLAUTH_ANY; |
289 } else if(xstrEQ(value, "none")) { |
289 } else if(xstrEQ(meth, "none")) { |
290 /* skip */ |
290 /* skip */ |
291 } else { |
291 } else { |
292 print_warning(lineno, |
292 print_warning(lineno, |
293 "unknown authentication method: %s\n", value); |
293 "unknown authentication method: %s\n", meth); |
294 } |
294 } |
295 meth = strtok(NULL, delims); |
295 meth = strtok(NULL, delims); |
296 } |
296 } |
297 free(meths); |
297 free(meths); |
298 } else { |
298 } else { |