25 #ifndef CURL_DISABLE_HTTP
40 #define _MPRINTF_REPLACE
62 while(*header && isspace((
int)*header))
66 header += strlen(
"Digest");
76 while(*header && isspace((
int)*header))
80 if(2 == sscanf(header,
"%31[^=]=\"%127[^\"]\"",
91 else if(
strequal(value,
"algorithm")) {
99 totlen = strlen(value)+strlen(content)+3;
121 static void md5_to_ascii(
unsigned char *
source,
126 sprintf((
char *)&dest[i*2],
"%02x", source[i]);
130 unsigned char *request,
131 unsigned char *uripath)
136 unsigned char md5buf[16];
137 unsigned char ha1[33];
138 unsigned char ha2[33];
139 unsigned char request_digest[33];
140 unsigned char *md5this;
155 md5this = (
unsigned char *)
156 aprintf(
"%s:%s:%s:%s:%s",
164 md5this = (
unsigned char *)
172 md5_to_ascii(md5buf, ha1);
181 md5this = (
unsigned char *)aprintf(
"%s:%s", request, uripath);
184 md5_to_ascii(md5buf, ha2);
186 md5this = (
unsigned char *)aprintf(
"%s:%s:%s", ha1, data->
state.
digest.
nonce,
190 md5_to_ascii(md5buf, request_digest);
199 aprintf(
"Authorization: Digest "
204 "response=\"%s\"\r\n",
void Curl_md5it(unsigned char *outbuffer, unsigned char *input)
GLsizei const GLfloat * value
GLsizei GLsizei GLcharARB * source
GLsizei GLsizei GLenum GLenum const GLvoid * data
CURLdigest Curl_input_digest(struct connectdata *conn, char *header)
struct SessionHandle * data
#define checkprefix(a, b)
CURLcode Curl_output_digest(struct connectdata *conn, unsigned char *request, unsigned char *uripath)
void Curl_digest_cleanup(struct SessionHandle *data)
struct connectdata::dynamically_allocated_data allocptr
int sprintf(idStr &string, const char *fmt,...)