Compy 0.2.0
A lightweight RTSP 1.0 server library for embedded systems
Loading...
Searching...
No Matches
auth.h
Go to the documentation of this file.
1
19#pragma once
20
22
23#include <stdbool.h>
24#include <stddef.h>
25
26#include <slice99.h>
27
28#include <compy/priv/compiler_attrs.h>
29
30/* Forward declaration — full definition in context.h */
31typedef struct Compy_Context Compy_Context;
32
33#include <compy/types/request.h>
34
49typedef bool (*Compy_CredentialLookup)(
50 const char *username, char *password_out, size_t password_max,
51 void *user_data);
52
56typedef struct Compy_Auth Compy_Auth;
57
69 const char *realm, Compy_CredentialLookup lookup,
70 void *user_data) COMPY_PRIV_MUST_USE;
71
77void Compy_Auth_free(Compy_Auth *self);
78
101 Compy_Auth *self, Compy_Context *ctx,
102 const Compy_Request *req) COMPY_PRIV_MUST_USE;
103
118 char out[restrict 33], const char *username, const char *realm,
119 const char *password, const char *nonce, const char *method,
120 const char *uri);
bool(* Compy_CredentialLookup)(const char *username, char *password_out, size_t password_max, void *user_data)
Credential lookup callback.
Definition auth.h:49
void compy_digest_response(char out[restrict 33], const char *username, const char *realm, const char *password, const char *nonce, const char *method, const char *uri)
Computes the MD5 Digest response hash per RFC 2617 Section 3.2.2.
Definition auth.c:95
void Compy_Auth_free(Compy_Auth *self)
Frees an authentication context.
Definition auth.c:90
Compy_Auth * Compy_Auth_new(const char *realm, Compy_CredentialLookup lookup, void *user_data) COMPY_PRIV_MUST_USE
Creates a new Digest authentication context.
Definition auth.c:69
int compy_auth_check(Compy_Auth *self, Compy_Context *ctx, const Compy_Request *req) COMPY_PRIV_MUST_USE
Validates the request's Authorization header.
Definition auth.c:172
An RTSP header map.
An RTSP request.
Definition auth.c:26
Definition context.c:10
An RTSP request.
Definition request.h:21