edir_ldapext.cc File Reference
#include "squid.h"
#include "auth/digest/eDirectory/digest_common.h"
#include "mem/Sensitive.h"
#include <lber.h>
#include <ldap.h>
#include "edir_ldapext.h"
#include <cwchar>
Include dependency graph for edir_ldapext.cc:

Go to the source code of this file.

Macros

#define NMASLDAP_GET_LOGIN_CONFIG_REQUEST   "2.16.840.1.113719.1.39.42.100.3"
 
#define NMASLDAP_GET_LOGIN_CONFIG_RESPONSE   "2.16.840.1.113719.1.39.42.100.4"
 
#define NMASLDAP_SET_PASSWORD_REQUEST   "2.16.840.1.113719.1.39.42.100.11"
 
#define NMASLDAP_SET_PASSWORD_RESPONSE   "2.16.840.1.113719.1.39.42.100.12"
 
#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"
 
#define NMAS_LDAP_EXT_VERSION   1
 
#define SMB_MALLOC_ARRAY(type, nelem)   calloc(sizeof(type), nelem)
 
#define DEBUG(level, args)
 

Functions

static int berEncodePasswordData (struct berval **requestBV, const char *objectDN, const char *password, const char *password2)
 
static int berEncodeLoginData (struct berval **requestBV, char *objectDN, unsigned int methodIDLen, unsigned int *methodID, char *tag, size_t putDataLen, void *putData)
 
static int berDecodeLoginData (struct berval *replyBV, int *serverVersion, size_t *retDataLen, void *retData)
 
static int getLoginConfig (LDAP *ld, char *objectDN, unsigned int methodIDLen, unsigned int *methodID, char *tag, size_t *dataLen, void *data)
 
static int nmasldap_get_simple_pwd (LDAP *ld, char *objectDN, size_t pwdLen, char *pwd)
 
static int nmasldap_get_password (LDAP *ld, char *objectDN, size_t *pwdSize, unsigned char *pwd)
 
int nds_get_password (LDAP *ld, char *object_dn, size_t *pwd_len, char *pwd)
 

Macro Definition Documentation

◆ DEBUG

#define DEBUG (   level,
  args 
)

Definition at line 73 of file edir_ldapext.cc.

◆ NMAS_LDAP_EXT_VERSION

#define NMAS_LDAP_EXT_VERSION   1

Definition at line 70 of file edir_ldapext.cc.

◆ NMASLDAP_GET_LOGIN_CONFIG_REQUEST

#define NMASLDAP_GET_LOGIN_CONFIG_REQUEST   "2.16.840.1.113719.1.39.42.100.3"

Definition at line 63 of file edir_ldapext.cc.

◆ NMASLDAP_GET_LOGIN_CONFIG_RESPONSE

#define NMASLDAP_GET_LOGIN_CONFIG_RESPONSE   "2.16.840.1.113719.1.39.42.100.4"

Definition at line 64 of file edir_ldapext.cc.

◆ NMASLDAP_GET_PASSWORD_REQUEST

#define NMASLDAP_GET_PASSWORD_REQUEST   "2.16.840.1.113719.1.39.42.100.13"

Definition at line 67 of file edir_ldapext.cc.

◆ NMASLDAP_GET_PASSWORD_RESPONSE

#define NMASLDAP_GET_PASSWORD_RESPONSE   "2.16.840.1.113719.1.39.42.100.14"

Definition at line 68 of file edir_ldapext.cc.

◆ NMASLDAP_SET_PASSWORD_REQUEST

#define NMASLDAP_SET_PASSWORD_REQUEST   "2.16.840.1.113719.1.39.42.100.11"

Definition at line 65 of file edir_ldapext.cc.

◆ NMASLDAP_SET_PASSWORD_RESPONSE

#define NMASLDAP_SET_PASSWORD_RESPONSE   "2.16.840.1.113719.1.39.42.100.12"

Definition at line 66 of file edir_ldapext.cc.

◆ SMB_MALLOC_ARRAY

#define SMB_MALLOC_ARRAY (   type,
  nelem 
)    calloc(sizeof(type), nelem)

Definition at line 72 of file edir_ldapext.cc.

Function Documentation

◆ berDecodeLoginData()

static int berDecodeLoginData ( struct berval *  replyBV,
int serverVersion,
size_t retDataLen,
void *  retData 
)
static

Definition at line 232 of file edir_ldapext.cc.

References SMB_MALLOC_ARRAY.

Referenced by getLoginConfig(), and nmasldap_get_password().

◆ berEncodeLoginData()

static int berEncodeLoginData ( struct berval **  requestBV,
char *  objectDN,
unsigned int  methodIDLen,
unsigned int methodID,
char *  tag,
size_t  putDataLen,
void *  putData 
)
static

Definition at line 150 of file edir_ldapext.cc.

References int, and NMAS_LDAP_EXT_VERSION.

Referenced by getLoginConfig().

◆ berEncodePasswordData()

static int berEncodePasswordData ( struct berval **  requestBV,
const char *  objectDN,
const char *  password,
const char *  password2 
)
static

Definition at line 80 of file edir_ldapext.cc.

References NMAS_LDAP_EXT_VERSION.

Referenced by nmasldap_get_password().

◆ getLoginConfig()

static int getLoginConfig ( LDAP *  ld,
char *  objectDN,
unsigned int  methodIDLen,
unsigned int methodID,
char *  tag,
size_t dataLen,
void *  data 
)
static

◆ nds_get_password()

int nds_get_password ( LDAP *  ld,
char *  object_dn,
size_t pwd_len,
char *  pwd 
)

Definition at line 498 of file edir_ldapext.cc.

References DEBUG, ld, nmasldap_get_password(), and nmasldap_get_simple_pwd().

Referenced by getpassword().

◆ nmasldap_get_password()

static int nmasldap_get_password ( LDAP *  ld,
char *  objectDN,
size_t pwdSize,
unsigned char *  pwd 
)
static

◆ nmasldap_get_simple_pwd()

static int nmasldap_get_simple_pwd ( LDAP *  ld,
char *  objectDN,
size_t  pwdLen,
char *  pwd 
)
static

Definition at line 356 of file edir_ldapext.cc.

References getLoginConfig(), ld, SMB_MALLOC_ARRAY, and Mem::ZeroSensitiveMemory().

Referenced by nds_get_password().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors