The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Functions
password.h File Reference

Password normalisation functions. More...

#include <freeradius-devel/server/request.h>
+ Include dependency graph for password.h:

Go to the source code of this file.

Functions

fr_pair_tpassword_find (bool *ephemeral, TALLOC_CTX *ctx, request_t *request, fr_dict_attr_t const *allowed_attrs[], size_t allowed_attrs_len, bool normify)
 Find a "known good" password in the control list of a request. More...
 
int password_init (void)
 Load our dictionaries. More...
 
int password_normalise_and_replace (request_t *request, bool normify)
 Find all password attributes in the control list of a request and normalise them. More...
 

Detailed Description

Password normalisation functions.

Definition in file password.h.

Function Documentation

◆ password_find()

fr_pair_t* password_find ( bool ephemeral,
TALLOC_CTX *  ctx,
request_t request,
fr_dict_attr_t const *  allowed_attrs[],
size_t  allowed_attrs_len,
bool  normify 
)

Find a "known good" password in the control list of a request.

Searches for a "known good" password attribute, and applies any processing and normification operations to it, returning a new normalised fr_pair_t.

The ctx passed in should be freed when the caller is done with the returned fr_pair_t, or alternatively, a persistent ctx may be used and the value of ephemeral checked. If ephemeral is false the returned pair MUST NOT BE FREED, it may be an attribute in the request->control_pairs list. If ephemeral is true, the returned pair MUST be freed, or added to one of the pair lists appropriate to the ctx passed in.

Parameters
[out]ephemeralIf true, the caller must use TALLOC_FREE to free the return value of this function. Alternatively 'ctx' can be freed, which is simpler and cleaner, but some people have religious objections to that.
[in]ctxEphemeral ctx to allocate new attributes in.
[in]requestThe current request.
[in]allowed_attrsOptional list of allowed attributes.
[in]allowed_attrs_lenLength of allowed attributes list.
[in]normifyApply hex/base64 normalisation to attributes.
Returns
  • A fr_pair_t containing a "known good" password.
  • NULL on error, or if no usable password attributes were found.

Definition at line 954 of file password.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ password_init()

int password_init ( void  )

Load our dictionaries.

Definition at line 1044 of file password.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ password_normalise_and_replace()

int password_normalise_and_replace ( request_t request,
bool  normify 
)

Find all password attributes in the control list of a request and normalise them.

Parameters
[in]requestThe current request.
[in]normifyApply hex/base64 normalisation to attributes.
Returns
the number of attributes normalised.

Definition at line 858 of file password.c.

+ Here is the call graph for this function: