lutil_passwd(
const struct berval *passwd, /* stored passwd */
const struct berval *cred, /* user cred */
- const char **schemes )
+ const char **schemes,
+ const char **text )
{
struct pw_slist *pws;
+ if ( text ) *text = NULL;
+
if (cred == NULL || cred->bv_len == 0 ||
passwd == NULL || passwd->bv_len == 0 )
{
passwd, &x, schemes );
if( p != NULL ) {
- return (pws->s.chk_fn)( &(pws->s.name), p, cred );
+ return (pws->s.chk_fn)( &(pws->s.name), p, cred, text );
}
}
}
struct berval * lutil_passwd_hash(
const struct berval * passwd,
- const char * method )
+ const char * method,
+ const char **text )
{
const struct pw_scheme *sc = get_scheme( method );
+ if( text ) *text = NULL;
if( sc == NULL ) return NULL;
if( ! sc->hash_fn ) return NULL;
- return (sc->hash_fn)( &sc->name, passwd );
+ return (sc->hash_fn)( &sc->name, passwd, text );
}
/* pw_string is only called when SLAPD_LMHASH or SLAPD_CRYPT is defined */
static int chk_ssha1(
const struct berval *sc,
const struct berval * passwd,
- const struct berval * cred )
+ const struct berval * cred,
+ const char **text )
{
lutil_SHA1_CTX SHA1context;
unsigned char SHA1digest[LUTIL_SHA1_BYTES];
static int chk_sha1(
const struct berval *sc,
const struct berval * passwd,
- const struct berval * cred )
+ const struct berval * cred,
+ const char **text )
{
lutil_SHA1_CTX SHA1context;
unsigned char SHA1digest[LUTIL_SHA1_BYTES];
static int chk_smd5(
const struct berval *sc,
const struct berval * passwd,
- const struct berval * cred )
+ const struct berval * cred,
+ const char **text )
{
lutil_MD5_CTX MD5context;
unsigned char MD5digest[LUTIL_MD5_BYTES];
static int chk_md5(
const struct berval *sc,
const struct berval * passwd,
- const struct berval * cred )
+ const struct berval * cred,
+ const char **text )
{
lutil_MD5_CTX MD5context;
unsigned char MD5digest[LUTIL_MD5_BYTES];
static int chk_lanman(
const struct berval *scheme,
const struct berval *passwd,
- const struct berval *cred )
+ const struct berval *cred,
+ const char **text )
{
struct berval *hash;
static int chk_ns_mta_md5(
const struct berval *scheme,
const struct berval *passwd,
- const struct berval *cred )
+ const struct berval *cred,
+ const char **text )
{
lutil_MD5_CTX MD5context;
unsigned char MD5digest[LUTIL_MD5_BYTES], c;
static int chk_sasl(
const struct berval *sc,
const struct berval * passwd,
- const struct berval * cred )
+ const struct berval * cred,
+ const char **text )
{
unsigned int i;
int rtn;
if( lutil_passwd_sasl_conn != NULL ) {
int sc;
# if SASL_VERSION_MAJOR < 2
- const char *errstr = NULL;
sc = sasl_checkpass( lutil_passwd_sasl_conn,
passwd->bv_val, passwd->bv_len,
cred->bv_val, cred->bv_len,
- &errstr );
+ text );
# else
sc = sasl_checkpass( lutil_passwd_sasl_conn,
passwd->bv_val, passwd->bv_len,
static int chk_kerberos(
const struct berval *sc,
const struct berval * passwd,
- const struct berval * cred )
+ const struct berval * cred,
+ const char **text )
{
unsigned int i;
int rtn;
static int chk_crypt(
const struct berval *sc,
const struct berval * passwd,
- const struct berval * cred )
+ const struct berval * cred,
+ const char **text )
{
char *cr;
unsigned int i;
static int chk_unix(
const struct berval *sc,
const struct berval * passwd,
- const struct berval * cred )
+ const struct berval * cred,
+ const char **text )
{
unsigned int i;
char *pw,*cr;
#ifdef LUTIL_SHA1_BYTES
static struct berval *hash_ssha1(
const struct berval *scheme,
- const struct berval *passwd )
+ const struct berval *passwd,
+ const char **text )
{
lutil_SHA1_CTX SHA1context;
unsigned char SHA1digest[LUTIL_SHA1_BYTES];
static struct berval *hash_sha1(
const struct berval *scheme,
- const struct berval *passwd )
+ const struct berval *passwd,
+ const char **text )
{
lutil_SHA1_CTX SHA1context;
unsigned char SHA1digest[LUTIL_SHA1_BYTES];
static struct berval *hash_smd5(
const struct berval *scheme,
- const struct berval *passwd )
+ const struct berval *passwd,
+ const char **text )
{
lutil_MD5_CTX MD5context;
unsigned char MD5digest[LUTIL_MD5_BYTES];
static struct berval *hash_md5(
const struct berval *scheme,
- const struct berval *passwd )
+ const struct berval *passwd,
+ const char **text )
{
lutil_MD5_CTX MD5context;
unsigned char MD5digest[LUTIL_MD5_BYTES];
static struct berval *hash_lanman(
const struct berval *scheme,
- const struct berval *passwd )
+ const struct berval *passwd,
+ const char **text )
{
int i;
#ifdef SLAPD_CRYPT
static struct berval *hash_crypt(
const struct berval *scheme,
- const struct berval *passwd )
+ const struct berval *passwd,
+ const char **text )
{
struct berval hash;
unsigned char salt[32]; /* salt suitable for most anything */
#ifdef SLAPD_CLEARTEXT
static struct berval *hash_clear(
const struct berval *scheme,
- const struct berval *passwd )
+ const struct berval *passwd,
+ const char **text )
{
return ber_bvdup( (struct berval *) passwd );
}