All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
edir.c File Reference

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

#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/rad_assert.h>
#include "ldap.h"
+ Include dependency graph for edir.c:

Go to the source code of this file.

Macros

#define NMAS_E_ACCESS_NOT_ALLOWED   (NMAS_E_BASE-59) /* -1659 0xFFFFF985 */
 
#define NMAS_E_BASE   (-1600)
 
#define NMAS_E_BUFFER_OVERFLOW   (NMAS_E_BASE-33) /* -1633 0xFFFFF99F */
 
#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 * edir_errstr (int code)
 
int nmasldap_get_password (LDAP *ld, char const *dn, char *password, size_t *passlen)
 Attempt to retrieve the universal password from Novell eDirectory. More...
 

Detailed Description

LDAP extension for reading eDirectory universal password.

Id:
ddac7e226a1bac6dc449d84b4dab9f24425255dc

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.

Macro Definition Documentation

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

Definition at line 47 of file edir.c.

#define NMAS_E_BASE   (-1600)

Definition at line 38 of file edir.c.

#define NMAS_E_BUFFER_OVERFLOW   (NMAS_E_BASE-33) /* -1633 0xFFFFF99F */

Definition at line 41 of file edir.c.

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

Definition at line 40 of file edir.c.

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

Definition at line 43 of file edir.c.

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

Definition at line 45 of file edir.c.

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

Definition at line 48 of file edir.c.

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

Definition at line 46 of file edir.c.

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

Definition at line 44 of file edir.c.

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

Definition at line 42 of file edir.c.

#define NMAS_LDAP_EXT_VERSION   1

Definition at line 54 of file edir.c.

#define NMASLDAP_GET_PASSWORD_REQUEST   "2.16.840.1.113719.1.39.42.100.13"

Definition at line 51 of file edir.c.

#define NMASLDAP_GET_PASSWORD_RESPONSE   "2.16.840.1.113719.1.39.42.100.14"

Definition at line 52 of file edir.c.

Function Documentation

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 128 of file edir.c.

+ Here is the caller graph for this function:

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 70 of file edir.c.

+ Here is the caller graph for this function:

char const* edir_errstr ( int  code)

Definition at line 245 of file edir.c.

+ Here is the caller graph for this function:

int nmasldap_get_password ( LDAP *  ld,
char const *  dn,
char *  password,
size_t *  passlen 
)

Attempt to retrieve the universal password from Novell eDirectory.

Parameters
[in]ldLDAP handle.
[in]dnof user we want to retrieve the password for.
[out]passwordWhere to write the retrieved password.
[out]passlenLength of data written to the password buffer.
Returns
  • 0 on success.
  • < 0 on failure.

Definition at line 165 of file edir.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: