The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Functions
edir.c File Reference

LDAP extension for reading eDirectory universal password. More...

#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/ldap/base.h>
+ Include dependency graph for edir.c:

Go to the source code of this file.

Data Structures

struct  ldap_edir_ctx_t
 

Macros

#define NMAS_E_ACCESS_NOT_ALLOWED   (NMAS_E_BASE-59) /* -1659 0xFFFFF985 */
 
#define NMAS_E_BASE   (-1600)
 
#define NMAS_E_FRAG_FAILURE   (NMAS_E_BASE-31) /* -1631 0xFFFFF9A1 */
 
#define NMAS_E_INSUFFICIENT_MEMORY   (NMAS_E_BASE-35) /* -1635 0xFFFFF99D */
 
#define NMAS_E_INVALID_PARAMETER   (NMAS_E_BASE-43) /* -1643 0xFFFFF995 */
 
#define NMAS_E_INVALID_SPM_REQUEST   (NMAS_E_BASE-97) /* -1697 0xFFFFF95F */
 
#define NMAS_E_INVALID_VERSION   (NMAS_E_BASE-52) /* -1652 0xFFFFF98C */
 
#define NMAS_E_NOT_SUPPORTED   (NMAS_E_BASE-36) /* -1636 0xFFFFF99C */
 
#define NMAS_E_SYSTEM_RESOURCES   (NMAS_E_BASE-34) /* -1634 0xFFFFF99E */
 
#define NMAS_LDAP_EXT_VERSION   1
 
#define NMASLDAP_GET_PASSWORD_REQUEST   "2.16.840.1.113719.1.39.42.100.13"
 
#define NMASLDAP_GET_PASSWORD_RESPONSE   "2.16.840.1.113719.1.39.42.100.14"
 

Functions

static int ber_decode_login_data (struct berval *reply_bv, int *server_version, void *out, size_t *outlen)
 Converts the reply into server version and a return code. More...
 
static int ber_encode_request_data (char const *dn, struct berval **request_bv)
 Takes the object DN and BER encodes the data into the BER value which is used as part of the request. More...
 
char const * fr_ldap_edir_errstr (int code)
 
unlang_action_t fr_ldap_edir_get_password (request_t *request, char const *dn, fr_ldap_thread_trunk_t *ttrunk, fr_dict_attr_t const *password_da)
 Initiate retrieval of the universal password from Novell eDirectory. More...
 
static void ldap_edir_get_password_cancel (UNUSED request_t *request, UNUSED fr_signal_t action, void *uctx)
 Cancel an in progress Universal Password lookup. More...
 
static unlang_action_t ldap_edir_get_password_resume (rlm_rcode_t *p_result, UNUSED int *priority, request_t *request, void *uctx)
 Handle results of retrieving Universal Password. More...
 
static unlang_action_t ldap_edir_get_password_start (UNUSED rlm_rcode_t *p_result, UNUSED int *priority, request_t *request, void *uctx)
 Submit LDAP extended operation to retrieve Universal Password. More...
 

Detailed Description

LDAP extension for reading eDirectory universal password.

Id
74b4b1084da786be5a4e001705e594eb9bfe6f5f

To contact Novell about this file by physical or electronic mail, you may find current contact information at www.novell.com.

Definition in file edir.c.


Data Structure Documentation

◆ ldap_edir_ctx_t

struct ldap_edir_ctx_t

Definition at line 54 of file edir.c.

+ Collaboration diagram for ldap_edir_ctx_t:
Data Fields
struct berval * dn
fr_dict_attr_t const * password_da
fr_ldap_query_t * query
char const * reqoid
fr_ldap_thread_trunk_t * ttrunk

Macro Definition Documentation

◆ NMAS_E_ACCESS_NOT_ALLOWED

#define NMAS_E_ACCESS_NOT_ALLOWED   (NMAS_E_BASE-59) /* -1659 0xFFFFF985 */

Definition at line 45 of file edir.c.

◆ NMAS_E_BASE

#define NMAS_E_BASE   (-1600)

Definition at line 37 of file edir.c.

◆ NMAS_E_FRAG_FAILURE

#define NMAS_E_FRAG_FAILURE   (NMAS_E_BASE-31) /* -1631 0xFFFFF9A1 */

Definition at line 39 of file edir.c.

◆ NMAS_E_INSUFFICIENT_MEMORY

#define NMAS_E_INSUFFICIENT_MEMORY   (NMAS_E_BASE-35) /* -1635 0xFFFFF99D */

Definition at line 41 of file edir.c.

◆ NMAS_E_INVALID_PARAMETER

#define NMAS_E_INVALID_PARAMETER   (NMAS_E_BASE-43) /* -1643 0xFFFFF995 */

Definition at line 43 of file edir.c.

◆ NMAS_E_INVALID_SPM_REQUEST

#define NMAS_E_INVALID_SPM_REQUEST   (NMAS_E_BASE-97) /* -1697 0xFFFFF95F */

Definition at line 46 of file edir.c.

◆ NMAS_E_INVALID_VERSION

#define NMAS_E_INVALID_VERSION   (NMAS_E_BASE-52) /* -1652 0xFFFFF98C */

Definition at line 44 of file edir.c.

◆ NMAS_E_NOT_SUPPORTED

#define NMAS_E_NOT_SUPPORTED   (NMAS_E_BASE-36) /* -1636 0xFFFFF99C */

Definition at line 42 of file edir.c.

◆ NMAS_E_SYSTEM_RESOURCES

#define NMAS_E_SYSTEM_RESOURCES   (NMAS_E_BASE-34) /* -1634 0xFFFFF99E */

Definition at line 40 of file edir.c.

◆ NMAS_LDAP_EXT_VERSION

#define NMAS_LDAP_EXT_VERSION   1

Definition at line 52 of file edir.c.

◆ NMASLDAP_GET_PASSWORD_REQUEST

#define NMASLDAP_GET_PASSWORD_REQUEST   "2.16.840.1.113719.1.39.42.100.13"

Definition at line 49 of file edir.c.

◆ NMASLDAP_GET_PASSWORD_RESPONSE

#define NMASLDAP_GET_PASSWORD_RESPONSE   "2.16.840.1.113719.1.39.42.100.14"

Definition at line 50 of file edir.c.

Function Documentation

◆ ber_decode_login_data()

static int ber_decode_login_data ( struct berval *  reply_bv,
int *  server_version,
void *  out,
size_t outlen 
)
static

Converts the reply into server version and a return code.

This function takes the reply BER Value and decodes the NMAS server version and return code and if a non null retData buffer was supplied, tries to decode the the return data and length.

       ResponseBer contents:
        server_version          INTEGER
        error                   INTEGER
        data                    OCTET STRING
Parameters
[in]reply_bvreply data from extended request.
[out]server_versionthat responded.
[out]outdata.
[out]outlenLength of data written to out.
Returns
  • 0 on success.
  • < 0 on error.

Definition at line 134 of file edir.c.

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

◆ ber_encode_request_data()

static int ber_encode_request_data ( char const *  dn,
struct berval **  request_bv 
)
static

Takes the object DN and BER encodes the data into the BER value which is used as part of the request.

       RequestBer contents:
        clientVersion           INTEGER
        targetObjectDN          OCTET STRING
Parameters
[out]request_bvwhere to write the request BER value (must be freed with ber_bvfree).
[in]dnto query for.
Returns
  • 0 on success.
  • < 0 on error.

Definition at line 76 of file edir.c.

+ Here is the caller graph for this function:

◆ fr_ldap_edir_errstr()

char const* fr_ldap_edir_errstr ( int  code)

Definition at line 326 of file edir.c.

+ Here is the caller graph for this function:

◆ fr_ldap_edir_get_password()

unlang_action_t fr_ldap_edir_get_password ( request_t request,
char const *  dn,
fr_ldap_thread_trunk_t ttrunk,
fr_dict_attr_t const *  password_da 
)

Initiate retrieval of the universal password from Novell eDirectory.

Parameters
[in]requestCurrent request.
[in]dnof the user whose password is to be retrieved.
[in]ttrunkon which to send the LDAP request.
[in]password_daDA to use when creating password attribute.
Returns
  • UNLANG_ACTION_PUSHED_CHILD on success.
  • UNLANG_ACTION_FAIL on failure.

Definition at line 295 of file edir.c.

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

◆ ldap_edir_get_password_cancel()

static void ldap_edir_get_password_cancel ( UNUSED request_t request,
UNUSED fr_signal_t  action,
void *  uctx 
)
static

Cancel an in progress Universal Password lookup.

Definition at line 276 of file edir.c.

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

◆ ldap_edir_get_password_resume()

static unlang_action_t ldap_edir_get_password_resume ( rlm_rcode_t p_result,
UNUSED int *  priority,
request_t request,
void *  uctx 
)
static

Handle results of retrieving Universal Password.

Parameters
p_resultResult of current operation.
priorityUnused.
requestCurrent request.
uctxeDir lookup context.
Returns
One of the RLM_MODULE_* values.

Definition at line 184 of file edir.c.

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

◆ ldap_edir_get_password_start()

static unlang_action_t ldap_edir_get_password_start ( UNUSED rlm_rcode_t p_result,
UNUSED int *  priority,
request_t request,
void *  uctx 
)
static

Submit LDAP extended operation to retrieve Universal Password.

Parameters
p_resultResult of current operation.
priorityUnused.
requestCurrent request.
uctxeDir lookup context.
Returns
One of the RLM_MODULE_* values.

Definition at line 168 of file edir.c.

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