re/include/re_httpauth.h

41 lines
857 B
C
Raw Permalink Normal View History

2010-11-03 11:34:14 +00:00
/**
* @file re_httpauth.h Interface to HTTP Authentication
*
* Copyright (C) 2010 Creytiv.com
*/
2011-12-09 11:45:17 +00:00
/** HTTP Digest Challenge */
2010-11-03 11:34:14 +00:00
struct httpauth_digest_chall {
struct pl realm;
struct pl nonce;
/* optional */
struct pl opaque;
struct pl stale;
struct pl algorithm;
struct pl qop;
};
2011-12-09 11:45:17 +00:00
/** HTTP Digest response */
2010-11-03 11:34:14 +00:00
struct httpauth_digest_resp {
struct pl realm;
struct pl nonce;
struct pl response;
struct pl username;
struct pl uri;
/* optional */
2010-11-03 11:34:14 +00:00
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,
2010-11-03 11:34:14 +00:00
const struct pl *hval);
2011-12-09 11:45:17 +00:00
int httpauth_digest_response_auth(const struct httpauth_digest_resp *resp,
const struct pl *method, const uint8_t *ha1);