48 const char *token =
"nonce=4711, foo=bar, algorithm=md5-sess";
50 printf (
"challenge `%s': ", token);
54 printf (
"nonce `%s': %s", c.
nonce,
55 strcmp (
"4711", c.
nonce) == 0 ?
"PASS" :
"FAILURE");
60 printf (
"printed `%s' PASS\n", tmp);
67 "qop=\"auth, auth-conf\", nonce=42, algorithm=md5-sess";
69 printf (
"challenge `%s': ", token);
78 const char *token =
"cipher=\"des\", nonce=42, algorithm=md5-sess";
80 printf (
"challenge `%s': ", token);
89 const char *token =
"qop=\"auth, auth-conf\", nonce=42, "
90 "algorithm=md5-sess, cipher=\"des\"";
92 printf (
"challenge `%s': ", token);
96 printf (
"qop %02x ciphers %02x: %s\n",
98 (c.
qops == 5 && c.
ciphers == 1) ?
"PASS" :
"FAILURE");
102 printf (
"printed `%s' PASS\n", tmp);
108 const char *token =
"bar=foo, foo=bar";
110 printf (
"challenge `%s': ", token);
118 const char *token =
"realm=foo, realm=bar, nonce=42, algorithm=md5-sess";
120 printf (
"challenge `%s': ", token);
126 printf (
"realms `%s', `%s': PASS\n", c.
realms[0], c.
realms[1]);
130 printf (
"printed `%s' PASS\n", tmp);
138 const char *token =
"bar=foo, foo=bar";
140 printf (
"response `%s': ", token);
149 const char *token =
"username=jas, nonce=42, cnonce=4711, nc=00000001, "
150 "digest-uri=foo, response=01234567890123456789012345678901";
152 printf (
"response `%s': ", token);
156 printf (
"username `%s', nonce `%s', cnonce `%s',"
157 " nc %08lx, digest-uri `%s', response `%s': PASS\n",
162 printf (
"printed `%s' PASS\n", tmp);
170 const char *token =
"rspauth=\"6a204da26b9888ee40bb3052ff056a67\"";
172 printf (
"finish `%s': ", token);
176 printf (
"`%s'? %s\n", f.
rspauth,
177 strcmp (
"6a204da26b9888ee40bb3052ff056a67", f.
rspauth) == 0
183 const char *token =
"bar=foo, foo=bar";
185 printf (
"finish `%s': ", token);
189 printf (
"invalid? PASS\n");
196 printf (
"gc_init error %d\n",
rc);
200 memset (buf16,
'Q', 16);
204 1, 0, NULL, NULL, NULL, NULL);
208 if (strcmp (buf32,
"6a204da26b9888ee40bb3052ff056a67") != 0)
210 printf (
"digest: `%s': PASS\n", buf32);
214 NULL, NULL, NULL, NULL);
218 if (strcmp (buf32,
"6c1f58bfa46e9c225b93745c84204efd") != 0)
220 printf (
"digest: `%s': PASS\n", buf32);
void digest_md5_free_finish(digest_md5_finish *f)
void digest_md5_free_response(digest_md5_response *r)
void digest_md5_free_challenge(digest_md5_challenge *c)
int digest_md5_parse_challenge(const char *challenge, size_t len, digest_md5_challenge *out)
int digest_md5_parse_response(const char *response, size_t len, digest_md5_response *out)
int digest_md5_parse_finish(const char *finish, size_t len, digest_md5_finish *out)
char * digest_md5_print_challenge(digest_md5_challenge *c)
char * digest_md5_print_response(digest_md5_response *r)
int digest_md5_hmac(char *output, char secret[MD5LEN], const char *nonce, unsigned long nc, const char *cnonce, digest_md5_qop qop, const char *authzid, const char *digesturi, int rspauth, digest_md5_cipher cipher, char *kic, char *kis, char *kcc, char *kcs)
char rspauth[DIGEST_MD5_RESPONSE_LENGTH+1]
char response[DIGEST_MD5_RESPONSE_LENGTH+1]