re/include/re_httpauth.h
Alfred E. Heggestad d5671216c4 patch: cleanup and improve httpauth
- fix parsing bug nonce/cnonce
- handle line-folding
- parsing speed increased by 620%
- handle response w/o qop support
2011-03-15 11:26:47 +00:00

38 lines
794 B
C

/**
* @file re_httpauth.h Interface to HTTP Authentication
*
* Copyright (C) 2010 Creytiv.com
*/
struct httpauth_digest_chall {
struct pl realm;
struct pl nonce;
/* optional */
struct pl opaque;
struct pl stale;
struct pl algorithm;
struct pl qop;
};
struct httpauth_digest_resp {
struct pl realm;
struct pl nonce;
struct pl response;
struct pl username;
struct pl uri;
/* optional */
struct pl nc;
struct pl cnonce;
struct pl qop;
};
int httpauth_digest_challenge_decode(struct httpauth_digest_chall *chall,
const struct pl *hval);
int httpauth_digest_response_decode(struct httpauth_digest_resp *resp,
const struct pl *hval);
int httpauth_digest_response_auth(struct httpauth_digest_resp *resp,
const struct pl *method, const uint8_t *ha1);