Lines Matching refs:ai

52 static handler_t mod_authn_file_htdigest_digest(request_st *r, void *p_d, http_auth_info_t *ai);
54 static handler_t mod_authn_file_plain_digest(request_st *r, void *p_d, http_auth_info_t *ai);
172 static void mod_authn_file_digest(http_auth_info_t *ai, const char *pw, size_t pwlen) { in mod_authn_file_digest() argument
177 if (ai->dalgo & HTTP_AUTH_DIGEST_SHA256) in mod_authn_file_digest()
180 else if (ai->dalgo & HTTP_AUTH_DIGEST_SHA512_256) in mod_authn_file_digest()
186 { ai->username, ai->ulen } in mod_authn_file_digest()
188 ,{ ai->realm, ai->rlen } in mod_authn_file_digest()
192 digest_iov(ai->digest, iov, sizeof(iov)/sizeof(*iov)); in mod_authn_file_digest()
198 …digest_get_loop(const char *data, const buffer *auth_fn, http_auth_info_t *ai, log_error_st *errh)… in mod_authn_file_htdigest_get_loop() argument
239 if (ai->userhash) { in mod_authn_file_htdigest_get_loop()
244 if (ai->ulen == uh_len && ai->rlen == r_len in mod_authn_file_htdigest_get_loop()
247 && ck_memeq_const_time_fixed_len(ai->username,f_userhash,uh_len) in mod_authn_file_htdigest_get_loop()
248 && 0 == memcmp(ai->realm, f_realm, r_len) in mod_authn_file_htdigest_get_loop()
249 && u_len <= sizeof(ai->userbuf)) { in mod_authn_file_htdigest_get_loop()
251 ai->ulen = u_len; in mod_authn_file_htdigest_get_loop()
252 ai->username = memcpy(ai->userbuf, f_user, u_len); in mod_authn_file_htdigest_get_loop()
259 if (ai->ulen == u_len && ai->rlen == r_len in mod_authn_file_htdigest_get_loop()
260 && 0 == memcmp(ai->username, f_user, u_len) in mod_authn_file_htdigest_get_loop()
261 && 0 == memcmp(ai->realm, f_realm, r_len)) { in mod_authn_file_htdigest_get_loop()
274 if (pwd_len != (ai->dlen << 1)) continue; in mod_authn_file_htdigest_get_loop()
275 return li_hex2bin(ai->digest, sizeof(ai->digest), f_pwd, pwd_len); in mod_authn_file_htdigest_get_loop()
282 static int mod_authn_file_htdigest_get(request_st * const r, void *p_d, http_auth_info_t * const ai… in mod_authn_file_htdigest_get() argument
292 int rc = mod_authn_file_htdigest_get_loop(data, auth_fn, ai, r->conf.errh); in mod_authn_file_htdigest_get()
298 …er_t mod_authn_file_htdigest_digest(request_st * const r, void *p_d, http_auth_info_t * const ai) { in mod_authn_file_htdigest_digest() argument
299 return (0 == mod_authn_file_htdigest_get(r, p_d, ai)) in mod_authn_file_htdigest_digest()
305 http_auth_info_t ai; in mod_authn_file_htdigest_basic() local
306 unsigned char htdigest[sizeof(ai.digest)]; in mod_authn_file_htdigest_basic()
309 ai.dalgo = (require->algorithm & ~HTTP_AUTH_DIGEST_SESS); in mod_authn_file_htdigest_basic()
310 ai.dlen = http_auth_digest_len(ai.dalgo); in mod_authn_file_htdigest_basic()
311 ai.username = username->ptr; in mod_authn_file_htdigest_basic()
312 ai.ulen = buffer_clen(username); in mod_authn_file_htdigest_basic()
313 ai.realm = require->realm->ptr; in mod_authn_file_htdigest_basic()
314 ai.rlen = buffer_clen(require->realm); in mod_authn_file_htdigest_basic()
315 ai.userhash = 0; in mod_authn_file_htdigest_basic()
317 if (mod_authn_file_htdigest_get(r, p_d, &ai)) return HANDLER_ERROR; in mod_authn_file_htdigest_basic()
319 if (ai.dlen > sizeof(htdigest)) { in mod_authn_file_htdigest_basic()
320 ck_memzero(ai.digest, ai.dlen); in mod_authn_file_htdigest_basic()
323 memcpy(htdigest, ai.digest, ai.dlen); /*(save digest before reuse of ai)*/ in mod_authn_file_htdigest_basic()
325 mod_authn_file_digest(&ai, pw, strlen(pw)); in mod_authn_file_htdigest_basic()
327 int rc = (ck_memeq_const_time_fixed_len(htdigest, ai.digest, ai.dlen) in mod_authn_file_htdigest_basic()
330 ck_memzero(htdigest, ai.dlen); in mod_authn_file_htdigest_basic()
331 ck_memzero(ai.digest, ai.dlen); in mod_authn_file_htdigest_basic()
397 …ndler_t mod_authn_file_plain_digest(request_st * const r, void *p_d, http_auth_info_t * const ai) { in mod_authn_file_plain_digest() argument
402 ai->username, ai->ulen, tb, in mod_authn_file_plain_digest()
407 mod_authn_file_digest(ai, BUF_PTR_LEN(tb)); in mod_authn_file_plain_digest()