Lines 79-84
Link Here
|
79 |
static char *salt_format = NULL; |
79 |
static char *salt_format = NULL; |
80 |
#endif |
80 |
#endif |
81 |
|
81 |
|
|
|
82 |
/* KLUDGE: |
83 |
* chk_fn is NULL iff name is {CLEARTEXT} |
84 |
* otherwise, things will break |
85 |
*/ |
82 |
struct pw_scheme { |
86 |
struct pw_scheme { |
83 |
struct berval name; |
87 |
struct berval name; |
84 |
LUTIL_PASSWD_CHK_FUNC *chk_fn; |
88 |
LUTIL_PASSWD_CHK_FUNC *chk_fn; |
Lines 161-167
Link Here
|
161 |
|
165 |
|
162 |
#ifdef SLAPD_CLEARTEXT |
166 |
#ifdef SLAPD_CLEARTEXT |
163 |
/* pseudo scheme */ |
167 |
/* pseudo scheme */ |
164 |
{ {0, "{CLEARTEXT}"}, NULL, hash_clear }, |
168 |
{ BER_BVC("{CLEARTEXT}"), NULL, hash_clear }, |
165 |
#endif |
169 |
#endif |
166 |
|
170 |
|
167 |
{ BER_BVNULL, NULL, NULL } |
171 |
{ BER_BVNULL, NULL, NULL } |
Lines 223-231
Link Here
|
223 |
bv.bv_val = (char *) scheme; |
227 |
bv.bv_val = (char *) scheme; |
224 |
|
228 |
|
225 |
for( pws=pw_schemes; pws; pws=pws->next ) { |
229 |
for( pws=pw_schemes; pws; pws=pws->next ) { |
226 |
if( bv.bv_len != pws->s.name.bv_len ) |
230 |
if ( ber_bvstrcasecmp(&bv, &pws->s.name ) == 0 ) { |
227 |
continue; |
|
|
228 |
if( strncasecmp(bv.bv_val, pws->s.name.bv_val, bv.bv_len ) == 0 ) { |
229 |
return &(pws->s); |
231 |
return &(pws->s); |
230 |
} |
232 |
} |
231 |
} |
233 |
} |
Lines 317-326
Link Here
|
317 |
} |
319 |
} |
318 |
|
320 |
|
319 |
#ifdef SLAPD_CLEARTEXT |
321 |
#ifdef SLAPD_CLEARTEXT |
|
|
322 |
/* Do we think there is a scheme specifier here that we |
323 |
* didn't recognize? Assume a scheme name is at least 1 character. |
324 |
*/ |
325 |
if (( passwd->bv_val[0] == '{' ) && |
326 |
( strchr( passwd->bv_val, '}' ) > passwd->bv_val+1 )) |
327 |
{ |
328 |
return 1; |
329 |
} |
320 |
if( is_allowed_scheme("{CLEARTEXT}", schemes ) ) { |
330 |
if( is_allowed_scheme("{CLEARTEXT}", schemes ) ) { |
321 |
return (( passwd->bv_len == cred->bv_len ) && |
331 |
return ( passwd->bv_len == cred->bv_len ) ? |
322 |
( passwd->bv_val[0] != '{' /*'}'*/ )) |
332 |
memcmp( passwd->bv_val, cred->bv_val, passwd->bv_len ) |
323 |
? memcmp( passwd->bv_val, cred->bv_val, passwd->bv_len ) |
|
|
324 |
: 1; |
333 |
: 1; |
325 |
} |
334 |
} |
326 |
#endif |
335 |
#endif |