40 comma_append (
char **dst,
const char *key,
const char *value,
int quotes)
48 result = asprintf (&tmp,
"%s, %s=\"%s\"", *dst, key, value);
50 result = asprintf (&tmp,
"%s, %s=%s", *dst, key, value);
52 result = asprintf (&tmp,
"%s, %s", *dst, key);
55 result = asprintf (&tmp,
"%s=\"%s\"", key, value);
57 result = asprintf (&tmp,
"%s=%s", key, value);
59 result = asprintf (&tmp,
"%s", key);
82 for (i = 0; i < c->
nrealms; i++)
84 if (comma_append (&out,
"realm", c->
realms[i], 1) < 0)
92 if (comma_append (&out,
"nonce", c->
nonce, 1) < 0)
103 if (comma_append (&tmp,
"auth", NULL, 0) < 0)
111 if (comma_append (&tmp,
"auth-int", NULL, 0) < 0)
119 if (comma_append (&tmp,
"auth-conf", NULL, 0) < 0)
126 if (comma_append (&out,
"qop", tmp, 1) < 0)
137 if (comma_append (&out,
"stale",
"true", 0) < 0)
153 if (comma_append (&out,
"maxbuf", tmp, 0) < 0)
163 if (comma_append (&out,
"charset",
"utf-8", 0) < 0)
169 if (comma_append (&out,
"algorithm",
"md5-sess", 0) < 0)
180 if (comma_append (&tmp,
"3des", NULL, 0) < 0)
188 if (comma_append (&tmp,
"des", NULL, 0) < 0)
196 if (comma_append (&tmp,
"rc4-40", NULL, 0) < 0)
204 if (comma_append (&tmp,
"rc4", NULL, 0) < 0)
212 if (comma_append (&tmp,
"rc4-56", NULL, 0) < 0)
220 if (comma_append (&tmp,
"aes-cbc", NULL, 0) < 0)
227 if (comma_append (&out,
"cipher", tmp, 1) < 0)
244 const char *qop = NULL;
245 const char *cipher = NULL;
253 qop =
"qop=auth-conf";
255 qop =
"qop=auth-int";
260 cipher =
"cipher=3des";
262 cipher =
"cipher=des";
264 cipher =
"cipher=rc4-40";
266 cipher =
"cipher=rc4";
268 cipher =
"cipher=rc4-56";
270 cipher =
"cipher=aes-cbc";
273 if (comma_append (&out,
"username", r->
username, 1) < 0)
280 if (comma_append (&out,
"realm", r->
realm, 1) < 0)
287 if (comma_append (&out,
"nonce", r->
nonce, 1) < 0)
294 if (comma_append (&out,
"cnonce", r->
cnonce, 1) < 0)
304 if (asprintf (&tmp,
"%08lx", r->
nc) < 0)
310 if (comma_append (&out,
"nc", tmp, 0) < 0)
321 if (comma_append (&out, qop, NULL, 0) < 0)
328 if (comma_append (&out,
"digest-uri", r->
digesturi, 1) < 0)
334 if (comma_append (&out,
"response", r->
response, 0) < 0)
350 if (comma_append (&out,
"maxbuf", tmp, 0) < 0)
361 if (comma_append (&out,
"charset",
"utf-8", 0) < 0)
368 if (comma_append (&out, cipher, NULL, 0) < 0)
375 if (comma_append (&out,
"authzid", r->
authzid, 1) < 0)
394 if (asprintf (&out,
"rspauth=%s", finish->
rspauth) < 0)
char * digest_md5_print_finish(digest_md5_finish *finish)
char * digest_md5_print_challenge(digest_md5_challenge *c)
char * digest_md5_print_response(digest_md5_response *r)
@ DIGEST_MD5_QOP_AUTH_INT
@ DIGEST_MD5_QOP_AUTH_CONF
@ DIGEST_MD5_CIPHER_RC4_56
@ DIGEST_MD5_CIPHER_AES_CBC
@ DIGEST_MD5_CIPHER_RC4_40
int digest_md5_validate_challenge(digest_md5_challenge *c)
int digest_md5_validate_response(digest_md5_response *r)
int digest_md5_validate_finish(digest_md5_finish *f)
unsigned long servermaxbuf
char rspauth[DIGEST_MD5_RESPONSE_LENGTH+1]
char response[DIGEST_MD5_RESPONSE_LENGTH+1]
unsigned long clientmaxbuf