60 DBG (
"CHAP %p initialising with %s digest\n", chap, digest->
name );
65 DBG (
"CHAP %p could not allocate %zd bytes for state\n",
109 DBG (
"CHAP %p responding to challenge\n", chap );
125 DBG (
"CHAP %p finished\n", chap );
128 memset ( chap, 0,
sizeof ( *chap ) );
static void digest_update(struct digest_algorithm *digest, void *ctx, const void *data, size_t len)
uint8_t * response
CHAP response.
uint8_t * digest_context
Context used by the digest algorithm.
static void digest_final(struct digest_algorithm *digest, void *ctx, void *out)
void chap_respond(struct chap_response *chap)
Respond to the CHAP challenge.
#define ENOMEM
Not enough space.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
int chap_init(struct chap_response *chap, struct digest_algorithm *digest)
Initialise CHAP challenge/response.
struct digest_algorithm * digest
Digest algorithm used for the response.
static void digest_init(struct digest_algorithm *digest, void *ctx)
static void(* free)(struct refcnt *refcnt))
void chap_finish(struct chap_response *chap)
Free resources used by a CHAP response.
size_t response_len
Length of CHAP response.
void * malloc(size_t size)
Allocate memory.
size_t ctxsize
Context size.
size_t digestsize
Digest size.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
const char * name
Algorithm name.
A message digest algorithm.
uint8_t data[48]
Additional event data.
#define DBG(...)
Print a debugging message.
void chap_update(struct chap_response *chap, const void *data, size_t len)
Add data to the CHAP challenge.
#define NULL
NULL pointer (VOID *)
void * memset(void *dest, int character, size_t len) __nonnull